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.
This commit is contained in:
Mathieu Lirzin 2015-07-22 01:00:45 +02:00
commit 7ed303705c
4 changed files with 658 additions and 165 deletions

View file

@ -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@