1 ##### DP_MAKE_TARGET autodetection and arch specific variables #####
11 DP_ARCH:=$(shell uname)
12 ifneq ($(filter %BSD,$(DP_ARCH)),)
15 ifeq ($(DP_ARCH), Darwin)
18 ifeq ($(DP_ARCH), SunOS)
23 endif # ifeq ($(DP_ARCH), SunOS)
24 endif # ifeq ($(DP_ARCH), Darwin)
25 endif # ifneq ($(filter %BSD,$(DP_ARCH)),)
27 endif # ifndef DP_MAKE_TARGET
29 # If we're not on compiling for Win32, we need additional information
30 ifneq ($(DP_MAKE_TARGET), mingw)
31 DP_ARCH:=$(shell uname)
32 DP_MACHINE:=$(shell uname -m)
36 # Command used to delete files
43 # 64bits AMD CPUs use another lib directory
44 ifeq ($(DP_MACHINE),x86_64)
45 UNIX_X11LIBPATH:=/usr/X11R6/lib64
47 UNIX_X11LIBPATH:=/usr/X11R6/lib
52 ifeq ($(DP_MAKE_TARGET), linux)
60 LDFLAGS_CL=$(LDFLAGS_LINUXCL)
61 LDFLAGS_SV=$(LDFLAGS_LINUXSV)
62 LDFLAGS_SDL=$(LDFLAGS_LINUXSDL)
66 EXE_SDL=$(EXE_UNIXSDL)
67 EXE_CLNEXUIZ=$(EXE_UNIXCLNEXUIZ)
68 EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
69 EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
72 # Mac OS X configuration
73 ifeq ($(DP_MAKE_TARGET), macosx)
74 DEFAULT_SNDAPI=COREAUDIO
75 OBJ_CD=$(OBJ_MACOSXCD)
81 LDFLAGS_CL=$(LDFLAGS_MACOSXCL)
82 LDFLAGS_SV=$(LDFLAGS_MACOSXSV)
83 LDFLAGS_SDL=$(LDFLAGS_MACOSXSDL)
85 EXE_CL=$(EXE_MACOSXCL)
87 EXE_SDL=$(EXE_UNIXSDL)
88 EXE_CLNEXUIZ=$(EXE_MACOSXCLNEXUIZ)
89 EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
90 EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
92 ifeq ($(word 2, $(filter -arch, $(CC))), -arch)
97 # SunOS configuration (Solaris)
98 ifeq ($(DP_MAKE_TARGET), sunos)
100 OBJ_CD=$(OBJ_SUNOSCD)
106 CFLAGS_EXTRA=$(CFLAGS_SUNOS)
108 LDFLAGS_CL=$(LDFLAGS_SUNOSCL)
109 LDFLAGS_SV=$(LDFLAGS_SUNOSSV)
110 LDFLAGS_SDL=$(LDFLAGS_SUNOSSDL)
114 EXE_SDL=$(EXE_UNIXSDL)
115 EXE_CLNEXUIZ=$(EXE_UNIXCLNEXUIZ)
116 EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
117 EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
121 ifeq ($(DP_MAKE_TARGET), bsd)
122 ifeq ($(DP_ARCH),FreeBSD)
133 LDFLAGS_CL=$(LDFLAGS_BSDCL)
134 LDFLAGS_SV=$(LDFLAGS_BSDSV)
135 LDFLAGS_SDL=$(LDFLAGS_BSDSDL)
139 EXE_SDL=$(EXE_UNIXSDL)
140 EXE_CLNEXUIZ=$(EXE_UNIXCLNEXUIZ)
141 EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
142 EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
145 # Win32 configuration
146 ifeq ($(DP_MAKE_TARGET), mingw)
151 OBJ_ICON=darkplaces.o
152 OBJ_ICON_NEXUIZ=nexuiz.o
154 LDFLAGS_CL=$(LDFLAGS_WINCL)
155 LDFLAGS_SV=$(LDFLAGS_WINSV)
156 LDFLAGS_SDL=$(LDFLAGS_WINSDL)
160 EXE_SDL=$(EXE_WINSDL)
161 EXE_CLNEXUIZ=$(EXE_WINCLNEXUIZ)
162 EXE_SVNEXUIZ=$(EXE_WINSVNEXUIZ)
163 EXE_SDLNEXUIZ=$(EXE_WINSDLNEXUIZ)
167 ##### Sound configuration #####
170 DP_SOUND_API=$(DEFAULT_SNDAPI)
174 ifeq ($(DP_SOUND_API), NULL)
175 OBJ_SOUND=$(OBJ_SND_NULL)
176 LIB_SOUND=$(LIB_SND_NULL)
179 # OSS: Open Sound System
180 ifeq ($(DP_SOUND_API), OSS)
181 OBJ_SOUND=$(OBJ_SND_OSS)
182 LIB_SOUND=$(LIB_SND_OSS)
185 # ALSA: Advanced Linux Sound Architecture
186 ifeq ($(DP_SOUND_API), ALSA)
187 OBJ_SOUND=$(OBJ_SND_ALSA)
188 LIB_SOUND=$(LIB_SND_ALSA)
191 # COREAUDIO: Core Audio
192 ifeq ($(DP_SOUND_API), COREAUDIO)
193 OBJ_SOUND=$(OBJ_SND_COREAUDIO)
194 LIB_SOUND=$(LIB_SND_COREAUDIO)
197 # BSD: BSD / Sun audio API
198 ifeq ($(DP_SOUND_API), BSD)
199 OBJ_SOUND=$(OBJ_SND_BSD)
200 LIB_SOUND=$(LIB_SND_BSD)
203 # WIN: DirectX and Win32 WAVE output
204 ifeq ($(DP_SOUND_API), WIN)
205 OBJ_SOUND=$(OBJ_SND_WIN)
206 LIB_SOUND=$(LIB_SND_WIN)
210 ##### Extra CFLAGS #####
214 CFLAGS_FS=-DDP_FS_BASEDIR='\"$(DP_FS_BASEDIR)\"'
220 ##### GNU Make specific definitions #####
222 DO_LD=$(CC) -o $@ $^ $(LDFLAGS)
225 ##### Definitions shared by all makefiles #####
229 ##### Dependency files #####