5b150f9f782c2ddaf507ed0a6552377cb1dc23e0
[xonotic/darkplaces.git] / makefile.inc
1 # Invalid call detection
2 CHECKLEVEL1 = @if [ "$(LEVEL)" != 1 ]; then $(MAKE) help; false; fi
3 CHECKLEVEL2 = @if [ "$(LEVEL)" != 2 ]; then $(MAKE) help; false; fi
4
5 # Choose the compiler you want to use
6 CC?=gcc
7
8 # athlon optimizations
9 #CPUOPTIMIZATIONS?=-march=athlon
10 # athlon xp optimizations
11 #CPUOPTIMIZATIONS?=-march=athlon-xp
12 # athlon 64 optimizations
13 #CPUOPTIMIZATIONS?=-march=athlon64 -m32
14 # Pentium 3 optimizations
15 #CPUOPTIMIZATIONS?=-march=pentium3
16 # Pentium 4 optimizations
17 #CPUOPTIMIZATIONS?=-march=pentium4
18 # 686 (Pentium Pro/II) optimizations
19 #CPUOPTIMIZATIONS?=-march=i686
20 # No specific CPU (386 compatible)
21 #CPUOPTIMIZATIONS?=
22 # Experimental
23 #CPUOPTIMIZATIONS?=-fno-math-errno -fno-rounding-math -fno-signaling-nans -fassociative-math -freciprocal-math -fno-signed-zeros -fno-trapping-math
24 # Normal
25 ifeq ($(CC), clang)
26         CPUOPTIMIZATIONS?=-fno-math-errno -fno-rounding-math -fno-trapping-math
27 else
28         CPUOPTIMIZATIONS?=-fno-math-errno -fno-rounding-math -fno-signaling-nans -fno-trapping-math
29 endif
30 # NOTE: *never* *ever* use the -ffast-math or -funsafe-math-optimizations flag
31 # Also, since gcc 5, -ffinite-math-only makes NaN and zero compare equal inside engine code but not inside QC, which causes error spam for seemingly valid QC code like if (x != 0) return 1 / x;
32
33 SDL_CONFIG?=sdl2-config
34 SDLCONFIG_UNIXCFLAGS?=`$(SDL_CONFIG) --cflags`
35 SDLCONFIG_UNIXCFLAGS_X11?=
36 SDLCONFIG_UNIXLIBS?=`$(SDL_CONFIG) --libs`
37 SDLCONFIG_UNIXLIBS_X11?=-lX11
38 SDLCONFIG_UNIXSTATICLIBS?=`$(SDL_CONFIG) --static-libs`
39 SDLCONFIG_UNIXSTATICLIBS_X11?=-lX11
40 SDLCONFIG_MACOSXCFLAGS=-I/Library/Frameworks/SDL2.framework/Headers -I$(HOME)/Library/Frameworks/SDL2.framework/Headers
41 SDLCONFIG_MACOSXLIBS=-F$(HOME)/Library/Frameworks/ -framework SDL2 -framework Cocoa $(SDLCONFIG_MACOSXCFLAGS)
42 SDLCONFIG_MACOSXSTATICLIBS=-F$(HOME)/Library/Frameworks/ -framework SDL2 -framework Cocoa $(SDLCONFIG_MACOSXCFLAGS)
43 STRIP?=strip
44
45
46 ###### Sound #####
47
48 OBJ_SND_COMMON=snd_main.o snd_mem.o snd_mix.o snd_ogg.o snd_wav.o $(OBJ_SND_XMP)
49
50 # No sound
51 OBJ_SND_NULL=snd_null.o
52 LIB_SND_NULL=
53
54 # Open Sound System (Linux, FreeBSD and Solaris)
55 OBJ_SND_OSS=$(OBJ_SND_COMMON) snd_oss.o
56 LIB_SND_OSS=
57
58 # Advanced Linux Sound Architecture (Linux)
59 OBJ_SND_ALSA=$(OBJ_SND_COMMON) snd_alsa.o
60 LIB_SND_ALSA=-lasound
61
62 # Core Audio (Mac OS X)
63 OBJ_SND_COREAUDIO=$(OBJ_SND_COMMON) snd_coreaudio.o
64 LIB_SND_COREAUDIO=-framework CoreAudio
65
66 # BSD / Sun audio API (NetBSD and OpenBSD)
67 OBJ_SND_BSD=$(OBJ_SND_COMMON) snd_bsd.o
68 LIB_SND_BSD=
69
70 # DirectX and Win32 WAVE output (Win32)
71 OBJ_SND_WIN=$(OBJ_SND_COMMON) snd_win.o
72 LIB_SND_WIN=
73
74
75 ###### Common objects and flags #####
76
77 # Common objects
78 OBJ_COMMON= \
79         bih.o \
80         crypto.o \
81         cd_shared.o \
82         cl_cmd.o \
83         cl_collision.o \
84         cl_demo.o \
85         cl_ents.o \
86         cl_ents4.o \
87         cl_ents5.o \
88         cl_ents_nq.o \
89         cl_ents_qw.o \
90         cl_input.o \
91         cl_main.o \
92         cl_parse.o \
93         cl_particles.o \
94         cl_screen.o \
95         cl_video.o \
96         cl_video_libavw.o \
97         clvm_cmds.o \
98         cmd.o \
99         collision.o \
100         com_crc16.o \
101         com_ents.o \
102         com_ents4.o \
103         com_game.o \
104         com_msg.o \
105         common.o \
106         console.o \
107         csprogs.o \
108         curves.o \
109         cvar.o \
110         dpvsimpledecode.o \
111         filematch.o \
112         fractalnoise.o \
113         fs.o \
114         ft2.o \
115         utf8lib.o \
116         gl_backend.o \
117         gl_draw.o \
118         gl_rmain.o \
119         gl_rsurf.o \
120         gl_textures.o \
121         hmac.o \
122         host.o \
123         image.o \
124         image_png.o \
125         jpeg.o \
126         keys.o \
127         lhnet.o \
128         libcurl.o \
129         mathlib.o \
130         matrixlib.o \
131         mdfour.o \
132         meshqueue.o \
133         mod_skeletal_animatevertices_sse.o \
134         mod_skeletal_animatevertices_generic.o \
135         model_alias.o \
136         model_brush.o \
137         model_shared.o \
138         model_sprite.o \
139         netconn.o \
140         palette.o \
141         polygon.o \
142         portals.o \
143         protocol.o \
144         prvm_cmds.o \
145         prvm_edict.o \
146         prvm_exec.o \
147         r_explosion.o \
148         r_lightning.o \
149         r_modules.o \
150         r_shadow.o \
151         r_sky.o \
152         r_sprites.o \
153         r_stats.o \
154         sbar.o \
155         sv_ccmds.o \
156         sv_demo.o \
157         sv_ents.o \
158         sv_ents4.o \
159         sv_ents5.o \
160         sv_ents_csqc.o \
161         sv_ents_nq.o \
162         sv_main.o \
163         sv_move.o \
164         sv_phys.o \
165         sv_save.o \
166         sv_send.o \
167         sv_user.o \
168         svbsp.o \
169         svvm_cmds.o \
170         sys_shared.o \
171         taskqueue.o \
172         vid_shared.o \
173         view.o \
174         wad.o \
175         world.o \
176         zone.o
177
178 OBJ_MENU= \
179         menu.o \
180         mvm_cmds.o
181
182 # note that builddate.c is very intentionally not compiled to a .o before
183 # being linked, because it should be recompiled every time an executable is
184 # built to give the executable a proper date string
185 OBJ_SV= builddate.c sys_unix.o vid_null.o thread_null.o $(OBJ_SND_NULL) $(OBJ_COMMON)
186 OBJ_SDL= builddate.c sys_sdl.o vid_sdl.o thread_sdl.o $(OBJ_MENU) $(OBJ_SND_COMMON) $(OBJ_SND_XMP) snd_sdl.o $(OBJ_VIDEO_CAPTURE) $(OBJ_COMMON)
187
188
189 # Compilation
190 ifeq ($(PEDANTIC),1)
191         CFLAGS_STANDARD=-std=c11 -pedantic -D_POSIX_C_SOURCE=200809L -DCONFIG_PEDANTIC
192 else
193         CFLAGS_STANDARD=
194 endif
195
196 CFLAGS_TCC=
197
198 ifeq ($(CC), tcc)
199         CFLAGS_TCC=-DSDL_DISABLE_IMMINTRIN_H
200 endif
201
202 CFLAGS_COMMON=$(CFLAGS_STANDARD) $(CFLAGS_TCC) $(CFLAGS_MAKEDEP) $(CFLAGS_PRELOAD) $(CFLAGS_FS) $(CFLAGS_WARNINGS) $(CFLAGS_LIBZ) $(CFLAGS_LIBJPEG) $(CFLAGS_SND_XMP) $(CFLAGS_NET) $(CFLAGS_SDL) -D_FILE_OFFSET_BITS=64 -D__KERNEL_STRICT_NAMES -I../../../
203 CFLAGS_CLIENT=-DCONFIG_MENU $(CFLAGS_VIDEO_CAPTURE)
204 CFLAGS_SERVER=
205 CFLAGS_DEBUG=-ggdb
206 CFLAGS_PROFILE=-g -pg -ggdb -fprofile-arcs
207 CFLAGS_RELEASE=
208 CFLAGS_RELEASE_PROFILE=-fbranch-probabilities
209 CFLAGS_SDL=
210
211 ifeq ($(DP_SSE),1)
212         CFLAGS_SSE=-msse
213         CFLAGS_SSE2=-msse2
214 else
215         CFLAGS_SSE=
216         CFLAGS_SSE2=
217 endif # ifeq ($(DP_SSE),1)
218
219 OPTIM_DEBUG=$(CPUOPTIMIZATIONS)
220 #OPTIM_RELEASE=-O2 -fno-strict-aliasing -ffast-math -funroll-loops $(CPUOPTIMIZATIONS)
221 #OPTIM_RELEASE=-O2 -fno-strict-aliasing -fno-math-errno -fno-trapping-math -fno-signaling-nans -fcx-limited-range -funroll-loops $(CPUOPTIMIZATIONS)
222 #OPTIM_RELEASE=-O2 -fno-strict-aliasing -funroll-loops $(CPUOPTIMIZATIONS)
223 #OPTIM_RELEASE=-O2 -fno-strict-aliasing $(CPUOPTIMIZATIONS)
224 OPTIM_RELEASE=-O3 -fno-strict-aliasing $(CPUOPTIMIZATIONS)
225 # NOTE: *never* *ever* use the -ffast-math or -funsafe-math-optimizations flag
226 # Also, since gcc 5, -ffinite-math-only makes NaN and zero compare equal inside engine code but not inside QC, which causes error spam for seemingly valid QC code like if (x != 0) return 1 / x;
227
228 DO_CC=$(CC) $(CFLAGS) -c $< -o $@
229
230
231 # Link
232 LDFLAGS_DEBUG=-g -ggdb $(OPTIM_DEBUG) -DSVNREVISION=`{ test -d .svn && svnversion; } || { test -d .git && git describe --always; } || echo -` -DBUILDTYPE=debug
233 LDFLAGS_PROFILE=-g -pg -fprofile-arcs $(OPTIM_RELEASE) -DSVNREVISION=`{ test -d .svn && svnversion; } || { test -d .git && git describe --always; } || echo -` -DBUILDTYPE=profile
234 LDFLAGS_RELEASE=$(OPTIM_RELEASE) -DSVNREVISION=`{ test -d .svn && svnversion; } || { test -d .git && git describe --always; } || echo -` -DBUILDTYPE=release
235
236
237 ##### UNIX specific variables #####
238
239 LDFLAGS_UNIXCOMMON=-lm $(LIB_ODE) $(LIB_Z) $(LIB_JPEG) $(LIB_CRYPTO) $(LIB_CRYPTO_RIJNDAEL) $(LIB_SND_XMP)
240 LDFLAGS_UNIXSV_PRELOAD=-lz -ljpeg -lpng -lcurl
241 LDFLAGS_UNIXSDL_PRELOAD=-lz -ljpeg -lpng -logg -ltheora -lvorbis -lvorbisenc -lvorbisfile -lcurl -lxmp
242 CFLAGS_UNIX_PRELOAD=-DPREFER_PRELOAD
243
244 LDFLAGS_UNIXSDL=$(SDL_LIBS) #-lGLESv2
245 EXE_UNIXSV=darkplaces-dedicated
246 EXE_UNIXSDL=darkplaces-sdl
247 EXE_UNIXSVNEXUIZ=nexuiz-dedicated
248 EXE_UNIXSDLNEXUIZ=nexuiz-sdl
249
250 CMD_UNIXRM=rm -rf
251 CMD_UNIXCP=cp -f
252 CMD_UNIXMKDIR=mkdir -p
253
254
255 ##### Linux specific variables #####
256
257 # Link
258 LDFLAGS_LINUXSV=$(LDFLAGS_UNIXCOMMON) -lrt -ldl
259 LDFLAGS_LINUXSDL=$(LDFLAGS_UNIXCOMMON) -lrt -ldl $(LDFLAGS_UNIXSDL)
260
261
262 ##### Mac OS X specific variables #####
263
264 # Link
265 LDFLAGS_MACOSXSV=$(LDFLAGS_UNIXCOMMON) -ldl
266 LDFLAGS_MACOSXSDL=$(LDFLAGS_UNIXCOMMON) -ldl -framework IOKit $(SDLCONFIG_STATICLIBS) ../../../SDLMain.m
267
268
269 ##### SunOS specific variables #####
270
271 CFLAGS_SUNOS=-I/usr/lib/oss/include -DBSD_COMP -DSUNOS
272
273 # Link
274 LDFLAGS_SUNOSSV=$(LDFLAGS_UNIXCOMMON) -lrt -ldl -lsocket -lnsl
275 LDFLAGS_SUNOSSDL=$(LDFLAGS_UNIXCOMMON) -lrt -ldl -lsocket -lnsl $(LDFLAGS_UNIXSDL)
276
277
278 ##### BSD specific variables #####
279
280 # Link
281 LDFLAGS_BSDSV=$(LDFLAGS_UNIXCOMMON) 
282 LDFLAGS_BSDSDL=$(LDFLAGS_UNIXCOMMON) $(LDFLAGS_UNIXSDL)
283
284
285 ##### Win32 specific variables #####
286
287 WINDRES ?= windres
288
289 # Link
290 # see LDFLAGS_WINCOMMON in makefile
291 LDFLAGS_WINSV=$(LDFLAGS_WINCOMMON) $(LIB_CRYPTO) $(LIB_CRYPTO_RIJNDAEL) -mconsole -lwinmm -lws2_32 $(LIB_Z) $(LIB_JPEG)
292 LDFLAGS_WINSDL=$(LDFLAGS_WINCOMMON) $(LIB_CRYPTO) $(LIB_CRYPTO_RIJNDAEL) $(LDFLAGS_UNIXSDL) -lwinmm -lws2_32 $(LIB_Z) $(LIB_JPEG) $(LIB_SND_XMP)
293 EXE_WINSV=darkplaces-dedicated.exe
294 EXE_WINSDL=darkplaces-sdl.exe
295 EXE_WINSVNEXUIZ=nexuiz-dedicated.exe
296 EXE_WINSDLNEXUIZ=nexuiz-sdl.exe
297
298 VPATH := ../../../
299
300 ##### Commands #####
301
302 .PHONY : clean clean-profile help \
303          debug profile release \
304          sv-debug sv-profile sv-release \
305          sdl-debug sdl-profile sdl-release
306
307 help:
308         @echo
309         @echo "===== Choose one ====="
310         @echo "* $(MAKE) clean                : delete all files produced by the build except"
311         @echo "                              profiling information"
312         @echo "* $(MAKE) clean-profile        : delete all files produced by the build, including"
313         @echo "                              profiling informaiton"
314         @echo "* $(MAKE) help                 : this help"
315         @echo "* $(MAKE) debug                : make client and server binaries (debug versions)"
316         @echo "* $(MAKE) profile              : make client and server binaries (profile versions)"
317         @echo "* $(MAKE) release              : make client and server binaries (release versions)"
318         @echo "* $(MAKE) release-profile      : make client and server binaries (release versions)"
319         @echo "                              (with profiling optimizations) The profiled"
320         @echo "                              version of the program must have been"
321         @echo "                              previously compiled"
322         @echo "* $(MAKE) nexuiz               : make client and server binaries with nexuiz icon"
323         @echo "                              (release versions)"
324         @echo "* $(MAKE) sv-debug             : make dedicated server (debug version)"
325         @echo "* $(MAKE) sv-profile           : make dedicated server (profile version)"
326         @echo "* $(MAKE) sv-release-profile   : make dedicated server (release profile version)"
327         @echo "* $(MAKE) sv-release           : make dedicated server (release version)"
328         @echo "* $(MAKE) sv-nexuiz            : make dedicated server with nexuiz icon"
329         @echo "                              (release version)"
330         @echo "* $(MAKE) sdl-debug            : make SDL client (debug version)"
331         @echo "* $(MAKE) sdl-profile          : make SDL client (profile version)"
332         @echo "* $(MAKE) sdl-release-profile  : make SDL client (release version)"
333         @echo "* $(MAKE) sdl-release          : make SDL client (release version)"
334         @echo "* $(MAKE) sdl-nexuiz           : make SDL client with nexuiz icon (release version)"
335         @echo
336
337 debug :
338         $(MAKE) $(TARGETS_DEBUG)
339
340 profile :
341         $(MAKE) $(TARGETS_PROFILE)
342
343 release :
344         $(MAKE) $(TARGETS_RELEASE)
345
346 release-profile :
347         $(MAKE) $(TARGETS_RELEASE_PROFILE)
348
349 nexuiz :
350         $(MAKE) $(TARGETS_NEXUIZ)
351
352 sv-debug :
353         $(MAKE) bin-debug \
354                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
355                 EXE='$(EXE_SV)' CFLAGS_FEATURES='$(CFLAGS_SERVER)' LDFLAGS_COMMON='$(LDFLAGS_SV)' LEVEL=1
356
357 sv-profile :
358         $(MAKE) bin-profile \
359                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
360                 EXE='$(EXE_SV)' CFLAGS_FEATURES='$(CFLAGS_SERVER)' LDFLAGS_COMMON='$(LDFLAGS_SV)' LEVEL=1
361
362 sv-release :
363         $(MAKE) bin-release \
364                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
365                 EXE='$(EXE_SV)' CFLAGS_FEATURES='$(CFLAGS_SERVER)' LDFLAGS_COMMON='$(LDFLAGS_SV)' LEVEL=1
366
367 sv-release-profile :
368         $(MAKE) bin-release-profile \
369                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
370                 EXE='$(EXE_SV)' CFLAGS_FEATURES='$(CFLAGS_SERVER)' LDFLAGS_COMMON='$(LDFLAGS_SV)' LEVEL=1
371
372 sv-nexuiz :
373         $(MAKE) bin-release \
374                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
375                 EXE='$(EXE_SVNEXUIZ)' CFLAGS_FEATURES='$(CFLAGS_SERVER)' LDFLAGS_COMMON='$(LDFLAGS_SV)' LEVEL=1
376
377 sdl-debug :
378         $(MAKE) bin-debug \
379                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
380                 EXE='$(EXE_SDL)' CFLAGS_FEATURES='$(CFLAGS_CLIENT)' CFLAGS_SDL='$(SDLCONFIG_CFLAGS)' LDFLAGS_COMMON='$(LDFLAGS_SDL)' LEVEL=1
381
382 sdl-profile :
383         $(MAKE) bin-profile \
384                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
385                 EXE='$(EXE_SDL)' CFLAGS_FEATURES='$(CFLAGS_CLIENT)' CFLAGS_SDL='$(SDLCONFIG_CFLAGS)' LDFLAGS_COMMON='$(LDFLAGS_SDL)' LEVEL=1
386
387 sdl-release :
388         $(MAKE) bin-release \
389                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
390                 EXE='$(EXE_SDL)' CFLAGS_FEATURES='$(CFLAGS_CLIENT)' CFLAGS_SDL='$(SDLCONFIG_CFLAGS)' LDFLAGS_COMMON='$(LDFLAGS_SDL)' LEVEL=1
391
392 sdl-release-profile :
393         $(MAKE) bin-release-profile \
394                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
395                 EXE='$(EXE_SDL)' CFLAGS_FEATURES='$(CFLAGS_CLIENT)' CFLAGS_SDL='$(SDLCONFIG_CFLAGS)' LDFLAGS_COMMON='$(LDFLAGS_SDL)' LEVEL=1
396
397 sdl-nexuiz :
398         $(MAKE) bin-release \
399                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
400                 EXE='$(EXE_SDLNEXUIZ)' CFLAGS_FEATURES='$(CFLAGS_CLIENT)' CFLAGS_SDL='$(SDLCONFIG_CFLAGS)' LDFLAGS_COMMON='$(LDFLAGS_SDL)' LEVEL=1
401
402 bin-debug :
403         $(CHECKLEVEL1)
404         @echo
405         @echo '========== $(EXE) (debug) =========='
406         $(MAKE) prepare BUILD_DIR=build-obj/debug/$(EXE)
407         $(MAKE) -C build-obj/debug/$(EXE) $(EXE) \
408                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
409                 CFLAGS='$(CFLAGS_COMMON) $(CFLAGS_FEATURES) $(CFLAGS_EXTRA) $(CFLAGS_DEBUG) $(OPTIM_DEBUG)'\
410                 LDFLAGS='$(LDFLAGS_DEBUG) $(LDFLAGS_COMMON)' LEVEL=2
411
412 bin-profile :
413         $(CHECKLEVEL1)
414         @echo
415         @echo '========== $(EXE) (profile) =========='
416         $(MAKE) prepare BUILD_DIR=build-obj/profile/$(EXE)
417         $(MAKE) -C build-obj/profile/$(EXE) $(EXE) \
418                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
419                 CFLAGS='$(CFLAGS_COMMON) $(CFLAGS_FEATURES) $(CFLAGS_EXTRA) $(CFLAGS_PROFILE) $(OPTIM_RELEASE)'\
420                 LDFLAGS='$(LDFLAGS_PROFILE) $(LDFLAGS_COMMON)' LEVEL=2
421
422 bin-release :
423         $(CHECKLEVEL1)
424         @echo
425         @echo '========== $(EXE) (release) =========='
426         $(MAKE) prepare BUILD_DIR=build-obj/release/$(EXE)
427         $(MAKE) -C build-obj/release/$(EXE) $(EXE) \
428                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
429                 CFLAGS='$(CFLAGS_COMMON) $(CFLAGS_FEATURES) $(CFLAGS_EXTRA) $(CFLAGS_RELEASE) $(OPTIM_RELEASE)'\
430                 LDFLAGS='$(LDFLAGS_RELEASE) $(LDFLAGS_COMMON)' LEVEL=2
431         $(STRIP) $(EXE)
432
433 bin-release-profile :
434         $(CHECKLEVEL1)
435         @echo
436         @echo '========== $(EXE) (release) =========='
437         $(MAKE) prepare BUILD_DIR=build-obj/release-profile/$(EXE)
438         $(MAKE) -C build-obj/release-profile/$(EXE) $(EXE) \
439                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
440                 CFLAGS='$(CFLAGS_COMMON) $(CFLAGS_FEATURES) $(CFLAGS_EXTRA) $(CFLAGS_RELEASE_PROFILE) $(OPTIM_RELEASE)'\
441                 LDFLAGS='$(LDFLAGS_RELEASE) $(LDFLAGS_COMMON)' LEVEL=2
442         $(STRIP) $(EXE)
443
444 prepare :
445         $(CMD_MKDIR) $(BUILD_DIR)
446         $(CMD_CP) makefile.inc $(BUILD_DIR)/
447         $(CMD_CP) $(MAKEFILE) $(BUILD_DIR)/
448
449
450 #this checks USEODE when compiling so it needs the ODE flags as well
451 cl_parse.o: cl_parse.c
452         $(CHECKLEVEL2)
453         $(DO_CC) $(CFLAGS_ODE)
454
455 cs_progs.o: cs_progs.c
456         $(CHECKLEVEL2)
457         $(DO_CC) $(CFLAGS_ODE)
458
459 sv_main.o: sv_main.c
460         $(CHECKLEVEL2)
461         $(DO_CC) $(CFLAGS_ODE)
462
463 sv_phys.o: sv_phys.c
464         $(CHECKLEVEL2)
465         $(DO_CC) $(CFLAGS_ODE)
466
467 prvm_cmds.o: prvm_cmds.c
468         $(CHECKLEVEL2)
469         $(DO_CC) $(CFLAGS_ODE)
470
471 world.o: world.c
472         $(CHECKLEVEL2)
473         $(DO_CC) $(CFLAGS_ODE)
474
475 crypto.o: crypto.c
476         $(CHECKLEVEL2)
477         $(DO_CC) $(CFLAGS_CRYPTO) $(CFLAGS_CRYPTO_RIJNDAEL)
478
479 mod_skeletal_animatevertices_sse.o: mod_skeletal_animatevertices_sse.c
480         $(CHECKLEVEL2)
481         $(DO_CC) $(CFLAGS_SSE)
482
483 snd_xmp.o: snd_xmp.c
484         $(CHECKLEVEL2)
485         $(DO_CC) $(CFLAGS_SND_XMP)
486
487 #this checks USEXMP when compiling so it needs the XMP flags as well
488 snd_main.o: snd_main.c
489         $(CHECKLEVEL2)
490         $(DO_CC) $(CFLAGS_SND_XMP)
491
492 #this checks USEXMP when compiling so it needs the XMP flags as well
493 snd_mem.o: snd_mem.c
494         $(CHECKLEVEL2)
495         $(DO_CC) $(CFLAGS_SND_XMP)
496
497 darkplaces.o: %.o : %.rc
498         $(CHECKLEVEL2)
499         $(WINDRES) -o $@ $<
500
501 nexuiz.o: %.o : %.rc
502         $(CHECKLEVEL2)
503         $(WINDRES) -o $@ $<
504
505 .c.o:
506         $(CHECKLEVEL2)
507         $(DO_CC)
508
509 $(EXE_SV): $(OBJ_SV) $(OBJ_ICON)
510         $(CHECKLEVEL2)
511         $(DO_LD)
512
513 $(EXE_SDL): $(OBJ_SDL) $(OBJ_ICON)
514         $(CHECKLEVEL2)
515         $(DO_LD)
516
517 $(EXE_SVNEXUIZ): $(OBJ_SV) $(OBJ_ICON_NEXUIZ)
518         $(CHECKLEVEL2)
519         $(DO_LD)
520
521 $(EXE_SDLNEXUIZ): $(OBJ_SDL) $(OBJ_ICON_NEXUIZ)
522         $(CHECKLEVEL2)
523         $(DO_LD)
524
525 clean:
526         -$(CMD_RM) $(EXE_SV)
527         -$(CMD_RM) $(EXE_SDL)
528         -$(CMD_RM) $(EXE_SVNEXUIZ)
529         -$(CMD_RM) $(EXE_SDLNEXUIZ)
530         -$(CMD_RM) *.o
531         -$(CMD_RM) *.d
532         -$(CMD_RM) *.gch
533         -$(CMD_RM) build-obj/
534
535 clean-profile: clean
536         -$(CMD_RM) *.gcda
537         -$(CMD_RM) *.gcno