1 DPSRC = source/darkplaces
2 D0SRC = source/d0_blind_id
3 CLIENT = xonotic-local-sdl
4 SERVER = xonotic-local-dedicated
6 # CC and MAKEFLAGS are always set so ?= has no effect, therefore
7 # use CFLAGS to set default optimisations and support user override
8 CFLAGS ?= -pipe -march=native -mtune=native -flto=auto
9 # user can override this with make -j
10 MAKEFLAGS = -j$(shell nproc)
11 # DP makefile overrides CFLAGS (exporting CFLAGS does work for d0_blind_id but so does this)
12 export CC += $(CFLAGS)
14 # d0_blind_id header location
15 export CC += -I$(PWD)/source/
16 # d0_blind_id static libs location
17 export CC += -L$(PWD)/$(D0SRC)/.libs/
18 # Player IDs: DP_LINK_CRYPTO needs to be set (else it defaults to "dlopen"),
19 # it should be set to "shared" but then LIB_CRYPTO gets overridden in DP makefile,
20 # and we need to set LIB_CRYPTO such that libgmp gets linked
21 export DP_LINK_CRYPTO=foo
22 export CFLAGS_CRYPTO=-DLINK_TO_CRYPTO
23 export LIB_CRYPTO=-ld0_blind_id -lgmp
25 export DP_LINK_CRYPTO_RIJNDAEL=shared
31 @echo " ===== Xonotic Makefile for stable and beta releases ====="
33 @echo "The DarkPlaces engine builds will be named $(CLIENT) and $(SERVER) and"
34 @echo "will be preferred by the xonotic-linux-sdl.sh and xonotic-linux-dedicated.sh scripts."
36 @echo "For more info, see https://gitlab.com/xonotic/xonotic/-/wikis/Compiling"
38 @echo "-O3 is already enabled for DarkPlaces. Do not add any math flags!"
40 @echo "MAKEFLAGS=$(MAKEFLAGS)"
41 @echo "CFLAGS= $(CFLAGS)"
43 @echo " make clean-sources Delete build objects"
44 @echo " make clean Delete engine builds and build objects"
46 @echo " make update-stable Update to the latest stable release via rsync"
47 @echo " make update-beta Update to the latest daily autobuild via rsync"
49 @echo " make server Compile $(SERVER)"
50 @echo " make client Compile $(CLIENT)"
56 @if [ -d .git ]; then \
57 echo "To compile from git sources, please use ./all instead!"; \
63 $(MAKE) -C $(DPSRC) clean
64 $(MAKE) -C $(D0SRC) clean
68 $(RM) $(CLIENT) $(SERVER)
72 misc/tools/rsync-updater/update-to-release.sh
76 misc/tools/rsync-updater/update-to-autobuild.sh
79 ( cd $(D0SRC) && ./autogen.sh && ./configure --enable-static --disable-shared )
82 d0_blind_id: nogit $(D0SRC)/Makefile
87 $(MAKE) -C $(DPSRC) sv-release
88 cp -v $(DPSRC)/darkplaces-dedicated $(SERVER)
92 $(MAKE) -C $(DPSRC) sdl-release
93 cp -v $(DPSRC)/darkplaces-sdl $(CLIENT)