fix all the () problems, and make gcc warn for them
[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 -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fassociative-math -freciprocal-math -fno-signed-zeros -fno-trapping-math
24 # NOTE: *never* *ever* use the -ffast-math or -funsafe-math-optimizations flag
25
26 SDL_CONFIG?=sdl-config
27 SDLCONFIG_UNIXCFLAGS?=`$(SDL_CONFIG) --cflags`
28 SDLCONFIG_UNIXLIBS?=`$(SDL_CONFIG) --libs`
29 SDLCONFIG_UNIXSTATICLIBS?=`$(SDL_CONFIG) --static-libs`
30 SDLCONFIG_MACOSXCFLAGS=-I/Library/Frameworks/SDL.framework/Headers
31 SDLCONFIG_MACOSXLIBS=-framework SDL -framework Cocoa $(SDLCONFIG_MACOSXCFLAGS)
32 SDLCONFIG_MACOSXSTATICLIBS=-framework SDL -framework Cocoa $(SDLCONFIG_MACOSXCFLAGS)
33 STRIP?=strip
34
35
36 ###### Sound and audio CD #####
37
38 OBJ_SND_COMMON=snd_main.o snd_mem.o snd_mix.o snd_ogg.o snd_wav.o snd_modplug.o
39
40 # Additional stuff for libmodplug
41 LIB_SND_MODPLUG=`[ -n "$(DP_MODPLUG_STATIC_LIBDIR)" ] && echo \ $(DP_MODPLUG_STATIC_LIBDIR)/libmodplug.a\ -lstdc++`
42 CFLAGS_SND_MODPLUG=`[ -n "$(DP_MODPLUG_STATIC_LIBDIR)" ] && echo \ -I$(DP_MODPLUG_STATIC_LIBDIR)/../include\ -DSND_MODPLUG_STATIC`
43
44 # No sound
45 OBJ_SND_NULL=snd_null.o
46 LIB_SND_NULL=
47
48 # Open Sound System (Linux, FreeBSD and Solaris)
49 OBJ_SND_OSS=$(OBJ_SND_COMMON) snd_oss.o
50 LIB_SND_OSS=$(LIB_SND_MODPLUG)
51
52 # Advanced Linux Sound Architecture (Linux)
53 OBJ_SND_ALSA=$(OBJ_SND_COMMON) snd_alsa.o
54 LIB_SND_ALSA=-lasound $(LIB_SND_MODPLUG)
55
56 # Core Audio (Mac OS X)
57 OBJ_SND_COREAUDIO=$(OBJ_SND_COMMON) snd_coreaudio.o
58 LIB_SND_COREAUDIO=-framework CoreAudio $(LIB_SND_MODPLUG)
59
60 # BSD / Sun audio API (NetBSD and OpenBSD)
61 OBJ_SND_BSD=$(OBJ_SND_COMMON) snd_bsd.o
62 LIB_SND_BSD=$(LIB_SND_MODPLUG)
63
64 # DirectX and Win32 WAVE output (Win32)
65 OBJ_SND_WIN=$(OBJ_SND_COMMON) snd_win.o
66 LIB_SND_WIN=$(LIB_SND_MODPLUG)
67
68 # Qantourisc's 3D Realtime Acoustic Lib (3D RAS)
69 OBJ_SND_3DRAS=snd_3dras.o
70 LIB_SND_3DRAS=
71
72 # CD objects
73 OBJ_NOCD=cd_null.o
74
75
76 ###### Common objects and flags #####
77
78 # Common objects
79 OBJ_COMMON= \
80         cap_avi.o \
81         cap_ogg.o \
82         cd_shared.o \
83         cl_collision.o \
84         cl_demo.o \
85         cl_dyntexture.o \
86         cl_gecko.o \
87         cl_input.o \
88         cl_main.o \
89         cl_parse.o \
90         cl_particles.o \
91         cl_screen.o \
92         cl_video.o \
93         clvm_cmds.o \
94         cmd.o \
95         collision.o \
96         common.o \
97         console.o \
98         csprogs.o \
99         curves.o \
100         cvar.o \
101         dpvsimpledecode.o \
102         filematch.o \
103         fractalnoise.o \
104         fs.o \
105         gl_backend.o \
106         gl_draw.o \
107         gl_rmain.o \
108         gl_rsurf.o \
109         gl_textures.o \
110         hmac.o \
111         host.o \
112         host_cmd.o \
113         image.o \
114         image_png.o \
115         jpeg.o \
116         keys.o \
117         lhnet.o \
118         libcurl.o \
119         mathlib.o \
120         matrixlib.o \
121         mdfour.o \
122         menu.o \
123         meshqueue.o \
124         model_alias.o \
125         model_brush.o \
126         model_shared.o \
127         model_sprite.o \
128         mvm_cmds.o \
129         netconn.o \
130         palette.o \
131         polygon.o \
132         portals.o \
133         protocol.o \
134         prvm_cmds.o \
135         prvm_edict.o \
136         prvm_exec.o \
137         r_explosion.o \
138         r_lerpanim.o \
139         r_lightning.o \
140         r_modules.o \
141         r_shadow.o \
142         r_sky.o \
143         r_sprites.o \
144         sbar.o \
145         sv_demo.o \
146         sv_main.o \
147         sv_move.o \
148         sv_phys.o \
149         sv_user.o \
150         svbsp.o \
151         svvm_cmds.o \
152         sys_shared.o \
153         vid_shared.o \
154         view.o \
155         wad.o \
156         world.o \
157         zone.o
158
159 # note that builddate.c is very intentionally not compiled to a .o before
160 # being linked, because it should be recompiled every time an executable is
161 # built to give the executable a proper date string
162 OBJ_SV= builddate.c sys_linux.o vid_null.o $(OBJ_SND_NULL) $(OBJ_NOCD) $(OBJ_COMMON)
163 OBJ_SDL= builddate.c sys_sdl.o vid_sdl.o $(OBJ_SND_COMMON) snd_sdl.o cd_sdl.o $(OBJ_COMMON)
164
165
166 # Compilation
167 CFLAGS_COMMON=$(CFLAGS_MAKEDEP) $(CFLAGS_PRELOAD) $(CFLAGS_FS) -Wall -Wold-style-definition -Wstrict-prototypes -Wsign-compare -Wdeclaration-after-statement
168 CFLAGS_DEBUG=-ggdb
169 CFLAGS_PROFILE=-g -pg -ggdb -fprofile-arcs
170 CFLAGS_RELEASE=
171 CFLAGS_RELEASE_PROFILE=-fbranch-probabilities
172 CFLAGS_SDL=$(SDLCONFIG_CFLAGS)
173
174 OPTIM_DEBUG=$(CPUOPTIMIZATIONS)
175 #OPTIM_RELEASE=-O2 -fno-strict-aliasing -ffast-math -funroll-loops $(CPUOPTIMIZATIONS)
176 #OPTIM_RELEASE=-O2 -fno-strict-aliasing -fno-math-errno -fno-trapping-math -ffinite-math-only -fno-signaling-nans -fcx-limited-range -funroll-loops $(CPUOPTIMIZATIONS)
177 #OPTIM_RELEASE=-O2 -fno-strict-aliasing -funroll-loops $(CPUOPTIMIZATIONS)
178 OPTIM_RELEASE=-O2 -fno-strict-aliasing $(CPUOPTIMIZATIONS)
179 # NOTE: *never* *ever* use the -ffast-math or -funsafe-math-optimizations flag
180
181 DO_CC=$(CC) $(CFLAGS) -c $< -o $@
182
183
184 # Link
185 LDFLAGS_DEBUG=-g -ggdb $(OPTIM_DEBUG) -DSVNREVISION=`test -d .svn && svnversion || echo -` -DBUILDTYPE=debug
186 LDFLAGS_PROFILE=-g -pg -fprofile-arcs $(OPTIM_RELEASE) -DSVNREVISION=`test -d .svn && svnversion || echo -` -DBUILDTYPE=profile
187 LDFLAGS_RELEASE=$(OPTIM_RELEASE) -DSVNREVISION=`test -d .svn && svnversion || echo -` -DBUILDTYPE=release
188
189
190 ##### UNIX specific variables #####
191
192 OBJ_GLX= builddate.c sys_linux.o vid_glx.o $(OBJ_SOUND) $(OBJ_CD) $(OBJ_COMMON)
193
194 LDFLAGS_UNIXCOMMON=-lm
195 LDFLAGS_UNIXCL=-L$(UNIX_X11LIBPATH) -lX11 -lXpm -lXext -lXxf86dga -lXxf86vm $(LIB_SOUND)
196 LDFLAGS_UNIXCL_PRELOAD=-lz -ljpeg -lpng -logg -ltheora -lvorbis -lvorbisenc -lvorbisfile -lcurl -lmodplug
197 LDFLAGS_UNIXSV_PRELOAD=-lz -lcurl
198 LDFLAGS_UNIXSDL_PRELOAD=-lz -ljpeg -lpng -logg -ltheora -lvorbis -lvorbisenc -lvorbisfile -lcurl -lmodplug
199 CFLAGS_UNIX_PRELOAD=-DPREFER_PRELOAD
200
201 LDFLAGS_UNIXSDL=$(SDLCONFIG_LIBS) $(LIB_SND_MODPLUG)
202 EXE_UNIXCL=darkplaces-glx
203 EXE_UNIXSV=darkplaces-dedicated
204 EXE_UNIXSDL=darkplaces-sdl
205 EXE_UNIXCLNEXUIZ=nexuiz-glx
206 EXE_UNIXSVNEXUIZ=nexuiz-dedicated
207 EXE_UNIXSDLNEXUIZ=nexuiz-sdl
208
209 CMD_UNIXRM=rm -rf
210
211
212 ##### Linux specific variables #####
213
214 # If you want CD sound in Linux
215 OBJ_LINUXCD=cd_linux.o
216 # If you want no CD audio
217 #OBJ_LINUXCD=$(OBJ_NOCD)
218
219 # Link
220 LDFLAGS_LINUXCL=$(LDFLAGS_UNIXCOMMON) -lrt -ldl $(LDFLAGS_UNIXCL)
221 LDFLAGS_LINUXSV=$(LDFLAGS_UNIXCOMMON) -lrt -ldl
222 LDFLAGS_LINUXSDL=$(LDFLAGS_UNIXCOMMON) -lrt -ldl $(LDFLAGS_UNIXSDL)
223
224
225 ##### Mac OS X specific variables #####
226
227 # No CD support available
228 OBJ_MACOSXCD=$(OBJ_NOCD)
229
230 # Link
231 LDFLAGS_MACOSXCL=$(LDFLAGS_UNIXCOMMON) -ldl -framework IOKit -framework Carbon $(LIB_SOUND)
232 LDFLAGS_MACOSXSV=$(LDFLAGS_UNIXCOMMON) -ldl
233 LDFLAGS_MACOSXSDL=$(LDFLAGS_UNIXCOMMON) -ldl $(SDLCONFIG_STATICLIBS) SDLMain.m
234
235 OBJ_AGL= builddate.c sys_linux.o vid_agl.o $(OBJ_SOUND) $(OBJ_CD) $(OBJ_COMMON)
236
237 EXE_MACOSXCL=darkplaces-agl
238 EXE_MACOSXCLNEXUIZ=nexuiz-agl
239
240
241 ##### SunOS specific variables #####
242
243 # No CD support available
244 OBJ_SUNOSCD=$(OBJ_NOCD)
245
246 CFLAGS_SUNOS=-I/usr/lib/oss/include -DBSD_COMP -DSUNOS
247
248 # Link
249 LDFLAGS_SUNOSCL=$(LDFLAGS_UNIXCOMMON) -lrt -ldl -lsocket -lnsl -R$(UNIX_X11LIBPATH) -L$(UNIX_X11LIBPATH) -lX11 -lXpm -lXext -lXxf86vm $(LIB_SOUND)
250 LDFLAGS_SUNOSSV=$(LDFLAGS_UNIXCOMMON) -lrt -ldl -lsocket -lnsl
251 LDFLAGS_SUNOSSDL=$(LDFLAGS_UNIXCOMMON) -lrt -ldl -lsocket -lnsl $(LDFLAGS_UNIXSDL)
252
253
254 ##### BSD specific variables #####
255
256 #if you want CD sound in BSD
257 OBJ_BSDCD=cd_bsd.o
258 #if you want no CD audio
259 #OBJ_BSDCD=$(OBJ_NOCD)
260
261 # Link
262 LDFLAGS_BSDCL=$(LDFLAGS_UNIXCOMMON) -lutil $(LDFLAGS_UNIXCL)
263 LDFLAGS_BSDSV=$(LDFLAGS_UNIXCOMMON) 
264 LDFLAGS_BSDSDL=$(LDFLAGS_UNIXCOMMON) $(LDFLAGS_UNIXSDL)
265
266
267 ##### Win32 specific variables #####
268
269 WINDRES ?= windres
270 #if you want CD sound in Win32
271 OBJ_WINCD=cd_win.o
272 #if you want no CD audio
273 #OBJ_WINCD=$(OBJ_NOCD)
274
275 OBJ_WGL= builddate.c sys_win.o vid_wgl.o $(OBJ_SND_WIN) $(OBJ_WINCD) $(OBJ_COMMON)
276
277 # Link
278 # Note that Windows Vista users may need --large-address-aware because Vista seems to map over 500MB of application address space for its own purposes, which is a significant chunk taken out of the default 2GB address space, this option raises the limit to 4GB (or 3GB on Vista 32 and older versions of Windows).
279 LDFLAGS_WINCOMMON=-lws2_32 -Wl,--large-address-aware
280 LDFLAGS_WINCL=$(LDFLAGS_WINCOMMON) -mwindows -lwinmm -luser32 -lgdi32 -ldxguid -ldinput -lcomctl32
281 LDFLAGS_WINSV=$(LDFLAGS_WINCOMMON) -mconsole -lwinmm
282 LDFLAGS_WINSDL=$(LDFLAGS_WINCOMMON) $(SDLCONFIG_LIBS) $(LIB_SND_MODPLUG)
283 EXE_WINCL=darkplaces.exe
284 EXE_WINSV=darkplaces-dedicated.exe
285 EXE_WINSDL=darkplaces-sdl.exe
286 EXE_WINCLNEXUIZ=nexuiz.exe
287 EXE_WINSVNEXUIZ=nexuiz-dedicated.exe
288 EXE_WINSDLNEXUIZ=nexuiz-sdl.exe
289
290
291 ##### Commands #####
292
293 .PHONY : clean clean-profile help \
294          debug profile release \
295          cl-debug cl-profile cl-release \
296          sv-debug sv-profile sv-release \
297          sdl-debug sdl-profile sdl-release
298
299 help:
300         @echo
301         @echo "===== Choose one ====="
302         @echo "* $(MAKE) clean               : delete all files produced by the build except"
303         @echo "                             profiling information"
304         @echo "* $(MAKE) clean-profile       : delete all files produced by the build, including"
305         @echo "                             profiling informaiton"
306         @echo "* $(MAKE) help                : this help"
307         @echo "* $(MAKE) debug               : make client and server binaries (debug versions)"
308         @echo "* $(MAKE) profile             : make client and server binaries (profile versions)"
309         @echo "* $(MAKE) release             : make client and server binaries (release versions)"
310         @echo "* $(MAKE) release-profile     : make client and server binaries (release versions)"
311         @echo "                             with profileing optomizations) The profiled"
312         @echo "                             version of the program must have been"
313         @echo "                             previously compiled"
314         @echo "* $(MAKE) nexuiz              : make client and server binaries with nexuiz icon"
315         @echo "                             (release versions)"
316         @echo "* $(MAKE) cl-debug            : make client (debug version)"
317         @echo "* $(MAKE) cl-profile          : make client (profile version)"
318         @echo "* $(MAKE) cl-release          : make client (release version)"
319         @echo "* $(MAKE) cl-release-profile  : make client (release version)"
320         @echo "* $(MAKE) cl-nexuiz           : make client with nexuiz icon (release version)"
321         @echo "* $(MAKE) sv-debug            : make dedicated server (debug version)"
322         @echo "* $(MAKE) sv-profile          : make dedicated server (profile version)"
323         @echo "* $(MAKE) sv-release          : make dedicated server (release version)"
324         @echo "* $(MAKE) sv-release-profile  : make dedicated server (release version)"
325         @echo "* $(MAKE) sv-nexuiz           : make dedicated server with nexuiz icon"
326         @echo "                             (release version)"
327         @echo "* $(MAKE) sdl-debug           : make SDL client (debug version)"
328         @echo "* $(MAKE) sdl-profile         : make SDL client (profile version)"
329         @echo "* $(MAKE) sdl-profile-profile : make SDL client (profile version)"
330         @echo "* $(MAKE) sdl-release         : make SDL client (release version)"
331         @echo "* $(MAKE) sdl-nexuiz          : make SDL client with nexuiz icon (release version)"
332         @echo
333
334 debug :
335         $(MAKE) sv-debug cl-debug sdl-debug
336
337 profile :
338         $(MAKE) sv-profile cl-profile sdl-profile
339
340 release :
341         $(MAKE) sv-release cl-release sdl-release
342
343 release-profile :
344         $(MAKE) sv-release-profile cl-release-profile sdl-release-profile
345
346 nexuiz :
347         $(MAKE) sv-nexuiz cl-nexuiz sdl-nexuiz
348
349 cl-debug :
350         $(MAKE) bin-debug \
351                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
352                 EXE="$(EXE_CL)" LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1
353
354 cl-profile :
355         $(MAKE) bin-profile \
356                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
357                 EXE="$(EXE_CL)" LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1
358
359 cl-release :
360         $(MAKE) bin-release \
361                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
362                 EXE="$(EXE_CL)" LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1
363
364 cl-release-profile :
365         $(MAKE) bin-release-profile \
366                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
367                 EXE="$(EXE_CL)" LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1
368
369 cl-nexuiz :
370         $(MAKE) bin-release \
371                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
372                 EXE="$(EXE_CLNEXUIZ)" LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1
373
374 sv-debug :
375         $(MAKE) bin-debug \
376                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
377                 EXE="$(EXE_SV)" LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1
378
379 sv-profile :
380         $(MAKE) bin-profile \
381                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
382                 EXE="$(EXE_SV)" LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1
383
384 sv-release :
385         $(MAKE) bin-release \
386                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
387                 EXE="$(EXE_SV)" LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1
388
389 sv-release-profile :
390         $(MAKE) bin-release-profile \
391                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
392                 EXE="$(EXE_SV)" LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1
393
394 sv-nexuiz :
395         $(MAKE) bin-release \
396                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
397                 EXE="$(EXE_SVNEXUIZ)" LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1
398
399 sdl-debug :
400         $(MAKE) bin-debug \
401                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
402                 EXE="$(EXE_SDL)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1
403
404 sdl-profile :
405         $(MAKE) bin-profile \
406                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
407                 EXE="$(EXE_SDL)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1
408
409 sdl-release :
410         $(MAKE) bin-release \
411                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
412                 EXE="$(EXE_SDL)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1
413
414 sdl-release-profile :
415         $(MAKE) bin-release-profile \
416                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
417                 EXE="$(EXE_SDL)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1
418
419 sdl-nexuiz :
420         $(MAKE) bin-release \
421                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
422                 EXE="$(EXE_SDLNEXUIZ)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1
423
424 bin-debug :
425         $(CHECKLEVEL1)
426         @echo
427         @echo "========== $(EXE) (debug) =========="
428         $(MAKE) $(EXE) \
429                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
430                 CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_DEBUG) $(OPTIM_DEBUG)"\
431                 LDFLAGS="$(LDFLAGS_DEBUG) $(LDFLAGS_COMMON)" LEVEL=2
432
433 bin-profile :
434         $(CHECKLEVEL1)
435         @echo
436         @echo "========== $(EXE) (profile) =========="
437         $(MAKE) $(EXE) \
438                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
439                 CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_PROFILE) $(OPTIM_RELEASE)"\
440                 LDFLAGS="$(LDFLAGS_PROFILE) $(LDFLAGS_COMMON)" LEVEL=2
441
442 bin-release :
443         $(CHECKLEVEL1)
444         @echo
445         @echo "========== $(EXE) (release) =========="
446         $(MAKE) $(EXE) \
447                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
448                 CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_RELEASE) $(OPTIM_RELEASE)"\
449                 LDFLAGS="$(LDFLAGS_RELEASE) $(LDFLAGS_COMMON)" LEVEL=2
450         $(STRIP) $(EXE)
451
452 bin-release-profile :
453         $(CHECKLEVEL1)
454         @echo
455         @echo "========== $(EXE) (release) =========="
456         $(MAKE) $(EXE) \
457                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
458                 CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_RELEASE_PROFILE) $(OPTIM_RELEASE)"\
459                 LDFLAGS="$(LDFLAGS_RELEASE) $(LDFLAGS_COMMON)" LEVEL=2
460         $(STRIP) $(EXE)
461
462
463 snd_modplug.o: snd_modplug.c
464         $(CHECKLEVEL2)
465         $(DO_CC) $(CFLAGS_SND_MODPLUG)
466
467 vid_glx.o: vid_glx.c
468         $(CHECKLEVEL2)
469         $(DO_CC) -I/usr/X11R6/include
470
471 vid_sdl.o: vid_sdl.c
472         $(CHECKLEVEL2)
473         $(DO_CC) $(CFLAGS_SDL)
474
475 sys_sdl.o: sys_sdl.c
476         $(CHECKLEVEL2)
477         $(DO_CC) $(CFLAGS_SDL)
478
479 snd_sdl.o: snd_sdl.c
480         $(CHECKLEVEL2)
481         $(DO_CC) $(CFLAGS_SDL)
482
483 snd_3dras.o: snd_3dras.c
484         $(CHECKLEVEL2)
485         $(DO_CC)
486
487 cd_sdl.o: cd_sdl.c
488         $(CHECKLEVEL2)
489         $(DO_CC) $(CFLAGS_SDL)
490
491 darkplaces.o: %.o : %.rc
492         $(CHECKLEVEL2)
493         $(WINDRES) -o $@ $<
494
495 nexuiz.o: %.o : %.rc
496         $(CHECKLEVEL2)
497         $(WINDRES) -o $@ $<
498
499 .c.o:
500         $(CHECKLEVEL2)
501         $(DO_CC)
502
503 $(EXE_CL): $(OBJ_CL) $(OBJ_ICON)
504         $(CHECKLEVEL2)
505         $(DO_LD)
506
507 $(EXE_SV): $(OBJ_SV) $(OBJ_ICON)
508         $(CHECKLEVEL2)
509         $(DO_LD)
510
511 $(EXE_SDL): $(OBJ_SDL) $(OBJ_ICON)
512         $(CHECKLEVEL2)
513         $(DO_LD)
514
515 $(EXE_CLNEXUIZ): $(OBJ_CL) $(OBJ_ICON_NEXUIZ)
516         $(CHECKLEVEL2)
517         $(DO_LD)
518
519 $(EXE_SVNEXUIZ): $(OBJ_SV) $(OBJ_ICON_NEXUIZ)
520         $(CHECKLEVEL2)
521         $(DO_LD)
522
523 $(EXE_SDLNEXUIZ): $(OBJ_SDL) $(OBJ_ICON_NEXUIZ)
524         $(CHECKLEVEL2)
525         $(DO_LD)
526
527 clean:
528         -$(CMD_RM) $(EXE_CL)
529         -$(CMD_RM) $(EXE_SV)
530         -$(CMD_RM) $(EXE_SDL)
531         -$(CMD_RM) $(EXE_CLNEXUIZ)
532         -$(CMD_RM) $(EXE_SVNEXUIZ)
533         -$(CMD_RM) $(EXE_SDLNEXUIZ)
534         -$(CMD_RM) *.o
535         -$(CMD_RM) *.d
536
537 clean-profile: clean
538         -$(CMD_RM) *.gcda
539         -$(CMD_RM) *.gcno
540