Created a dist target for Documentation/Makefile that tars up the man pages and html files.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>


---

 Documentation/Makefile |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

f8b6b70c89364418724899ab5ca28aaaf3eee7dc
diff --git a/Documentation/Makefile b/Documentation/Makefile
index c1af22c..271d9e4 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -31,6 +31,7 @@ man7=$(mandir)/man7
 # DESTDIR=
 
 INSTALL?=install
+TAR?=tar
 
 #
 # Please note that there is a minor bug in asciidoc.
@@ -55,6 +56,18 @@ install: man
 	$(INSTALL) $(DOC_MAN1) $(DESTDIR)/$(man1)
 	$(INSTALL) $(DOC_MAN7) $(DESTDIR)/$(man7)
 
+-include ../GIT-VERSION-FILE
+
+dist: html man
+	@mkdir -p git-doc-{html,man}-$(GIT_VERSION)
+	@cp $(DOC_HTML) git-doc-html-$(GIT_VERSION)
+	@cp $(DOC_MAN1) $(DOC_MAN7) git-doc-man-$(GIT_VERSION)
+	
+	@for d in html man; do \
+		$(TAR) cf git-doc-$$d-$(GIT_VERSION).tar git-doc-$$d-$(GIT_VERSION) && \
+		rm -rf git-doc-$$d-$(GIT_VERSION) && \
+		gzip -f -9 git-doc-$$d-$(GIT_VERSION).tar \
+	; done
 
 #
 # Determine "include::" file references in asciidoc files.
@@ -73,7 +86,8 @@ README: ../README
 
 
 clean:
-	rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html doc.dep README
+	rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html doc.dep README \
+	      git-doc-{html,man}-$(GIT_VERSION).tar.gz
 
 %.html : %.txt
 	asciidoc -b xhtml11 -d manpage -f asciidoc.conf $<
-- 
1.3.3


