build: Fix 'make -j' handling.

Some build targets create multiple outputs, which can cause problems
when doing parallel builds. Clean up the build system so that all
subdir invocations come from the top-level Makefile and use $(MAKE).
Also fix the FREEDOOM/FREEDM lumps to really include the version
number by using $(shell ...) syntax.
This commit is contained in:
Simon Howard 2014-01-16 06:30:15 +00:00
parent d9b4c2530a
commit d241e7f326
4 changed files with 44 additions and 51 deletions

View file

@ -39,9 +39,22 @@ GRAPHICS = \
all: $(GRAPHICS)
$(GRAPHICS): config.py fontchars ../../lumps/fraggle/freedoom.bex
# textgen creates multiple outputs, which is awkward to express in
# make. Use a witness file (graphics.stamp) as suggested in the
# automake manual: "Handling Tools that Produce Many Outputs"
$(GRAPHICS): graphics.stamp
@if test -f $@; then :; else \
rm -f graphics.stamp; \
$(MAKE) data.stamp; \
fi
graphics.stamp: config.py fontchars ../../lumps/fraggle/freedoom.bex
@rm -f graphics.tmp
@touch graphics.tmp
./textgen
@mv graphics.tmp $@
clean:
rm -f $(GRAPHICS)
rm -f $(GRAPHICS) graphics.stamp