]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/Makefile
Merge branch 'terencehill/cl_forceplayercolors_3' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / Makefile
index 903d8537e695bf35b33fb78889c814a38536cf7b..1edb96fa22932b1f65328fe215b71d768223f89d 100644 (file)
@@ -1,31 +1,38 @@
 CPP := cc -xc -E
-QCC ?= gmqcc
+QCC ?= ../../../../gmqcc/gmqcc
 
-PROGS_OUT ?= $(CURDIR)/..
+PROGS_OUT ?= ..
 WORKDIR ?= ../.tmp
 
 QCCFLAGS_WATERMARK ?= $(shell git describe --tags --dirty='~')
 VER = $(subst *,\*,$(QCCFLAGS_WATERMARK))
 NDEBUG ?= 1
 XONOTIC ?= 1
+ENABLE_EFFECTINFO ?= 0
+ENABLE_DEBUGDRAW ?= 0
+ENABLE_DEBUGTRACE ?= 0
 BUILD_MOD ?=
 
 ifndef ZIP
-       ifneq ($(shell which zip),)
+       ifneq ($(shell which zip 2>/dev/null),)
                ZIP := zip -9
        endif
-       ifneq ($(shell which 7z),)
+       ifneq ($(shell which 7z 2>/dev/null),)
                ZIP := 7z a -tzip -mx=9
        endif
-       ifneq ($(shell which 7za),)
+       ifneq ($(shell which 7za 2>/dev/null),)
                ZIP := 7za a -tzip -mx=9
        endif
     ifndef ZIP
-        $(warning "No zip in ($(PATH))")
+        $(warning "No zip / 7z / 7za in ($(PATH))")
         ZIP := : zip_not_found
     endif
 endif
 
+# Set to empty string to temporarily enable warnings when debugging
+QCCFLAGS_WERROR ?= \
+       -Werror
+
 # We eventually need to get rid of these
 QCCFLAGS_WTFS ?= \
        -Wno-field-redeclared
@@ -34,6 +41,9 @@ QCCDEFS ?= \
        -DXONOTIC=$(XONOTIC) \
        -DWATERMARK="$(QCCFLAGS_WATERMARK)" \
        -DNDEBUG=$(NDEBUG) \
+       -DENABLE_EFFECTINFO=$(ENABLE_EFFECTINFO) \
+       -DENABLE_DEBUGDRAW=$(ENABLE_DEBUGDRAW) \
+       -DENABLE_DEBUGTRACE=$(ENABLE_DEBUGTRACE) \
        $(if $(BUILD_MOD), -DBUILD_MOD="$(BUILD_MOD)" -I$(BUILD_MOD), ) \
        $(QCCDEFS_EXTRA)
 
@@ -42,7 +52,8 @@ QCCFLAGS ?= \
        -std=gmqcc \
        -Ooverlap-locals \
        -O3 \
-       -Werror -Wall \
+       $(QCCFLAGS_WERROR) \
+       -Wall \
        $(QCCFLAGS_WTFS) \
        -flno -futf8 -fno-bail-on-werror \
        -frelaxed-switch -freturn-assignments \
@@ -61,9 +72,14 @@ clean: | $(WORKDIR)
        $(RM) $(PROGS_OUT)/csprogs.dat
        $(RM) $(PROGS_OUT)/menu.dat
        $(RM) $(PROGS_OUT)/progs.dat
+       $(RM) $(PROGS_OUT)/csprogs.lno
+       $(RM) $(PROGS_OUT)/menu.lno
+       $(RM) $(PROGS_OUT)/progs.lno
        $(RM) $(WORKDIR)/*.d
        $(RM) $(WORKDIR)/*.qc
        $(RM) $(WORKDIR)/*.txt
+       $(RM) $(WORKDIR)/qccversion.*
+       $(RM) csprogs-*.pk3
 
 .PHONY: qc
 qc: $(PROGS_OUT)/csprogs.dat $(PROGS_OUT)/menu.dat $(PROGS_OUT)/progs.dat
@@ -82,9 +98,9 @@ pk3: csprogs-$(VER).pk3
        $(eval DAT=$(PROG)-$(VER).dat)
        $(eval LNO=$(PROG)-$(VER).lno)
        @ echo "http://xonotic.org" > $(TXT)
-       @ ln -f $(PROGS_OUT)/$(PROG).dat $(DAT)
-       @ ln -f $(PROGS_OUT)/$(PROG).lno $(LNO)
-       @ $(RM) *.pk3
+       @ cp -f $(PROGS_OUT)/$(PROG).dat $(DAT)
+       @ cp -f $(PROGS_OUT)/$(PROG).lno $(LNO)
+       @ $(RM) csprogs-*.pk3
        $(ZIP) $(PK3) $(TXT) $(DAT) $(LNO)
        @ $(RM) $(TXT) $(DAT) $(LNO)
 
@@ -102,15 +118,15 @@ export QCCFLAGS
 
 $(PROGS_OUT)/csprogs.dat: client/progs.inc $(QCCVERSIONFILE) | $(WORKDIR)
        @ echo make[1]: Entering directory \`$(CURDIR)/client\'
-       ./tools/qcc.sh client $@ $<
+       ./tools/qcc.sh client $@ $<
 -include $(WORKDIR)/client.d
 
 $(PROGS_OUT)/progs.dat: server/progs.inc $(QCCVERSIONFILE) | $(WORKDIR)
        @ echo make[1]: Entering directory \`$(CURDIR)/server\'
-       ./tools/qcc.sh server $@ $<
+       ./tools/qcc.sh server $@ $<
 -include $(WORKDIR)/server.d
 
 $(PROGS_OUT)/menu.dat: menu/progs.inc $(QCCVERSIONFILE) | $(WORKDIR)
        @ echo make[1]: Entering directory \`$(CURDIR)/menu\'
-       ./tools/qcc.sh menu $@ $<
+       ./tools/qcc.sh menu $@ $<
 -include $(WORKDIR)/menu.d