TEMPLATE = app
CONFIG -= app_bundle
CONFIG -= qt
CONFIG += console
CONFIG += c99

#CONFIG += BACKEND_GRX
#CONFIG += BACKEND_SDL2
CONFIG += BACKEND_DJGPP

SHARED = $$PWD/../shared

DESTDIR = $$OUT_PWD/bin

INCLUDEPATH += \
	$$PWD/src \
	$$SHARED

HEADERS += \
	$$SHARED/macros.h \
	$$SHARED/array.h \
	$$SHARED/memory.h \
	$$SHARED/stddclmr.h \
	$$SHARED/thirdparty/memwatch/memwatch.h \
	$$SHARED/thirdparty/stb_ds.h \
	$$SHARED/log.h \
	$$SHARED/util.h \
	src/gui/font.h \
	src/gui/gui.h \
	src/gui/image.h \
	src/gui/wmwindow.h \
	src/os.h \
	src/platform/djgpp.h \
	src/platform/grx.h \
	src/platform/platform.h \
	src/platform/sdl2.h \
	src/thirdparty/stb_image.h

SOURCES += \
	$$SHARED/array.c \
	$$SHARED/memory.c \
	$$SHARED/thirdparty/memwatch/memwatch.c \
	$$SHARED/log.c \
	$$SHARED/util.c \
	src/gui/font.c \
	src/gui/gui.c \
	src/gui/image.c \
	src/gui/wmwindow.c \
	src/main.c \
	src/platform/djgpp.c \
	src/platform/grx.c \
	src/platform/sdl2.c

OTHER_FILES += \
	$$PWD/../LICENSE

BACKEND_GRX {
	LINUX  = $$PWD/../installed/linux
	DEFINES += BACKEND_GRX
	INCLUDEPATH += $$LINUX/include
	LIBS += \
		-L$$LINUX/lib \
		-lgrx20X \
		-lX11 \
		-ljpeg \
		-lpng \
		-lz
}

BACKEND_SDL2 {
	DEFINES += BACKEND_SDL2
	LIBS += \
		-lSDL2
}

BACKEND_DJGPP {
	DEFINES += BACKEND_DJGPP
	OTHER_FILES += \
		$$PWD/../build.sh \
		$$PWD/../Makefile.djgpp \
		$$PWD/../test.sh \
		$$PWD/../test.conf
}

