]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/Makefile
Merge remote-tracking branch 'origin/master' into terencehill/menu_remove_tab_title
[xonotic/xonotic-data.pk3dir.git] / qcsrc / Makefile
index 618e3ad4e234fc465e927bd80493429d9d5bcc16..f53707e829f482c39e0f6dcdee0c54d54d4aa3c1 100644 (file)
@@ -1,47 +1,62 @@
 SCM := $(shell if [ -d .svn ]; then echo svn; elif [ -d ../.git ]; then echo git; fi)
-FTEQCC ?= fteqcc
 PERL ?= perl
+QCCFLAGS_WATERMARK ?= -DWATERMARK='"$(shell git describe)"'
+QCC ?= gmqcc
 
-FTEQCCFLAGS_WATERMARK ?= -DWATERMARK='"$(shell git describe)"' -DCVAR_POPCON
-FTEQCCFLAGS ?= -Werror -Wno-Q302 -O3 -fno-fastarrays $(FTEQCCFLAGS_EXTRA) $(FTEQCCFLAGS_WATERMARK)
-FTEQCCFLAGS_PROGS ?=
-FTEQCCFLAGS_MENU ?=
+QCCVERSIONFILE := qccversion.$(shell (cd server && $(QCC) --version) > qccversion.txt && git hash-object qccversion.txt)
 
-# NOTE: use -DUSE_FTE instead of -TFTE here!
-# It will automagically add an engine check with -TID and then change back to -TFTE
-FTEQCCFLAGS_CSPROGS ?= 
+# We eventually need to get rid of these.
+QCCFLAGS_WTFS ?= \
+       -Wno-field-redeclared
+
+QCCFLAGS ?= \
+       -std=gmqcc \
+       -O3 -flno \
+       -Werror -fno-bail-on-werror -Wall \
+       -fftepp -fftepp-predefs -Wcpp -futf8 \
+       $(QCCFLAGS_WTFS) \
+       $(QCCFLAGS_FEATURES) \
+       $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
+
+QCCFLAGS_FEATURES ?= \
+       -DVEHICLES_ENABLED=1 \
+       -DVEHICLES_USE_ODE=0
 
 # xonotic build system overrides this by command line argument to turn off the update-cvarcount step
 XON_BUILDSYSTEM =
 
 all: qc
+.PHONY: all
 
 .PHONY: qc
-qc:
-       $(MAKE) qc-recursive
-
-.PHONY: qc-recursive
-qc-recursive: ../menu.dat ../progs.dat ../csprogs.dat
+qc: ../menu.dat ../progs.dat ../csprogs.dat
 
 .PHONY: clean
 clean:
-       rm -f ../progs.dat ../menu.dat ../csprogs.dat
+       rm -f ../progs.dat ../menu.dat ../csprogs.dat server/precache-for-csqc.inc
 
-FILES_CSPROGS = $(shell find client common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
-../csprogs.dat: $(FILES_CSPROGS)
+$(QCCVERSIONFILE):
+       $(RM) qccversion.*
+       echo This file intentionally left blank. > $@
+
+FILES_CSPROGS = $(shell find client common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm)
+../csprogs.dat: $(FILES_CSPROGS) $(QCCVERSIONFILE)
        @echo make[1]: Entering directory \`$(PWD)/client\'
-       cd client && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_CSPROGS)
+       cd client && $(QCC) $(QCCFLAGS) -DCSQC
+
+server/precache-for-csqc.inc: $(FILES_CSPROGS)
+       sh collect-precache.sh
 
-FILES_PROGS = $(shell find server common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
-../progs.dat: $(FILES_PROGS)
+FILES_PROGS = $(shell find server common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm)
+../progs.dat: $(FILES_PROGS) $(QCCVERSIONFILE) server/precache-for-csqc.inc
        @echo make[1]: Entering directory \`$(PWD)/server\'
-       cd server && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_PROGS)
+       cd server && $(QCC) $(QCCFLAGS) -DSVQC
 
-FILES_MENU = $(shell find menu common warpzonelib -type f -not -name fteqcc.log -not -name qc.asm) $(wildcard server/w_*.qc)
-../menu.dat: $(FILES_MENU)
+FILES_MENU = $(shell find menu common warpzonelib -type f -not -name fteqcc.log -not -name qc.asm)
+../menu.dat: $(FILES_MENU) $(QCCVERSIONFILE)
        @echo make[1]: Entering directory \`$(PWD)/menu\'
-       cd menu && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_MENU)
+       cd menu && $(QCC) $(QCCFLAGS) -DMENUQC
 
 .PHONY: testcase
 testcase:
-       cd testcase && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_CSPROGS) -DTESTCASE="$$TESTCASE"
+       cd testcase && $(QCC) $(QCCFLAGS) -DTESTCASE="$$TESTCASE"