]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/Makefile
Merge branch 'Mario/qc_updates' into 'master'
[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)"'
4 QCC ?= gmqcc
5
6 QCCVERSIONFILE := qccversion.$(shell (cd server && $(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
12 QCCFLAGS ?= \
13         -std=gmqcc \
14         -O3 -flno \
15         -Werror -fno-bail-on-werror -Wall \
16         -fftepp -fftepp-predefs -Wcpp -futf8 \
17         $(QCCFLAGS_WTFS) \
18         $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
19
20 # xonotic build system overrides this by command line argument to turn off the update-cvarcount step
21 XON_BUILDSYSTEM =
22
23 all: qc
24 .PHONY: all
25
26 .PHONY: qc
27 qc: ../menu.dat ../progs.dat ../csprogs.dat
28
29 .PHONY: clean
30 clean:
31         rm -f ../progs.dat ../menu.dat ../csprogs.dat server/precache-for-csqc.inc
32
33 $(QCCVERSIONFILE):
34         $(RM) qccversion.*
35         echo This file intentionally left blank. > $@
36
37 FILES_CSPROGS = $(shell find client common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm)
38 ../csprogs.dat: $(FILES_CSPROGS) $(QCCVERSIONFILE)
39         @echo make[1]: Entering directory \`$(PWD)/client\'
40         cd client && $(QCC) $(QCCFLAGS) -DCSQC
41
42 server/precache-for-csqc.inc: $(FILES_CSPROGS)
43         sh collect-precache.sh
44
45 FILES_PROGS = $(shell find server common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm)
46 ../progs.dat: $(FILES_PROGS) $(QCCVERSIONFILE) server/precache-for-csqc.inc
47         @echo make[1]: Entering directory \`$(PWD)/server\'
48         cd server && $(QCC) $(QCCFLAGS) -DSVQC
49
50 FILES_MENU = $(shell find menu common warpzonelib -type f -not -name fteqcc.log -not -name qc.asm)
51 ../menu.dat: $(FILES_MENU) $(QCCVERSIONFILE)
52         @echo make[1]: Entering directory \`$(PWD)/menu\'
53         cd menu && $(QCC) $(QCCFLAGS) -DMENUQC
54
55 .PHONY: testcase
56 testcase:
57         cd testcase && $(QCC) $(QCCFLAGS) -DTESTCASE="$$TESTCASE"