dist/Makefile: rewrite targets so they build only when sources change

Also includes a change to the top-level Makefile to accommodate new
target names.  Moved the installation variable settings close to the
install targets.
This commit is contained in:
Mike Swanson 2019-09-04 14:06:17 -07:00
parent 2a810409de
commit 96b28272a6
2 changed files with 20 additions and 19 deletions

View file

@ -118,12 +118,6 @@ clean: wad-image-clean
$(MAKE) -C lumps/textures clean $(MAKE) -C lumps/textures clean
$(MAKE) -C bootstrap clean $(MAKE) -C bootstrap clean
prefix?=/usr/local
bindir?=/bin
mandir?=/share/man
waddir?=/share/games/doom
target=$(DESTDIR)$(prefix)
# Variables that are common to wad-image* targets. # Variables that are common to wad-image* targets.
WI_LEVELS := levels WI_LEVELS := levels
WI_SCRIPTS := scripts WI_SCRIPTS := scripts
@ -272,10 +266,16 @@ fix-map-names:
scripts/fix-map-names levels scripts/fix-map-names levels
%.6: %.6:
$(MAKE) -C dist man-$* $(MAKE) -C dist $@
%.png: %.png:
$(MAKE) -C dist icon-$* $(MAKE) -C dist $@
prefix?=/usr/local
bindir?=/bin
mandir?=/share/man
waddir?=/share/games/doom
target=$(DESTDIR)$(prefix)
install-%: $(WADS)/%.wad %.6 %.png install-%: $(WADS)/%.wad %.6 %.png
install -Dm 755 dist/freedoom "$(target)$(bindir)/$*" install -Dm 755 dist/freedoom "$(target)$(bindir)/$*"

23
dist/Makefile vendored
View file

@ -1,18 +1,19 @@
all: man-freedm man-freedoom1 man-freedoom2 \ .SUFFIXES: .adoc .6
icon-freedm icon-freedoom1 icon-freedoom2
man-%: freedoom.adoc all: freedm.6 freedoom1.6 freedoom2.6 freedm.png freedoom1.png freedoom2.png
sed -e s/freedoom/$*/ freedoom.adoc > $*.adoc
%.6: freedoom.adoc
sed -e s/freedoom/$*/ $< > $*.adoc
a2x -f manpage $*.adoc a2x -f manpage $*.adoc
icon-freedm: freedm.png: ../graphics/titlepic/freedm_title2.png
./pillow-resize ../graphics/titlepic/freedm_title2.png freedm.png 64 64 ./pillow-resize $< $@ 64 64
icon-freedoom1: freedoom1.png: ../sprites/playa2a8.png
./pillow-compose ../sprites/playa2a8.png freedoom1.png 64 64 ./pillow-compose $< $@ 64 64
icon-freedoom2: freedoom2.png: ../sprites/heada1.png
./pillow-compose ../sprites/heada1.png freedoom2.png 64 64 ./pillow-compose $< $@ 64 64
clean: clean:
rm -f *.6 *.png freedm.adoc freedoom1.adoc freedoom2.adoc $(RM) *.6 *.png freedm.adoc freedoom1.adoc freedoom2.adoc