X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2FMakefile;h=a92b06bc645b4f814cee7ddf1cedb2cda0de54a3;hb=fb1dcac984f31f1b00acdff66a8ee10c152dcdab;hp=e2be8a841bac1d411537784bfdcfc01b263a6217;hpb=a1a7f9e63999f3e9edec742b7563cfdff5876ef7;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/Makefile b/qcsrc/Makefile index e2be8a841..a92b06bc6 100644 --- a/qcsrc/Makefile +++ b/qcsrc/Makefile @@ -1,15 +1,40 @@ 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)"' -DCVAR_POPCON=1 +QCC ?= gmqcc -FTEQCCFLAGS_WATERMARK ?= -DWATERMARK='"$(shell git describe)"' -DCVAR_POPCON -FTEQCCFLAGS ?= -Werror -Wno-Q302 -O3 -Ono-c -Ono-cs $(FTEQCCFLAGS_EXTRA) $(FTEQCCFLAGS_WATERMARK) -FTEQCCFLAGS_PROGS ?= -FTEQCCFLAGS_MENU ?= +QCCVERSIONFILE := qccversion.$(shell $(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 ?= +QCCFLAGS ?= \ + -std=fteqcc \ + -Werror -Wall \ + -Wcpp \ + -Wno-field-redeclared \ + -Wno-double-declaration \ + -Wno-uninitialized-global \ + -O3 \ + -fadjust-vector-fields \ + -fftepp \ + -fftepp-predefs \ + -frelaxed-switch \ + -fshort-logic \ + -fno-perl-logic \ + -ftranslatable-strings \ + -fno-initialized-nonconstants \ + -fno-assign-function-types \ + -flno \ + -fcorrect-ternary \ + -fno-single-vector-defs \ + -fcorrect-logic \ + -ftrue-empty-strings \ + -fno-false-empty-strings \ + -futf8 \ + -fno-bail-on-werror \ + -floop-labels \ + -funtyped-nil \ + -fno-permissive \ + -fvariadic-args \ + $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK) # xonotic build system overrides this by command line argument to turn off the update-cvarcount step XON_BUILDSYSTEM = @@ -25,23 +50,30 @@ qc-recursive: ../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 -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) $(wildcard server/w_*.qc) +../csprogs.dat: $(FILES_CSPROGS) $(QCCVERSIONFILE) @echo make[1]: Entering directory \`$(PWD)/client\' - cd client && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_CSPROGS) + cd client && $(QCC) $(QCCFLAGS) + +server/precache-for-csqc.inc: $(FILES_CSPROGS) + sh collect-precache.sh -FILES_PROGS = $(shell find server common warpzonelib -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) $(wildcard server/w_*.qc) +../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) 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) +../menu.dat: $(FILES_MENU) $(QCCVERSIONFILE) @echo make[1]: Entering directory \`$(PWD)/menu\' - cd menu && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_MENU) + cd menu && $(QCC) $(QCCFLAGS) .PHONY: testcase testcase: - cd testcase && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_CSPROGS) -DTESTCASE="$$TESTCASE" + cd testcase && $(QCC) $(QCCFLAGS) -DTESTCASE="$$TESTCASE"