diff options
-rw-r--r-- | bin/local.mk | 6 | ||||
-rw-r--r-- | cfg.mk | 12 | ||||
-rw-r--r-- | configure.ac | 5 | ||||
-rw-r--r-- | lib/Makefile.am | 6 |
4 files changed, 19 insertions, 10 deletions
diff --git a/bin/local.mk b/bin/local.mk index 57983f82..ff7b2cfd 100644 --- a/bin/local.mk +++ b/bin/local.mk @@ -38,10 +38,6 @@ EXTRA_DIST += \ # Files that should be removed, but which Automake does not know. MOSTLYCLEANFILES += $(bin_SCRIPTS) bin/autoconf.in bin/*.tmp -# Get the release year from ChangeLog. -RELEASE_YEAR = \ - `sed 's/^\([0-9][0-9][0-9][0-9]\).*/\1/;q' $(top_srcdir)/ChangeLog` - ## ------------- ## ## The scripts. ## ## ------------- ## @@ -60,7 +56,7 @@ edit = sed \ -e 's|@M4_DEBUGFILE[@]|$(M4_DEBUGFILE)|g' \ -e 's|@M4_GNU[@]|$(M4_GNU)|g' \ -e 's|@AWK[@]|$(AWK)|g' \ - -e 's|@RELEASE_YEAR[@]|'$(RELEASE_YEAR)'|g' \ + -e 's|@RELEASE_YEAR[@]|$(RELEASE_YEAR)|g' \ -e 's|@VERSION[@]|$(VERSION)|g' \ -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \ -e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g' @@ -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 diff --git a/configure.ac b/configure.ac index b3f3fa9c..91f6a74a 100644 --- a/configure.ac +++ b/configure.ac @@ -27,6 +27,11 @@ AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE([1.11 dist-xz readme-alpha no-texinfo.tex std-options]) +# Keep this on a line of its own, since it must be found and processed +# by the 'update-release-year' rule in our Makefile. +RELEASE_YEAR=2013 +AC_SUBST([RELEASE_YEAR]) + AB_INIT # We use '/bin/sh -n script' to check that there are no syntax errors diff --git a/lib/Makefile.am b/lib/Makefile.am index 1004622b..2b4c494d 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -162,10 +162,6 @@ nodist_m4sugarlib_DATA = \ CLEANFILES += $(nodist_m4sugarlib_DATA) -# Get the release year from ../ChangeLog. -RELEASE_YEAR = \ - `sed 's/^\([0-9][0-9][0-9][0-9]\).*/\1/;q' $(top_srcdir)/ChangeLog` - # The ':;' in the second line of the recipe works around a redirected # compound command bash exit status bug. m4sugar/version.m4: Makefile @@ -182,7 +178,7 @@ m4sugar/version.m4: Makefile echo 'm4_define([m4_PACKAGE_STRING], [$(PACKAGE_STRING)])' && \ echo 'm4_define([m4_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])' && \ echo 'm4_define([m4_PACKAGE_URL], [$(PACKAGE_URL)])' && \ - echo 'm4_define([m4_PACKAGE_YEAR], ['$(RELEASE_YEAR)'])'; \ + echo 'm4_define([m4_PACKAGE_YEAR], [$(RELEASE_YEAR)])'; \ } > $@-t mv $@-t $@ |