aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2011-11-29 04:54:18 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2013-01-05 17:17:50 +0100
commit1b40a031e39f00e0ebb70033f8697a14ed1c8dc4 (patch)
tree13be542e6750a003faea9449112bd1759a8b2f84
parent53bd23d0e679746b78d0bcf9234e7b99983e6071 (diff)
downloadusdx-1b40a031e39f00e0ebb70033f8697a14ed1c8dc4.tar.gz
usdx-1b40a031e39f00e0ebb70033f8697a14ed1c8dc4.tar.xz
usdx-1b40a031e39f00e0ebb70033f8697a14ed1c8dc4.zip
Makefile with shared include for main app and tests
Diffstat (limited to '')
-rw-r--r--Makefile12
-rw-r--r--Makefile.inc8
-rw-r--r--test/Makefile15
3 files changed, 15 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index 46c41450..9715ed39 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,11 @@
PROJECT:=usdx
TOP:=.
-headers:=$(wildcard $(TOP)/src/*/*/*.hpp) $(wildcard $(TOP)/src/*/*.hpp) $(wildcard $(TOP)/src/*.hpp)
+headers:=$(wildcard ${TOP}/src/*.hpp)
+sources:=$(wildcard ${TOP}/src/*.cpp)
-sources:=$(wildcard $(TOP)/src/*/*/*.cpp) $(wildcard $(TOP)/src/*/*.cpp) $(wildcard $(TOP)/src/*.cpp)
-
-deps:=$(sources:.cpp=.d)
-
-CXXFLAGS:=-Wall -Werror -I$(TOP)/src -I$(TOP)/src/base -I$(TOP)/src/menu -I$(TOP)/src/media -I$(TOP)/src/screens -I$(TOP)/src/frames -I$(TOP)/src/utils $(shell pkg-config ftgl --cflags) -g
-LDFLAGS:=-lsqlite3 -lSDL $(shell log4cpp-config --libs) -lboost_program_options-mt -lboost_filesystem-mt -lboost_thread-mt -lSDL_image -lSDL_gfx -lcppunit -lGL $(shell pkg-config ftgl --libs)
TARGET:=$(PROJECT)
-
-objects:=$(sources:.cpp=.o)
+include ${TOP}/Makefile.inc
##############################################################################
diff --git a/Makefile.inc b/Makefile.inc
new file mode 100644
index 00000000..733d3b2f
--- /dev/null
+++ b/Makefile.inc
@@ -0,0 +1,8 @@
+headers+=$(wildcard $(TOP)/src/*/*.hpp) $(wildcard $(TOP)/src/*/*/*.hpp)
+sources+=$(wildcard $(TOP)/src/*/*.cpp) $(wildcard $(TOP)/src/*/*/*.cpp)
+
+deps:=$(sources:.cpp=.d)
+objects:=$(sources:.cpp=.o)
+
+CXXFLAGS:=-Wall -Werror -I$(TOP)/src -I$(TOP)/src/base -I$(TOP)/src/menu -I$(TOP)/src/media -I$(TOP)/src/screens -I$(TOP)/src/frames -I$(TOP)/src/utils $(shell pkg-config ftgl --cflags) -g
+LDFLAGS:=-lsqlite3 -lSDL $(shell log4cpp-config --libs) -lboost_program_options-mt -lboost_filesystem-mt -lboost_thread-mt -lSDL_image -lSDL_gfx -lGL $(shell pkg-config ftgl --libs)
diff --git a/test/Makefile b/test/Makefile
index 61f92e19..d292b876 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,20 +1,13 @@
PROJECT:=usdx-tests
TOP:=..
-headers:=$(wildcard *.hpp) $(wildcard */*.hpp) $(wildcard $(TOP)/src/*/*/*.hpp) \
- $(wildcard $(TOP)/src/*/*.hpp)
+headers:=$(wildcard *.hpp) $(wildcard */*.hpp)
+sources:=$(wildcard *.cpp) $(wildcard */*.cpp)
-sources:=$(wildcard *.cpp) $(wildcard */*.cpp) $(wildcard $(TOP)/src/*/*/*.cpp) \
- $(wildcard $(TOP)/src/*/*.cpp)
-
-deps:=$(sources:.cpp=.d)
-
-CXXFLAGS:=-Wall -Werror -I$(TOP)/src -I$(TOP)/src/base -I$(TOP)/src/menu -I$(TOP)/src/media -I$(TOP)/src/screens -I$(TOP)/src/frames -I$(TOP)/src/utils $(shell pkg-config ftgl --cflags) -g
-LDFLAGS:=-lsqlite3 -lSDL $(shell log4cpp-config --libs) -lboost_program_options-mt -lboost_filesystem-mt -lboost_thread-mt -lSDL_image -lSDL_gfx -lcppunit -lGL $(shell pkg-config ftgl --libs)
TARGET:=$(PROJECT)
+include ${TOP}/Makefile.inc
-objects:=$(sources:.cpp=.o)
-
+LDFLAGS+=-lcppunit
CXXFLAGS-COVERAGE:=-fprofile-arcs -ftest-coverage
LDFLAGS-COVERAGE:=-coverage
TARGET-COVERAGE:=$(TARGET)-coverage