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/
19 export DP_LINK_CRYPTO=static
21 export DP_LINK_CRYPTO_RIJNDAEL=static
27 @printf " \e[1;33m===== Xonotic Makefile for stable and beta releases =====\e[m\n"
29 @printf "The DarkPlaces Engine builds will be named \e[1m$(CLIENT) \e[mand \e[1m$(SERVER)\e[m\n"
30 @printf "and will be preferred by \e[1mxonotic-linux-sdl.sh \e[mand \e[1mxonotic-linux-dedicated.sh \e[mscripts.\n"
32 @printf "More info is available at \e[1;36mhttps://gitlab.com/xonotic/xonotic/-/wikis/Compiling\e[m\n"
34 @echo "-O3 is already enabled for DarkPlaces Engine. Do not add any math flags!"
36 @echo "MAKEFLAGS=$(MAKEFLAGS)"
37 @echo "CFLAGS= $(CFLAGS)"
39 @echo " make clean-sources Delete build objects"
40 @echo " make clean Delete engine builds and build objects"
42 @echo " make update-stable Update to the latest stable release via rsync"
43 @echo " make update-beta Update to the latest beta autobuild via rsync"
45 @printf " make server Compile \e[1m$(SERVER)\e[m\n"
46 @printf " make client Compile \e[1m$(CLIENT)\e[m\n"
50 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")
56 # If requested, these targets must always run first:
57 .EXTRA_PREREQS := $(filter clean update-stable update-beta, $(MAKECMDGOALS))
61 $(MAKE) -C $(DPSRC) clean
62 ( $(MAKE) -C $(D0SRC) clean || true ) # autotools may not have created the Makefile yet
63 clean-sources: .EXTRA_PREREQS = # prevents circular dependency
67 $(RM) $(CLIENT) $(SERVER)
71 misc/tools/rsync-updater/update-to-release.sh
75 misc/tools/rsync-updater/update-to-autobuild.sh
78 $(D0SRC)/.libs/libd0_blind_id.a $(D0SRC)/.libs/libd0_rijndael.a:
79 ( cd $(D0SRC) && ./autogen.sh && ./configure --enable-static --disable-shared )
80 $(MAKE) -C $(D0SRC) clean # ensures missing .a files are created FIXME WORKAROUND
83 $(DPSRC)/darkplaces-dedicated: $(D0SRC)/.libs/libd0_blind_id.a
84 $(MAKE) -C $(DPSRC) sv-release
85 $(SERVER): $(DPSRC)/darkplaces-dedicated
86 cp $(DPSRC)/darkplaces-dedicated $(SERVER)
88 $(DPSRC)/darkplaces-sdl: $(D0SRC)/.libs/libd0_blind_id.a
89 $(MAKE) -C $(DPSRC) sdl-release
90 $(CLIENT): $(DPSRC)/darkplaces-sdl
91 cp $(DPSRC)/darkplaces-sdl $(CLIENT)