-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (39 loc) · 1.47 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
TARGETS= Gen/float/testbed Gen/fixed/testbed
PROJECT= ../..
CXXFLAGS= -g -O2 -I$(PROJECT)/Contrib -I$(PROJECT)/Include -DGLUI_FREEGLUT
LDFLAGS= -L$(PROJECT)/Contrib/freeglut -L$(PROJECT)/Contrib/glui \
SOURCES= Framework/Main.cpp \
Framework/Test.cpp \
Framework/Render.cpp \
Tests/BroadPhaseTest.cpp \
Tests/Biped.cpp \
Tests/BipedDef.cpp \
Tests/TestEntries.cpp
ifneq ($(INCLUDE_DEPENDENCIES),yes)
all:
@make --no-print-directory INCLUDE_DEPENDENCIES=yes $(TARGETS)
.PHONY: clean
clean:
rm -rf Gen
else
-include $(addprefix Gen/float/,$(SOURCES:.cpp=.d))
-include $(addprefix Gen/fixed/,$(SOURCES:.cpp=.d))
endif
FLOAT_OBJECTS= $(addprefix Gen/float/,$(SOURCES:.cpp=.o))
Gen/float/%.o: %.cpp
mkdir -p $(dir $@)
c++ $(CXXFLAGS) -c -o $@ $<
Gen/float/testbed: $(FLOAT_OBJECTS) $(PROJECT)/Source/Gen/float/libbox2d.a
g++ -o $@ $^ $(LDFLAGS) -L$(PROJECT)/Source/Gen/float -lbox2d -lglui -lglut -lGLU -lGL
Gen/float/%.d: %.cpp
@mkdir -p $(dir $@)
c++ -M -MT $(@:.d=.o) $(CXXFLAGS) -o $@ $<
FIXED_OBJECTS= $(addprefix Gen/fixed/,$(SOURCES:.cpp=.o))
Gen/fixed/%.o: %.cpp
mkdir -p $(dir $@)
c++ $(CXXFLAGS) -DTARGET_FLOAT32_IS_FIXED -c -o $@ $<
Gen/fixed/testbed: $(FIXED_OBJECTS) $(PROJECT)/Source/Gen/fixed/libbox2d.a
g++ -rdynamic -o $@ $^ $(LDFLAGS) -L$(PROJECT)/Source/Gen/fixed -lbox2d -lglui -lglut -lGLU -lGL
Gen/fixed/%.d: %.cpp
@mkdir -p $(dir $@)
c++ -M -MT $(@:.d=.o) $(CXXFLAGS) -o $@ $<