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