From e10cbf0a2af598d44229525ccd58869b24b62ed5 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Mon, 28 May 2012 10:26:56 +0200 Subject: [PATCH] [ng] maintcheck: refactor checks on obsolete variable names This is just a preparatory refactoring, to make future additions easier. * syntax-checks.mk (sc_renamed_variables_rules): New autocomputed variable. ($(sc_renamed_variables_rules)): New static pattern rule, subsuming most of the existing checks against the use of old names for some automake provided make variables. (syntax_check_rules): Add the contents of the new variable, and do not explicitly list the checks subsumed by it. Signed-off-by: Stefano Lattarini --- syntax-checks.mk | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/syntax-checks.mk b/syntax-checks.mk index e567c968c..b34a35d07 100644 --- a/syntax-checks.mk +++ b/syntax-checks.mk @@ -62,12 +62,7 @@ sc_tests_make_can_chain_suffix_rules \ sc_tests_make_dont_do_useless_vpath_rebuilds \ sc_no_dotmake_target \ sc_no_am_makeflags \ -sc_no_DISTFILES \ -sc_no_DIST_COMMON \ -sc_no_DIST_SOURCES \ -sc_no_am_TEST_BASES \ -sc_no_am_TEST_RESULTS \ -sc_no_am_TEST_LOGS \ +$(sc_renamed_variables_rules) \ sc_no_RECHECK_LOGS \ sc_tests_no_make_e \ sc_docs_no_make_e \ @@ -323,11 +318,17 @@ sc_no_am_makeflags: fi # Modern names for internal variables that had a bad name once. -modern_DISTFILES = am__dist_files -modern_DIST_COMMON = am__dist_common -modern_DIST_SOURCES = am__dist_sources +modern.DISTFILES = am__dist_files +modern.DIST_COMMON = am__dist_common +modern.DIST_SOURCES = am__dist_sources +modern.am__TEST_BASES = am__test_bases +modern.am__TEST_LOGS = am__test_logs +modern.am__TEST_RESULTS = am__test_results -sc_no_DISTFILES sc_no_DIST_COMMON sc_no_DIST_SOURCES: sc_no_% : +sc_renamed_variables_rules = \ + $(patsubst modern.%,sc_no_%,$(filter modern.%,$(.VARIABLES))) + +$(sc_renamed_variables_rules): sc_no_% : @files="\ $(xtests) \ $(pms) \ @@ -337,21 +338,7 @@ sc_no_DISTFILES sc_no_DIST_COMMON sc_no_DIST_SOURCES: sc_no_% : "; \ if grep -F '$*' $$files; then \ echo "'\$$($*)' is obsolete and no more used." >&2; \ - echo "You should use '$(modern_$*)' instead." >&2; \ - exit 1; \ - fi - -sc_no_am_TEST_BASES sc_no_am_TEST_RESULTS sc_no_am_TEST_LOGS: sc_no_am_% : - @files="\ - $(xtests) \ - $(pms) \ - $(ams) \ - $(srcdir)/automake.in \ - "; \ - tolower () { LC_ALL=C tr '[A-Z]' '[a-z]'; }; \ - if grep -F 'am__$*' $$files; then \ - echo "'\$$(am__$*)' is obsolete and no more used." >&2; \ - echo "You should use 'am__`echo $* | tolower`' instead." >&2; \ + echo "You should use '$(modern.$*)' instead." >&2; \ exit 1; \ fi -- 2.47.2