-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile.mingw
More file actions
224 lines (198 loc) · 4.32 KB
/
Copy pathMakefile.mingw
File metadata and controls
224 lines (198 loc) · 4.32 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
# features selection :
#
# gamespy/server browser:
USE_GAMESPY=1
# dynamically linked gamespy:
GAMESPY_DLL=1
# libcurl/http downloads:
USE_CURL=1
# ogg/vorbis music:
USE_OGG=1
# use tremor library for ogg/vorbis:
USE_TREMOR=0
# abrash's asm optimizations:
USE_ASM=1
# dynamic refresh (video) modules:
REF_DLL=1
# compile which renderer if REF_DXE=0 : enable ONLY ONE!
REF_STATIC_SOFT=1
REF_STATIC_GL=0
# new q3 style dedicated server console
NEW_DED_CONSOLE=0
CC = gcc
RC = windres
ifeq ($(DEBUG),1)
CFLAGS = -m32 -Wall -g -fno-strict-aliasing
CPPFLAGS =
else
CFLAGS = -m32 -Wall -O2 -fno-strict-aliasing -fomit-frame-pointer
CPPFLAGS = -DNDEBUG
endif
CPPFLAGS+= -DCLIENT_SPLIT_NETFRAME
LDFLAGS = -m32 -mwindows
LDLIBS = -lwinmm -lws2_32
# for doing -march= targets. Mostly for my own fooling around.
MARCHFLAGS =
EXE = q2.exe
ifneq ($(REF_DLL),1)
CPPFLAGS+= -DREF_HARD_LINKED
endif
ifeq ($(USE_ASM),1)
CPPFLAGS+= -Did386=1
endif
ifeq ($(USE_GAMESPY),1)
CPPFLAGS+= -DGAMESPY
ifneq ($(GAMESPY_DLL),1)
CPPFLAGS+= -DGAMESPY_HARD_LINKED
endif
endif
ifeq ($(USE_OGG),1)
CPPFLAGS+= -DOGG_SUPPORT
VORBIS_CFLAGS = -Iwin32/include
ifneq ($(USE_TREMOR),1)
VORBIS_LIBS = -Lwin32/lib -lvorbisfile -lvorbis -logg
else
CPPFLAGS+= -DVORBIS_USE_TREMOR
VORBIS_LIBS = -Lwin32/lib -lvorbisidec -logg
endif
endif
ifeq ($(USE_CURL),1)
CPPFLAGS+= -DUSE_CURL -DCURL_NO_OLDIES
CURL_CFLAGS = -Iwin32/include
CURL_LIBS = -Lwin32/lib -lcurl
endif
ifeq ($(NEW_DED_CONSOLE),1)
CPPFLAGS+= -DNEW_DED_CONSOLE
endif
WIN32 = win32/cd_win.o \
win32/in_win.o \
win32/net_wins.o \
win32/q_shwin.o \
win32/snd_win.o \
win32/vid_dll.o \
win32/vid_menu.o \
win32/win_dedconsole.o \
win32/sys_win.o
WIN32RES = win32/q2.res
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_DLL),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_DLL),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 \
win32/rw_imp.o \
win32/rw_ddraw.o \
win32/rw_dib.o
endif
endif
ifeq ($(USE_ASM),1)
COMMONASM = gas/math.o
CLIENTASM = gas/snd_mixa.o
ifneq ($(REF_DLL),1)
COMMONREFASM = gas/math_ref.o \
gas/sys_dosa.o
ifeq ($(REF_STATIC_SOFT),1)
REFASM = 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) $(REFASM) $(WIN32) $(WIN32RES)
.PHONY: clean
all: quake2
quake2: $(OBJECTS)
$(CC) -o $(EXE) $(LDFLAGS) $(OBJECTS) $(VORBIS_LIBS) $(CURL_LIBS) $(LDLIBS)
clean:
rm -f qcommon/*.o
rm -f client/*.o
rm -f server/*.o
rm -f ref_soft/*.o
rm -f win32/*.o
rm -f win32/*.res
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) $(MARCHFLAGS) $(CFLAGS) $(CPPFLAGS) $(VORBIS_CFLAGS) $(CURL_CFLAGS) -c $< -o $@
%.o: %.S
$(DO_AS) $(MARCHFLAGS) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
%.o: %.s
$(DO_AS) $(MARCHFLAGS) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
%.res: %.rc
$(RC) --output-format=coff --target=pe-i386 -o $@ $<