]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/Makefile
Merge remote-tracking branch 'origin/Mario/vote_mapchange_fix'
[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 ?= -DWATERMARK='"$(shell git describe)"' -DCVAR_POPCON=1
4 QCC ?= fteqcc
5
6 VERSION_MESSAGE = $(shell cd server && $(QCC) --version --help)
7 ifneq (,$(findstring GMQCC,$(VERSION_MESSAGE)))
8 # this is gmqcc
9 QCCFLAGS ?= \
10         -std=fteqcc \
11         -Werror -Wall \
12         -Wno-field-redeclared \
13         -Wno-double-declaration \
14         -Wno-assign-function-types \
15         -Wno-unused-variable \
16         -Wno-uninitialized-global \
17         -O3 \
18         -fftepp \
19         -ftranslatable-strings \
20         -fadjust-vector-fields \
21         -fassign-function-types \
22         -fcorrect-ternary \
23         -fcorrect-logic \
24         -ftrue-empty-strings \
25         -funtyped-nil \
26         -fshort-logic \
27         -flno \
28         $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
29 else
30 # this. is. fteqccccccccccccccccccc!
31 QCCFLAGS ?= -Werror -Wno-Q302 -O3 -Ono-return_only -fno-fastarrays $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
32 endif
33
34 # xonotic build system overrides this by command line argument to turn off the update-cvarcount step
35 XON_BUILDSYSTEM =
36
37 all: qc
38
39 .PHONY: qc
40 qc:
41         $(MAKE) qc-recursive
42
43 .PHONY: qc-recursive
44 qc-recursive: ../menu.dat ../progs.dat ../csprogs.dat
45
46 .PHONY: clean
47 clean:
48         rm -f ../progs.dat ../menu.dat ../csprogs.dat
49
50 FILES_CSPROGS = $(shell find client common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
51 ../csprogs.dat: $(FILES_CSPROGS)
52         @echo make[1]: Entering directory \`$(PWD)/client\'
53         cd client && $(QCC) $(QCCFLAGS)
54
55 FILES_PROGS = $(shell find server common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
56 ../progs.dat: $(FILES_PROGS)
57         @echo make[1]: Entering directory \`$(PWD)/server\'
58         cd server && $(QCC) $(QCCFLAGS)
59
60 FILES_MENU = $(shell find menu common warpzonelib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
61 ../menu.dat: $(FILES_MENU)
62         @echo make[1]: Entering directory \`$(PWD)/menu\'
63         cd menu && $(QCC) $(QCCFLAGS)
64
65 .PHONY: testcase
66 testcase:
67         cd testcase && $(QCC) $(QCCFLAGS) -DTESTCASE="$$TESTCASE"