# 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. ##
## ------------- ##
-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'
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
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
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
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 $@