summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am36
1 files changed, 36 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 4807096..1d9036b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -27,6 +27,42 @@ endif
doc: doxygen-doc
$(AM_V_GEN)cd $(DX_DOCDIR) && ./fixmanpages && cd -
+## Generate MD5 checksum file
+MD5 = md5sum
+md5-dist:
+ @for file in $(DIST_ARCHIVES); do \
+ $(MD5) $$file > $$file.md5; \
+ done
+
+## Check if tagged in git
+release-hook:
+ @if [ ! `git tag | grep v$(PACKAGE_VERSION)` ]; then \
+ echo; \
+ printf "\e[1m\e[41mCannot find release tag v$(PACKAGE_VERSION)\e[0m\n"; \
+ printf "\e[1m\e[5mDo release anyway?\e[0m "; read yorn; \
+ if [ "$$yorn" != "y" -a "$$yorn" != "Y" ]; then \
+ printf "OK, aborting release.\n"; \
+ exit 1; \
+ fi; \
+ echo; \
+ else \
+ echo; \
+ printf "\e[1m\e[42mFound GIT release tag v$(PACKAGE_VERSION)\e[0m\n"; \
+ printf "\e[1m\e[44m>>Remember to push tags!\e[0m\n"; \
+ echo; \
+ fi
+
+## Target to run when building a release
+release: distcheck release-hook md5-dist
+ @echo
+ @echo "Resulting release files:"
+ @echo "================================================================="
+ @for file in $(DIST_ARCHIVES); do \
+ printf "%-32s Distribution tarball\n" $$file; \
+ printf "%-32s " $$file.md5; cat $$file.md5 | cut -f1 -d' '; \
+ mv $$file* ../; \
+ done
+
# (GNU make only) Unless we say otherwise, spare us the
# “Entering/Leaving directory ...” messages
GNUMAKEFLAGS = $(if $(value VERBOSE),,--no-print-directory)