]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/Makefile
Merge branch 'master' into terencehill/quickmenu
[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 ?= gmqcc
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-uninitialized-global \
15         -O3 \
16         -fadjust-vector-fields \
17         -fftepp \
18         -fftepp-predefs \
19         -frelaxed-switch \
20         -fshort-logic \
21         -fno-perl-logic \
22         -ftranslatable-strings \
23         -fno-initialized-nonconstants \
24         -fno-assign-function-types \
25         -flno \
26         -fcorrect-ternary \
27         -fno-single-vector-defs \
28         -fcorrect-logic \
29         -ftrue-empty-strings \
30         -fno-false-empty-strings \
31         -futf8 \
32         -fno-bail-on-werror \
33         -floop-labels \
34         -funtyped-nil \
35         -fno-permissive \
36         -fvariadic-args \
37         $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
38 else
39 # this. is. fteqccccccccccccccccccc!
40 QCCFLAGS ?= -Werror -Wno-Q302 -O3 -Ono-return_only -fno-fastarrays $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
41 endif
42
43 # xonotic build system overrides this by command line argument to turn off the update-cvarcount step
44 XON_BUILDSYSTEM =
45
46 all: qc
47
48 .PHONY: qc
49 qc:
50         $(MAKE) qc-recursive
51
52 .PHONY: qc-recursive
53 qc-recursive: ../menu.dat ../progs.dat ../csprogs.dat
54
55 .PHONY: clean
56 clean:
57         rm -f ../progs.dat ../menu.dat ../csprogs.dat
58
59 FILES_CSPROGS = $(shell find client common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
60 ../csprogs.dat: $(FILES_CSPROGS)
61         @echo make[1]: Entering directory \`$(PWD)/client\'
62         cd client && $(QCC) $(QCCFLAGS)
63
64 FILES_PROGS = $(shell find server common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
65 ../progs.dat: $(FILES_PROGS)
66         @echo make[1]: Entering directory \`$(PWD)/server\'
67         cd server && $(QCC) $(QCCFLAGS)
68
69 FILES_MENU = $(shell find menu common warpzonelib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
70 ../menu.dat: $(FILES_MENU)
71         @echo make[1]: Entering directory \`$(PWD)/menu\'
72         cd menu && $(QCC) $(QCCFLAGS)
73
74 .PHONY: testcase
75 testcase:
76         cd testcase && $(QCC) $(QCCFLAGS) -DTESTCASE="$$TESTCASE"