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