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