]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/Makefile
Merge branch 'master' of git://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 ?= gmqcc
5
6 QCCVERSIONFILE := qccversion.$(shell $(QCC) --version > qccversion.txt && git hash-object qccversion.txt)
7
8 QCCFLAGS ?= \
9         -std=fteqcc \
10         -Werror -Wall \
11         -Wcpp \
12         -Wno-field-redeclared \
13         -Wno-double-declaration \
14         -Wno-uninitialized-global \
15         -Wno-parenthesis \
16         -O3 \
17         -fadjust-vector-fields \
18         -fftepp \
19         -fftepp-predefs \
20         -frelaxed-switch \
21         -fshort-logic \
22         -fno-perl-logic \
23         -ftranslatable-strings \
24         -fno-initialized-nonconstants \
25         -fno-assign-function-types \
26         -flno \
27         -fcorrect-ternary \
28         -fno-single-vector-defs \
29         -fcorrect-logic \
30         -ftrue-empty-strings \
31         -fno-false-empty-strings \
32         -futf8 \
33         -fno-bail-on-werror \
34         -floop-labels \
35         -funtyped-nil \
36         -fno-permissive \
37         -fvariadic-args \
38         $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
39
40 # xonotic build system overrides this by command line argument to turn off the update-cvarcount step
41 XON_BUILDSYSTEM =
42
43 all: qc
44
45 .PHONY: qc
46 qc:
47         $(MAKE) qc-recursive
48
49 .PHONY: qc-recursive
50 qc-recursive: ../menu.dat ../progs.dat ../csprogs.dat
51
52 .PHONY: clean
53 clean:
54         rm -f ../progs.dat ../menu.dat ../csprogs.dat server/precache-for-csqc.inc
55
56 $(QCCVERSIONFILE):
57         $(RM) qccversion.*
58         echo This file intentionally left blank. > $@
59
60 FILES_CSPROGS = $(shell find client common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
61 ../csprogs.dat: $(FILES_CSPROGS) $(QCCVERSIONFILE)
62         @echo make[1]: Entering directory \`$(PWD)/client\'
63         cd client && $(QCC) $(QCCFLAGS)
64
65 server/precache-for-csqc.inc: $(FILES_CSPROGS)
66         sh collect-precache.sh
67
68 FILES_PROGS = $(shell find server common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
69 ../progs.dat: $(FILES_PROGS) $(QCCVERSIONFILE) server/precache-for-csqc.inc
70         @echo make[1]: Entering directory \`$(PWD)/server\'
71         cd server && $(QCC) $(QCCFLAGS)
72
73 FILES_MENU = $(shell find menu common warpzonelib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
74 ../menu.dat: $(FILES_MENU) $(QCCVERSIONFILE)
75         @echo make[1]: Entering directory \`$(PWD)/menu\'
76         cd menu && $(QCC) $(QCCFLAGS)
77
78 .PHONY: testcase
79 testcase:
80         cd testcase && $(QCC) $(QCCFLAGS) -DTESTCASE="$$TESTCASE"