]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/Makefile
badc3ac1c2ca5cd0a721278f4647e8ade92fb2e9
[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
4 ifdef XONOTIC_USE_FTEQCC
5 FTEQCC ?= gmqcc
6 FTEQCCFLAGS_WATERMARK ?=
7 FTEQCCFLAGS ?= -std=fteqcc -fshort-logic -O1 -flno $(FTEQCCFLAGS_EXTRA) $(FTEQCCFLAGS_WATERMARK)
8 FTEQCCFLAGS_PROGS ?=
9 FTEQCCFLAGS_MENU ?=
10 else
11 FTEQCC ?= fteqcc
12 FTEQCCFLAGS_WATERMARK ?= -DWATERMARK='"$(shell git describe)"' -DCVAR_POPCON
13 FTEQCCFLAGS ?= -Werror -Wno-Q302 -O3 -Ono-return_only -fno-fastarrays $(FTEQCCFLAGS_EXTRA) $(FTEQCCFLAGS_WATERMARK)
14 FTEQCCFLAGS_PROGS ?=
15 FTEQCCFLAGS_MENU ?=
16 endif
17
18 # NOTE: use -DUSE_FTE instead of -TFTE here!
19 # It will automagically add an engine check with -TID and then change back to -TFTE
20 FTEQCCFLAGS_CSPROGS ?= 
21
22 # xonotic build system overrides this by command line argument to turn off the update-cvarcount step
23 XON_BUILDSYSTEM =
24
25 all: qc
26
27 .PHONY: qc
28 qc:
29         $(MAKE) qc-recursive
30
31 .PHONY: qc-recursive
32 qc-recursive: ../menu.dat ../progs.dat ../csprogs.dat
33
34 .PHONY: clean
35 clean:
36         rm -f ../progs.dat ../menu.dat ../csprogs.dat
37
38 FILES_CSPROGS = $(shell find client common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
39 ../csprogs.dat: $(FILES_CSPROGS)
40         @echo make[1]: Entering directory \`$(PWD)/client\'
41         cd client && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_CSPROGS)
42
43 FILES_PROGS = $(shell find server common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
44 ../progs.dat: $(FILES_PROGS)
45         @echo make[1]: Entering directory \`$(PWD)/server\'
46         cd server && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_PROGS)
47
48 FILES_MENU = $(shell find menu common warpzonelib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
49 ../menu.dat: $(FILES_MENU)
50         @echo make[1]: Entering directory \`$(PWD)/menu\'
51         cd menu && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_MENU)
52
53 .PHONY: testcase
54 testcase:
55         cd testcase && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_CSPROGS) -DTESTCASE="$$TESTCASE"