summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 11 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 7f8eaf4..1b93597 100644
--- a/Makefile
+++ b/Makefile
@@ -60,4 +60,14 @@ check: tests/auto/Makefile
cd src/qtchooser && $(MAKE) check
cd tests/auto && $(MAKE) check
-.PHONY: all install uninstall check clean distclean
+dist: .git
+ @ \
+ { rev=$$(git describe --tags HEAD 2>/dev/null) && \
+ name=qtchooser-$${rev#v}; } || \
+ { rev=$$(git rev-parse --short HEAD) && \
+ name=qtchooser-$$(git rev-list HEAD | wc -l)-g$$rev; } && \
+ echo "Creating package $$name" >&2 && \
+ git archive --prefix="$$name/" -9 --format=tar.gz -o $$name.tar.gz $$rev && \
+ git archive --prefix="$$name/" -9 --format=zip -v -o $$name.zip $$rev
+
+.PHONY: all install uninstall check clean distclean dist