From 4042ac12e7226bcc14b106beacd08cd129be04ff Mon Sep 17 00:00:00 2001 From: Heikki Hokkanen Date: Fri, 25 Dec 2009 11:31:27 +0200 Subject: [PATCH] Makefile: set VERSION properly on release. --- Makefile | 8 ++++++-- doc/TODO.txt | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 742d83f..7427419 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ RESOURCEDIR=$(PREFIX)/share/gitstats RESOURCES=gitstats.css sortable.js *.gif BINARIES=gitstats VERSION=$(shell git describe 2>/dev/null || git rev-parse --short HEAD) +SEDVERSION=sed -i 's/VERSION = 0/VERSION = "$(VERSION)"/' all: help @@ -19,9 +20,12 @@ install: install -d $(BINDIR) $(RESOURCEDIR) install -v $(BINARIES) $(BINDIR) install -v -m 644 $(RESOURCES) $(RESOURCEDIR) - sed -i 's/VERSION = 0/VERSION = "$(VERSION)"/' $(BINDIR)/gitstats + $(SEDVERSION) $(BINDIR)/gitstats release: - @tar --owner=0 --group=0 --transform 's!^!gitstats/!' -zcf gitstats-$(VERSION).tar.gz $(BINARIES) $(RESOURCES) doc/ Makefile + @cp gitstats gitstats.tmp + @$(SEDVERSION) gitstats.tmp + @tar --owner=0 --group=0 --transform 's!^!gitstats/!' --transform 's!gitstats.tmp!gitstats!' -zcf gitstats-$(VERSION).tar.gz gitstats.tmp $(RESOURCES) doc/ Makefile + @$(RM) gitstats.tmp .PHONY: all help install release diff --git a/doc/TODO.txt b/doc/TODO.txt index c69d3e4..36368c1 100644 --- a/doc/TODO.txt +++ b/doc/TODO.txt @@ -1,5 +1,4 @@ [] -- Makefile: 'release' target does not replace "VERSION" in binary - https://sourceforge.net/tracker/index.php?func=detail&aid=2865754&group_id=203965&atid=987714 - gitstats is a great tool, but the one thing that I miss is the number of -- 2.11.4.GIT