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 # We eventually need to get rid of these
37 -DXONOTIC=$(XONOTIC) \
38 -DWATERMARK="$(QCCFLAGS_WATERMARK)" \
40 -DENABLE_EFFECTINFO=$(ENABLE_EFFECTINFO) \
41 -DENABLE_DEBUGDRAW=$(ENABLE_DEBUGDRAW) \
42 -DENABLE_DEBUGTRACE=$(ENABLE_DEBUGTRACE) \
43 $(if $(BUILD_MOD), -DBUILD_MOD="$(BUILD_MOD)" -I$(BUILD_MOD), ) \
46 # -Ooverlap-locals is required
53 -flno -futf8 -fno-bail-on-werror \
54 -frelaxed-switch -freturn-assignments \
67 $(RM) $(PROGS_OUT)/csprogs.dat
68 $(RM) $(PROGS_OUT)/menu.dat
69 $(RM) $(PROGS_OUT)/progs.dat
72 $(RM) $(WORKDIR)/*.txt
75 qc: $(PROGS_OUT)/csprogs.dat $(PROGS_OUT)/menu.dat $(PROGS_OUT)/progs.dat
78 pk3: csprogs-$(VER).pk3
84 %-$(VER).pk3: $(PROGS_OUT)/%.dat
86 $(eval PK3=$(PROG)-$(VER).pk3)
87 $(eval TXT=$(PROG)-$(VER).txt)
88 $(eval DAT=$(PROG)-$(VER).dat)
89 $(eval LNO=$(PROG)-$(VER).lno)
90 @ echo "http://xonotic.org" > $(TXT)
91 @ ln -f $(PROGS_OUT)/$(PROG).dat $(DAT)
92 @ ln -f $(PROGS_OUT)/$(PROG).lno $(LNO)
94 $(ZIP) $(PK3) $(TXT) $(DAT) $(LNO)
95 @ $(RM) $(TXT) $(DAT) $(LNO)
97 QCCVERSION := $(shell cd lib && $(QCC) --version)
98 QCCVERSIONFILE := $(WORKDIR)/qccversion.$(shell echo ${QCCVERSION} | git hash-object --stdin)
99 $(QCCVERSIONFILE): | $(WORKDIR)
100 @ $(RM) $(WORKDIR)/qccversion.*
101 @ echo $(QCCVERSION) > $@
109 $(PROGS_OUT)/csprogs.dat: client/progs.inc $(QCCVERSIONFILE) | $(WORKDIR)
110 @ echo make[1]: Entering directory \`$(CURDIR)/client\'
111 ./tools/qcc.sh client $@ $<
112 -include $(WORKDIR)/client.d
114 $(PROGS_OUT)/progs.dat: server/progs.inc $(QCCVERSIONFILE) | $(WORKDIR)
115 @ echo make[1]: Entering directory \`$(CURDIR)/server\'
116 ./tools/qcc.sh server $@ $<
117 -include $(WORKDIR)/server.d
119 $(PROGS_OUT)/menu.dat: menu/progs.inc $(QCCVERSIONFILE) | $(WORKDIR)
120 @ echo make[1]: Entering directory \`$(CURDIR)/menu\'
121 ./tools/qcc.sh menu $@ $<
122 -include $(WORKDIR)/menu.d