]> git.xonotic.org Git - xonotic/darkplaces.git/blob - makefile.inc
README.md: various doc adjustments
[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
6 STRIP?=strip
7
8
9 ###### Sound #####
10
11 OBJ_SND_COMMON=snd_main.o snd_mem.o snd_mix.o snd_ogg.o snd_wav.o $(OBJ_SND_XMP)
12
13 # No sound
14 OBJ_SND_NULL=snd_null.o
15 LIB_SND_NULL=
16
17 ###### Common objects and flags #####
18
19 # Common objects
20 OBJ_COMMON= \
21         bih.o \
22         crypto.o \
23         cd_shared.o \
24         cl_cmd.o \
25         cl_collision.o \
26         cl_demo.o \
27         cl_ents.o \
28         cl_ents4.o \
29         cl_ents5.o \
30         cl_ents_nq.o \
31         cl_ents_qw.o \
32         cl_input.o \
33         cl_main.o \
34         cl_parse.o \
35         cl_particles.o \
36         cl_screen.o \
37         cl_video.o \
38         cl_video_libavw.o \
39         clvm_cmds.o \
40         cmd.o \
41         collision.o \
42         com_crc16.o \
43         com_ents.o \
44         com_ents4.o \
45         com_game.o \
46         com_infostring.o \
47         com_msg.o \
48         common.o \
49         console.o \
50         csprogs.o \
51         curves.o \
52         cvar.o \
53         dpvsimpledecode.o \
54         filematch.o \
55         fractalnoise.o \
56         fs.o \
57         ft2.o \
58         utf8lib.o \
59         gl_backend.o \
60         gl_draw.o \
61         gl_rmain.o \
62         gl_rsurf.o \
63         gl_textures.o \
64         hmac.o \
65         host.o \
66         image.o \
67         image_png.o \
68         jpeg.o \
69         keys.o \
70         lhnet.o \
71         libcurl.o \
72         mathlib.o \
73         matrixlib.o \
74         mdfour.o \
75         meshqueue.o \
76         mod_skeletal_animatevertices_sse.o \
77         mod_skeletal_animatevertices_generic.o \
78         model_alias.o \
79         model_brush.o \
80         model_shared.o \
81         model_sprite.o \
82         netconn.o \
83         palette.o \
84         phys.o \
85         polygon.o \
86         portals.o \
87         protocol.o \
88         prvm_cmds.o \
89         prvm_edict.o \
90         prvm_exec.o \
91         r_explosion.o \
92         r_lightning.o \
93         r_modules.o \
94         r_shadow.o \
95         r_sky.o \
96         r_sprites.o \
97         r_stats.o \
98         sbar.o \
99         sv_ccmds.o \
100         sv_demo.o \
101         sv_ents.o \
102         sv_ents4.o \
103         sv_ents5.o \
104         sv_ents_csqc.o \
105         sv_ents_nq.o \
106         sv_main.o \
107         sv_move.o \
108         sv_phys.o \
109         sv_save.o \
110         sv_send.o \
111         sv_user.o \
112         svbsp.o \
113         svvm_cmds.o \
114         sys_shared.o \
115         taskqueue.o \
116         vid_shared.o \
117         view.o \
118         wad.o \
119         world.o \
120         zone.o
121
122 OBJ_MENU= \
123         menu.o \
124         mvm_cmds.o
125
126 # note that builddate.c is very intentionally not compiled to a .o before
127 # being linked, because it should be recompiled every time an executable is
128 # built to give the executable a proper date string
129 OBJ_SV= builddate.c sys_null.o vid_null.o thread_null.o $(OBJ_SND_NULL) $(OBJ_COMMON)
130 OBJ_SDL= builddate.c sys_sdl.o vid_sdl.o thread_sdl.o $(OBJ_MENU) $(OBJ_SND_COMMON) $(OBJ_SND_XMP) snd_sdl.o $(OBJ_VIDEO_CAPTURE) $(OBJ_COMMON)
131
132
133 # Compilation
134 ifeq ($(PEDANTIC),1)
135         CFLAGS_STANDARD=-std=c11 -pedantic -D_POSIX_C_SOURCE=200809L -DCONFIG_PEDANTIC
136 else
137         CFLAGS_STANDARD=
138 endif
139
140 CFLAGS_WARNINGS=-Wall -Werror=vla -Werror=c++-compat -Wwrite-strings -Wshadow -Wold-style-definition -Wstrict-prototypes -Wsign-compare -Wdeclaration-after-statement -Wmissing-prototypes
141
142 CFLAGS_TCC=
143 ifeq ($(CC), tcc)
144         CFLAGS_TCC=-DSDL_DISABLE_IMMINTRIN_H
145 else
146         CFLAGS_MAKEDEP?=-MMD
147 endif
148
149 CFLAGS_COMMON=$(CFLAGS_STANDARD) $(CFLAGS_TCC) $(CFLAGS_MAKEDEP) $(CFLAGS_PRELOAD) $(CFLAGS_FS) $(CFLAGS_WARNINGS) $(CFLAGS_LIBZ) $(CFLAGS_LIBJPEG) $(CFLAGS_SND_XMP) $(CFLAGS_NET) $(CFLAGS_SDL) -D_FILE_OFFSET_BITS=64 -D__KERNEL_STRICT_NAMES -I../../../
150 CFLAGS_CLIENT=-DCONFIG_MENU $(CFLAGS_VIDEO_CAPTURE)
151 CFLAGS_SERVER=
152 CFLAGS_DEBUG=-ggdb
153 CFLAGS_PROFILE=-g -pg -ggdb -fprofile-arcs
154 CFLAGS_RELEASE=
155 CFLAGS_RELEASE_PROFILE=-fbranch-probabilities
156 CFLAGS_SDL=
157
158 ifeq ($(DP_SSE),1)
159         CFLAGS_SSE=-msse
160         CFLAGS_SSE2=-msse2
161 else
162         CFLAGS_SSE=
163         CFLAGS_SSE2=
164 endif # ifeq ($(DP_SSE),1)
165
166 # No specific CPU
167 CPUOPTIMIZATIONS?=
168 # x86
169 ifeq ($(DP_SSE),1)
170         CPUOPTIMIZATIONS+=-mno-avx
171 endif
172 # bones_was_here: added -mno-avx because when compiling for (at least) haswell or skylake with gcc or clang, with both -O2 and -O3, AVX auto-vectorisation causes subtle bugs in Xonotic QC physics, and changes the hash generated by the CI pipeline.  AVX2 seems to be OK.
173
174 # We can get good stack traces at -O1 with -fno-omit-frame-pointer (as recommended by ASan docs) for a hefty boost compared to unoptimised.
175 OPTIM_DEBUG=-O1 -fno-omit-frame-pointer $(CPUOPTIMIZATIONS)
176 #OPTIM_RELEASE=-O2 -fno-strict-aliasing -ffast-math -funroll-loops $(CPUOPTIMIZATIONS)
177 #OPTIM_RELEASE=-O2 -fno-strict-aliasing -fno-math-errno -fno-trapping-math -fno-signaling-nans -fcx-limited-range -funroll-loops $(CPUOPTIMIZATIONS)
178 #OPTIM_RELEASE=-O2 -fno-strict-aliasing -funroll-loops $(CPUOPTIMIZATIONS)
179 #OPTIM_RELEASE=-O2 -fno-strict-aliasing $(CPUOPTIMIZATIONS)
180 #OPTIM_RELEASE=-O3 -fno-strict-aliasing $(CPUOPTIMIZATIONS)
181 #OPTIM_RELEASE=-O3 -fno-strict-aliasing -fno-math-errno -fno-trapping-math $(CPUOPTIMIZATIONS)
182 # -Winline is here instead of in CFLAGS_WARNINGS because we need inlining disabled for good stack traces in debug builds,
183 # also because UBSan and ASan cause this warning to be spammed.
184 OPTIM_RELEASE=-O3 -fno-math-errno -fno-trapping-math $(CPUOPTIMIZATIONS) -Winline
185 # NOTE: *never* *ever* use the -ffast-math or -funsafe-math-optimizations flag
186 # Also, since gcc 5, -ffinite-math-only makes NaN and zero compare equal inside engine code but not inside QC, which causes error spam for seemingly valid QC code like if (x != 0) return 1 / x;
187
188 DO_CC=$(CC) $(CFLAGS) -c $< -o $@
189
190
191 # Link
192
193 # not checking for .git directory before running `git describe` because that would stop it working in a subdirectory
194 VCREVISION=$(shell { test -d .svn && svnversion; } || git describe --always --dirty='~' 2>/dev/null || echo -)
195
196 LDFLAGS_DEBUG=-g -ggdb $(OPTIM_DEBUG)                  -DVCREVISION=$(VCREVISION) -DBUILDTYPE=debug
197 LDFLAGS_PROFILE=-g -pg -fprofile-arcs $(OPTIM_RELEASE) -DVCREVISION=$(VCREVISION) -DBUILDTYPE=profile
198 LDFLAGS_RELEASE=$(OPTIM_RELEASE)                       -DVCREVISION=$(VCREVISION) -DBUILDTYPE=release
199
200
201 ##### UNIX specific variables #####
202
203 LDFLAGS_UNIXCOMMON=-lm $(LIB_ODE) $(LIB_Z) $(LIB_JPEG) $(LIB_CRYPTO) $(LIB_CRYPTO_RIJNDAEL) $(LIB_SND_XMP)
204 LDFLAGS_UNIXSV_PRELOAD=-lz -ljpeg -lpng -lcurl
205 LDFLAGS_UNIXSDL_PRELOAD=-lz -ljpeg -lpng -logg -ltheora -lvorbis -lvorbisenc -lvorbisfile -lcurl -lxmp
206 CFLAGS_UNIX_PRELOAD=-DPREFER_PRELOAD
207
208 LDFLAGS_UNIXSDL=$(SDL_LIBS) #-lGLESv2
209 EXE_UNIXSV=darkplaces-dedicated
210 EXE_UNIXSDL=darkplaces-sdl
211 EXE_UNIXSVNEXUIZ=nexuiz-dedicated
212 EXE_UNIXSDLNEXUIZ=nexuiz-sdl
213
214 CMD_UNIXRM=rm -rf
215 CMD_UNIXCP=cp -f
216 CMD_UNIXMKDIR=mkdir -p
217
218
219 ##### Linux specific variables #####
220
221 # Link
222 # -rdynamic allows glibc backtrace_symbols_fd() to convert addresses to function names
223 # with a much smaller binary than with full debug symbols
224 LDFLAGS_LINUXSV=$(LDFLAGS_UNIXCOMMON) -lrt -ldl -rdynamic
225 LDFLAGS_LINUXSDL=$(LDFLAGS_UNIXCOMMON) -lrt -ldl -rdynamic $(LDFLAGS_UNIXSDL)
226
227
228 ##### Mac OS X specific variables #####
229
230 # Link
231 LDFLAGS_MACOSXSV=$(LDFLAGS_UNIXCOMMON) -ldl
232 LDFLAGS_MACOSXSDL=$(LDFLAGS_UNIXCOMMON) -ldl -framework IOKit $(SDLCONFIG_STATICLIBS) #../../../SDLMain.m
233
234
235 ##### SunOS specific variables #####
236
237 CFLAGS_SUNOS=-I/usr/lib/oss/include -DBSD_COMP -DSUNOS
238
239 # Link
240 LDFLAGS_SUNOSSV=$(LDFLAGS_UNIXCOMMON) -lrt -ldl -lsocket -lnsl
241 LDFLAGS_SUNOSSDL=$(LDFLAGS_UNIXCOMMON) -lrt -ldl -lsocket -lnsl $(LDFLAGS_UNIXSDL)
242
243
244 ##### BSD specific variables #####
245
246 # Link
247 LDFLAGS_BSDSV=$(LDFLAGS_UNIXCOMMON) 
248 LDFLAGS_BSDSDL=$(LDFLAGS_UNIXCOMMON) $(LDFLAGS_UNIXSDL)
249
250
251 ##### Win32 specific variables #####
252
253 WINDRES ?= windres
254
255 # Link
256 # see LDFLAGS_WINCOMMON in makefile
257 LDFLAGS_WINSV=$(LDFLAGS_WINCOMMON) $(LIB_CRYPTO) $(LIB_CRYPTO_RIJNDAEL) -mconsole -lwinmm -lws2_32 $(LIB_Z) $(LIB_JPEG)
258 LDFLAGS_WINSDL=$(LDFLAGS_WINCOMMON) $(LIB_CRYPTO) $(LIB_CRYPTO_RIJNDAEL) $(LDFLAGS_UNIXSDL) -lwinmm -lws2_32 $(LIB_Z) $(LIB_JPEG) $(LIB_SND_XMP)
259 EXE_WINSV=darkplaces-dedicated.exe
260 EXE_WINSDL=darkplaces-sdl.exe
261 EXE_WINSVNEXUIZ=nexuiz-dedicated.exe
262 EXE_WINSDLNEXUIZ=nexuiz-sdl.exe
263
264 VPATH := ../../../
265
266 ##### Commands #####
267
268 .PHONY : clean clean-profile help \
269          debug profile release \
270          sv-debug sv-profile sv-release \
271          sdl-debug sdl-profile sdl-release
272
273 help:
274         @echo
275         @echo "===== Choose one ====="
276         @echo "* $(MAKE) clean                : delete all files produced by the build except"
277         @echo "                              profiling information"
278         @echo "* $(MAKE) clean-profile        : delete all files produced by the build, including"
279         @echo "                              profiling informaiton"
280         @echo "* $(MAKE) help                 : this help"
281         @echo "* $(MAKE) debug                : make client and server binaries (debug versions)"
282         @echo "* $(MAKE) profile              : make client and server binaries (profile versions)"
283         @echo "* $(MAKE) release              : make client and server binaries (release versions)"
284         @echo "* $(MAKE) release-profile      : make client and server binaries (release versions)"
285         @echo "                              (with profiling optimizations) The profiled"
286         @echo "                              version of the program must have been"
287         @echo "                              previously compiled"
288         @echo "* $(MAKE) nexuiz               : make client and server binaries with nexuiz icon"
289         @echo "                              (release versions)"
290         @echo "* $(MAKE) sv-debug             : make dedicated server (debug version)"
291         @echo "* $(MAKE) sv-profile           : make dedicated server (profile version)"
292         @echo "* $(MAKE) sv-release-profile   : make dedicated server (release profile version)"
293         @echo "* $(MAKE) sv-release           : make dedicated server (release version)"
294         @echo "* $(MAKE) sv-nexuiz            : make dedicated server with nexuiz icon"
295         @echo "                              (release version)"
296         @echo "* $(MAKE) sdl-debug            : make SDL client (debug version)"
297         @echo "* $(MAKE) sdl-profile          : make SDL client (profile version)"
298         @echo "* $(MAKE) sdl-release-profile  : make SDL client (release version)"
299         @echo "* $(MAKE) sdl-release          : make SDL client (release version)"
300         @echo "* $(MAKE) sdl-nexuiz           : make SDL client with nexuiz icon (release version)"
301         @echo
302
303 debug :
304         $(MAKE) $(TARGETS_DEBUG)
305
306 profile :
307         $(MAKE) $(TARGETS_PROFILE)
308
309 release :
310         $(MAKE) $(TARGETS_RELEASE)
311
312 release-profile :
313         $(MAKE) $(TARGETS_RELEASE_PROFILE)
314
315 nexuiz :
316         $(MAKE) $(TARGETS_NEXUIZ)
317
318 sv-debug :
319         $(MAKE) bin-debug \
320                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
321                 EXE='$(EXE_SV)' CFLAGS_FEATURES='$(CFLAGS_SERVER)' LDFLAGS_COMMON='$(LDFLAGS_SV)' LEVEL=1
322
323 sv-profile :
324         $(MAKE) bin-profile \
325                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
326                 EXE='$(EXE_SV)' CFLAGS_FEATURES='$(CFLAGS_SERVER)' LDFLAGS_COMMON='$(LDFLAGS_SV)' LEVEL=1
327
328 sv-release :
329         $(MAKE) bin-release \
330                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
331                 EXE='$(EXE_SV)' CFLAGS_FEATURES='$(CFLAGS_SERVER)' LDFLAGS_COMMON='$(LDFLAGS_SV)' LEVEL=1
332
333 sv-release-profile :
334         $(MAKE) bin-release-profile \
335                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
336                 EXE='$(EXE_SV)' CFLAGS_FEATURES='$(CFLAGS_SERVER)' LDFLAGS_COMMON='$(LDFLAGS_SV)' LEVEL=1
337
338 sv-nexuiz :
339         $(MAKE) bin-release \
340                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
341                 EXE='$(EXE_SVNEXUIZ)' CFLAGS_FEATURES='$(CFLAGS_SERVER)' LDFLAGS_COMMON='$(LDFLAGS_SV)' LEVEL=1
342
343 sdl-debug :
344         $(MAKE) bin-debug \
345                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
346                 EXE='$(EXE_SDL)' CFLAGS_FEATURES='$(CFLAGS_CLIENT)' CFLAGS_SDL='$(SDLCONFIG_CFLAGS)' LDFLAGS_COMMON='$(LDFLAGS_SDL)' LEVEL=1
347
348 sdl-profile :
349         $(MAKE) bin-profile \
350                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
351                 EXE='$(EXE_SDL)' CFLAGS_FEATURES='$(CFLAGS_CLIENT)' CFLAGS_SDL='$(SDLCONFIG_CFLAGS)' LDFLAGS_COMMON='$(LDFLAGS_SDL)' LEVEL=1
352
353 sdl-release :
354         $(MAKE) bin-release \
355                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
356                 EXE='$(EXE_SDL)' CFLAGS_FEATURES='$(CFLAGS_CLIENT)' CFLAGS_SDL='$(SDLCONFIG_CFLAGS)' LDFLAGS_COMMON='$(LDFLAGS_SDL)' LEVEL=1
357
358 sdl-release-profile :
359         $(MAKE) bin-release-profile \
360                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
361                 EXE='$(EXE_SDL)' CFLAGS_FEATURES='$(CFLAGS_CLIENT)' CFLAGS_SDL='$(SDLCONFIG_CFLAGS)' LDFLAGS_COMMON='$(LDFLAGS_SDL)' LEVEL=1
362
363 sdl-nexuiz :
364         $(MAKE) bin-release \
365                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
366                 EXE='$(EXE_SDLNEXUIZ)' CFLAGS_FEATURES='$(CFLAGS_CLIENT)' CFLAGS_SDL='$(SDLCONFIG_CFLAGS)' LDFLAGS_COMMON='$(LDFLAGS_SDL)' LEVEL=1
367
368 bin-debug :
369         $(CHECKLEVEL1)
370         @echo
371         @echo '========== $(EXE) (debug) =========='
372         $(MAKE) prepare BUILD_DIR=build-obj/debug/$(EXE)
373         $(MAKE) -C build-obj/debug/$(EXE) $(EXE) \
374                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
375                 CFLAGS='$(CFLAGS_COMMON) $(CFLAGS_FEATURES) $(CFLAGS_EXTRA) $(CFLAGS_DEBUG) $(OPTIM_DEBUG)'\
376                 LDFLAGS='$(LDFLAGS_DEBUG) $(LDFLAGS_COMMON)' LEVEL=2
377
378 bin-profile :
379         $(CHECKLEVEL1)
380         @echo
381         @echo '========== $(EXE) (profile) =========='
382         $(MAKE) prepare BUILD_DIR=build-obj/profile/$(EXE)
383         $(MAKE) -C build-obj/profile/$(EXE) $(EXE) \
384                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
385                 CFLAGS='$(CFLAGS_COMMON) $(CFLAGS_FEATURES) $(CFLAGS_EXTRA) $(CFLAGS_PROFILE) $(OPTIM_RELEASE)'\
386                 LDFLAGS='$(LDFLAGS_PROFILE) $(LDFLAGS_COMMON)' LEVEL=2
387
388 bin-release :
389         $(CHECKLEVEL1)
390         @echo
391         @echo '========== $(EXE) (release) =========='
392         $(MAKE) prepare BUILD_DIR=build-obj/release/$(EXE)
393         $(MAKE) -C build-obj/release/$(EXE) $(EXE) \
394                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
395                 CFLAGS='$(CFLAGS_COMMON) $(CFLAGS_FEATURES) $(CFLAGS_EXTRA) $(CFLAGS_RELEASE) $(OPTIM_RELEASE)'\
396                 LDFLAGS='$(LDFLAGS_RELEASE) $(LDFLAGS_COMMON)' LEVEL=2
397         $(STRIP) $(EXE)
398
399 bin-release-profile :
400         $(CHECKLEVEL1)
401         @echo
402         @echo '========== $(EXE) (release) =========='
403         $(MAKE) prepare BUILD_DIR=build-obj/release-profile/$(EXE)
404         $(MAKE) -C build-obj/release-profile/$(EXE) $(EXE) \
405                 DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
406                 CFLAGS='$(CFLAGS_COMMON) $(CFLAGS_FEATURES) $(CFLAGS_EXTRA) $(CFLAGS_RELEASE_PROFILE) $(OPTIM_RELEASE)'\
407                 LDFLAGS='$(LDFLAGS_RELEASE) $(LDFLAGS_COMMON)' LEVEL=2
408         $(STRIP) $(EXE)
409
410 prepare :
411         $(CMD_MKDIR) $(BUILD_DIR)
412         $(CMD_CP) makefile.inc $(BUILD_DIR)/
413         $(CMD_CP) $(MAKEFILE) $(BUILD_DIR)/
414
415
416 #this checks USEODE when compiling so it needs the ODE flags as well
417 cl_parse.o: cl_parse.c
418         $(CHECKLEVEL2)
419         $(DO_CC) $(CFLAGS_ODE)
420
421 cs_progs.o: cs_progs.c
422         $(CHECKLEVEL2)
423         $(DO_CC) $(CFLAGS_ODE)
424
425 sv_main.o: sv_main.c
426         $(CHECKLEVEL2)
427         $(DO_CC) $(CFLAGS_ODE)
428
429 sv_phys.o: sv_phys.c
430         $(CHECKLEVEL2)
431         $(DO_CC) $(CFLAGS_ODE)
432
433 prvm_cmds.o: prvm_cmds.c
434         $(CHECKLEVEL2)
435         $(DO_CC) $(CFLAGS_ODE)
436
437 world.o: world.c
438         $(CHECKLEVEL2)
439         $(DO_CC) $(CFLAGS_ODE)
440
441 crypto.o: crypto.c
442         $(CHECKLEVEL2)
443         $(DO_CC) $(CFLAGS_CRYPTO) $(CFLAGS_CRYPTO_RIJNDAEL)
444
445 mod_skeletal_animatevertices_sse.o: mod_skeletal_animatevertices_sse.c
446         $(CHECKLEVEL2)
447         $(DO_CC) $(CFLAGS_SSE)
448
449 snd_xmp.o: snd_xmp.c
450         $(CHECKLEVEL2)
451         $(DO_CC) $(CFLAGS_SND_XMP)
452
453 #this checks USEXMP when compiling so it needs the XMP flags as well
454 snd_main.o: snd_main.c
455         $(CHECKLEVEL2)
456         $(DO_CC) $(CFLAGS_SND_XMP)
457
458 #this checks USEXMP when compiling so it needs the XMP flags as well
459 snd_mem.o: snd_mem.c
460         $(CHECKLEVEL2)
461         $(DO_CC) $(CFLAGS_SND_XMP)
462
463 darkplaces.o: %.o : %.rc
464         $(CHECKLEVEL2)
465         $(WINDRES) -o $@ $<
466
467 nexuiz.o: %.o : %.rc
468         $(CHECKLEVEL2)
469         $(WINDRES) -o $@ $<
470
471 .c.o:
472         $(CHECKLEVEL2)
473         $(DO_CC)
474 .c.o: .EXTRA_PREREQS =  # According to POSIX, a suffix rule cannot contain prerequisites.
475
476 $(EXE_SV): $(OBJ_SV) $(OBJ_ICON)
477         $(CHECKLEVEL2)
478         $(DO_LD)
479
480 $(EXE_SDL): $(OBJ_SDL) $(OBJ_ICON)
481         $(CHECKLEVEL2)
482         $(DO_LD)
483
484 $(EXE_SVNEXUIZ): $(OBJ_SV) $(OBJ_ICON_NEXUIZ)
485         $(CHECKLEVEL2)
486         $(DO_LD)
487
488 $(EXE_SDLNEXUIZ): $(OBJ_SDL) $(OBJ_ICON_NEXUIZ)
489         $(CHECKLEVEL2)
490         $(DO_LD)
491
492 # If requested, these targets must always run first:
493 .EXTRA_PREREQS := $(filter clean clean-profile, $(MAKECMDGOALS))
494
495 clean:
496         -$(CMD_RM) $(EXE_SV)
497         -$(CMD_RM) $(EXE_SDL)
498         -$(CMD_RM) $(EXE_SVNEXUIZ)
499         -$(CMD_RM) $(EXE_SDLNEXUIZ)
500         -$(CMD_RM) *.o
501         -$(CMD_RM) *.d
502         -$(CMD_RM) *.gch
503         -$(CMD_RM) build-obj/
504 clean: .EXTRA_PREREQS =  # prevents circular dependency with clean-profile
505
506 clean-profile: clean
507         -$(CMD_RM) *.gcda
508         -$(CMD_RM) *.gcno