Skip to content

Commit

Permalink
build: Simplify tag detection
Browse files Browse the repository at this point in the history
  • Loading branch information
wkz committed Sep 18, 2021
1 parent 691f9f5 commit bc49780
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,14 @@ EXTRA_DIST = $(doc_DATA) kernel
DISTCLEANFILES = *~ *.d
ACLOCAL_AMFLAGS = -I m4

TAG = $(top_srcdir)/.git/refs/tags/$(PACKAGE_VERSION)

## Check if tagged in git
release-hook:
if [ ! `git tag -l $(PACKAGE_VERSION) | grep $(PACKAGE_VERSION)` ]; then \
echo; \
printf "\e[1m\e[41mCannot find release tag $(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 $(PACKAGE_VERSION)\e[0m\n"; \
printf "\e[1m\e[44m>>Remember to push tags!\e[0m\n"; \
echo; \
fi
$(TAG):
@printf "\e[1m\e[41mPlease create the \"$(PACKAGE_VERSION)\" tag first\e[0m\n"
@exit 1

## Target to run when building a release
release: release-hook distcheck
release: $(TAG) distcheck
@git status
@for file in $(DIST_ARCHIVES); do \
md5sum $$file > ../$$file.md5; \
sha1sum $$file > ../$$file.sha1; \
Expand Down

0 comments on commit bc49780

Please sign in to comment.