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