-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile.dj
More file actions
310 lines (278 loc) · 6.25 KB
/
Copy pathMakefile.dj
File metadata and controls
310 lines (278 loc) · 6.25 KB
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
308
309
# features selection :
#
# use WatTCP (WATT-32) for DOS UDP networking
USE_WATT32=1
# gamespy/server browser:
USE_GAMESPY=1
# dynamically linked gamespy:
GAMESPY_DXE=1
# libcurl/http downloads:
USE_CURL=1
# ogg/vorbis music:
USE_OGG=1
# use tremor library for ogg/vorbis:
USE_TREMOR=1
# pci sound card support:
USE_SNDPCI=1
# pci sound card support as dxe3:
SNDPCI_DXE=1
# cd audio support:
USE_CDAUDIO=1
# abrash's asm optimizations:
USE_ASM=1
# dynamic refresh (video) modules:
REF_DXE=1
# compile which renderer if REF_DXE=0 : enable ONLY ONE!
REF_STATIC_SOFT=1
REF_STATIC_GL=0
# compile for which gl driver if REF_DXE=0 and REF_STATIC_GL=1
# mesa, sage, or fxmesa
REFGL_DRIVER=fxmesa
# compile which glide driver,if REF_DXE=0 and REF_STATIC_GL=1
# sst1=Voodoo Graphics, sst96=Voodoo Rush
# cvg=Voodoo2, h5=Banshee and Voodoo3/4/5
FX_GLIDE_HW=h5
# enable evil 3dfx glide hacks for native hardware gamma
# (if REF_DXE=0 and REF_STATIC_GL=1)
USE_3DFXGAMMA=1
CC = gcc
ifeq ($(DEBUG),1)
CFLAGS = -Wall -Werror -g -fno-strict-aliasing
else
CFLAGS = -Wall -Werror -O2 -fno-strict-aliasing -fomit-frame-pointer
endif
CPPFLAGS = -DCLIENT_SPLIT_NETFRAME
LDFLAGS =
CLIBS = -lc -lgcc
#CLIBS += -lm
EXE = q2.exe
ifeq ($(USE_SSE),1)
# FS: approx 10-15% speed boost on my P3 550 when running timedemos, but could be dangerous.
CFLAGS+= -march=pentium3
EXE = q2sse.exe
endif
ifneq ($(REF_DXE),1)
CPPFLAGS+= -DREF_HARD_LINKED
endif
ifneq ($(USE_WATT32),1)
NET_OBJ = dos/net_null.o
else
NET_OBJ = dos/net_watt.o
WATT32_CFLAGS = -Iwattcp/inc -DWATT32_NO_OLDIES
WATT32_LIBS = -Lwattcp/lib -lwatt
endif
ifeq ($(USE_ASM),1)
CPPFLAGS+= -Did386=1
endif
ifeq ($(USE_GAMESPY),1)
CPPFLAGS+= -DGAMESPY
ifneq ($(GAMESPY_DXE),1)
CPPFLAGS+= -DGAMESPY_HARD_LINKED
endif
endif
ifeq ($(USE_SNDPCI),1)
CPPFLAGS+= -DUSE_SNDPCI
CFLAGS+= -Idos/3rdparty/include
ifeq ($(SNDPCI_DXE),1)
CPPFLAGS+= -DSNDPCI_DXE
else
LDFLAGS+= -Ldos/3rdparty/lib -lau
endif
endif
ifeq ($(USE_CDAUDIO),1)
CPPFLAGS+= -DUSE_DOS_CD
endif
ifeq ($(USE_OGG),1)
CPPFLAGS+= -DOGG_SUPPORT
VORBIS_CFLAGS = -Idos/3rdparty/include
ifneq ($(USE_TREMOR),1)
VORBIS_LIBS = -Ldos/3rdparty/lib -lvorbisfile -lvorbis -logg
else
CPPFLAGS+= -DVORBIS_USE_TREMOR
VORBIS_LIBS = -Ldos/3rdparty/lib -lvorbisidec -logg
endif
endif
ifeq ($(USE_CURL),1)
CPPFLAGS+= -DUSE_CURL -DCURL_NO_OLDIES
CURL_CFLAGS = -Ilibcurl/include
CURL_LIBS = -Llibcurl/lib -lcurl
endif
ifneq ($(REF_DXE),1)
ifeq ($(REF_STATIC_GL),1)
EXE = q2fx.exe
CFLAGS += -Idos/3rdparty/include -Idos/3rdparty/include/glide3
LDFLAGS += -Ldos/3rdparty/lib/$(GLDIR) -lgl -Ldos/3rdparty/lib/$(FX_GLIDE_HW) -lglide3x
REF_STATIC_SOFT=0
# compile which gl driver in: mesa, sage, or fxmesa. (only one.)
ifeq ($(REFGL_DRIVER),fxmesa)
CPPFLAGS+= -DREFGL_FXMESA
endif
ifeq ($(REFGL_DRIVER),mesa)
CPPFLAGS+= -DREFGL_MESA
endif
ifeq ($(REFGL_DRIVER),sage)
CPPFLAGS+= -DREFGL_SAGE
endif
GLDIR=$(REFGL_DRIVER)
endif
endif
# needed if building against djgpp <= 2.03
#VSNPRINTF = dos/vsnprntf.o
DOS = dos/dos_v2.o \
dos/cd_dos.o \
dos/vid_dos.o \
dos/snddma_dos.o \
dos/snd_gus.o \
dos/snd_sb.o \
dos/snd_pci.o \
dos/in_dos.o \
$(NET_OBJ) \
dos/q_shdos.o \
$(VSNPRINTF) \
dos/dxe.o \
dos/sys_dos.o
CLIENT = client/cl_input.o \
client/cl_inv.o \
client/cl_main.o \
client/cl_cin.o \
client/cl_ents.o \
client/cl_http.o \
client/cl_fx.o \
client/cl_parse.o \
client/cl_pred.o \
client/cl_scrn.o \
client/cl_tent.o \
client/cl_view.o \
client/menu.o \
client/console.o \
client/keys.o \
client/snd_dma.o \
client/snd_mem.o \
client/snd_mix.o \
client/snd_stream.o \
client/snd_wavstream.o \
client/qmenu.o \
client/cl_newfx.o
ifeq ($(USE_GAMESPY),1)
ifneq ($(GAMESPY_DXE),1)
GAMESPY = Goa/CEngine/darray.o \
Goa/CEngine/gserver.o \
Goa/CEngine/gserverlist.o \
Goa/CEngine/gutil.o \
Goa/CEngine/hashtable.o \
Goa/nonport.o
endif
endif
QCOMMON = qcommon/cmd.o \
qcommon/cmd_auto.o \
qcommon/cmodel.o \
qcommon/common.o \
qcommon/crc.o \
qcommon/cvar.o \
qcommon/files.o \
qcommon/md4.o \
qcommon/net_chan.o \
qcommon/pmove.o \
game/m_flash.o \
game/q_shared.o
SERVER = server/sv_ccmds.o \
server/sv_ents.o \
server/sv_game.o \
server/sv_init.o \
server/sv_main.o \
server/sv_send.o \
server/sv_user.o \
server/sv_world.o
ifneq ($(REF_DXE),1)
ifeq ($(REF_STATIC_SOFT),1)
REFSOFT = ref_soft/r_alias.o \
ref_soft/r_main.o \
ref_soft/r_light.o \
ref_soft/r_misc.o \
ref_soft/r_model.o \
ref_soft/r_part.o \
ref_soft/r_poly.o \
ref_soft/r_polyse.o \
ref_soft/r_rast.o \
ref_soft/r_scan.o \
ref_soft/r_sprite.o \
ref_soft/r_surf.o \
ref_soft/r_aclip.o \
ref_soft/r_bsp.o \
ref_soft/r_draw.o \
ref_soft/r_edge.o \
ref_soft/r_image.o \
dos/vid_ext.o \
dos/vregset.o \
dos/swimp_dos.o
endif
endif
ifneq ($(REF_DXE),1)
ifeq ($(REF_STATIC_GL),1)
REFGL = ref_gl/gl_draw.o \
ref_gl/gl_image.o \
ref_gl/gl_light.o \
ref_gl/gl_mesh.o \
ref_gl/gl_model.o \
ref_gl/gl_rmain.o \
ref_gl/gl_rmisc.o \
ref_gl/gl_rsurf.o \
ref_gl/gl_warp.o \
dos/qgl_dos.o \
dos/gl_fxmesa.o \
dos/gl_dmesa.o \
dos/gl_sage.o \
dos/glimp_dos.o
ifeq ($(USE_3DFXGAMMA),1)
REFGL+= dos/fx_gamma.o
CPPFLAGS+= -DUSE_3DFXGAMMA
endif
endif
endif
ifeq ($(USE_ASM),1)
COMMONASM = gas/math.o
CLIENTASM = gas/snd_mixa.o
ifneq ($(REF_DXE),1)
COMMONREFASM = gas/math_ref.o \
gas/sys_dosa.o
ifeq ($(REF_STATIC_SOFT),1)
REFASM = gas/d_copy.o \
gas/r_aclipa.o \
gas/r_aliasa.o \
gas/r_draw16.o \
gas/r_drawa.o \
gas/r_edgea.o \
gas/r_parta.o \
gas/r_polysa.o \
gas/r_scana.o \
gas/r_spr8.o \
gas/r_surf8.o \
gas/r_varsa.o
endif
endif
endif
OBJECTS = $(CLIENT) $(CLIENTASM) $(QCOMMON) $(COMMONASM) $(COMMONREFASM) $(SERVER) $(GAMESPY) $(REFSOFT) $(REFGL) $(REFASM) $(DOS)
.PHONY: clean
all: q2dos
q2dos: $(OBJECTS)
$(CC) $(OBJECTS) $(LDFLAGS) $(GLIDE_LIBS) $(VORBIS_LIBS) $(CURL_LIBS) $(WATT32_LIBS) $(CLIBS) -o $(EXE)
clean:
rm -f qcommon/*.o
rm -f client/*.o
rm -f server/*.o
rm -f ref_soft/*.o
rm -f ref_gl/*.o
rm -f dos/*.o
rm -f gas/*.o
rm -f Goa/*.o
rm -f Goa/CEngine/*.o
rm -f game/*.o
DO_AS=$(CC) -x assembler-with-cpp
%.o : %.c
$(CC) $(CFLAGS) $(CPPFLAGS) $(WATT32_CFLAGS) $(VORBIS_CFLAGS) $(CURL_CFLAGS) -c $< -o $@
%.o: %.S
$(DO_AS) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
%.o: %.s
$(DO_AS) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
dos/net_null.o : null/net_null.c
$(CC) $(CFLAGS) $(CPPFLAGS) $(WATT32_CFLAGS) $(VORBIS_CFLAGS) $(CURL_CFLAGS) -c $< -o $@