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