]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - BSDmakefile
add a FIXME comment regarding canjump, will check that later
[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 # libjpeg dependency (set these to "" if you want to use dynamic loading instead)
54 CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG
55 LIB_JPEG=-ljpeg
56
57 .endif
58
59
60 ##### Sound configuration #####
61
62 .ifndef DP_SOUND_API
63 DP_SOUND_API=$(DEFAULT_SNDAPI)
64 .endif
65
66 # NULL: no sound
67 .if $(DP_SOUND_API) == "NULL"
68 OBJ_SOUND=$(OBJ_SND_NULL)
69 LIB_SOUND=$(LIB_SND_NULL)
70 .endif
71
72 # OSS: Open Sound System
73 .if $(DP_SOUND_API) == "OSS"
74 OBJ_SOUND=$(OBJ_SND_OSS)
75 LIB_SOUND=$(LIB_SND_OSS)
76 .endif
77
78 # BSD: BSD / Sun audio API
79 .if $(DP_SOUND_API) == "BSD"
80 OBJ_SOUND=$(OBJ_SND_BSD)
81 LIB_SOUND=$(LIB_SND_BSD)
82 .endif
83
84
85 ##### Extra CFLAGS #####
86
87 CFLAGS_MAKEDEP=-MD
88 .ifdef DP_FS_BASEDIR
89 CFLAGS_FS=-DDP_FS_BASEDIR='\"$(DP_FS_BASEDIR)\"'
90 .else
91 CFLAGS_FS=
92 .endif
93
94 CFLAGS_PRELOAD=
95 .ifdef DP_PRELOAD_DEPENDENCIES
96 LDFLAGS_CL+=$(LDFLAGS_UNIXCL_PRELOAD)
97 LDFLAGS_SV+=$(LDFLAGS_UNIXSV_PRELOAD)
98 LDFLAGS_SDL+=$(LDFLAGS_UNIXSDL_PRELOAD)
99 CFLAGS_PRELOAD=$(CFLAGS_UNIX_PRELOAD)
100 .endif
101
102
103 ##### BSD Make specific definitions #####
104
105 MAKE:=$(MAKE) -f BSDmakefile
106
107 DO_LD=$(CC) -o $@ $> $(LDFLAGS)
108
109
110 ##### Definitions shared by all makefiles #####
111 .include "makefile.inc"