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 # we use CFLAGS to set default optimisations which users may 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 @printf " \e[1;33m===== Xonotic Makefile for stable and beta releases =====\e[m\n"
33 @printf "The DarkPlaces Engine builds will be named \e[1m$(CLIENT) \e[mand \e[1m$(SERVER)\e[m\n"
34 @printf "and will be preferred by \e[1mxonotic-linux-sdl.sh \e[mand \e[1mxonotic-linux-dedicated.sh \e[mscripts.\n"
36 @printf "More info is available at \e[1;36mhttps://gitlab.com/xonotic/xonotic/-/wikis/Compiling\e[m\n"
38 @echo "-O3 is already enabled for DarkPlaces Engine. 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 @printf " make server Compile \e[1m$(SERVER)\e[m\n"
50 @printf " make client Compile \e[1m$(CLIENT)\e[m\n"
54 GIT := $(shell [ -d .git ] && printf "\e[1;31mThis Makefile only supports stable releases and autobuilds, whereas you are using a git repository. To compile from git, please read https://gitlab.com/xonotic/xonotic/-/wikis/Repository_Access\e[m")
59 .EXTRA_PREREQS := $(findstring update-stable,$(MAKECMDGOALS)) $(findstring update-beta,$(MAKECMDGOALS))
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: $(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)