From e18991f25ff4e8fa44dc93af8bc946aa1772bb72 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Thu, 23 Oct 2014 20:41:06 +0200 Subject: [PATCH] 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. --- Makefile | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) 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/* -- 1.7.0.4