7 QCCFLAGS_WATERMARK ?= $(shell git describe --tags --dirty='~')
8 VER = $(subst *,\*,$(QCCFLAGS_WATERMARK))
11 ENABLE_EFFECTINFO ?= 0
13 ENABLE_DEBUGTRACE ?= 0
17 ifneq ($(shell which zip 2>/dev/null),)
20 ifneq ($(shell which 7z 2>/dev/null),)
21 ZIP := 7z a -tzip -mx=9
23 ifneq ($(shell which 7za 2>/dev/null),)
24 ZIP := 7za a -tzip -mx=9
27 $(warning "No zip / 7z / 7za in ($(PATH))")
28 ZIP := : zip_not_found
32 # Set to empty string to temporarily enable warnings when debugging
36 # We eventually need to get rid of these
41 -DXONOTIC=$(XONOTIC) \
42 -DWATERMARK="$(QCCFLAGS_WATERMARK)" \
44 -DENABLE_EFFECTINFO=$(ENABLE_EFFECTINFO) \
45 -DENABLE_DEBUGDRAW=$(ENABLE_DEBUGDRAW) \
46 -DENABLE_DEBUGTRACE=$(ENABLE_DEBUGTRACE) \
47 $(if $(BUILD_MOD), -DBUILD_MOD="$(BUILD_MOD)" -I$(BUILD_MOD), ) \
50 # -Ooverlap-locals is required
58 -flno -futf8 -fno-bail-on-werror \
59 -frelaxed-switch -freturn-assignments \
72 $(RM) $(PROGS_OUT)/csprogs.dat
73 $(RM) $(PROGS_OUT)/menu.dat
74 $(RM) $(PROGS_OUT)/progs.dat
77 $(RM) $(WORKDIR)/*.txt
80 qc: $(PROGS_OUT)/csprogs.dat $(PROGS_OUT)/menu.dat $(PROGS_OUT)/progs.dat
83 pk3: csprogs-$(VER).pk3
89 %-$(VER).pk3: $(PROGS_OUT)/%.dat
91 $(eval PK3=$(PROG)-$(VER).pk3)
92 $(eval TXT=$(PROG)-$(VER).txt)
93 $(eval DAT=$(PROG)-$(VER).dat)
94 $(eval LNO=$(PROG)-$(VER).lno)
95 @ echo "http://xonotic.org" > $(TXT)
96 @ cp -f $(PROGS_OUT)/$(PROG).dat $(DAT)
97 @ cp -f $(PROGS_OUT)/$(PROG).lno $(LNO)
99 $(ZIP) $(PK3) $(TXT) $(DAT) $(LNO)
100 @ $(RM) $(TXT) $(DAT) $(LNO)
102 QCCVERSION := $(shell cd lib && $(QCC) --version)
103 QCCVERSIONFILE := $(WORKDIR)/qccversion.$(shell echo ${QCCVERSION} | git hash-object --stdin)
104 $(QCCVERSIONFILE): | $(WORKDIR)
105 @ $(RM) $(WORKDIR)/qccversion.*
106 @ echo $(QCCVERSION) > $@
114 $(PROGS_OUT)/csprogs.dat: client/progs.inc $(QCCVERSIONFILE) | $(WORKDIR)
115 @ echo make[1]: Entering directory \`$(CURDIR)/client\'
116 ./tools/qcc.sh client $@ $<
117 -include $(WORKDIR)/client.d
119 $(PROGS_OUT)/progs.dat: server/progs.inc $(QCCVERSIONFILE) | $(WORKDIR)
120 @ echo make[1]: Entering directory \`$(CURDIR)/server\'
121 ./tools/qcc.sh server $@ $<
122 -include $(WORKDIR)/server.d
124 $(PROGS_OUT)/menu.dat: menu/progs.inc $(QCCVERSIONFILE) | $(WORKDIR)
125 @ echo make[1]: Entering directory \`$(CURDIR)/menu\'
126 ./tools/qcc.sh menu $@ $<
127 -include $(WORKDIR)/menu.d