File: BSDmakefile

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 (196 lines) | stat: -rw-r--r-- 3,983 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
#####  DP_MAKE_TARGET autodetection and arch specific variables #####

.ifndef DP_MAKE_TARGET

DP_MAKE_TARGET=bsd

.endif
DP_ARCH != uname

# Makefile name
MAKEFILE=BSDmakefile

# Commands
CMD_RM=$(CMD_UNIXRM)
CMD_CP=$(CMD_UNIXCP)
CMD_MKDIR=$(CMD_UNIXMKDIR)

# 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

# Link options
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

###### Optional features #####
DP_CDDA?=enabled
.if $(DP_CDDA) == "enabled"
  OBJ_SDLCD=$(OBJ_CD_COMMON) cd_sdl.o
  OBJ_BSDCD=$(OBJ_CD_COMMON) cd_bsd.o
.else
  OBJ_SDLCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
  OBJ_BSDCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
.endif

DP_VIDEO_CAPTURE?=enabled
.if $(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

# X11 libs
UNIX_X11LIBPATH=/usr/X11R6/lib

# BSD configuration
.if $(DP_MAKE_TARGET) == "bsd"

# FreeBSD uses OSS
.if $(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)

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

# jpeg
.if $(DP_LINK_JPEG) == "shared"
CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG
LIB_JPEG=-ljpeg
.else
CFLAGS_LIBJPEG=
LIB_JPEG=
.endif

# ode
.if $(DP_LINK_ODE) == "shared"
ODE_CONFIG?=ode-config
LIB_ODE=`$(ODE_CONFIG) --libs`
CFLAGS_ODE=`$(ODE_CONFIG) --cflags` -DUSEODE -DLINK_TO_LIBODE
.else
LIB_ODE=
CFLAGS_ODE=-DUSEODE
.endif

# d0_blind_id
.if $(DP_LINK_CRYPTO) == "shared"
LIB_CRYPTO=-ld0_blind_id
CFLAGS_CRYPTO=-DLINK_TO_CRYPTO
.else
LIB_CRYPTO=
CFLAGS_CRYPTO=
.endif
.if $(DP_LINK_CRYPTO_RIJNDAEL) == "shared"
LIB_CRYPTO_RIJNDAEL=-ld0_rijndael
CFLAGS_CRYPTO_RIJNDAEL=-DLINK_TO_CRYPTO_RIJNDAEL
.else
LIB_CRYPTO_RIJNDAEL=
CFLAGS_CRYPTO_RIJNDAEL=
.endif

# vorbis
.if $(DP_LINK_VORBIS) == "shared"
CFLAGS_LIBVORBIS=-DLINK_TO_LIBVORBIS `pkg-config --cflags vorbisfile`
LIB_VORBIS=`pkg-config --libs vorbisfile`
.else
CFLAGS_LIBVORBIS=
LIB_VORBIS=
.endif

.endif


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

.ifndef DP_SOUND_API
DP_SOUND_API=$(DEFAULT_SNDAPI)
.endif

# NULL: no sound
.if $(DP_SOUND_API) == "NULL"
OBJ_SOUND=$(OBJ_SND_NULL)
LIB_SOUND=$(LIB_SND_NULL)
.endif

# OSS: Open Sound System
.if $(DP_SOUND_API) == "OSS"
OBJ_SOUND=$(OBJ_SND_OSS)
LIB_SOUND=$(LIB_SND_OSS)
.endif

# BSD: BSD / Sun audio API
.if $(DP_SOUND_API) == "BSD"
OBJ_SOUND=$(OBJ_SND_BSD)
LIB_SOUND=$(LIB_SND_BSD)
.endif


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

CFLAGS_MAKEDEP=-MD
.ifdef DP_FS_BASEDIR
CFLAGS_FS=-DDP_FS_BASEDIR='\"$(DP_FS_BASEDIR)\"'
.else
CFLAGS_FS=
.endif

CFLAGS_PRELOAD=
.ifdef DP_PRELOAD_DEPENDENCIES
LDFLAGS_CL+=$(LDFLAGS_UNIXCL_PRELOAD)
LDFLAGS_SV+=$(LDFLAGS_UNIXSV_PRELOAD)
LDFLAGS_SDL+=$(LDFLAGS_UNIXSDL_PRELOAD)
CFLAGS_PRELOAD=$(CFLAGS_UNIX_PRELOAD)
.endif

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

##### BSD Make specific definitions #####

MAKE:=$(MAKE) -f BSDmakefile

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


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