Factorized common qmake parts

This commit is contained in:
Michaël Lemaire 2013-08-23 22:56:58 +02:00
parent 08d7b56f00
commit 02e839406c
8 changed files with 22 additions and 101 deletions

12
src/common.pri Normal file
View file

@ -0,0 +1,12 @@
INCLUDEPATH += ..
CONFIG(debug) {
DESTDIR = ../../build/debug/
MAKEFILE = Makefile.debug
} else {
DESTDIR = ../../build/release/
MAKEFILE = Makefile.release
}
release:DEFINES += NDEBUG

View file

@ -1,35 +0,0 @@
OBJECTS = ${SOURCES:%.c=${OBJPATH}/%.o}
ifeq (${BUILDMODE},debug)
CC_FLAGS += -g
CC_LDFLAGS += -g
endif
ifeq (${BUILDMODE},release)
CC_FLAGS += -O3 -DNDEBUG -Wno-unused-variable -Wno-unused-but-set-variable
endif
ifneq (,${LIBS})
CC_FLAGS += $(shell pkg-config --cflags ${LIBS})
CC_LDFLAGS += $(shell pkg-config --libs ${LIBS})
endif
CC_FLAGS += -fPIC -Wall -I${PROJECT_PATH}/src
CC_LDFLAGS += -fPIC -lm
all:prepare ${RESULT}
prepare:
mkdir -p ${BUILDPATH}
clean:
rm -f ${OBJECTS}
rm -f ${RESULT}
${OBJPATH}/%.o:%.c ${HEADERS}
mkdir -p `dirname $@`
${CC} -c ${CC_FLAGS} $< -o $@
${RESULT}:${OBJECTS}
${CC} $^ ${CC_LDFLAGS} -o $@
.PHONY:all clean prepare

View file

@ -1,11 +0,0 @@
ifeq ($(strip $(BUILDMODE)),)
exit 1
endif
ifeq ($(strip $(PROJECT_PATH)),)
exit 1
endif
PATH_LIB_PAYSAGES = ${PROJECT_PATH}/rendering
BUILDMODE = debug
BUILDPATH = ${PROJECT_PATH}/build/${BUILDMODE}
HEADERS = $(${PATH_LIB_PAYSAGES}/atmosphere/*.h ${PATH_LIB_PAYSAGES}/clouds/*.h ${PATH_LIB_PAYSAGES}/terrain/*.h ${PATH_LIB_PAYSAGES}/textures/*.h ${PATH_LIB_PAYSAGES}/water/*.h ${PATH_LIB_PAYSAGES}/tools/*.h ${PATH_LIB_PAYSAGES}/shared/*.h)

View file

@ -1,23 +1,14 @@
include(../common.pri)
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
TARGET = paysages-cli
INCLUDEPATH += ..
CONFIG(debug) {
DESTDIR = ../../build/debug/
MAKEFILE = Makefile.debug
} else {
DESTDIR = ../../build/release/
MAKEFILE = Makefile.release
}
OBJECTS_DIR = $$DESTDIR/controlling/
release:DEFINES += NDEBUG
DEPENDPATH += ..
linux-clang:LIBS += -L$$DESTDIR -lpaysages_rendering

View file

@ -1,24 +1,15 @@
include(../common.pri)
TEMPLATE = app
CONFIG += qt
QT += core gui opengl
TARGET = paysages-gui
INCLUDEPATH += ..
CONFIG(debug) {
DESTDIR = ../../build/debug/
MAKEFILE = Makefile.debug
} else {
DESTDIR = ../../build/release/
MAKEFILE = Makefile.release
}
OBJECTS_DIR = $$DESTDIR/editing/
MOC_DIR = $$OBJECTS_DIR/moc/
release:DEFINES += NDEBUG
DEPENDPATH += ..
linux-clang:LIBS += -L$$DESTDIR -lpaysages_rendering -lpaysages_exploring -lGLU
win32:LIBS += ../../libpaysages.a -lDevIL -lILU -lILUT -lglib-2.0 -lgthread-2.0

View file

@ -1,23 +1,14 @@
include(../common.pri)
TEMPLATE = lib
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
TARGET = paysages_exploring
INCLUDEPATH += ..
CONFIG(debug) {
DESTDIR = ../../build/debug/
MAKEFILE = Makefile.debug
} else {
DESTDIR = ../../build/release/
MAKEFILE = Makefile.release
}
OBJECTS_DIR = $$DESTDIR/exploring/
release:DEFINES += NDEBUG
SOURCES += main.c \
terrain.c \
sky.c \

View file

@ -1,23 +1,14 @@
include(../common.pri)
TEMPLATE = lib
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
TARGET = paysages_rendering
INCLUDEPATH += ..
CONFIG(debug) {
DESTDIR = ../../build/debug/
MAKEFILE = Makefile.debug
} else {
DESTDIR = ../../build/release/
MAKEFILE = Makefile.release
}
OBJECTS_DIR = $$DESTDIR/rendering/
release:DEFINES += NDEBUG
linux-clang {
CONFIG += link_pkgconfig
PKGCONFIG += glib-2.0 gthread-2.0 IL ILU

View file

@ -1,23 +1,14 @@
include(../common.pri)
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
TARGET = paysages-tests
INCLUDEPATH += ..
CONFIG(debug) {
DESTDIR = ../../build/debug/
MAKEFILE = Makefile.debug
} else {
DESTDIR = ../../build/release/
MAKEFILE = Makefile.release
}
OBJECTS_DIR = $$DESTDIR/testing/
release:DEFINES += NDEBUG
linux-clang {
CONFIG += link_pkgconfig
PKGCONFIG += check