Makefile: set VERSION properly on release.

This commit is contained in:
Heikki Hokkanen
2009-12-25 11:31:27 +02:00
parent 48919ff425
commit 4042ac12e7
2 changed files with 6 additions and 3 deletions

View File

@@ -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

View File

@@ -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