diff --git a/.gitignore b/.gitignore index 5d43ffd..dafa321 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ -/genkernel.8 -/genkernel-*.tar.bz2 -/ChangeLog +/*.tar.* diff --git a/Makefile b/Makefile index 8e31a06..063d7e7 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,13 @@ -PACKAGE_VERSION = `/bin/fgrep GK_V= genkernel | sed "s/.*GK_V='\([^']\+\)'/\1/"` -distdir = genkernel-$(PACKAGE_VERSION) +VERSION ?= +distdir = genkernel-$(VERSION) # Add off-Git/generated files here that need to be shipped with releases -EXTRA_DIST = genkernel.8 ChangeLog +EXTRA_DIST = genkernel.8 genkernel.8: doc/genkernel.8.txt doc/asciidoc.conf Makefile genkernel - a2x --conf-file=doc/asciidoc.conf --attribute="genkernelversion=$(PACKAGE_VERSION)" \ + a2x --conf-file=doc/asciidoc.conf --attribute="genkernelversion=$(VERSION)" \ --format=manpage -D . "$<" -ChangeLog: - git log >$@ - clean: rm -f $(EXTRA_DIST) @@ -19,12 +16,9 @@ check-git-repository: git diff --cached --quiet || { echo 'STOP, you have uncommitted changes in the index' ; false ; } dist: check-git-repository $(EXTRA_DIST) - rm -Rf "$(distdir)" "$(distdir)".tar "$(distdir)".tar.bz2 - mkdir "$(distdir)" - git ls-files -z | xargs -0 cp --no-dereference --parents --target-directory="$(distdir)" \ - $(EXTRA_DIST) - tar cf "$(distdir)".tar "$(distdir)" - bzip2 -9v "$(distdir)".tar - rm -Rf "$(distdir)" + test -n "$(VERSION)" || { echo "VERSION not set" >&2; exit 1; } + git archive --prefix=$(distdir)/ --format=tar "v$(VERSION)" > $(distdir).tar + rm -f $(distdir).tar.xz + xz $(distdir).tar .PHONY: clean check-git-repository dist