]> git.rm.cloudns.org Git - xonotic/xonotic.git/commitdiff
Makefile: fix build failure when PWD path contains a space bones_was_here/flatpak_updates_2 125/head
authorbones_was_here <bones_was_here@xonotic.au>
Thu, 17 Apr 2025 22:14:46 +0000 (08:14 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Sat, 19 Apr 2025 09:55:16 +0000 (19:55 +1000)
Autotools can't handle this even when quoted or escaped so it can't be
set globally.

Moves some related lines closer together.

Makefile

index 68e1264d549616ae15b7ed330b35aea5992348df..e97e5e3c6314e720b91334e8a6c0bfacfb1d7f4e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -12,16 +12,6 @@ MAKEFLAGS := -j$(shell nproc)
 # DP makefile overrides CFLAGS (exporting CFLAGS does work for d0_blind_id but so does this)
 export CC += $(CFLAGS)
 
-# d0_blind_id header location
-export CC += -I$(PWD)/source/
-# d0_blind_id static libs location
-export CC += -L$(PWD)/$(D0SRC)/.libs/
-# Player IDs
-export DP_LINK_CRYPTO=static
-# AES
-export DP_LINK_CRYPTO_RIJNDAEL=static
-
-
 .PHONY: help
 help:
        @echo
@@ -87,25 +77,27 @@ $(D0SRC)/.libs/libd0_blind_id.a $(D0SRC)/.libs/libd0_rijndael.a:
        $(MAKE) -C $(D0SRC) clean  # ensures missing .a files are created FIXME WORKAROUND
        $(MAKE) -C $(D0SRC)
 
-$(DPSRC)/darkplaces-dedicated: $(D0SRC)/.libs/libd0_blind_id.a
-       $(MAKE) -C $(DPSRC) sv-release
-$(SERVERBIN): $(DPSRC)/darkplaces-dedicated
-       cp $(DPSRC)/darkplaces-dedicated $(SERVERBIN)
-
-$(DPSRC)/darkplaces-sdl: $(D0SRC)/.libs/libd0_blind_id.a
-       $(MAKE) -C $(DPSRC) sdl-release
-$(CLIENTBIN): $(DPSRC)/darkplaces-sdl
-       cp $(DPSRC)/darkplaces-sdl $(CLIENTBIN)
+export DP_LINK_CRYPTO=static
+export DP_LINK_CRYPTO_RIJNDAEL=static
+# d0_blind_id/d0_blind_id.h and .a locations (respectively)
+D0INC=-I"$(PWD)/source/" -L"$(PWD)/$(D0SRC)/.libs/"
 
+.PHONY: all both
+all both: client server
 
 .PHONY: server
 server: $(SERVERBIN)
+$(DPSRC)/darkplaces-dedicated: $(D0SRC)/.libs/libd0_blind_id.a
+       CC='$(CC) $(D0INC)' $(MAKE) -C $(DPSRC) sv-release
+$(SERVERBIN): $(DPSRC)/darkplaces-dedicated
+       cp $(DPSRC)/darkplaces-dedicated $(SERVERBIN)
 
 .PHONY: client
 client: $(CLIENTBIN)
-
-.PHONY: all both
-all both: client server
+$(DPSRC)/darkplaces-sdl: $(D0SRC)/.libs/libd0_blind_id.a
+       CC='$(CC) $(D0INC)' $(MAKE) -C $(DPSRC) sdl-release
+$(CLIENTBIN): $(DPSRC)/darkplaces-sdl
+       cp $(DPSRC)/darkplaces-sdl $(CLIENTBIN)
 
 
 # GNU make standard directory variables for install targets