Use a git hash for the version if HEAD isn't tagged

This commit is contained in:
Bruno Wolff III 2013-06-29 13:44:27 -05:00
parent 233dc11b5e
commit a74dac72d4

View File

@ -1,10 +1,17 @@
# Get the version name first by seeing if HEAD is tagged
version := $(shell git tag --points-at HEAD)
# And if it wasn't use a git hash
ifeq ($(version),)
version := $(shell git log -1 --abbrev=8 --pretty=git%h)
endif
all: dist all: dist
clean: clean:
rm -f spin-kickstarts-*.tar.gz rm -f spin-kickstarts-*.tar.gz
dist: dist:
git archive --format=tar --prefix=spin-kickstarts-`git tag --points-at HEAD`/ HEAD | gzip > spin-kickstarts.tar-`git tag --points-at HEAD`.gz git archive --format=tar --prefix=spin-kickstarts-$(version)/ HEAD | gzip > spin-kickstarts.tar-$(version).gz
dist-clean: dist-clean:
git clean -f -d git clean -f -d