[game-data-packager] 01/01: Makefile: switch to depedency-based build

Alexandre Detiste detiste-guest at moszumanska.debian.org
Mon Mar 9 14:25:13 UTC 2015


This is an automated email from the git hooks/post-receive script.

detiste-guest pushed a commit to branch master
in repository game-data-packager.

commit 6ea1dc6b357f375424116269a80f53337cdc4026
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Mon Mar 9 15:24:29 2015 +0100

    Makefile: switch to depedency-based build
---
 Makefile                          | 44 +++++++++++++++++++--------------------
 debian/game-data-packager.install |  1 +
 2 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/Makefile b/Makefile
index bbe5bba..9424126 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 VERSION := $(shell dpkg-parsechangelog | grep ^Version | cut -d' ' -f2-)
-DIRS := ./out ./build
+DIRS := ./out
 GDP_MIRROR ?= localhost
 
 # some cherry picked games that:
@@ -12,28 +12,30 @@ GDP_MIRROR ?= localhost
 # - are not too big
 TEST_SUITE += rott spear-of-destiny wolf3d
 
-default: $(DIRS)
+png       := $(patsubst ./data/%.xpm,./out/%.png,$(wildcard ./data/*.xpm))
+svgz      := $(patsubst ./data/%.svg,./out/%.svgz,$(wildcard ./data/*.svg))
+yaml      := $(patsubst ./data/%,./out/%,$(wildcard ./data/*.yaml))
+copyright := $(patsubst ./data/%,./out/%,$(wildcard ./data/*.copyright))
+dot_in    := $(patsubst ./data/%,./out/%,$(wildcard ./data/*.in))
+
+default: $(DIRS) $(png) $(svgz) $(yaml) $(copyright) $(dot_in) \
+         out/changelog.gz out/copyright out/game-data-packager
+
+out/%: data/%
+	if [ -L $< ]; then cp -a $< $@ ; else install -m644 $< $@ ; fi
+
+out/changelog.gz: debian/changelog
 	gzip -nc9 debian/changelog > ./out/changelog.gz
 	chmod 0644 ./out/changelog.gz
-	for f in data/*.yaml data/*.control.in data/*.copyright \
-                        data/copyright \
-			data/*.copyright.in data/*.desktop.in \
-			data/*.preinst.in data/*.README.Debian.in; do \
-		if [ -L $$f ]; then \
-			cp -a $$f out/ || exit $$?; \
-		else \
-			install -m644 $$f out/ || exit $$?; \
-		fi; \
-	done
+
+out/game-data-packager: run
 	install -m644 run out/game-data-packager
-	for x in data/*.xpm; do \
-		o=out/$${x#data/}; \
-		convert $$x $${o%.xpm}.png || exit $$?; \
-	done
-	for x in data/*.svg; do \
-		o=out/$${x#data/}; \
-		gzip -c $$x > $${o%.svg}.svgz || exit $$?; \
-	done
+
+out/%.png: data/%.xpm
+	convert $< $@
+
+out/%.svgz: data/%.svg
+	gzip -nc $< > $@
 
 $(DIRS):
 	mkdir -p $@
@@ -42,8 +44,6 @@ clean:
 	rm -f ./out/changelog.gz
 	rm -f ./out/copyright
 	rm -f ./out/game-data-packager
-	rm -f ./out/foo ./out/bar ./out/baz
-	rm -f ./out/*.control
 	rm -f ./out/*.control.in
 	rm -f ./out/*.copyright
 	rm -f ./out/*.copyright.in
diff --git a/debian/game-data-packager.install b/debian/game-data-packager.install
index e9f166a..4b69509 100644
--- a/debian/game-data-packager.install
+++ b/debian/game-data-packager.install
@@ -7,6 +7,7 @@ out/*.copyright               usr/share/games/game-data-packager
 out/*.copyright.in            usr/share/games/game-data-packager
 out/*.desktop.in              usr/share/games/game-data-packager
 out/*.png                     usr/share/games/game-data-packager
+out/*.svgz                    usr/share/games/game-data-packager
 out/*.preinst.in              usr/share/games/game-data-packager
 out/*.README.Debian.in        usr/share/games/game-data-packager
 out/changelog.gz              usr/share/games/game-data-packager

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/game-data-packager.git



More information about the Pkg-games-commits mailing list