7 QCCFLAGS_WATERMARK ?= $(shell git describe --tags --dirty='~')
8 VER = $(subst *,\*,$(QCCFLAGS_WATERMARK))
14 ifneq ($(shell which zip),)
17 ifneq ($(shell which 7z),)
18 ZIP := 7z a -tzip -mx=9
20 ifneq ($(shell which 7za),)
21 ZIP := 7za a -tzip -mx=9
24 $(warning "No zip in ($(PATH))")
25 ZIP := : zip_not_found
29 # We eventually need to get rid of these
34 -DXONOTIC=$(XONOTIC) \
35 -DWATERMARK="$(QCCFLAGS_WATERMARK)" \
37 $(if $(BUILD_MOD), -DBUILD_MOD="$(BUILD_MOD)" -I$(BUILD_MOD), ) \
40 # -Ooverlap-locals is required
47 -flno -futf8 -fno-bail-on-werror \
48 -frelaxed-switch -freturn-assignments \
61 $(RM) $(PROGS_OUT)/csprogs.dat
62 $(RM) $(PROGS_OUT)/menu.dat
63 $(RM) $(PROGS_OUT)/progs.dat
66 $(RM) $(WORKDIR)/*.txt
69 qc: $(PROGS_OUT)/csprogs.dat $(PROGS_OUT)/menu.dat $(PROGS_OUT)/progs.dat
72 pk3: csprogs-$(VER).pk3
78 %-$(VER).pk3: $(PROGS_OUT)/%.dat
80 $(eval PK3=$(PROG)-$(VER).pk3)
81 $(eval TXT=$(PROG)-$(VER).txt)
82 $(eval DAT=$(PROG)-$(VER).dat)
83 $(eval LNO=$(PROG)-$(VER).lno)
84 @ echo "http://xonotic.org" > $(TXT)
85 @ ln -f $(PROGS_OUT)/$(PROG).dat $(DAT)
86 @ ln -f $(PROGS_OUT)/$(PROG).lno $(LNO)
88 $(ZIP) $(PK3) $(TXT) $(DAT) $(LNO)
89 @ $(RM) $(TXT) $(DAT) $(LNO)
91 QCCVERSION := $(shell cd lib && $(QCC) --version)
92 QCCVERSIONFILE := $(WORKDIR)/qccversion.$(shell echo ${QCCVERSION} | git hash-object --stdin)
93 $(QCCVERSIONFILE): | $(WORKDIR)
94 @ $(RM) $(WORKDIR)/qccversion.*
95 @ echo $(QCCVERSION) > $@
103 $(PROGS_OUT)/csprogs.dat: client/progs.inc $(QCCVERSIONFILE) | $(WORKDIR)
104 @ echo make[1]: Entering directory \`$(CURDIR)/client\'
105 ./tools/qcc.sh client $@ $<
106 -include $(WORKDIR)/client.d
108 $(PROGS_OUT)/progs.dat: server/progs.inc $(QCCVERSIONFILE) | $(WORKDIR)
109 @ echo make[1]: Entering directory \`$(CURDIR)/server\'
110 ./tools/qcc.sh server $@ $<
111 -include $(WORKDIR)/server.d
113 $(PROGS_OUT)/menu.dat: menu/progs.inc $(QCCVERSIONFILE) | $(WORKDIR)
114 @ echo make[1]: Entering directory \`$(CURDIR)/menu\'
115 ./tools/qcc.sh menu $@ $<
116 -include $(WORKDIR)/menu.d