From 4774b89a8a498bbe6875a22c48f921068e51f349 Mon Sep 17 00:00:00 2001 From: havoc Date: Fri, 29 Nov 2013 20:14:31 +0000 Subject: [PATCH] patch from Blub to make BSDmakefile work again, this also changes the 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 --- BSDmakefile | 55 +++++++++++++++++++++++++++++++++++++++------------- makefile.inc | 19 +++++++++--------- 2 files changed, 51 insertions(+), 23 deletions(-) diff --git a/BSDmakefile b/BSDmakefile index 6ca3c655..eb135cef 100644 --- a/BSDmakefile +++ b/BSDmakefile @@ -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 diff --git a/makefile.inc b/makefile.inc index 80ab84b7..e215245a 100644 --- a/makefile.inc +++ b/makefile.inc @@ -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 -- 2.39.2