]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/Makefile
Add checkboxes in the menu for hud_dynamic_follow and hud_dynamic_shake
[xonotic/xonotic-data.pk3dir.git] / qcsrc / Makefile
1 SCM := $(shell if [ -d .svn ]; then echo svn; elif [ -d ../.git ]; then echo git; fi)
2 PERL ?= perl
3 QCCFLAGS_WATERMARK ?= $(shell git describe)
4 CPP := cc -xc -E
5 QCC ?= gmqcc
6 NDEBUG ?= 1
7 PROGS_OUT ?= $(CURDIR)/..
8 BUILD_MOD ?= 0
9
10 QCCVERSIONFILE := qccversion.$(shell (cd server && $(QCC) --version) > qccversion.txt && git hash-object qccversion.txt)
11
12 # We eventually need to get rid of these
13 QCCFLAGS_WTFS ?= \
14         -Wno-field-redeclared
15
16 QCCDEFS ?= \
17         -DWATERMARK="$(QCCFLAGS_WATERMARK)" \
18         -DNDEBUG=$(NDEBUG) \
19         -DBUILD_MOD=$(BUILD_MOD) \
20         $(QCCDEFS_EXTRA)
21
22 # -Ooverlap-locals is required
23 QCCFLAGS ?= \
24         -std=gmqcc \
25         -Ooverlap-locals \
26         -O3 \
27         -Werror -Wall \
28         $(QCCFLAGS_WTFS) \
29         -flno -futf8 -fno-bail-on-werror \
30         -frelaxed-switch -freturn-assignments \
31         $(QCCFLAGS_EXTRA)
32
33 # xonotic build system overrides this by command line argument to turn off the update-cvarcount step
34 XON_BUILDSYSTEM =
35
36 .PHONY: all
37 all: qc
38
39 .PHONY: qc
40 qc: $(PROGS_OUT)/menu.dat $(PROGS_OUT)/progs.dat $(PROGS_OUT)/csprogs.dat
41
42 .PHONY: clean
43 clean:
44         rm -f $(PROGS_OUT)/csprogs.dat
45         rm -f $(PROGS_OUT)/progs.dat
46         rm -f $(PROGS_OUT)/menu.dat
47         rm -f ../.tmp/*.qc
48         rm -f ../.tmp/*.d
49         rm -f ../.tmp/*.txt
50
51 $(QCCVERSIONFILE):
52         $(RM) qccversion.*
53         echo This file intentionally left blank. > $@
54
55 export QCC
56 export CPP
57 export QCCDEFS
58 export QCCFLAGS
59
60 $(PROGS_OUT)/csprogs.dat: client/progs.inc $(QCCVERSIONFILE)
61         @echo make[1]: Entering directory \`$(PWD)/client\'
62         sh ./qcc.sh client $@ $<
63 -include ../.tmp/client.d
64
65 $(PROGS_OUT)/progs.dat: server/progs.inc $(QCCVERSIONFILE)
66         @echo make[1]: Entering directory \`$(PWD)/server\'
67         sh ./qcc.sh server $@ $<
68 -include ../.tmp/server.d
69
70 $(PROGS_OUT)/menu.dat: menu/progs.inc $(QCCVERSIONFILE)
71         @echo make[1]: Entering directory \`$(PWD)/menu\'
72         sh ./qcc.sh menu $@ $<
73 -include ../.tmp/menu.d
74
75 .PHONY: testcase
76 testcase:
77         cd testcase && $(QCC) $(QCCDEFS) $(QCCFLAGS) -DTESTCASE="$$TESTCASE"