From f8ac780d14229e99d70b46b50e3d026e2c93a6a3 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Sun, 5 May 2013 20:16:25 +0200 Subject: build: define RELEASE_YEAR with AC_SUBST Rather than reading it dynamically from the ChangeLog -- that, remember, is only a dummy in a Git checkout! To avoid risking the definition to get out-of-sync, let's enhance the maintainer target 'update-copyright' to update it automatically (the same way it's done in the Automake build system). * configure.ac (RELEASE_YEAR): New AC_SUBST'd variable. * cfg.mk (update-release-year): New maintainer-specific target to automatically update the value of that variable. (update-copyright): Depend on the new target. * bin/local.mk (RELEASE_YEAR): Drop definition. (edit): Simplify quoting of $(RELEASE_YEAR). * lib/Makefile.am (RELEASE_YEAR): Drop definition. (m4sugar/version.m4): Simplify quoting of $(RELEASE_YEAR). Signed-off-by: Stefano Lattarini --- cfg.mk | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'cfg.mk') diff --git a/cfg.mk b/cfg.mk index a57196e2..980eab97 100644 --- a/cfg.mk +++ b/cfg.mk @@ -123,6 +123,18 @@ update-copyright-env = \ UPDATE_COPYRIGHT_USE_INTERVALS=1 \ UPDATE_COPYRIGHT_MAX_LINE_LENGTH=72 +update-copyright: update-release-year +update-release-year: + $(AM_V_GEN):; \ + if test -n "$$UPDATE_COPYRIGHT_YEAR"; then \ + current_year=$$UPDATE_COPYRIGHT_YEAR; \ + else \ + current_year=`date +%Y` && test -n "$$current_year" \ + || { echo "$@: cannot get current year" >&2; exit 1; }; \ + fi; \ + sed -i "/^RELEASE_YEAR=/s/=.*$$/=$$current_year/" configure.ac +.PHONY: update-release-year + # Prevent incorrect NEWS edits. old_NEWS_hash = 8532b4ed4fb456eb71071a5cf8c258d4 -- cgit v1.2.1