aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2010-12-24 22:54:22 +0100
committerSebastian Pipping <sebastian@pipping.org>2010-12-24 23:08:58 +0100
commit9cad6b63e5f89067cf72cedc76f639abd8a9b40f (patch)
tree754f61e1203767d6987198f3e73219c31a18d15e /Makefile
parentBump version to 3.4.10.908 (diff)
downloadgenkernel-9cad6b63e5f89067cf72cedc76f639abd8a9b40f.tar.gz
genkernel-9cad6b63e5f89067cf72cedc76f639abd8a9b40f.tar.bz2
genkernel-9cad6b63e5f89067cf72cedc76f639abd8a9b40f.zip
Implement "make dist" based on git ls-files
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 19 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index ec7e55c..74c5bb9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,8 @@
PACKAGE_VERSION = `/bin/fgrep GK_V= genkernel | sed "s/.*GK_V='\([^']\+\)'/\1/"`
+distdir = genkernel-$(PACKAGE_VERSION)
+
+# Add off-Git/generated files here that need to be shipped with releases
+EXTRA_DIST = genkernel.8
genkernel.8: doc/genkernel.8.txt doc/asciidoc.conf Makefile
a2x --conf-file=doc/asciidoc.conf --attribute="genkernelversion=$(PACKAGE_VERSION)" \
@@ -6,3 +10,18 @@ genkernel.8: doc/genkernel.8.txt doc/asciidoc.conf Makefile
clean:
rm -f genkernel.8
+
+check-git-repository:
+ git diff --quiet || { echo 'STOP, you have uncommitted changes in the working directory' ; false ; }
+ git diff --cached --quiet || { echo 'STOP, you have uncommitted changes in the index' ; false ; }
+
+dist: check-git-repository genkernel.8
+ 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)"
+
+.PHONY: clean check-git-repository dist