]> 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 # We eventually need to get rid of these.
9 QCCFLAGS_WTFS ?= \
10         -Wno-field-redeclared \
11         -Wno-double-declaration \
12
13 QCCFLAGS ?= \
14         -std=gmqcc \
15         -O3 -flno \
16         -Werror -fno-bail-on-werror -Wall \
17         -fftepp -fftepp-predefs -Wcpp -futf8 \
18         $(QCCFLAGS_WTFS) \
19         $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
20
21 # xonotic build system overrides this by command line argument to turn off the update-cvarcount step
22 XON_BUILDSYSTEM =
23
24 all: qc
25
26 .PHONY: qc
27 qc:
28         $(MAKE) qc-recursive
29
30 .PHONY: qc-recursive
31 qc-recursive: ../menu.dat ../progs.dat ../csprogs.dat
32
33 .PHONY: clean
34 clean:
35         rm -f ../progs.dat ../menu.dat ../csprogs.dat server/precache-for-csqc.inc
36
37 $(QCCVERSIONFILE):
38         $(RM) qccversion.*
39         echo This file intentionally left blank. > $@
40
41 FILES_CSPROGS = $(shell find client common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
42 ../csprogs.dat: $(FILES_CSPROGS) $(QCCVERSIONFILE)
43         @echo make[1]: Entering directory \`$(PWD)/client\'
44         cd client && $(QCC) $(QCCFLAGS)
45
46 server/precache-for-csqc.inc: $(FILES_CSPROGS)
47         sh collect-precache.sh
48
49 FILES_PROGS = $(shell find server common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
50 ../progs.dat: $(FILES_PROGS) $(QCCVERSIONFILE) server/precache-for-csqc.inc
51         @echo make[1]: Entering directory \`$(PWD)/server\'
52         cd server && $(QCC) $(QCCFLAGS)
53
54 FILES_MENU = $(shell find menu common warpzonelib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
55 ../menu.dat: $(FILES_MENU) $(QCCVERSIONFILE)
56         @echo make[1]: Entering directory \`$(PWD)/menu\'
57         cd menu && $(QCC) $(QCCFLAGS)
58
59 .PHONY: testcase
60 testcase:
61         cd testcase && $(QCC) $(QCCFLAGS) -DTESTCASE="$$TESTCASE"