]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/Makefile
Merge branch 'master' into TimePath/csqc_viewmodels
[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         -DNDEBUG=1 \
26         $(QCCFLAGS_FEATURES) \
27         $(QCCFLAGS_EXTRA)
28
29 # xonotic build system overrides this by command line argument to turn off the update-cvarcount step
30 XON_BUILDSYSTEM =
31
32 .PHONY: all
33 all: qc
34
35 .PHONY: qc
36 qc: ../menu.dat ../progs.dat ../csprogs.dat
37
38 .PHONY: clean
39 clean:
40         rm -f ../progs.dat ../menu.dat ../csprogs.dat
41
42 $(QCCVERSIONFILE):
43         $(RM) qccversion.*
44         echo This file intentionally left blank. > $@
45
46 FILES_CSPROGS = $(shell find lib common client -type f)
47 ../csprogs.dat: $(FILES_CSPROGS) $(QCCVERSIONFILE)
48         @echo make[1]: Entering directory \`$(PWD)/client\'
49         cd client && $(QCC) $(QCCFLAGS) -DCSQC
50
51 FILES_PROGS = $(shell find lib common server -type f)
52 ../progs.dat: $(FILES_PROGS) $(QCCVERSIONFILE)
53         @echo make[1]: Entering directory \`$(PWD)/server\'
54         cd server && $(QCC) $(QCCFLAGS) -DSVQC
55
56 FILES_MENU = $(shell find lib common menu -type f)
57 ../menu.dat: $(FILES_MENU) $(QCCVERSIONFILE)
58         @echo make[1]: Entering directory \`$(PWD)/menu\'
59         cd menu && $(QCC) $(QCCFLAGS) -DMENUQC
60
61 .PHONY: testcase
62 testcase:
63         cd testcase && $(QCC) $(QCCFLAGS) -DTESTCASE="$$TESTCASE"