]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/Makefile
write compiler options more explicitly
[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 $(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         -O3 \
17         -fftepp \
18         -ftranslatable-strings \
19         -fadjust-vector-fields \
20         -fassign-function-types \
21         -fcorrect-ternary \
22         -fshort-logic \
23         -flno \
24         $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
25 else
26 # this. is. fteqccccccccccccccccccc!
27 QCCFLAGS ?= -Werror -Wno-Q302 -O3 -Ono-return_only -fno-fastarrays $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
28 endif
29
30 # xonotic build system overrides this by command line argument to turn off the update-cvarcount step
31 XON_BUILDSYSTEM =
32
33 all: qc
34
35 .PHONY: qc
36 qc:
37         $(MAKE) qc-recursive
38
39 .PHONY: qc-recursive
40 qc-recursive: ../menu.dat ../progs.dat ../csprogs.dat
41
42 .PHONY: clean
43 clean:
44         rm -f ../progs.dat ../menu.dat ../csprogs.dat
45
46 FILES_CSPROGS = $(shell find client common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
47 ../csprogs.dat: $(FILES_CSPROGS)
48         @echo make[1]: Entering directory \`$(PWD)/client\'
49         cd client && $(QCC) $(QCCFLAGS)
50
51 FILES_PROGS = $(shell find server common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
52 ../progs.dat: $(FILES_PROGS)
53         @echo make[1]: Entering directory \`$(PWD)/server\'
54         cd server && $(QCC) $(QCCFLAGS)
55
56 FILES_MENU = $(shell find menu common warpzonelib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
57 ../menu.dat: $(FILES_MENU)
58         @echo make[1]: Entering directory \`$(PWD)/menu\'
59         cd menu && $(QCC) $(QCCFLAGS)
60
61 .PHONY: testcase
62 testcase:
63         cd testcase && $(QCC) $(QCCFLAGS) -DTESTCASE="$$TESTCASE"