]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - makefile
Revert "Make cdda optional, server does not need to play music" because it
[xonotic/darkplaces.git] / makefile
index 84db7512929f70e67687b17d5bb9840f6fe0247b..cdf4c6417d8aace624729c342673fef45cef5dac 100644 (file)
--- a/makefile
+++ b/makefile
@@ -78,9 +78,9 @@ ifeq ($(DP_MAKE_TARGET), linux)
        EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
        EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
 
-       # libjpeg dependency (set these to "" if you want to use dynamic loading instead)
-       CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG
-       LIB_JPEG=-ljpeg
+       DP_LINK_ZLIB?=shared
+       DP_LINK_JPEG?=shared
+       DP_LINK_ODE?=dlopen
 endif
 
 # Mac OS X configuration
@@ -111,10 +111,9 @@ ifeq ($(DP_MAKE_TARGET), macosx)
                CFLAGS_MAKEDEP=
        endif
 
-       # libjpeg dependency (set these to "" if you want to use dynamic loading instead)
-       # we don't currently link to libjpeg on Mac because the OS does not have an easy way to load libjpeg and we provide our own in the .app
-       CFLAGS_LIBJPEG=
-       LIB_JPEG=
+       DP_LINK_ZLIB?=shared
+       DP_LINK_JPEG?=shared
+       DP_LINK_ODE?=dlopen
 
        # on OS X, we don't build the CL by default because it uses deprecated
        # and not-implemented-in-64bit Carbon
@@ -151,9 +150,9 @@ ifeq ($(DP_MAKE_TARGET), sunos)
        EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
        EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
 
-       # libjpeg dependency (set these to "" if you want to use dynamic loading instead)
-       CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG
-       LIB_JPEG=-ljpeg
+       DP_LINK_ZLIB?=shared
+       DP_LINK_JPEG?=shared
+       DP_LINK_ODE?=dlopen
 endif
 
 # BSD configuration
@@ -184,9 +183,9 @@ endif
        EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
        EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
 
-       # libjpeg dependency (set these to "" if you want to use dynamic loading instead)
-       CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG
-       LIB_JPEG=-ljpeg
+       DP_LINK_ZLIB?=shared
+       DP_LINK_JPEG?=shared
+       DP_LINK_ODE?=dlopen
 endif
 
 # Win32 configuration
@@ -213,7 +212,7 @@ ifeq ($(D3D), 1)
        LDFLAGS_D3D=-ld3d9
 else
        CFLAGS_D3D=
-       CFLAGS_WARNINGS=-Wall -Wold-style-definition -Wstrict-prototypes -Wsign-compare -Wdeclaration-after-statement
+       CFLAGS_WARNINGS=-Wall -Wold-style-definition -Wstrict-prototypes -Wsign-compare -Wdeclaration-after-statement -Wmissing-prototypes
        LDFLAGS_D3D=
 endif
 
@@ -241,10 +240,53 @@ ifeq ($(DP_MAKE_TARGET), mingw)
        EXE_SVNEXUIZ=$(EXE_WINSVNEXUIZ)
        EXE_SDLNEXUIZ=$(EXE_WINSDLNEXUIZ)
 
-       # libjpeg dependency (set these to "" if you want to use dynamic loading instead)
+       DP_LINK_ZLIB?=dlopen
+       DP_LINK_JPEG?=shared
+       DP_LINK_ODE?=dlopen
+endif
+
+# set these to "" if you want to use dynamic loading instead
+# zlib
+ifeq ($(DP_LINK_ZLIB), shared)
+       CFLAGS_LIBZ=-DLINK_TO_ZLIB
+       LIB_Z=-lz
+endif
+ifeq ($(DP_LINK_ZLIB), dlopen)
+       CFLAGS_LIBZ=
+       LIB_Z=
+endif
+
+# jpeg
+ifeq ($(DP_LINK_JPEG), shared)
        CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG
        LIB_JPEG=-ljpeg
 endif
+ifeq ($(DP_LINK_JPEG), dlopen)
+       CFLAGS_LIBJPEG=
+       LIB_JPEG=
+endif
+
+# ode
+ifeq ($(DP_LINK_ODE), shared)
+       ODE_CONFIG?=ode-config
+       LIB_ODE=`$(ODE_CONFIG) --libs`
+       CFLAGS_ODE=`$(ODE_CONFIG) --cflags` -DUSEODE -DLINK_TO_LIBODE
+endif
+ifeq ($(DP_LINK_ODE), dlopen)
+       LIB_ODE=
+       CFLAGS_ODE=-DUSEODE
+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=
 
 ##### Sound configuration #####
 
@@ -326,3 +368,10 @@ include makefile.inc
 ##### Dependency files #####
 
 -include *.d
+
+# hack to deal with no-longer-needed .h files
+%.h:
+       @echo
+       @echo "NOTE: file $@ mentioned in dependencies missing, continuing..."
+       @echo "HINT: consider 'make clean'"
+       @echo