]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/Makefile
Merge branch 'TimePath/cleanup'
[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_FEATURES ?= \
13         -DVEHICLES_ENABLED=1 \
14         -DVEHICLES_USE_ODE=0 \
15         -DBUILD_MOD=$(BUILD_MOD)
16
17 QCCFLAGS ?= \
18         -std=gmqcc \
19         -O3 \
20         -Werror -Wall -Wcpp \
21         $(QCCFLAGS_WTFS) \
22         -fftepp -flno -futf8 -fno-bail-on-werror -fftepp-predefs \
23         -frelaxed-switch -freturn-assignments \
24         $(QCCFLAGS_WATERMARK) \
25         $(QCCFLAGS_FEATURES) \
26         $(QCCFLAGS_EXTRA)
27
28 # xonotic build system overrides this by command line argument to turn off the update-cvarcount step
29 XON_BUILDSYSTEM =
30
31 .PHONY: all
32 all: qc
33
34 .PHONY: qc
35 qc: ../menu.dat ../progs.dat ../csprogs.dat
36
37 .PHONY: clean
38 clean:
39         rm -f ../progs.dat ../menu.dat ../csprogs.dat
40
41 $(QCCVERSIONFILE):
42         $(RM) qccversion.*
43         echo This file intentionally left blank. > $@
44
45 FILES_CSPROGS = $(shell find lib common client -type f)
46 ../csprogs.dat: $(FILES_CSPROGS) $(QCCVERSIONFILE)
47         @echo make[1]: Entering directory \`$(PWD)/client\'
48         cd client && $(QCC) $(QCCFLAGS) -DCSQC
49
50 FILES_PROGS = $(shell find lib common server -type f)
51 ../progs.dat: $(FILES_PROGS) $(QCCVERSIONFILE)
52         @echo make[1]: Entering directory \`$(PWD)/server\'
53         cd server && $(QCC) $(QCCFLAGS) -DSVQC
54
55 FILES_MENU = $(shell find lib common menu -type f)
56 ../menu.dat: $(FILES_MENU) $(QCCVERSIONFILE)
57         @echo make[1]: Entering directory \`$(PWD)/menu\'
58         cd menu && $(QCC) $(QCCFLAGS) -DMENUQC
59
60 .PHONY: testcase
61 testcase:
62         cd testcase && $(QCC) $(QCCFLAGS) -DTESTCASE="$$TESTCASE"