]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
patch from Blub to make BSDmakefile work again, this also changes the
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 29 Nov 2013 20:14:31 +0000 (20:14 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Wed, 18 Dec 2013 10:02:37 +0000 (11:02 +0100)
build directories from obj/ to build-obj/ due to pmake having a peculiar
fondness for obj/

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12028 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=4774b89a8a498bbe6875a22c48f921068e51f349

BSDmakefile
makefile.inc

index 6ca3c655ea2315445804648ded01e6483f6fc173..eb135cef8fc6ea5d05dcac9c927f9fe8efbee837 100644 (file)
@@ -22,23 +22,30 @@ 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
 
+# Link options
+DP_LINK_ZLIB?=shared
+DP_LINK_JPEG?=shared
+DP_LINK_ODE?=dlopen
+DP_LINK_CRYPTO?=dlopen
+DP_LINK_CRYPTO_RIJNDAEL?=dlopen
+
 ###### Optional features #####
 DP_CDDA?=enabled
 .if $(DP_CDDA) == "enabled"
-       OBJ_SDLCD=$(OBJ_CD_COMMON) cd_sdl.o
-       OBJ_BSDCD=$(OBJ_CD_COMMON) cd_bsd.o
+  OBJ_SDLCD=$(OBJ_CD_COMMON) cd_sdl.o
+  OBJ_BSDCD=$(OBJ_CD_COMMON) cd_bsd.o
 .else
-       OBJ_SDLCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
-       OBJ_BSDCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
+  OBJ_SDLCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
+  OBJ_BSDCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
 .endif
 
 DP_VIDEO_CAPTURE?=enabled
-.if $(DP_VIDEO_CAPTURE == "enabled"
-       CFLAGS_VIDEO_CAPTURE=-DCONFIG_VIDEO_CAPTURE
-       OBJ_VIDEO_CAPTURE= cap_avi.o cap_ogg.o
+.if $(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=
+  CFLAGS_VIDEO_CAPTURE=
+  OBJ_VIDEO_CAPTURE =
 .endif
 
 # X11 libs
@@ -76,28 +83,48 @@ EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
 
 # set these to "" if you want to use dynamic loading instead
 # zlib
+.if $(DP_LINK_ZLIB) == "shared"
 CFLAGS_LIBZ=-DLINK_TO_ZLIB
 LIB_Z=-lz
+.else
+CFLAGS_LIBZ=
+LIB_Z=
+.endif
 
 # jpeg
+.if $(DP_LINK_JPEG) == "shared"
 CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG
 LIB_JPEG=-ljpeg
+.else
+CFLAGS_LIBJPEG=
+LIB_JPEG=
+.endif
 
 # ode
+.if $(DP_LINK_ODE) == "shared"
 ODE_CONFIG?=ode-config
 LIB_ODE=`$(ODE_CONFIG) --libs`
 CFLAGS_ODE=`$(ODE_CONFIG) --cflags` -DUSEODE -DLINK_TO_LIBODE
+.else
+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
+.if $(DP_LINK_CRYPTO) == "shared"
+LIB_CRYPTO=-ld0_blind_id
+CFLAGS_CRYPTO=-DLINK_TO_CRYPTO
+.else
 LIB_CRYPTO=
 CFLAGS_CRYPTO=
+.endif
+.if $(DP_LINK_CRYPTO_RIJNDAEL) == "shared"
+LIB_CRYPTO_RIJNDAEL=-ld0_rijndael
+CFLAGS_CRYPTO_RIJNDAEL=-DLINK_TO_CRYPTO_RIJNDAEL
+.else
 LIB_CRYPTO_RIJNDAEL=
 CFLAGS_CRYPTO_RIJNDAEL=
+.endif
 
 .endif
 
index 80ab84b7735c114a653d155b0fdc34305e2b5a27..e215245af0532d523886f6f87fd0008980dbae55 100644 (file)
@@ -426,8 +426,8 @@ bin-debug :
        $(CHECKLEVEL1)
        @echo
        @echo '========== $(EXE) (debug) =========='
-       $(MAKE) prepare BUILD_DIR=obj/debug/$(EXE)
-       $(MAKE) -C obj/debug/$(EXE) -f ../../../$(MAKEFILE) $(EXE) \
+       $(MAKE) prepare BUILD_DIR=build-obj/debug/$(EXE)
+       $(MAKE) -C build-obj/debug/$(EXE) $(EXE) \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
                CFLAGS='$(CFLAGS_COMMON) $(CFLAGS_FEATURES) $(CFLAGS_EXTRA) $(CFLAGS_DEBUG) $(OPTIM_DEBUG)'\
                LDFLAGS='$(LDFLAGS_DEBUG) $(LDFLAGS_COMMON)' LEVEL=2
@@ -436,8 +436,8 @@ bin-profile :
        $(CHECKLEVEL1)
        @echo
        @echo '========== $(EXE) (profile) =========='
-       $(MAKE) prepare BUILD_DIR=obj/profile/$(EXE)
-       $(MAKE) -C obj/profile/$(EXE) -f ../../../$(MAKEFILE) $(EXE) \
+       $(MAKE) prepare BUILD_DIR=build-obj/profile/$(EXE)
+       $(MAKE) -C build-obj/profile/$(EXE) $(EXE) \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
                CFLAGS='$(CFLAGS_COMMON) $(CFLAGS_FEATURES) $(CFLAGS_EXTRA) $(CFLAGS_PROFILE) $(OPTIM_RELEASE)'\
                LDFLAGS='$(LDFLAGS_PROFILE) $(LDFLAGS_COMMON)' LEVEL=2
@@ -446,8 +446,8 @@ bin-release :
        $(CHECKLEVEL1)
        @echo
        @echo '========== $(EXE) (release) =========='
-       $(MAKE) prepare BUILD_DIR=obj/release/$(EXE)
-       $(MAKE) -C obj/release/$(EXE) -f ../../../$(MAKEFILE) $(EXE) \
+       $(MAKE) prepare BUILD_DIR=build-obj/release/$(EXE)
+       $(MAKE) -C build-obj/release/$(EXE) $(EXE) \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
                CFLAGS='$(CFLAGS_COMMON) $(CFLAGS_FEATURES) $(CFLAGS_EXTRA) $(CFLAGS_RELEASE) $(OPTIM_RELEASE)'\
                LDFLAGS='$(LDFLAGS_RELEASE) $(LDFLAGS_COMMON)' LEVEL=2
@@ -457,8 +457,8 @@ bin-release-profile :
        $(CHECKLEVEL1)
        @echo
        @echo '========== $(EXE) (release) =========='
-       $(MAKE) prepare BUILD_DIR=obj/release-profile/$(EXE)
-       $(MAKE) -C obj/release-profile/$(EXE) -f ../../../$(MAKEFILE) $(EXE) \
+       $(MAKE) prepare BUILD_DIR=build-obj/release-profile/$(EXE)
+       $(MAKE) -C build-obj/release-profile/$(EXE) $(EXE) \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
                CFLAGS='$(CFLAGS_COMMON) $(CFLAGS_FEATURES) $(CFLAGS_EXTRA) $(CFLAGS_RELEASE_PROFILE) $(OPTIM_RELEASE)'\
                LDFLAGS='$(LDFLAGS_RELEASE) $(LDFLAGS_COMMON)' LEVEL=2
@@ -467,6 +467,7 @@ bin-release-profile :
 prepare :
        $(CMD_MKDIR) $(BUILD_DIR)
        $(CMD_CP) makefile.inc $(BUILD_DIR)/
+       $(CMD_CP) $(MAKEFILE) $(BUILD_DIR)/
 
 #this checks USEODE when compiling so it needs the ODE flags as well
 prvm_cmds.o: prvm_cmds.c
@@ -566,7 +567,7 @@ clean:
        -$(CMD_RM) $(EXE_SDLNEXUIZ)
        -$(CMD_RM) *.o
        -$(CMD_RM) *.d
-       -$(CMD_RM) obj/
+       -$(CMD_RM) build-obj/
 
 clean-profile: clean
        -$(CMD_RM) *.gcda