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)
93 # SunOS configuration (Solaris)
94 ifeq ($(DP_MAKE_TARGET), sunos)
102 CFLAGS_EXTRA=$(CFLAGS_SUNOS)
104 LDFLAGS_CL=$(LDFLAGS_SUNOSCL)
105 LDFLAGS_SV=$(LDFLAGS_SUNOSSV)
106 LDFLAGS_SDL=$(LDFLAGS_SUNOSSDL)
110 EXE_SDL=$(EXE_UNIXSDL)
111 EXE_CLNEXUIZ=$(EXE_UNIXCLNEXUIZ)
112 EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
113 EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
117 ifeq ($(DP_MAKE_TARGET), bsd)
118 ifeq ($(DP_ARCH),FreeBSD)
129 LDFLAGS_CL=$(LDFLAGS_BSDCL)
130 LDFLAGS_SV=$(LDFLAGS_BSDSV)
131 LDFLAGS_SDL=$(LDFLAGS_BSDSDL)
135 EXE_SDL=$(EXE_UNIXSDL)
136 EXE_CLNEXUIZ=$(EXE_UNIXCLNEXUIZ)
137 EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
138 EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
141 # Win32 configuration
142 ifeq ($(DP_MAKE_TARGET), mingw)
147 OBJ_ICON=darkplaces.o
148 OBJ_ICON_NEXUIZ=nexuiz.o
150 LDFLAGS_CL=$(LDFLAGS_WINCL)
151 LDFLAGS_SV=$(LDFLAGS_WINSV)
152 LDFLAGS_SDL=$(LDFLAGS_WINSDL)
156 EXE_SDL=$(EXE_WINSDL)
157 EXE_CLNEXUIZ=$(EXE_WINCLNEXUIZ)
158 EXE_SVNEXUIZ=$(EXE_WINSVNEXUIZ)
159 EXE_SDLNEXUIZ=$(EXE_WINSDLNEXUIZ)
163 ##### Sound configuration #####
166 DP_SOUND_API=$(DEFAULT_SNDAPI)
170 ifeq ($(DP_SOUND_API), NULL)
171 OBJ_SOUND=$(OBJ_SND_NULL)
172 LIB_SOUND=$(LIB_SND_NULL)
175 # OSS: Open Sound System
176 ifeq ($(DP_SOUND_API), OSS)
177 OBJ_SOUND=$(OBJ_SND_OSS)
178 LIB_SOUND=$(LIB_SND_OSS)
181 # ALSA: Advanced Linux Sound Architecture
182 ifeq ($(DP_SOUND_API), ALSA)
183 OBJ_SOUND=$(OBJ_SND_ALSA)
184 LIB_SOUND=$(LIB_SND_ALSA)
187 # COREAUDIO: Core Audio
188 ifeq ($(DP_SOUND_API), COREAUDIO)
189 OBJ_SOUND=$(OBJ_SND_COREAUDIO)
190 LIB_SOUND=$(LIB_SND_COREAUDIO)
193 # BSD: BSD / Sun audio API
194 ifeq ($(DP_SOUND_API), BSD)
195 OBJ_SOUND=$(OBJ_SND_BSD)
196 LIB_SOUND=$(LIB_SND_BSD)
199 # WIN: DirectX and Win32 WAVE output
200 ifeq ($(DP_SOUND_API), WIN)
201 OBJ_SOUND=$(OBJ_SND_WIN)
202 LIB_SOUND=$(LIB_SND_WIN)
206 ##### GNU Make specific definitions #####
208 DO_LD=$(CC) -o $@ $^ $(LDFLAGS)
211 ##### Definitions shared by all makefiles #####
215 ##### Dependency files #####