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