]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - makefile
-Added support for 515]'s BX_COLOREDTEXT extension.
[xonotic/darkplaces.git] / makefile
index 87de6620beae8137ef5adcea39760e0bacbc8604..299893bae932d5d0999f98d51436e3db72638fbf 100644 (file)
--- a/makefile
+++ b/makefile
@@ -9,14 +9,27 @@ else
 
 # UNIXes
 DP_ARCH:=$(shell uname)
-ifeq ($(DP_ARCH),NetBSD)
+ifneq ($(filter %BSD,$(DP_ARCH)),)
        DP_MAKE_TARGET=bsd
+else
+ifeq ($(DP_ARCH), Darwin)
+       DP_MAKE_TARGET=macosx
+else
+ifeq ($(DP_ARCH), SunOS)
+       DP_MAKE_TARGET=sunos
 else
        DP_MAKE_TARGET=linux
-endif
 
-endif
+endif  # ifeq ($(DP_ARCH), SunOS)
+endif  # ifeq ($(DP_ARCH), Darwin)
+endif  # ifneq ($(filter %BSD,$(DP_ARCH)),)
+endif  # ifdef windir
+endif  # ifndef DP_MAKE_TARGET
 
+# If we're not on compiling for Win32, we need additional information
+ifneq ($(DP_MAKE_TARGET), mingw)
+       DP_ARCH:=$(shell uname)
+       DP_MACHINE:=$(shell uname -m)
 endif
 
 
@@ -27,11 +40,17 @@ else
        CMD_RM=$(CMD_UNIXRM)
 endif
 
+# 64bits AMD CPUs use another lib directory
+ifeq ($(DP_MACHINE),x86_64)
+       UNIX_X11LIBPATH:=-L/usr/X11R6/lib64
+else
+       UNIX_X11LIBPATH:=-L/usr/X11R6/lib
+endif
+
 
 # Linux configuration
 ifeq ($(DP_MAKE_TARGET), linux)
-       OBJ_SOUND=$(OBJ_LINUXSOUND)
-       LIB_SOUND=$(LIB_LINUXSOUND)
+       DEFAULT_SNDAPI=ALSA
        OBJ_CD=$(OBJ_LINUXCD)
 
        OBJ_CL=$(OBJ_GLX)
@@ -45,10 +64,47 @@ ifeq ($(DP_MAKE_TARGET), linux)
        EXE_SDL=$(EXE_UNIXSDL)
 endif
 
+# Mac OS X configuration
+ifeq ($(DP_MAKE_TARGET), macosx)
+       DEFAULT_SNDAPI=COREAUDIO
+       OBJ_CD=$(OBJ_MACOSXCD)
+
+       OBJ_CL=$(OBJ_AGL)
+
+       LDFLAGS_CL=$(LDFLAGS_MACOSXCL)
+       LDFLAGS_SV=$(LDFLAGS_MACOSXSV)
+       LDFLAGS_SDL=$(LDFLAGS_MACOSXSDL)
+
+       EXE_CL=$(EXE_UNIXCL)
+       EXE_SV=$(EXE_UNIXSV)
+       EXE_SDL=$(EXE_UNIXSDL)
+endif
+
+# SunOS configuration (Solaris)
+ifeq ($(DP_MAKE_TARGET), sunos)
+       DEFAULT_SNDAPI=OSS
+       OBJ_CD=$(OBJ_SUNOSCD)
+
+       OBJ_CL=$(OBJ_GLX)
+
+       CFLAGS_EXTRA=$(CFLAGS_SUNOS)
+
+       LDFLAGS_CL=$(LDFLAGS_SUNOSCL)
+       LDFLAGS_SV=$(LDFLAGS_SUNOSSV)
+       LDFLAGS_SDL=$(LDFLAGS_SUNOSSDL)
+
+       EXE_CL=$(EXE_UNIXCL)
+       EXE_SV=$(EXE_UNIXSV)
+       EXE_SDL=$(EXE_UNIXSDL)
+endif
+
 # BSD configuration
 ifeq ($(DP_MAKE_TARGET), bsd)
-       OBJ_SOUND=$(OBJ_BSDSOUND)
-       LIB_SOUND=$(LIB_BSDSOUND)
+ifeq ($(DP_ARCH),FreeBSD)
+       DEFAULT_SNDAPI=OSS
+else
+       DEFAULT_SNDAPI=BSD
+endif
        OBJ_CD=$(OBJ_BSDCD)
 
        OBJ_CL=$(OBJ_GLX)
@@ -64,8 +120,7 @@ endif
 
 # Win32 configuration
 ifeq ($(DP_MAKE_TARGET), mingw)
-       OBJ_SOUND=$(OBJ_WINSOUND)
-       LIB_SOUND=$(LIB_WINSOUND)
+       DEFAULT_SNDAPI=WIN
        OBJ_CD=$(OBJ_WINCD)
 
        OBJ_CL=$(OBJ_WGL)
@@ -80,6 +135,49 @@ ifeq ($(DP_MAKE_TARGET), mingw)
 endif
 
 
+##### Sound configuration #####
+
+ifndef DP_SOUND_API
+       DP_SOUND_API=$(DEFAULT_SNDAPI)
+endif
+
+# NULL: no sound
+ifeq ($(DP_SOUND_API), NULL)
+       OBJ_SOUND=$(OBJ_SND_NULL)
+       LIB_SOUND=$(LIB_SND_NULL)
+endif
+
+# OSS: Open Sound System
+ifeq ($(DP_SOUND_API), OSS)
+       OBJ_SOUND=$(OBJ_SND_OSS)
+       LIB_SOUND=$(LIB_SND_OSS)
+endif
+
+# ALSA: Advanced Linux Sound Architecture
+ifeq ($(DP_SOUND_API), ALSA)
+       OBJ_SOUND=$(OBJ_SND_ALSA)
+       LIB_SOUND=$(LIB_SND_ALSA)
+endif
+
+# COREAUDIO: Core Audio
+ifeq ($(DP_SOUND_API), COREAUDIO)
+       OBJ_SOUND=$(OBJ_SND_COREAUDIO)
+       LIB_SOUND=$(LIB_SND_COREAUDIO)
+endif
+
+# BSD: BSD / Sun audio API
+ifeq ($(DP_SOUND_API), BSD)
+       OBJ_SOUND=$(OBJ_SND_BSD)
+       LIB_SOUND=$(LIB_SND_BSD)
+endif
+
+# WIN: DirectX and Win32 WAVE output
+ifeq ($(DP_SOUND_API), WIN)
+       OBJ_SOUND=$(OBJ_SND_WIN)
+       LIB_SOUND=$(LIB_SND_WIN)
+endif
+
+
 ##### GNU Make specific definitions #####
 
 DO_LD=$(CC) -o $@ $^ $(LDFLAGS)