sv_ccmds: Remove some more client-specific forward-to-server code
[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 sdl-debug
20 TARGETS_PROFILE=sv-profile sdl-profile
21 TARGETS_RELEASE=sv-release sdl-release
22 TARGETS_RELEASE_PROFILE=sv-release-profile sdl-release-profile
23 TARGETS_NEXUIZ=sv-nexuiz sdl-nexuiz
24
25 # Link options
26 DP_LINK_ZLIB?=shared
27 DP_LINK_JPEG?=shared
28 DP_LINK_ODE?=dlopen
29 DP_LINK_CRYPTO?=dlopen
30 DP_LINK_CRYPTO_RIJNDAEL?=dlopen
31 DP_LINK_XMP?=dlopen
32
33 ###### Optional features #####
34 DP_VIDEO_CAPTURE?=enabled
35 .if $(DP_VIDEO_CAPTURE) == "enabled"
36   CFLAGS_VIDEO_CAPTURE=-DCONFIG_VIDEO_CAPTURE
37   OBJ_VIDEO_CAPTURE=cap_avi.o cap_ogg.o
38 .else
39   CFLAGS_VIDEO_CAPTURE=
40   OBJ_VIDEO_CAPTURE=
41 .endif
42
43 # X11 libs
44 UNIX_X11LIBPATH=/usr/X11R6/lib
45
46 # BSD configuration
47 .if $(DP_MAKE_TARGET) == "bsd"
48
49 # FreeBSD uses OSS
50 .if $(DP_ARCH) == "FreeBSD"
51 DEFAULT_SNDAPI=OSS
52 .else
53 DEFAULT_SNDAPI=BSD
54 .endif
55
56 OBJ_ICON=
57 OBJ_ICON_NEXUIZ=
58
59 LDFLAGS_SV=$(LDFLAGS_BSDSV)
60 LDFLAGS_SDL=$(LDFLAGS_BSDSDL)
61
62 SDLCONFIG_CFLAGS=$(SDLCONFIG_UNIXCFLAGS) $(SDLCONFIG_UNIXCFLAGS_X11)
63 SDLCONFIG_LIBS=$(SDLCONFIG_UNIXLIBS) $(SDLCONFIG_UNIXLIBS_X11)
64 SDLCONFIG_STATICLIBS=$(SDLCONFIG_UNIXSTATICLIBS) $(SDLCONFIG_UNIXSTATICLIBS_X11)
65
66 EXE_SV=$(EXE_UNIXSV)
67 EXE_SDL=$(EXE_UNIXSDL)
68 EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
69 EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
70
71 # set these to "" if you want to use dynamic loading instead
72 # zlib
73 .if $(DP_LINK_ZLIB) == "shared"
74 CFLAGS_LIBZ=-DLINK_TO_ZLIB
75 LIB_Z=-lz
76 .else
77 CFLAGS_LIBZ=
78 LIB_Z=
79 .endif
80
81 # jpeg
82 .if $(DP_LINK_JPEG) == "shared"
83 CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG
84 LIB_JPEG=-ljpeg
85 .else
86 CFLAGS_LIBJPEG=
87 LIB_JPEG=
88 .endif
89
90 # ode
91 .if $(DP_LINK_ODE) == "shared"
92 ODE_CONFIG?=ode-config
93 LIB_ODE=`$(ODE_CONFIG) --libs`
94 CFLAGS_ODE=`$(ODE_CONFIG) --cflags` -DUSEODE -DLINK_TO_LIBODE
95 .else
96 LIB_ODE=
97 CFLAGS_ODE=-DUSEODE
98 .endif
99
100 # d0_blind_id
101 .if $(DP_LINK_CRYPTO) == "shared"
102 LIB_CRYPTO=-ld0_blind_id
103 CFLAGS_CRYPTO=-DLINK_TO_CRYPTO
104 .else
105 LIB_CRYPTO=
106 CFLAGS_CRYPTO=
107 .endif
108 .if $(DP_LINK_CRYPTO_RIJNDAEL) == "shared"
109 LIB_CRYPTO_RIJNDAEL=-ld0_rijndael
110 CFLAGS_CRYPTO_RIJNDAEL=-DLINK_TO_CRYPTO_RIJNDAEL
111 .else
112 LIB_CRYPTO_RIJNDAEL=
113 CFLAGS_CRYPTO_RIJNDAEL=
114 .endif
115
116 # xmp
117 .if $(DP_LINK_XMP) == "shared"
118 OBJ_SND_XMP=snd_xmp.o
119 LIB_SND_XMP=-lxmp
120 CFLAGS_SND_XMP=-DUSEXMP -DLINK_TO_LIBXMP
121 .else
122 OBJ_SND_XMP=snd_xmp.o
123 LIB_SND_XMP=
124 CFLAGS_SND_XMP=-DUSEXMP
125 .endif
126
127 .endif
128
129
130 ##### Extra CFLAGS #####
131
132 CFLAGS_MAKEDEP=-MD
133 .ifdef DP_FS_BASEDIR
134 CFLAGS_FS=-DDP_FS_BASEDIR='\"$(DP_FS_BASEDIR)\"'
135 .else
136 CFLAGS_FS=
137 .endif
138
139 CFLAGS_PRELOAD=
140 .ifdef DP_PRELOAD_DEPENDENCIES
141 LDFLAGS_SV+=$(LDFLAGS_UNIXSV_PRELOAD)
142 LDFLAGS_SDL+=$(LDFLAGS_UNIXSDL_PRELOAD)
143 CFLAGS_PRELOAD=$(CFLAGS_UNIX_PRELOAD)
144 .endif
145
146 CFLAGS_NET=
147 # Systems without IPv6 support should uncomment this:
148 #CFLAGS_NET+=-DNOSUPPORTIPV6
149
150 ##### BSD Make specific definitions #####
151
152 MAKE:=$(MAKE) -f BSDmakefile
153
154 DO_LD=$(CC) -o ../../../$@ $> $(LDFLAGS)
155
156
157 ##### Definitions shared by all makefiles #####
158 .include "makefile.inc"