From 7ed303705c17b127cc224ee1ddecc53a931d65e5 Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Wed, 22 Jul 2015 01:00:45 +0200 Subject: build: Generate 'ChangeLog' upon 'make dist'. * ChangeLog: Rename to ... * ChangeLog.old: ... this. * ChangeLog: New file. * Makefile.am (gen_start_date): New variable. (gen-ChangeLog, dist-hook): New targets. (EXTRA_DIST): Add 'ChangeLog.old'. * build-aux/gitlog-to-changelog: New file, from Gnulib. --- makefile.am | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'makefile.am') diff --git a/makefile.am b/makefile.am index da26a89..61fbe56 100644 --- a/makefile.am +++ b/makefile.am @@ -26,7 +26,7 @@ CP = @CP@ CLEANFILES = mcron.c -EXTRA_DIST = makefile.ed mcron.c.template BUGS +EXTRA_DIST = makefile.ed mcron.c.template BUGS ChangeLog.old info_TEXINFOS = doc/mcron.texi doc_mcron_TEXINFOS = doc/fdl.texi @@ -46,6 +46,21 @@ mcron.c : scm/mcron/main.scm scm/mcron/crontab.scm makefile.ed mcron.c.template @$(ED) < makefile.ed > /dev/null 2>&1 @rm -f mcron.escaped.scm > /dev/null 2>&1 +dist-hook: gen-ChangeLog + +gen_start_date = 2015-06-26 +.PHONY: gen-ChangeLog +gen-ChangeLog: + $(AM_V_GEN)if test -d $(srcdir)/.git; then \ + log_fix="$(srcdir)/build-aux/git-log-fix"; \ + test -e "$$log_fix" \ + && amend_git_log="--amend=$$log_fix" \ + || amend_git_log=; \ + $(top_srcdir)/build-aux/gitlog-to-changelog \ + $$amend_git_log --since=$(gen_start_date) > $(distdir)/cl-t && \ + { rm -f $(distdir)/ChangeLog && \ + mv $(distdir)/cl-t $(distdir)/ChangeLog; } \ + fi #full program prefix fpp = $(DESTDIR)$(bindir)/@real_program_prefix@ -- cgit v1.2.3