aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile42
1 files changed, 42 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 00000000..9d5c27a7
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,42 @@
+PROJECT:=usdx
+TOP:=.
+
+headers:=$(wildcard $(TOP)/src/*/*/*.hpp) $(wildcard $(TOP)/src/*/*.hpp) $(wildcard $(TOP)/src/*.hpp)
+
+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 -g
+LDFLAGS:=-lsqlite3 -lSDL -llog4cxx -lboost_program_options-mt -lboost_filesystem-mt -lSDL_image -lSDL_gfx -lcppunit -lGL
+TARGET:=$(PROJECT)
+
+objects:=$(sources:.cpp=.o)
+
+##############################################################################
+
+.PHONY: all clean run
+
+all: $(TARGET)
+
+clean:
+ -$(RM) -r $(TARGET) $(TARGET-COVERAGE) $(objects) $(deps) $(coverage)
+
+run: $(TARGET)
+ ./$(TARGET)
+
+ifneq ($(MAKECMDGOALS),clean)
+-include $(deps)
+endif
+
+##############################################################################
+# normal build
+
+$(TARGET): $(objects) $(deps)
+ $(CXX) $(LDFLAGS) -o $(TARGET) $(objects)
+
+%.o: %.cpp
+ $(CXX) $(CXXFLAGS) -MMD -c $< -o $@
+
+%.d: %.cpp
+ $(CXX) $(CXXFLAGS) -MM -c $< -MF $@