Revert "Make cdda optional, server does not need to play music" because it
[xonotic/darkplaces.git] / BSDmakefile
1 #####  DP_MAKE_TARGET autodetection and arch specific variables #####
2
3 .ifndef DP_MAKE_TARGET
4
5 DP_MAKE_TARGET=bsd
6
7 .endif
8 DP_ARCH != uname
9
10
11 # Makefile name
12 MAKEFILE=BSDmakefile
13
14 # Command used to delete files
15 CMD_RM=$(CMD_UNIXRM)
16
17 # default targets
18 TARGETS_DEBUG=sv-debug cl-debug sdl-debug
19 TARGETS_PROFILE=sv-profile cl-profile sdl-profile
20 TARGETS_RELEASE=sv-release cl-release sdl-release
21 TARGETS_RELEASE_PROFILE=sv-release-profile cl-release-profile sdl-release-profile
22 TARGETS_NEXUIZ=sv-nexuiz cl-nexuiz sdl-nexuiz
23
24 # X11 libs
25 UNIX_X11LIBPATH=/usr/X11R6/lib
26
27 # BSD configuration
28 .if $(DP_MAKE_TARGET) == "bsd"
29
30 # FreeBSD uses OSS
31 .if $(DP_ARCH) == "FreeBSD"
32 DEFAULT_SNDAPI=OSS
33 .else
34 DEFAULT_SNDAPI=BSD
35 .endif
36 OBJ_CD=$(OBJ_BSDCD)
37
38 OBJ_CL=$(OBJ_GLX)
39 OBJ_ICON=
40 OBJ_ICON_NEXUIZ=
41
42 LDFLAGS_CL=$(LDFLAGS_BSDCL)
43 LDFLAGS_SV=$(LDFLAGS_BSDSV)
44 LDFLAGS_SDL=$(LDFLAGS_BSDSDL)
45
46 SDLCONFIG_CFLAGS=$(SDLCONFIG_UNIXCFLAGS) $(SDLCONFIG_UNIXCFLAGS_X11)
47 SDLCONFIG_LIBS=$(SDLCONFIG_UNIXLIBS) $(SDLCONFIG_UNIXLIBS_X11)
48 SDLCONFIG_STATICLIBS=$(SDLCONFIG_UNIXSTATICLIBS) $(SDLCONFIG_UNIXSTATICLIBS_X11)
49
50 EXE_CL=$(EXE_UNIXCL)
51 EXE_SV=$(EXE_UNIXSV)
52 EXE_SDL=$(EXE_UNIXSDL)
53 EXE_CLNEXUIZ=$(EXE_UNIXCLNEXUIZ)
54 EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
55 EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
56
57 # set these to "" if you want to use dynamic loading instead
58 # zlib
59 CFLAGS_LIBZ=-DLINK_TO_ZLIB
60 LIB_Z=-lz
61
62 # jpeg
63 CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG
64 LIB_JPEG=-ljpeg
65
66 # ode
67 ODE_CONFIG?=ode-config
68 LIB_ODE=`$(ODE_CONFIG) --libs`
69 CFLAGS_ODE=`$(ODE_CONFIG) --cflags` -DUSEODE -DLINK_TO_LIBODE
70
71 # d0_blind_id
72 # most distros do not have d0_blind_id package, dlopen will used by default
73 # LIB_CRYPTO=-ld0_blind_id
74 # CFLAGS_CRYPTO=-DLINK_TO_CRYPTO
75 # LIB_CRYPTO_RIJNDAEL=-ld0_rijndael
76 # CFLAGS_CRYPTO_RIJNDAEL=-DLINK_TO_CRYPTO_RIJNDAEL
77 LIB_CRYPTO=
78 CFLAGS_CRYPTO=
79 LIB_CRYPTO_RIJNDAEL=
80 CFLAGS_CRYPTO_RIJNDAEL=
81
82 .endif
83
84
85 ##### Sound configuration #####
86
87 .ifndef DP_SOUND_API
88 DP_SOUND_API=$(DEFAULT_SNDAPI)
89 .endif
90
91 # NULL: no sound
92 .if $(DP_SOUND_API) == "NULL"
93 OBJ_SOUND=$(OBJ_SND_NULL)
94 LIB_SOUND=$(LIB_SND_NULL)
95 .endif
96
97 # OSS: Open Sound System
98 .if $(DP_SOUND_API) == "OSS"
99 OBJ_SOUND=$(OBJ_SND_OSS)
100 LIB_SOUND=$(LIB_SND_OSS)
101 .endif
102
103 # BSD: BSD / Sun audio API
104 .if $(DP_SOUND_API) == "BSD"
105 OBJ_SOUND=$(OBJ_SND_BSD)
106 LIB_SOUND=$(LIB_SND_BSD)
107 .endif
108
109
110 ##### Extra CFLAGS #####
111
112 CFLAGS_MAKEDEP=-MD
113 .ifdef DP_FS_BASEDIR
114 CFLAGS_FS=-DDP_FS_BASEDIR='\"$(DP_FS_BASEDIR)\"'
115 .else
116 CFLAGS_FS=
117 .endif
118
119 CFLAGS_PRELOAD=
120 .ifdef DP_PRELOAD_DEPENDENCIES
121 LDFLAGS_CL+=$(LDFLAGS_UNIXCL_PRELOAD)
122 LDFLAGS_SV+=$(LDFLAGS_UNIXSV_PRELOAD)
123 LDFLAGS_SDL+=$(LDFLAGS_UNIXSDL_PRELOAD)
124 CFLAGS_PRELOAD=$(CFLAGS_UNIX_PRELOAD)
125 .endif
126
127
128 ##### BSD Make specific definitions #####
129
130 MAKE:=$(MAKE) -f BSDmakefile
131
132 DO_LD=$(CC) -o $@ $> $(LDFLAGS)
133
134
135 ##### Definitions shared by all makefiles #####
136 .include "makefile.inc"