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