diff options
author | Thomas Deutschmann <whissi@gentoo.org> | 2019-03-10 04:18:51 +0100 |
---|---|---|
committer | Thomas Deutschmann <whissi@gentoo.org> | 2019-03-10 04:18:51 +0100 |
commit | 4a507f5d088260c117fc3836ecc66e468af4849b (patch) | |
tree | 74cbf5cee4a9dc53d266170135b83c0cf321b058 | |
parent | Reorganize file structure (diff) | |
download | eselect-rust-4a507f5d088260c117fc3836ecc66e468af4849b.tar.gz eselect-rust-4a507f5d088260c117fc3836ecc66e468af4849b.tar.bz2 eselect-rust-4a507f5d088260c117fc3836ecc66e468af4849b.zip |
Generate & add ChangeLog when creating dist target
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
-rw-r--r-- | Makefile.am | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index 144bee4..b969189 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,2 +1,20 @@ eselectdir = $(datadir)/eselect/modules dist_eselect_DATA = rust.eselect + +dist-hook: gen-ChangeLog + +.PHONY: gen-ChangeLog +gen-ChangeLog: + @if test -d "$(top_srcdir)/.git"; \ + then \ + echo "Creating ChangeLog ..." && \ + ( cd "$(top_srcdir)" && \ + echo '# Generated by Makefile. Do not edit.'; echo; \ + git log --no-color --no-decorate ) > ChangeLog.tmp \ + && mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \ + || ( rm -f ChangeLog.tmp ; \ + echo "Failed to generate ChangeLog" >&2; \ + exit 1; ); \ + else \ + echo "A git clone is required to generate a ChangeLog" >&2; \ + fi |