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