From: H.G.Muller Date: Thu, 23 Oct 2014 18:41:06 +0000 (+0200) Subject: Let 'make dist' use fairymax.c version in tar-ball name X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=e18991f25ff4e8fa44dc93af8bc946aa1772bb72;p=fairymax.git Let 'make dist' use fairymax.c version in tar-ball name The VERSION is extracted from the C source with grep|sed, and assigned to a variable in the Makefile (if it was not defined already), which is then used in the tar-ball name when creating the distro tar ball. --- diff --git a/Makefile b/Makefile index 6e8f804..1d0a677 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ CC?=gcc CFLAGS?= -O2 -s INI_F?=$(DESTDIR)/usr/share/games/fairymax/fmax.ini INI_Q?=$(DESTDIR)/usr/share/games/fairymax/qmax.ini - +VERSION?=`grep 'define VERSION' fairymax.c | sed -e 's/.*"\(.*\)".*/\1/'` ALL= fairymax shamax maxqi fairymax.6.gz @@ -48,15 +48,16 @@ clean: dist-clean: rm -f ${ALL} *~ data/*~ *.man md5sums -dist: +dist: fairymax install -d -m0755 Fairy-Max install -d -m0755 Fairy-Max/data rm -f fairymax.tar fairymax.tar.gz cp fairymax.c maxqi.c fairymax.pod Makefile README changelog copyright Fairy-Max cp data/* Fairy-Max/data (md5sum Fairy-Max/* Fairy-Max/data/* > Fairy-Max/md5sums) || true - tar -cvvf fairymax.tar Fairy-Max - gzip fairymax.tar + tar -cvvf fairymax-$(VERSION).tar Fairy-Max + gzip fairymax-$(VERSION).tar + rm fairymax rm Fairy-Max/data/* rmdir Fairy-Max/data rm Fairy-Max/*