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