File: makefile

package info (click to toggle)
darkplaces 0~20180412~beta1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 18,200 kB
  • sloc: ansic: 176,886; makefile: 485; pascal: 455; perl: 372; objc: 245; sh: 102
file content (548 lines) | stat: -rw-r--r-- 12,419 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
#####  DP_MAKE_TARGET autodetection and arch specific variables #####

ifndef DP_MAKE_TARGET

# Win32
ifdef WINDIR
	DP_MAKE_TARGET=mingw
else

# UNIXes
DP_ARCH:=$(shell uname)
ifeq ($(DP_ARCH), GNU/kFreeBSD)
	# same userspace as Linux, not a BSDish one
	DP_MAKE_TARGET=linux
else
ifneq ($(filter %BSD,$(DP_ARCH)),)
	DP_MAKE_TARGET=bsd
else
ifeq ($(DP_ARCH), Darwin)
	DP_MAKE_TARGET=macosx
else
ifeq ($(DP_ARCH), SunOS)
	DP_MAKE_TARGET=sunos
else
	DP_MAKE_TARGET=linux

endif  # ifeq ($(DP_ARCH), SunOS)
endif  # ifeq ($(DP_ARCH), Darwin)
endif  # ifneq ($(filter %BSD,$(DP_ARCH)),)
endif  # ifeq ($(DP_ARCH), GNU/kFreeBSD)
endif  # ifdef windir
endif  # ifndef DP_MAKE_TARGET

# If we're targeting an x86 CPU we want to enable DP_SSE (CFLAGS_SSE and SSE2)
ifeq ($(DP_MAKE_TARGET), mingw)
	DP_SSE:=1
else
	DP_MACHINE:=$(shell uname -m)
	ifeq ($(DP_MACHINE),x86_64)
		DP_SSE:=1
	else
	ifeq ($(DP_MACHINE),i686)
		DP_SSE:=1
	else
	ifeq ($(DP_MACHINE),i386)
		DP_SSE:=1
	else
		DP_SSE:=0
	endif # ifeq ($(DP_MACHINE),i386)
	endif # ifeq ($(DP_MACHINE),i686)
	endif # ifeq ($(DP_MACHINE),x86_64)
endif

# Makefile name
MAKEFILE=makefile

# Commands
ifdef windir
	CMD_RM=del
	CMD_CP=copy /y
	CMD_MKDIR=mkdir
else
	CMD_RM=$(CMD_UNIXRM)
	CMD_CP=$(CMD_UNIXCP)
	CMD_MKDIR=$(CMD_UNIXMKDIR)
endif

# CPU-specifics
OBJ_CPU =

ifeq ($(DP_MAKE_TARGET),mingw)
	# MinGW is always x86
	OBJ_CPU += $(OBJ_X86)
else
ifneq (,$(filter i%86 x86_64,$(DP_MACHINE)))
	OBJ_CPU += $(OBJ_X86)
endif
endif

# 64bits AMD CPUs use another lib directory
ifeq ($(DP_MACHINE),x86_64)
	UNIX_X11LIBPATH:=/usr/X11R6/lib64
else
	UNIX_X11LIBPATH:=/usr/X11R6/lib
endif

# default targets
TARGETS_DEBUG=sv-debug cl-debug sdl-debug
TARGETS_PROFILE=sv-profile cl-profile sdl-profile
TARGETS_RELEASE=sv-release cl-release sdl-release
TARGETS_RELEASE_PROFILE=sv-release-profile cl-release-profile sdl-release-profile
TARGETS_NEXUIZ=sv-nexuiz cl-nexuiz sdl-nexuiz

###### Optional features #####
DP_CDDA?=enabled
ifeq ($(DP_CDDA), enabled)
	OBJ_SDLCD=$(OBJ_CD_COMMON) cd_sdl.o
	OBJ_LINUXCD=$(OBJ_CD_COMMON) cd_linux.o
	OBJ_BSDCD=$(OBJ_CD_COMMON) cd_bsd.o
	OBJ_WINCD=$(OBJ_CD_COMMON) cd_win.o
else
	OBJ_SDLCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
	OBJ_LINUXCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
	OBJ_BSDCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
	OBJ_WINCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
endif

DP_VIDEO_CAPTURE?=enabled
ifeq ($(DP_VIDEO_CAPTURE), enabled)
	CFLAGS_VIDEO_CAPTURE=-DCONFIG_VIDEO_CAPTURE
	OBJ_VIDEO_CAPTURE= cap_avi.o cap_ogg.o
else
	CFLAGS_VIDEO_CAPTURE=
	OBJ_VIDEO_CAPTURE=
endif

# Linux configuration
ifeq ($(DP_MAKE_TARGET), linux)
	DEFAULT_SNDAPI=ALSA
	OBJ_CD=$(OBJ_LINUXCD)

	OBJ_CL=$(OBJ_GLX)
	OBJ_ICON=
	OBJ_ICON_NEXUIZ=

	LDFLAGS_CL=$(LDFLAGS_LINUXCL)
	LDFLAGS_SV=$(LDFLAGS_LINUXSV)
	LDFLAGS_SDL=$(LDFLAGS_LINUXSDL)

	SDLCONFIG_CFLAGS=$(SDLCONFIG_UNIXCFLAGS) $(SDLCONFIG_UNIXCFLAGS_X11)
	SDLCONFIG_LIBS=$(SDLCONFIG_UNIXLIBS) $(SDLCONFIG_UNIXLIBS_X11)
	SDLCONFIG_STATICLIBS=$(SDLCONFIG_UNIXSTATICLIBS) $(SDLCONFIG_UNIXSTATICLIBS_X11)

	EXE_CL=$(EXE_UNIXCL)
	EXE_SV=$(EXE_UNIXSV)
	EXE_SDL=$(EXE_UNIXSDL)
	EXE_CLNEXUIZ=$(EXE_UNIXCLNEXUIZ)
	EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
	EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)

	DP_LINK_ZLIB?=shared
	DP_LINK_JPEG?=shared
	DP_LINK_ODE?=dlopen
	DP_LINK_CRYPTO?=dlopen
	DP_LINK_CRYPTO_RIJNDAEL?=dlopen
	DP_LINK_VORBIS?=dlopen
	DP_LINK_THEORA?=dlopen
	DP_LINK_PNG?=dlopen
	DP_LINK_CURL?=dlopen
	DP_LINK_FREETYPE2?=dlopen
endif

# Mac OS X configuration
ifeq ($(DP_MAKE_TARGET), macosx)
	DEFAULT_SNDAPI=COREAUDIO
	OBJ_CD=$(OBJ_MACOSXCD)

	OBJ_CL=$(OBJ_AGL)
	OBJ_ICON=
	OBJ_ICON_NEXUIZ=

	LDFLAGS_CL=$(LDFLAGS_MACOSXCL)
	LDFLAGS_SV=$(LDFLAGS_MACOSXSV)
	LDFLAGS_SDL=$(LDFLAGS_MACOSXSDL)

	SDLCONFIG_CFLAGS=$(SDLCONFIG_MACOSXCFLAGS)
	SDLCONFIG_LIBS=$(SDLCONFIG_MACOSXLIBS)
	SDLCONFIG_STATICLIBS=$(SDLCONFIG_MACOSXSTATICLIBS)

	EXE_CL=$(EXE_MACOSXCL)
	EXE_SV=$(EXE_UNIXSV)
	EXE_SDL=$(EXE_UNIXSDL)
	EXE_CLNEXUIZ=$(EXE_MACOSXCLNEXUIZ)
	EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
	EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)

	ifeq ($(word 2, $(filter -arch, $(CC))), -arch)
		CFLAGS_MAKEDEP=
	endif

	DP_LINK_ZLIB?=shared
	DP_LINK_JPEG?=dlopen
	DP_LINK_ODE?=dlopen
	DP_LINK_CRYPTO?=dlopen
	DP_LINK_CRYPTO_RIJNDAEL?=dlopen
	DP_LINK_VORBIS?=dlopen
	DP_LINK_THEORA?=dlopen
	DP_LINK_PNG?=dlopen
	DP_LINK_CURL?=dlopen
	DP_LINK_FREETYPE2?=dlopen

	# on OS X, we don't build the CL by default because it uses deprecated
	# and not-implemented-in-64bit Carbon
	TARGETS_DEBUG=sv-debug sdl-debug
	TARGETS_PROFILE=sv-profile sdl-profile
	TARGETS_RELEASE=sv-release sdl-release
	TARGETS_RELEASE_PROFILE=sv-release-profile sdl-release-profile
	TARGETS_NEXUIZ=sv-nexuiz sdl-nexuiz
endif

# SunOS configuration (Solaris)
ifeq ($(DP_MAKE_TARGET), sunos)
	DEFAULT_SNDAPI=BSD
	OBJ_CD=$(OBJ_SUNOSCD)

	OBJ_CL=$(OBJ_GLX)
	OBJ_ICON=
	OBJ_ICON_NEXUIZ=

	CFLAGS_EXTRA=$(CFLAGS_SUNOS)

	LDFLAGS_CL=$(LDFLAGS_SUNOSCL)
	LDFLAGS_SV=$(LDFLAGS_SUNOSSV)
	LDFLAGS_SDL=$(LDFLAGS_SUNOSSDL)

	SDLCONFIG_CFLAGS=$(SDLCONFIG_UNIXCFLAGS) $(SDLCONFIG_UNIXCFLAGS_X11)
	SDLCONFIG_LIBS=$(SDLCONFIG_UNIXLIBS) $(SDLCONFIG_UNIXLIBS_X11)
	SDLCONFIG_STATICLIBS=$(SDLCONFIG_UNIXSTATICLIBS) $(SDLCONFIG_UNIXSTATICLIBS_X11)

	EXE_CL=$(EXE_UNIXCL)
	EXE_SV=$(EXE_UNIXSV)
	EXE_SDL=$(EXE_UNIXSDL)
	EXE_CLNEXUIZ=$(EXE_UNIXCLNEXUIZ)
	EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
	EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)

	DP_LINK_ZLIB?=shared
	DP_LINK_JPEG?=shared
	DP_LINK_ODE?=dlopen
	DP_LINK_CRYPTO?=dlopen
	DP_LINK_CRYPTO_RIJNDAEL?=dlopen
	DP_LINK_VORBIS?=dlopen
	DP_LINK_THEORA?=dlopen
	DP_LINK_PNG?=dlopen
	DP_LINK_CURL?=dlopen
	DP_LINK_FREETYPE2?=dlopen
endif

# BSD configuration
ifeq ($(DP_MAKE_TARGET), bsd)
ifeq ($(DP_ARCH),FreeBSD)
	DEFAULT_SNDAPI=OSS
else
	DEFAULT_SNDAPI=BSD
endif
	OBJ_CD=$(OBJ_BSDCD)

	OBJ_CL=$(OBJ_GLX)
	OBJ_ICON=
	OBJ_ICON_NEXUIZ=

	LDFLAGS_CL=$(LDFLAGS_BSDCL)
	LDFLAGS_SV=$(LDFLAGS_BSDSV)
	LDFLAGS_SDL=$(LDFLAGS_BSDSDL)

	SDLCONFIG_CFLAGS=$(SDLCONFIG_UNIXCFLAGS) $(SDLCONFIG_UNIXCFLAGS_X11)
	SDLCONFIG_LIBS=$(SDLCONFIG_UNIXLIBS) $(SDLCONFIG_UNIXLIBS_X11)
	SDLCONFIG_STATICLIBS=$(SDLCONFIG_UNIXSTATICLIBS) $(SDLCONFIG_UNIXSTATICLIBS_X11)

	EXE_CL=$(EXE_UNIXCL)
	EXE_SV=$(EXE_UNIXSV)
	EXE_SDL=$(EXE_UNIXSDL)
	EXE_CLNEXUIZ=$(EXE_UNIXCLNEXUIZ)
	EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
	EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)

	DP_LINK_ZLIB?=shared
	DP_LINK_JPEG?=shared
	DP_LINK_ODE?=dlopen
	DP_LINK_CRYPTO?=dlopen
	DP_LINK_CRYPTO_RIJNDAEL?=dlopen
	DP_LINK_VORBIS?=dlopen
	DP_LINK_THEORA?=dlopen
	DP_LINK_PNG?=dlopen
	DP_LINK_CURL?=dlopen
	DP_LINK_FREETYPE2?=dlopen
endif

# Win32 configuration
ifeq ($(WIN32RELEASE), 1)
#	TARGET=i686-pc-mingw32
#	CC=$(TARGET)-g++
#	WINDRES=$(TARGET)-windres
	CPUOPTIMIZATIONS=-march=pentium3 -mfpmath=sse -fno-math-errno -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fno-trapping-math
#       CPUOPTIMIZATIONS+=-DUSE_WSPIAPI_H -DSUPPORTIPV6
	LDFLAGS_WINCOMMON=-Wl,--large-address-aware
else
	LDFLAGS_WINCOMMON=
endif

ifeq ($(WIN64RELEASE), 1)
#	TARGET=x86_64-pc-mingw32
#	CC=$(TARGET)-g++
#	WINDRES=$(TARGET)-windres
endif

ifeq ($(D3D), 1)
	CFLAGS_D3D=-DSUPPORTD3D -DSUPPORTDIRECTX
	CFLAGS_WARNINGS=-Wall
	LDFLAGS_D3D=-ld3d9
else
	CFLAGS_D3D=
	CFLAGS_WARNINGS=-Wall -Wold-style-definition -Wstrict-prototypes -Wsign-compare -Wdeclaration-after-statement -Wmissing-prototypes
	LDFLAGS_D3D=
endif


ifeq ($(DP_MAKE_TARGET), mingw)
	DEFAULT_SNDAPI=WIN
	OBJ_CD=$(OBJ_WINCD)

	OBJ_CL=$(OBJ_WGL)
	OBJ_ICON=darkplaces.o
	OBJ_ICON_NEXUIZ=nexuiz.o

	LDFLAGS_CL=$(LDFLAGS_WINCL)
	LDFLAGS_SV=$(LDFLAGS_WINSV)
	LDFLAGS_SDL=$(LDFLAGS_WINSDL)

	SDLCONFIG_CFLAGS=$(SDLCONFIG_UNIXCFLAGS)
	SDLCONFIG_LIBS=$(SDLCONFIG_UNIXLIBS)
	SDLCONFIG_STATICLIBS=$(SDLCONFIG_UNIXSTATICLIBS)

	EXE_CL=$(EXE_WINCL)
	EXE_SV=$(EXE_WINSV)
	EXE_SDL=$(EXE_WINSDL)
	EXE_CLNEXUIZ=$(EXE_WINCLNEXUIZ)
	EXE_SVNEXUIZ=$(EXE_WINSVNEXUIZ)
	EXE_SDLNEXUIZ=$(EXE_WINSDLNEXUIZ)

	DP_LINK_ZLIB?=dlopen
	DP_LINK_JPEG?=shared
	DP_LINK_ODE?=dlopen
	DP_LINK_CRYPTO?=dlopen
	DP_LINK_CRYPTO_RIJNDAEL?=dlopen
	DP_LINK_VORBIS?=dlopen
	DP_LINK_THEORA?=dlopen
	DP_LINK_PNG?=dlopen
	DP_LINK_CURL?=dlopen
	DP_LINK_FREETYPE2?=dlopen
endif

# set these to "" if you want to use dynamic loading instead
# zlib
ifeq ($(DP_LINK_ZLIB), shared)
	CFLAGS_LIBZ=-DLINK_TO_ZLIB
	LIB_Z=-lz
endif
ifeq ($(DP_LINK_ZLIB), dlopen)
	CFLAGS_LIBZ=
	LIB_Z=
endif

# jpeg
ifeq ($(DP_LINK_JPEG), shared)
	CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG
	LIB_JPEG=-ljpeg
endif
ifeq ($(DP_LINK_JPEG), dlopen)
	CFLAGS_LIBJPEG=
	LIB_JPEG=
endif

# ode
ifeq ($(DP_LINK_ODE), shared)
	ODE_CONFIG?=ode-config
	LIB_ODE=`$(ODE_CONFIG) --libs`
	CFLAGS_ODE=`$(ODE_CONFIG) --cflags` -DUSEODE -DLINK_TO_LIBODE
endif
ifeq ($(DP_LINK_ODE), dlopen)
	LIB_ODE=
	CFLAGS_ODE=-DUSEODE
endif

# d0_blind_id
ifeq ($(DP_LINK_CRYPTO), shared)
	LIB_CRYPTO=-ld0_blind_id
	CFLAGS_CRYPTO=-DLINK_TO_CRYPTO
endif
ifeq ($(DP_LINK_CRYPTO), dlopen)
	LIB_CRYPTO=
	CFLAGS_CRYPTO=
endif
ifeq ($(DP_LINK_CRYPTO), never)
	LIB_CRYPTO=
	CFLAGS_CRYPTO=-DDISABLE_CRYPTO
endif
ifeq ($(DP_LINK_CRYPTO_RIJNDAEL), shared)
	LIB_CRYPTO_RIJNDAEL=-ld0_rijndael
	CFLAGS_CRYPTO_RIJNDAEL=-DLINK_TO_CRYPTO_RIJNDAEL
endif
ifeq ($(DP_LINK_CRYPTO_RIJNDAEL), dlopen)
	LIB_CRYPTO_RIJNDAEL=
	CFLAGS_CRYPTO_RIJNDAEL=
endif
ifeq ($(DP_LINK_CRYPTO_RIJNDAEL), never)
	LIB_CRYPTO_RIJNDAEL=
	CFLAGS_CRYPTO_RIJNDAEL=-DDISABLE_CRYPTO_RIJNDAEL
endif

ifndef PKG_CONFIG
	PKG_CONFIG=pkg-config
endif

# vorbis
ifeq ($(DP_LINK_VORBIS), shared)
	CFLAGS_LIBVORBIS=-DLINK_TO_LIBVORBIS `$(PKG_CONFIG) --cflags vorbisfile`
	LIB_VORBIS=`$(PKG_CONFIG) --libs vorbisfile`
endif
ifeq ($(DP_LINK_VORBIS), dlopen)
	CFLAGS_LIBVORBIS=
	LIB_VORBIS=
endif

# theora
ifeq ($(DP_LINK_THEORA), shared)
	CFLAGS_LIBTHEORA=-DLINK_TO_THEORA `$(PKG_CONFIG) --cflags theora vorbis vorbisenc ogg`
	LIB_THEORA=`$(PKG_CONFIG) --libs theora vorbis vorbisenc ogg`
endif
ifeq ($(DP_LINK_THEORA), dlopen)
	CFLAGS_LIBTHEORA=
	LIB_THEORA=
endif

# png
ifeq ($(DP_LINK_PNG), shared)
	CFLAGS_LIBPNG=-DLINK_TO_PNG `$(PKG_CONFIG) --cflags libpng`
	LIB_PNG=`$(PKG_CONFIG) --libs libpng`
endif
ifeq ($(DP_LINK_PNG), dlopen)
	CFLAGS_LIBPNG=
	LIB_PNG=
endif

# curl
ifeq ($(DP_LINK_CURL), shared)
	CFLAGS_LIBCURL=-DLINK_TO_CURL `$(PKG_CONFIG) --cflags libcurl`
	LIB_CURL=`$(PKG_CONFIG) --libs libcurl`
endif
ifeq ($(DP_LINK_CURL), dlopen)
	CFLAGS_LIBCURL=
	LIB_CURL=
endif

ifeq ($(DP_LINK_FREETYPE2), shared)
	CFLAGS_LIBFREETYPE2=-DLINK_TO_FREETYPE2 `$(PKG_CONFIG) --cflags freetype2`
	LIB_FREETYPE2=`$(PKG_CONFIG) --libs freetype2`
endif
ifeq ($(DP_LINK_FREETYPE2), dlopen)
	CFLAGS_LIBFREETYPE2=
	LIB_FREETYPE2=
endif

ifeq ($(DP_LINK_AVW), never)
	CFLAGS_LIBAVW=-DDISABLE_AVW
endif

##### Sound configuration #####

ifndef DP_SOUND_API
	DP_SOUND_API=$(DEFAULT_SNDAPI)
endif

# NULL: no sound
ifeq ($(DP_SOUND_API), NULL)
	OBJ_SOUND=$(OBJ_SND_NULL)
	LIB_SOUND=$(LIB_SND_NULL)
endif

# OSS: Open Sound System
ifeq ($(DP_SOUND_API), OSS)
	OBJ_SOUND=$(OBJ_SND_OSS)
	LIB_SOUND=$(LIB_SND_OSS)
endif

# ALSA: Advanced Linux Sound Architecture
ifeq ($(DP_SOUND_API), ALSA)
	OBJ_SOUND=$(OBJ_SND_ALSA)
	LIB_SOUND=$(LIB_SND_ALSA)
endif

# COREAUDIO: Core Audio
ifeq ($(DP_SOUND_API), COREAUDIO)
	OBJ_SOUND=$(OBJ_SND_COREAUDIO)
	LIB_SOUND=$(LIB_SND_COREAUDIO)
endif

# BSD: BSD / Sun audio API
ifeq ($(DP_SOUND_API), BSD)
	OBJ_SOUND=$(OBJ_SND_BSD)
	LIB_SOUND=$(LIB_SND_BSD)
endif

# WIN: DirectX and Win32 WAVE output
ifeq ($(DP_SOUND_API), WIN)
	OBJ_SOUND=$(OBJ_SND_WIN)
	LIB_SOUND=$(LIB_SND_WIN)
endif

ifeq ($(DP_SOUND_API),3DRAS)
	OBJ_SOUND=$(OBJ_SND_3DRAS)
	LIB_SOUND=$(LIB_SND_3DRAS)
endif

##### Extra CFLAGS #####

CFLAGS_MAKEDEP?=-MMD
ifdef DP_FS_BASEDIR
	CFLAGS_FS=-DDP_FS_BASEDIR=\"$(DP_FS_BASEDIR)\"
else
	CFLAGS_FS=
endif

CFLAGS_PRELOAD=
ifneq ($(DP_MAKE_TARGET), mingw)
ifdef DP_PRELOAD_DEPENDENCIES
# DP_PRELOAD_DEPENDENCIES: when set, link against the libraries needed using -l
# dynamically so they won't get loaded at runtime using dlopen
	LDFLAGS_CL+=$(LDFLAGS_UNIXCL_PRELOAD)
	LDFLAGS_SV+=$(LDFLAGS_UNIXSV_PRELOAD)
	LDFLAGS_SDL+=$(LDFLAGS_UNIXSDL_PRELOAD)
	CFLAGS_PRELOAD=$(CFLAGS_UNIX_PRELOAD)
endif
endif

CFLAGS_NET=
# Systems without IPv6 support should uncomment this:
#CFLAGS_NET+=-DNOSUPPORTIPV6

##### GNU Make specific definitions #####

DO_LD=$(CC) -o ../../../$@ $^ $(LDFLAGS)


##### Definitions shared by all makefiles #####
include makefile.inc


##### Dependency files #####

-include *.d

# hack to deal with no-longer-needed .h files
%.h:
	@echo
	@echo "NOTE: file $@ mentioned in dependencies missing, continuing..."
	@echo "HINT: consider 'make clean'"
	@echo