rewrite Makefile, use git archive

cleanup-cruft v6
Fabio Erculiani 12 years ago
parent a8f8f754cc
commit b8aee99d81

4
.gitignore vendored

@ -1,3 +1 @@
/genkernel.8 /*.tar.*
/genkernel-*.tar.bz2
/ChangeLog

@ -1,16 +1,13 @@
PACKAGE_VERSION = `/bin/fgrep GK_V= genkernel | sed "s/.*GK_V='\([^']\+\)'/\1/"` VERSION ?=
distdir = genkernel-$(PACKAGE_VERSION) distdir = genkernel-$(VERSION)
# Add off-Git/generated files here that need to be shipped with releases # 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 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 . "$<" --format=manpage -D . "$<"
ChangeLog:
git log >$@
clean: clean:
rm -f $(EXTRA_DIST) 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 ; } git diff --cached --quiet || { echo 'STOP, you have uncommitted changes in the index' ; false ; }
dist: check-git-repository $(EXTRA_DIST) dist: check-git-repository $(EXTRA_DIST)
rm -Rf "$(distdir)" "$(distdir)".tar "$(distdir)".tar.bz2 test -n "$(VERSION)" || { echo "VERSION not set" >&2; exit 1; }
mkdir "$(distdir)" git archive --prefix=$(distdir)/ --format=tar "v$(VERSION)" > $(distdir).tar
git ls-files -z | xargs -0 cp --no-dereference --parents --target-directory="$(distdir)" \ rm -f $(distdir).tar.xz
$(EXTRA_DIST) xz $(distdir).tar
tar cf "$(distdir)".tar "$(distdir)"
bzip2 -9v "$(distdir)".tar
rm -Rf "$(distdir)"
.PHONY: clean check-git-repository dist .PHONY: clean check-git-repository dist

Loading…
Cancel
Save