CPP := cc -xc -E
QCC ?= gmqcc
NDEBUG ?= 1
+PROGS_OUT ?= $(CURDIR)/..
BUILD_MOD ?= 0
QCCVERSIONFILE := qccversion.$(shell (cd server && $(QCC) --version) > qccversion.txt && git hash-object qccversion.txt)
all: qc
.PHONY: qc
-qc: ../menu.dat ../progs.dat ../csprogs.dat
+qc: $(PROGS_OUT)/menu.dat $(PROGS_OUT)/progs.dat $(PROGS_OUT)/csprogs.dat
.PHONY: clean
clean:
- rm -f ../progs.dat ../menu.dat ../csprogs.dat
+ rm -f $(PROGS_OUT)/progs.dat $(PROGS_OUT)/menu.dat $(PROGS_OUT)/csprogs.dat
rm -f tmp/*.qc tmp/*.d tmp/*.txt
$(QCCVERSIONFILE):
export QCCDEFS
export QCCFLAGS
-../csprogs.dat: client/progs.inc $(QCCVERSIONFILE)
+$(PROGS_OUT)/csprogs.dat: client/progs.inc $(QCCVERSIONFILE)
@echo make[1]: Entering directory \`$(PWD)/client\'
sh ./qcc.sh client $@ $<
-include tmp/client.d
-../progs.dat: server/progs.inc $(QCCVERSIONFILE)
+$(PROGS_OUT)/progs.dat: server/progs.inc $(QCCVERSIONFILE)
@echo make[1]: Entering directory \`$(PWD)/server\'
sh ./qcc.sh server $@ $<
-include tmp/server.d
-../menu.dat: menu/progs.inc $(QCCVERSIONFILE)
+$(PROGS_OUT)/menu.dat: menu/progs.inc $(QCCVERSIONFILE)
@echo make[1]: Entering directory \`$(PWD)/menu\'
sh ./qcc.sh menu $@ $<
-include tmp/menu.d
${CPP} -dM 1>./tmp/${MODE}_macros.txt -H 2>./tmp/${MODE}_includes.txt ${IN}
sed 's/^#\(line\)\? \([[:digit:]]\+\) "\(.*\)".*/\n#pragma file(\3)\n#pragma line(\2)/g' ./tmp/${MODE}.txt > ./tmp/${MODE}.qc
cd ${MODE}
-${QCC} ${QCCFLAGS} -o ../${OUT} ../tmp/${MODE}.qc
+${QCC} ${QCCFLAGS} -o ${OUT} ../tmp/${MODE}.qc