-
Notifications
You must be signed in to change notification settings - Fork 19
/
quake2.project
307 lines (253 loc) · 6.54 KB
/
quake2.project
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
# script file; perl highlighting
MAX_DEBUG = 1 #!! while implementing Q1/HL map support
#NO_DEBUG = 1
NOSHARED = 1 #!!!! shared; currently, shared build is not possible: Core is not yet finished
#!! make only 1 of STATIC/SHARED builds (not both in single makefile) - no problems with filenames etc ...
#!! + add "STATIC=1|0" to COM_DEFINES
OPTIMIZE = size
CPP_EXCEPT = 0
# compiler options
!if "$COMPILER" eq "VisualC"
WARNLEVEL = 3
# INLINES = explicit
# LIBC = static
PDB = 2
COM_DEFINES = _CRT_SECURE_NO_WARNINGS # VC8: ignore "unsafe strcpy()" etc
!elif "$COMPILER" eq "GnuC"
# INLINES = explicit -- not supported?
LIBC = shared
MAX_DEBUG = 1 # currently, in debug stage
# compiler: disable some optimizations
OPTIONS = -fno-strict-aliasing # required for our uint_cast()-based FP hacks
OPTIONS += {
# disable some warnings
-Wno-invalid-offsetof
# enable useful warnings
-Wabi -Wnon-virtual-dtor -Woverloaded-virtual -Wformat -Wimplicit -Wparentheses -Wreturn-type
-Wunused-function -Wunused-variable -Wunused-value
-Wunknown-pragmas -Wmissing-format-attribute -Wredundant-decls
-Waggregate-return -Wstrict-aliasing
# -Winline #?? for gcc4 will display a LOTS of warnings ...
# max warning level
# -Weffc++ -Wshadow -Wlarger-than-131072 -Wpacked -Winline -Wswitch -Wmissing-noreturn
# -Wunreachable-code -Wuninitialized
}
!endif
!if "$PLATFORM" eq "win32"
SUFF = Win32
STDLIBS = kernel32 user32 gdi32
!if $COMPILER eq "GnuC" # i.e. mingw32
STDLIBS += winmm wsock32 dinput stdc++
!endif
!else
# linux/cygwin + GCC
SUFF = Unix
STDLIBS = stdc++
!if "$PLATFORM" ne "cygwin"
STDLIBS += dl # dlopen() and friends
!endif
!endif
#------------------------------------------------------------------------------
# common defines
OUT = Release
OBJ = $OUT/obj-$PLATFORM
MAPFILES = 1
!ifndef MAX_DEBUG
MAX_DEBUG = 0
!endif
!ifndef NO_DEBUG
NO_DEBUG = 0
!endif
# build common defines string
COM_DEFINES += MAX_DEBUG=$MAX_DEBUG NO_DEBUG=$NO_DEBUG
#------------------------------------------------------------------------------
# source files
D = Core/Src
CORE = {
$D/CoreMain.cpp
$D/Core$SUFF.cpp
$D/CoreCpuid.cpp
$D/DbgSymbols.cpp
$D/DbgSymbols$SUFF.cpp
$D/Memory.cpp
$D/OutputDevice.cpp
$D/ErrorMgr.cpp
$D/ExceptHandler$SUFF.cpp
$D/ExceptDumpers.cpp
$D/ScriptParser.cpp
$D/Strings.cpp
$D/TextContainer.cpp
$D/FileSystem.cpp
$D/FileSystem$SUFF.cpp
$D/FileContainerArc.cpp
$D/Math3D.cpp
$D/MathMisc.cpp
# unfinished code:
# $D/CommandCompletion.cpp
# $D/Commands.cpp
}
D = client
CLIENT = {
$D/cl_cin.cpp
$D/cl_download.cpp
$D/cl_ents.cpp
$D/cl_fx.cpp
$D/cl_input.cpp
$D/cl_main.cpp
$D/cl_parse.cpp
$D/cl_playermodel.cpp
$D/cl_pred.cpp
$D/cl_scrn.cpp
$D/cl_tent.cpp
$D/cl_view.cpp
$D/console.cpp
$D/keys.cpp
$D/menu.cpp
$D/qmenu.cpp
$D/ref_vars.cpp
$D/snd_dma.cpp
$D/snd_mem.cpp
$D/snd_mix.cpp
}
D = server
SERVER = {
$D/sv_anim.cpp
$D/sv_ccmds.cpp
$D/sv_ents.cpp
$D/sv_game.cpp
$D/sv_init.cpp
$D/sv_main.cpp
$D/sv_send.cpp
$D/sv_text.cpp
$D/sv_tokenize.cpp
$D/sv_user.cpp
$D/sv_world.cpp
}
DED_CLIENT = \
$D/sv_dedicated.cpp
D = qcommon
COMMON = {
$D/anorms.cpp
$D/cmd.cpp
$D/cmodel.cpp
$D/common.cpp
$D/crc.cpp
$D/cvar.cpp
$D/entdelta.cpp
$D/EntityParser.cpp
$D/images.cpp
$D/MapBrush.cpp
$D/md4.cpp
$D/model.cpp
$D/msg.cpp
$D/net_chan.cpp
$D/pmove.cpp
$D/QuakeFileSystem.cpp
}
D = ref_gl
GL_RENDERER = {
$D/gl_backend.cpp
$D/gl_buffers.cpp
$D/gl_font.cpp
$D/gl_frontend.cpp
$D/gl_image.cpp
$D/gl_interface.cpp
$D/gl_light.cpp
$D/gl_lightmap.cpp
$D/gl_main.cpp
$D/gl_math.cpp
$D/gl_poly.cpp
$D/gl_shader.cpp
$D/gl_sky.cpp
$D/gl_text.cpp
$D/gl_model.cpp
$D/gl_bspmodel.cpp
$D/gl_trimodel.cpp
$D/GLBind.cpp
!if "$PLATFORM" eq "win32"
win32/gl_win.cpp
!endif
}
D = win32
WIN32_FILES = {
$D/cd_win.cpp
$D/in_win.cpp
$D/net_wins.cpp
$D/snd_win.cpp
$D/sys_win.cpp
$D/vid_dll.cpp
# resources
$D/q2.rc
}
DED_WIN32 = {
$D/net_wins.cpp
$D/sys_win.cpp
}
# internal files
RES_FILES = \
resource/makeres.asm
# tool debugging ...
#!if $COMPILER eq "VisualC"
#!dumpvars
#!endif
INCLUDES = SDK/include Core/Inc qcommon
LIBRARIES = SDK/lib
#------------------------------------------------------------------------------
# static build
DEFINES = $COM_DEFINES STATIC_BUILD
OBJDIR = $OBJ/CoreStatic
sources(STATIC) = $CORE
DEFINES = $COM_DEFINES STATIC_BUILD SINGLE_RENDERER #?? SINGLE_RENDERER: check when will be 2+ renderers
OBJDIR = $OBJ/q2stat
sources(STATIC) = $CLIENT $SERVER $COMMON $WIN32_FILES $RES_FILES $GL_RENDERER
LIBS = lib/libs-$TARGET
target(executable, $OUT/Quake2, STATIC, STATIC)
#------------------------------------------------------------------------------
# dynamic build
!ifndef NOSHARED #!!!! shared
# !! does not works now !!
DEFINES = $COM_DEFINES
OBJDIR = $OBJ/CoreShared
sources(CORE) = $CORE
IMPLIB = $OUT/Core
target(shared, $OUT/Core, CORE, DYNAMIC)
#----------------------------
LIBS = lib/libs-$TARGET $OUT/Core
DEFINES = $COM_DEFINES
OBJDIR = $OBJ/q2dyn
sources(DYN_EXE) = $CLIENT $SERVER $COMMON $RES_FILES $WIN32_FILES
target(executable, $OUT/quake2_dyn, DYN_EXE, DYNAMIC)
#----------------------------
LIBS = $OUT/Core
DEFINES = $COM_DEFINES
OBJDIR = $OBJ/gldyn
sources(DYN_GL) = $GL_RENDERER client/ref_vars.cpp
target(shared, $OUT/ref_gl, DYN_GL, DYNAMIC)
#!! + dedicated
!endif #!!!! shared
#------------------------------------------------------------------------------
# dedicated server
DEFINES = $COM_DEFINES STATIC_BUILD
OBJDIR = $OBJ/CoreStatic
sources(DEDICATED) = $CORE
DEFINES = $COM_DEFINES STATIC_BUILD DEDICATED_ONLY
OBJDIR = $OBJ/dedstat
sources(DEDICATED) = $DED_CLIENT $SERVER $COMMON $DED_WIN32 # no $RES_FILES for dedicated server
LIBS = lib/libs-$TARGET
CONSOLE = 1
target(executable, $OUT/q2ded, DEDICATED, DEDICATED)
#------------------------------------------------------------------------------
# test application
DEFINES = $COM_DEFINES STATIC_BUILD
LIBS = lib/libs-$TARGET # for zlib
#-- Core files
OBJDIR = $OBJ/CoreStatic
sources(TEST) = $CORE
#-- app files
TEST_FILES = TestApp/TestApp.cpp
#-- files, required for Core to be standalone
TEST_FILES += Core/Src/Commands.cpp
OBJDIR = $OBJ/TestApp
sources(TEST) = $TEST_FILES
CONSOLE = 1
target(executable, TestApp/TestApp, TEST, TESTAPP)