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