commit:     e58b9a9894bb6fd551a43e9d71c838fa8bbf6c0e
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 18 12:14:33 2021 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Jan 18 12:14:33 2021 +0000
URL:        https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=e58b9a98

Makefile: Add dist target

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 Makefile | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 13f2bb9..e516e15 100644
--- a/Makefile
+++ b/Makefile
@@ -91,9 +91,16 @@ tidy: $(HTMLS) $(ECLASS_HTMLS)
        test $${status} -eq 0 && echo "tidy validation successful"; \
        exit $${status}
 
+dist:
+       COMMITDATE=$$(TZ=UTC git log -1 --pretty="format:%cd" \
+         --date="format-local:%Y%m%d"); \
+       TARBALL="devmanual-0_pre$${COMMITDATE}.tar.xz"; \
+       echo "Creating tarball: $${TARBALL}"; \
+       git archive --format=tar --prefix=devmanual/ HEAD | xz > $${TARBALL}
+
 clean:
        @rm -f $(HTMLS) $(IMAGES) documents.js .depend
 
-.PHONY: all prereq build install validate tidy clean
+.PHONY: all prereq build install validate tidy dist clean
 
 -include .depend

Reply via email to