-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
237 lines (178 loc) · 7.36 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# This universal Makefile is prepared for different platforms.
# Platform Specific Settings
ifeq ($(OS),Windows_NT)
ifdef SystemRoot
ifdef VSINSTALLDIR
# ----------------- Windows visual c --------------------------------
CXX = $(VSINSTALLDIR)\VC\bin\cl.exe
LD = $(VSINSTALLDIR)\VC\bin\link.exe
CXXFLAGS = /nologo /W1 /EHsc
CXXFLAGS += -DOS_WIN32_NATIVE -DFTGL_LIBRARY -DWIN32 -D_WIN32 -D_WINDOWS -D_MBCS -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE
CXXFLAGS += -I$(LIB_SDL2_DIR)/include
CXXFLAGS += -IC:/Projects/freetype-2.3.5-1/include
CXXFLAGS += -IC:/Projects/freetype-2.3.5-1/include/freetype2
LDFLAGS = /MACHINE:X86
LDFLAGS += OpenGL32.lib GLU32.lib SDL2.lib SDL2_image.lib SDL2_mixer.lib freetype.lib
LDFLAGS += -LIBPATH:$(LIB_SDL2_DIR)/lib/x86
LDFLAGS += -LIBPATH:C:/Projects/freetype-2.3.5-1/lib
OBJ_EXT = obj
endif #VSINSTALLDIR
else
CXX ?= g++
LD = $(CXX)
OBJ_EXT = o
# ----------------- Windows with mingw --------------------------------
CXXFLAGS = -Wall -Wextra -O2 -DOS_WIN32_MINGW -mwindows -I/usr/include -I/usr/include/freetype2
LDFLAGS = -L/usr/lib -lSDL2 -lSDL2_image -lSDL2_mixer -lfreetype
LDFLAGS += -lopengl32 -lGLU32
# ----------------- Windows, erins mingw environment ;-) --------------
# CXXFLAGS = -Wall -Wextra -O2 -DOS_WIN32_MINGW -Ic:/mingw/include/freetype2
# LDFLAGS = -Lc:/mingw/lib/sdl2 -lmingw32 -mwindows -lSDLmain -lSDL2 -lopengl32 -lglu32 \
# -l:SDL2_image.lib -l:SDL2_mixer.lib -lfreetype
endif #SystemRoot
else
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
# ----------------- MAC OS --------------------------------------------
CXX ?= g++
LD = $(CXX)
OBJ_EXT = o
CXXFLAGS = -Wall -Wextra -DOS_MAC -framework OpenGL
CXXFLAGS += -I/usr/local/include -I/usr/include/freetype2
LDFLAGS = -framework Cocoa -framework OpenGL
LDFLAGS += -L/usr/local/lib -lSDL2 -lSDL2_image -lSDL2_mixer -lfreetype
else
# ----------------- Linux (Default) -----------------------------------
CXX ?= g++
LD = $(CXX)
OBJ_EXT = o
CXXFLAGS = -Wall -Wextra -O2 -DOS_LINUX -I/usr/include/freetype2
LDFLAGS = -lSDL2 -lSDL2_image -lSDL2_mixer -lfreetype
ifdef PROFILE
CXXFLAGS += -pg
LDFLAGS += -pg
endif #PROFILE
ifdef GLES
CXXFLAGS += -DHAVE_GL_GLES1
LDFLAGS += -lGLESv1_CM -lEGL -lX11
#Pandaboard
CXXFLAGS += -I/usr/lib/pvr-omap4-egl/include
LDFLAGS += -L/usr/lib/pvr-omap4-egl
#Raspberry Pi
CXXFLAGS += -I/opt/vc/include
CXXFLAGS += -I/opt/vc/include/interface/vcos/pthreads
LDFLAGS += -L/opt/vc/lib
else
LDFLAGS += -lGL -lGLU
endif #GLES
endif #Darwin
endif #Windows_NT
# Targets
BIN = etr
OBJ += main.$(OBJ_EXT) game_config.$(OBJ_EXT) ogl.$(OBJ_EXT) tux.$(OBJ_EXT) audio.$(OBJ_EXT) \
winsys.$(OBJ_EXT) particles.$(OBJ_EXT) mathlib.$(OBJ_EXT) splash_screen.$(OBJ_EXT) intro.$(OBJ_EXT) racing.$(OBJ_EXT) \
game_over.$(OBJ_EXT) paused.$(OBJ_EXT) reset.$(OBJ_EXT) game_type_select.$(OBJ_EXT) event_select.$(OBJ_EXT) \
race_select.$(OBJ_EXT) credits.$(OBJ_EXT) loading.$(OBJ_EXT) course.$(OBJ_EXT) keyframe.$(OBJ_EXT) env.$(OBJ_EXT) \
event.$(OBJ_EXT) spx.$(OBJ_EXT) common.$(OBJ_EXT) course_render.$(OBJ_EXT) game_ctrl.$(OBJ_EXT) physics.$(OBJ_EXT) \
track_marks.$(OBJ_EXT) hud.$(OBJ_EXT) view.$(OBJ_EXT) gui.$(OBJ_EXT) translation.$(OBJ_EXT) tools.$(OBJ_EXT) \
quadtree.$(OBJ_EXT) font.$(OBJ_EXT) ft_font.$(OBJ_EXT) textures.$(OBJ_EXT) help.$(OBJ_EXT) regist.$(OBJ_EXT) \
tool_frame.$(OBJ_EXT) tool_char.$(OBJ_EXT) newplayer.$(OBJ_EXT) score.$(OBJ_EXT) ogl_test.$(OBJ_EXT)
# Rules
$(BIN) : $(OBJ)
$(LD) -o $(BIN) $(OBJ) $(LDFLAGS)
clean :
rm -f $(BIN) $(OBJ)
# use this template and rename it if you want to add a module
# mmmm.$(OBJ_EXT) : mmmm.cpp mmmm.h
# $(CXX) -c mmmm.cpp $(CXXFLAGS)
# General
ogl_test.$(OBJ_EXT) : ogl_test.cpp ogl_test.h
$(CXX) -c ogl_test.cpp $(CXXFLAGS)
score.$(OBJ_EXT) : score.cpp score.h
$(CXX) -c score.cpp $(CXXFLAGS)
newplayer.$(OBJ_EXT) : newplayer.cpp newplayer.h
$(CXX) -c newplayer.cpp $(CXXFLAGS)
tool_char.$(OBJ_EXT) : tool_char.cpp tool_char.h
$(CXX) -c tool_char.cpp $(CXXFLAGS)
tool_frame.$(OBJ_EXT) : tool_frame.cpp tool_frame.h
$(CXX) -c tool_frame.cpp $(CXXFLAGS)
regist.$(OBJ_EXT) : regist.cpp regist.h
$(CXX) -c regist.cpp $(CXXFLAGS)
tools.$(OBJ_EXT) : tools.cpp tools.h
$(CXX) -c tools.cpp $(CXXFLAGS)
help.$(OBJ_EXT) : help.cpp help.h
$(CXX) -c help.cpp $(CXXFLAGS)
translation.$(OBJ_EXT) : translation.cpp translation.h
$(CXX) -c translation.cpp $(CXXFLAGS)
physics.$(OBJ_EXT) : physics.cpp physics.h
$(CXX) -c physics.cpp $(CXXFLAGS)
winsys.$(OBJ_EXT) : winsys.cpp winsys.h
$(CXX) -c winsys.cpp $(CXXFLAGS)
game_ctrl.$(OBJ_EXT) : game_ctrl.cpp game_ctrl.h
$(CXX) -c game_ctrl.cpp $(CXXFLAGS)
textures.$(OBJ_EXT) : textures.cpp textures.h
$(CXX) -c textures.cpp $(CXXFLAGS)
ft_font.$(OBJ_EXT) : ft_font.cpp ft_font.h
$(CXX) -c ft_font.cpp $(CXXFLAGS)
font.$(OBJ_EXT) : font.cpp font.h
$(CXX) -c font.cpp $(CXXFLAGS)
event.$(OBJ_EXT) : event.cpp event.h
$(CXX) -c event.cpp $(CXXFLAGS)
gui.$(OBJ_EXT) : gui.cpp gui.h
$(CXX) -c gui.cpp $(CXXFLAGS)
common.$(OBJ_EXT) : common.cpp common.h
$(CXX) -c common.cpp $(CXXFLAGS)
spx.$(OBJ_EXT) : spx.cpp spx.h
$(CXX) -c spx.cpp $(CXXFLAGS)
quadtree.$(OBJ_EXT) : quadtree.cpp quadtree.h
$(CXX) -c quadtree.cpp $(CXXFLAGS)
view.$(OBJ_EXT) : view.cpp view.h
$(CXX) -c view.cpp $(CXXFLAGS)
hud.$(OBJ_EXT) : hud.cpp hud.h
$(CXX) -c hud.cpp $(CXXFLAGS)
track_marks.$(OBJ_EXT) : track_marks.cpp track_marks.h
$(CXX) -c track_marks.cpp $(CXXFLAGS)
course_render.$(OBJ_EXT) : course_render.cpp course_render.h
$(CXX) -c course_render.cpp $(CXXFLAGS)
env.$(OBJ_EXT) : env.cpp env.h
$(CXX) -c env.cpp $(CXXFLAGS)
keyframe.$(OBJ_EXT) : keyframe.cpp keyframe.h
$(CXX) -c keyframe.cpp $(CXXFLAGS)
course.$(OBJ_EXT) : course.cpp course.h
$(CXX) -c course.cpp $(CXXFLAGS)
loading.$(OBJ_EXT) : loading.cpp loading.h
$(CXX) -c loading.cpp $(CXXFLAGS)
credits.$(OBJ_EXT) : credits.cpp credits.h
$(CXX) -c credits.cpp $(CXXFLAGS)
race_select.$(OBJ_EXT) : race_select.cpp race_select.h
$(CXX) -c race_select.cpp $(CXXFLAGS)
event_select.$(OBJ_EXT) : event_select.cpp event_select.h
$(CXX) -c event_select.cpp $(CXXFLAGS)
game_type_select.$(OBJ_EXT) : game_type_select.cpp game_type_select.h
$(CXX) -c game_type_select.cpp $(CXXFLAGS)
game_over.$(OBJ_EXT) : game_over.cpp game_over.h
$(CXX) -c game_over.cpp $(CXXFLAGS)
paused.$(OBJ_EXT) : paused.cpp paused.h
$(CXX) -c paused.cpp $(CXXFLAGS)
reset.$(OBJ_EXT) : reset.cpp reset.h
$(CXX) -c reset.cpp $(CXXFLAGS)
racing.$(OBJ_EXT) : racing.cpp racing.h
$(CXX) -c racing.cpp $(CXXFLAGS)
intro.$(OBJ_EXT) : intro.cpp intro.h
$(CXX) -c intro.cpp $(CXXFLAGS)
splash_screen.$(OBJ_EXT) : splash_screen.cpp splash_screen.h
$(CXX) -c splash_screen.cpp $(CXXFLAGS)
mathlib.$(OBJ_EXT) : mathlib.cpp mathlib.h
$(CXX) -c mathlib.cpp $(CXXFLAGS)
particles.$(OBJ_EXT) : particles.cpp particles.h
$(CXX) -c particles.cpp $(CXXFLAGS)
audio.$(OBJ_EXT) : audio.cpp audio.h
$(CXX) -c audio.cpp $(CXXFLAGS)
tux.$(OBJ_EXT) : tux.cpp tux.h
$(CXX) -c tux.cpp $(CXXFLAGS)
ogl.$(OBJ_EXT) : ogl.cpp ogl.h
$(CXX) -c ogl.cpp $(CXXFLAGS)
game_config.$(OBJ_EXT) : game_config.cpp game_config.h
$(CXX) -c game_config.cpp $(CXXFLAGS)
main.$(OBJ_EXT) : main.cpp bh.h etr_types.h
$(CXX) -c main.cpp $(CXXFLAGS)