-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (49 loc) · 2.33 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
62
63
64
65
66
CXX = g++
CXXFLAGS = -std=c++17 $(PLATFORMSPECIFICFLAGS) -m64 -ggdb3 -ggdb -g3 -g -Wall -pedantic
CXXFLAGS += -Isrc -Idep$(S)JSON$(S)include -Idep$(S)DllLoader$(S)include
CXXFLAGS += -Idep$(S)concurrentqueue
LIBS = -lBulletSoftBody -lLinearMath -lBulletCollision -lBulletDynamics
LIBS += -lIrrlicht -lm -lpthread
SHAREDFLAGS = -shared -Wl,-rpath,.
include MakefilePlatformSpecific
include MakefileFiles
compile: .$(S)game$(EXEC_EXT) .$(S)game-core$(SHARED_EXT) .$(S)engine$(SHARED_EXT) .$(S)scripts$(SHARED_EXT)
run: compile
./game$(EXTEXECUTEXEC_EXT)
tools: ObjToShapeConverter$(EXEC_EXT)
ObjToShapeConverter$(EXEC_EXT): src$(S)tools$(S)ObjToShapeConverter.cpp bin$(S)JSON.o
$(CXX) -o $@ $(CXXFLAGS) $(DIRINCLUDE) $(LIBS) $^
.$(S)game$(EXEC_EXT): bin$(S)Main.o .$(S)engine$(SHARED_EXT) .$(S)scripts$(SHARED_EXT)
$(CXX) -o $@ $(CXXFLAGS) $(LIBS) bin$(S)Main.o .$(S)engine$(SHARED_EXT)
.$(S)engine$(SHARED_EXT): $(ENGOBJ)
$(CXX) -o $@ $(CXXFLAGS) $^ $(SHAREDFLAGS) $(LIBS)
.$(S)game-core$(SHARED_EXT): $(GAMEOBJ) .$(S)engine$(SHARED_EXT)
$(CXX) -o $@ $(CXXFLAGS) $(GAMEOBJ) .$(S)engine$(SHARED_EXT) $(SHAREDFLAGS) $(LIBS)
.$(S)scripts$(SHARED_EXT): $(SCRIPTSOBJ) .$(S)engine$(SHARED_EXT)
$(CXX) -o $@ $(CXXFLAGS) $^ $(SHAREDFLAGS) $(LIBS)
bin$(S)%.o: src$(S)engine$(S)%.cpp src$(S)engine$(S)%.h
$(CXX) -o $@ -c $(CXXFLAGS) $(DIRINCLUDE) $<
bin$(S)%.o: src$(S)entities$(S)%.cpp src$(S)entities$(S)%.h
$(CXX) -o $@ -c $(CXXFLAGS) $(DIRINCLUDE) $<
bin$(S)%.o: src$(S)gui$(S)%.cpp src$(S)gui$(S)%.h
$(CXX) -o $@ -c $(CXXFLAGS) $(DIRINCLUDE) $<
bin$(S)%.o: src$(S)resources$(S)%.cpp src$(S)resources$(S)%.h
$(CXX) -o $@ -c $(CXXFLAGS) $(DIRINCLUDE) $<
bin$(S)%.o: src$(S)util$(S)%.cpp
$(CXX) -o $@ -c $(CXXFLAGS) $(DIRINCLUDE) $<
bin$(S)%.o: src$(S)game$(S)%.cpp src$(S)game$(S)%.h
$(CXX) -o $@ -c $(CXXFLAGS) $(DIRINCLUDE) $<
bin$(S)%.o: src$(S)scripts$(S)%.cpp
$(CXX) -o $@ -c $(CXXFLAGS) $(DIRINCLUDE) $<
bin$(S)%.o: src$(S)game$(S)%.cpp
$(CXX) -o $@ -c $(CXXFLAGS) $(DIRINCLUDE) $<
bin$(S)JSON.o: dep$(S)JSON$(S)src$(S)JSON.cpp
$(CXX) -o $@ -c $(CXXFLAGS) $(DIRINCLUDE) $<
bin$(S)%.o: dep$(S)DllLoader$(S)src$(S)%.cpp
$(CXX) -o $@ -c $(CXXFLAGS) $(DIRINCLUDE) $<
.PHONY: clean
clean:
$(RM) game$(EXEC_EXT) bin$(S)Main.o
$(RM) engine$(SHARED_EXT) $(ENGOBJDEL)
$(RM) game-core$(SHARED_EXT) $(GAMEOBJDEL)
$(RM) scripts$(SHARED_EXT) $(SCRIPTSOBJDEL)