]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - BSDmakefile
Build in subdirs
[xonotic/darkplaces.git] / BSDmakefile
index dc0af47b621fdbb2b66ea60dbeb4703b8083d192..74496edcb1c9917d2bb776c694fe64a04d882c9f 100644 (file)
@@ -8,9 +8,22 @@ DP_MAKE_TARGET=bsd
 DP_ARCH != uname
 
 
-# Command used to delete files
+# Makefile name
+MAKEFILE=BSDmakefile
+
+# Commands
 CMD_RM=$(CMD_UNIXRM)
+CMD_CP=$(CMD_UNIXCP)
+CMD_MKDIR=$(CMD_UNIXMKDIR)
+
+# default targets
+TARGETS_DEBUG=sv-debug cl-debug sdl-debug
+TARGETS_PROFILE=sv-profile cl-profile sdl-profile
+TARGETS_RELEASE=sv-release cl-release sdl-release
+TARGETS_RELEASE_PROFILE=sv-release-profile cl-release-profile sdl-release-profile
+TARGETS_NEXUIZ=sv-nexuiz cl-nexuiz sdl-nexuiz
 
+# X11 libs
 UNIX_X11LIBPATH=/usr/X11R6/lib
 
 # BSD configuration
@@ -30,6 +43,11 @@ OBJ_ICON_NEXUIZ=
 
 LDFLAGS_CL=$(LDFLAGS_BSDCL)
 LDFLAGS_SV=$(LDFLAGS_BSDSV)
+LDFLAGS_SDL=$(LDFLAGS_BSDSDL)
+
+SDLCONFIG_CFLAGS=$(SDLCONFIG_UNIXCFLAGS) $(SDLCONFIG_UNIXCFLAGS_X11)
+SDLCONFIG_LIBS=$(SDLCONFIG_UNIXLIBS) $(SDLCONFIG_UNIXLIBS_X11)
+SDLCONFIG_STATICLIBS=$(SDLCONFIG_UNIXSTATICLIBS) $(SDLCONFIG_UNIXSTATICLIBS_X11)
 
 EXE_CL=$(EXE_UNIXCL)
 EXE_SV=$(EXE_UNIXSV)
@@ -38,6 +56,38 @@ EXE_CLNEXUIZ=$(EXE_UNIXCLNEXUIZ)
 EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
 EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
 
+# set these to "" if you want to use dynamic loading instead
+# zlib
+CFLAGS_LIBZ=-DLINK_TO_ZLIB
+LIB_Z=-lz
+
+# jpeg
+CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG
+LIB_JPEG=-ljpeg
+
+# ode
+ODE_CONFIG?=ode-config
+LIB_ODE=`$(ODE_CONFIG) --libs`
+CFLAGS_ODE=`$(ODE_CONFIG) --cflags` -DUSEODE -DLINK_TO_LIBODE
+
+# 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=
+
+# modplug
+# now ogg is mostly used, modplug is required rarely, keep it dlopen by default
+# LIB_SND_MODPLUG=-lmodplug
+# CFLAGS_SND_MODPLUG=-DLINK_TO_LIBMODPLUG
+LIB_SND_MODPLUG=
+CFLAGS_SND_MODPLUG=
+
 .endif
 
 
@@ -66,20 +116,30 @@ LIB_SOUND=$(LIB_SND_BSD)
 .endif
 
 
-##### BSD Make specific definitions #####
+##### Extra CFLAGS #####
+
+CFLAGS_MAKEDEP=-MD
+.ifdef DP_FS_BASEDIR
+CFLAGS_FS=-DDP_FS_BASEDIR='\"$(DP_FS_BASEDIR)\"'
+.else
+CFLAGS_FS=
+.endif
 
-MAKE:=$(MAKE)
+CFLAGS_PRELOAD=
+.ifdef DP_PRELOAD_DEPENDENCIES
+LDFLAGS_CL+=$(LDFLAGS_UNIXCL_PRELOAD)
+LDFLAGS_SV+=$(LDFLAGS_UNIXSV_PRELOAD)
+LDFLAGS_SDL+=$(LDFLAGS_UNIXSDL_PRELOAD)
+CFLAGS_PRELOAD=$(CFLAGS_UNIX_PRELOAD)
+.endif
 
-DO_LD=$(CC) -o $@ $> $(LDFLAGS)
 
+##### BSD Make specific definitions #####
 
-##### Definitions shared by all makefiles #####
-.include "makefile.inc"
+MAKE:=$(MAKE) -f BSDmakefile
 
+DO_LD=$(CC) -o ../../../$@ $> $(LDFLAGS)
 
-##### Dependency files #####
 
-DEPEND_FILES != ls *.d
-.for i in $(DEPEND_FILES)
-.      include "$i"
-.endfor
+##### Definitions shared by all makefiles #####
+.include "makefile.inc"