]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - makefile
Made RENDERPATH_GL20 require fbo support and always use it.
[xonotic/darkplaces.git] / makefile
index ba2716953a25195cd01a9954619f6f707794079a..59504d117a17ed57ba5af39e61300fde1da12569 100644 (file)
--- a/makefile
+++ b/makefile
@@ -26,10 +26,24 @@ 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)
+# If we're targeting an x86 CPU we want to enable DP_SSE (CFLAGS_SSE and SSE2)
+ifeq ($(DP_MAKE_TARGET), mingw)
+       DP_SSE:=1
+else
        DP_MACHINE:=$(shell uname -m)
+       ifeq ($(DP_MACHINE),x86_64)
+               DP_SSE:=1
+       else
+       ifeq ($(DP_MACHINE),i686)
+               DP_SSE:=1
+       else
+       ifeq ($(DP_MACHINE),i386)
+               DP_SSE:=1
+       else
+               DP_SSE:=0
+       endif # ifeq ($(DP_MACHINE),i386)
+       endif # ifeq ($(DP_MACHINE),i686)
+       endif # ifeq ($(DP_MACHINE),x86_64)
 endif
 
 # Makefile name
@@ -74,6 +88,15 @@ else
        OBJ_WINCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
 endif
 
+DP_VIDEO_CAPTURE?=enabled
+ifeq ($(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
+
 # Linux configuration
 ifeq ($(DP_MAKE_TARGET), linux)
        DEFAULT_SNDAPI=ALSA
@@ -101,6 +124,8 @@ ifeq ($(DP_MAKE_TARGET), linux)
        DP_LINK_ZLIB?=shared
        DP_LINK_JPEG?=shared
        DP_LINK_ODE?=dlopen
+       DP_LINK_CRYPTO?=dlopen
+       DP_LINK_CRYPTO_RIJNDAEL?=dlopen
 endif
 
 # Mac OS X configuration
@@ -132,8 +157,10 @@ ifeq ($(DP_MAKE_TARGET), macosx)
        endif
 
        DP_LINK_ZLIB?=shared
-       DP_LINK_JPEG?=shared
+       DP_LINK_JPEG?=dlopen
        DP_LINK_ODE?=dlopen
+       DP_LINK_CRYPTO?=dlopen
+       DP_LINK_CRYPTO_RIJNDAEL?=dlopen
 
        # on OS X, we don't build the CL by default because it uses deprecated
        # and not-implemented-in-64bit Carbon
@@ -173,6 +200,8 @@ ifeq ($(DP_MAKE_TARGET), sunos)
        DP_LINK_ZLIB?=shared
        DP_LINK_JPEG?=shared
        DP_LINK_ODE?=dlopen
+       DP_LINK_CRYPTO?=dlopen
+       DP_LINK_CRYPTO_RIJNDAEL?=dlopen
 endif
 
 # BSD configuration
@@ -206,6 +235,8 @@ endif
        DP_LINK_ZLIB?=shared
        DP_LINK_JPEG?=shared
        DP_LINK_ODE?=dlopen
+       DP_LINK_CRYPTO?=dlopen
+       DP_LINK_CRYPTO_RIJNDAEL?=dlopen
 endif
 
 # Win32 configuration
@@ -213,7 +244,7 @@ ifeq ($(WIN32RELEASE), 1)
 #      TARGET=i686-pc-mingw32
 #      CC=$(TARGET)-g++
 #      WINDRES=$(TARGET)-windres
-       CPUOPTIMIZATIONS=-march=i686 -fno-math-errno -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fno-trapping-math
+       CPUOPTIMIZATIONS=-march=pentium3 -mfpmath=sse -fno-math-errno -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fno-trapping-math
 #       CPUOPTIMIZATIONS+=-DUSE_WSPIAPI_H -DSUPPORTIPV6
        LDFLAGS_WINCOMMON=-Wl,--large-address-aware
 else
@@ -260,9 +291,11 @@ ifeq ($(DP_MAKE_TARGET), mingw)
        EXE_SVNEXUIZ=$(EXE_WINSVNEXUIZ)
        EXE_SDLNEXUIZ=$(EXE_WINSDLNEXUIZ)
 
-       DP_LINK_ZLIB?=shared
+       DP_LINK_ZLIB?=dlopen
        DP_LINK_JPEG?=shared
        DP_LINK_ODE?=dlopen
+       DP_LINK_CRYPTO?=dlopen
+       DP_LINK_CRYPTO_RIJNDAEL?=dlopen
 endif
 
 # set these to "" if you want to use dynamic loading instead
@@ -298,15 +331,22 @@ ifeq ($(DP_LINK_ODE), dlopen)
 endif
 
 # d0_blind_id
-# most distros do not have d0_blind_id package, dlopen will used by default
-# LIB_CRYPTO=-ld0_blind_id
-# CFLAGS_CRYPTO=-DLINK_TO_CRYPTO
-# LIB_CRYPTO_RIJNDAEL=-ld0_rijndael
-# CFLAGS_CRYPTO_RIJNDAEL=-DLINK_TO_CRYPTO_RIJNDAEL
-LIB_CRYPTO=
-CFLAGS_CRYPTO=
-LIB_CRYPTO_RIJNDAEL=
-CFLAGS_CRYPTO_RIJNDAEL=
+ifeq ($(DP_LINK_CRYPTO), shared)
+       LIB_CRYPTO=-ld0_blind_id
+       CFLAGS_CRYPTO=-DLINK_TO_CRYPTO
+endif
+ifeq ($(DP_LINK_CRYPTO), dlopen)
+       LIB_CRYPTO=
+       CFLAGS_CRYPTO=
+endif
+ifeq ($(DP_LINK_CRYPTO_RIJNDAEL), shared)
+       LIB_CRYPTO_RIJNDAEL=-ld0_rijndael
+       CFLAGS_CRYPTO_RIJNDAEL=-DLINK_TO_CRYPTO_RIJNDAEL
+endif
+ifeq ($(DP_LINK_CRYPTO_RIJNDAEL), dlopen)
+       LIB_CRYPTO_RIJNDAEL=
+       CFLAGS_CRYPTO_RIJNDAEL=
+endif
 
 ##### Sound configuration #####
 
@@ -359,7 +399,7 @@ endif
 
 CFLAGS_MAKEDEP?=-MMD
 ifdef DP_FS_BASEDIR
-       CFLAGS_FS=-DDP_FS_BASEDIR='\"$(DP_FS_BASEDIR)\"'
+       CFLAGS_FS=-DDP_FS_BASEDIR=\"$(DP_FS_BASEDIR)\"
 else
        CFLAGS_FS=
 endif
@@ -376,6 +416,10 @@ ifdef DP_PRELOAD_DEPENDENCIES
 endif
 endif
 
+CFLAGS_NET=
+# Systems without IPv6 support should uncomment this:
+#CFLAGS_NET+=-DNOSUPPORTIPV6
+
 ##### GNU Make specific definitions #####
 
 DO_LD=$(CC) -o ../../../$@ $^ $(LDFLAGS)