-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmakefile
89 lines (66 loc) · 2.5 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
CC=g++
GCC=gcc
C_FLAGS= -ffast-math -Wall -g
COMPILE = $(CC) $(C_FLAGS) -c
CCOMPILE = $(GCC) $(C_FLAGS) -c
L_FLAGS=-lGL -lz -lopenal -lpython2.7 -lpthread -lXxf86vm -lX11 -ldl
W_FLAGS=-lmingw32 -lopengl32 -lglu32 -lglew32 -lSDLmain -lSDL -lpng -lstdc++ -lopenal32 -lvorbisfile -lvorbis -logg -lwsock32 -lzlib -lfreetype -lcal3d -lwinmm -lpthreadGC2 -lbulletdynamics -lbulletcollision -lbulletmath
M_FLAGS=-framework Cocoa -framework OpenGL -framework OpenAL -lGLEW -lSDLmain -lSDL -lpng -lvorbisfile -lvorbis -logg -lz -lfreetype -lstdc++ -lcal3d -lbulletdynamics -lbulletcollision -lbulletmath
OBJS := $(patsubst %.cpp, %.o, $(wildcard src/*.cpp))
OBJS2 := $(patsubst %.cpp, %.o, $(wildcard src/*/*.cpp))
OBJS3 := $(patsubst %.cpp, %.o, $(wildcard src/*/*/*.cpp))
OBJS4 := $(patsubst %.cpp, %.o, $(wildcard src/*/*/*/*.cpp))
OBJS5 := $(patsubst %.cpp, %.o, $(wildcard src/*/*/*/*/*.cpp))
MOBJSC := $(patsubst %.m, %.o, $(wildcard src/*.m))
MOBJSCPP := $(patsubst %.mm, %.o, $(wildcard src/*.mm))
MOBJS := $(patsubst %.cpp, %.o, $(wildcard src/*.cpp))
MOBJS2 := $(patsubst %.cpp, %.o, $(wildcard src/*/*.cpp))
MOBJS3 := $(patsubst %.cpp, %.o, $(wildcard src/*/*/*.cpp))
MOBJS4 := $(patsubst %.cpp, %.o, $(wildcard src/*/*/*/*.cpp))
MOBJS5 := $(patsubst %.cpp, %.o, $(wildcard src/*/*/*/*/*.cpp))
OBJECTS = $(OBJS) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5)
MOBJECTS = $(MOBJSC) $(MOBJSCPP) $(MOBJS) $(MOBJS2) $(MOBJS3) $(MOBJS4) $(MOBJS5)
all: error
precompile: $(HEADS)
@echo
@echo " Precompiled the headers"
@echo " Note that this is done only once unless you dist-clean"
@echo
error:
@echo
@echo
@echo " Please run make win, make lin or make mac to build depending on your platform"
@echo " Other options:"
@echo " make clean : removes Azadi executable as well as object files"
@echo " make dist-clean : removes all compiled objects, executables, and headers"
@echo
@echo
win: Azadi-Win
lin: Azadi-Lin
mac: Azadi-Mac
Azadi-Win: $(OBJECTS)
$(CC) -g -o Century $(OBJECTS) $(W_FLAGS)
doxygen azadi-docs
Azadi-Lin: $(OBJECTS)
$(CC) -g -o Century $(OBJECTS) $(L_FLAGS)
doxygen azadi-docs
Azadi-Mac: $(MOBJECTS)
$(CC) -g -o Azadi $(OBJECTS) $(M_FLAGS)
doxygen azadi-docs
%.obj: %.c
$(CCOMPILE) $(L_INCLUDES) $< -o $@
%.o: %.cpp
$(COMPILE) $(L_INCLUDES) $< -o $@
%.o: %.m
$(COMPILE) $(L_INCLUDES) $< -o $@
%.o: %.mm
$(COMPILE) $(L_INCLUDES) $< -o $@
%.h.gch: %.h
$(COMPILE) $< -o $@
dist-clean:
rm $(OBJECTS)
rm Century
rm -rf SourceDocs
clean:
rm $(OBJECTS)
rm Century