diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2013-05-22 00:09:30 +0200 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2013-05-22 00:09:30 +0200 |
commit | 4d56c0f3b5973e386c3e5f0fb2367d2fff00bf71 (patch) | |
tree | f0a26a6c57a6018c9405ce3a22ab9eddad70309d /maintainer | |
parent | 60bfe0b9af62baae3498fe8688703570ecb1a93e (diff) | |
parent | c7cfa09349bb588b71ea7adffa385034465b1b09 (diff) | |
download | automake-4d56c0f3b5973e386c3e5f0fb2367d2fff00bf71.tar.gz |
Merge branch 'micro' into maint
* micro:
tests: run_make: options to do command redirection
tests: only activate 'unset' alias if required
tests: better idiom to override make macro defs on the cmdline
test-lib: minor style changes
test-lib: fix botched function name in an error message
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 'maintainer')
-rw-r--r-- | maintainer/syntax-checks.mk | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/maintainer/syntax-checks.mk b/maintainer/syntax-checks.mk index 7e6391b40..e849d1ba6 100644 --- a/maintainer/syntax-checks.mk +++ b/maintainer/syntax-checks.mk @@ -66,6 +66,7 @@ sc_tests_exit_not_Exit \ sc_tests_automake_fails \ sc_tests_required_after_defs \ sc_tests_overriding_macros_on_cmdline \ +sc_tests_no_make_e \ sc_tests_plain_sleep \ sc_tests_ls_t \ sc_m4_am_plain_egrep_fgrep \ @@ -361,6 +362,17 @@ sc_tests_required_after_defs: fi; \ done +# "make -e" is brittle and unsafe, since it let *all* the environment +# win over the macro definitions in the Makefiles. Since we offer +# AM_MAKEFLAGS to allow the user to portably override macro definitions +# from the command line in a safe way, we should encourage users to use +# it. +sc_tests_no_make_e: + @if grep -E '\$$MAKE\b.* -[a-zA-Z0-9]*e' $(xtests); then \ + echo '"make -e" is brittle, use "run_make" instead.' 1>&2; \ + exit 1; \ + fi + ## Overriding a Makefile macro on the command line is not portable when ## recursive targets are used. Better use an envvar. SHELL is an ## exception, POSIX says it can't come from the environment. V, DESTDIR, @@ -369,11 +381,6 @@ sc_tests_required_after_defs: ## Finally, 'exp' is used by some ad-hoc checks, where we ensure it's ## ok to override it from the command line. sc_tests_overriding_macros_on_cmdline: - @if grep -E '\$$MAKE .*(SHELL=.*=|=.*SHELL=)' $(xtests); then \ - echo 'Rewrite "$$MAKE foo=bar SHELL=$$SHELL" as "foo=bar $$MAKE -e SHELL=$$SHELL"' 1>&2; \ - echo ' in the above lines, it is more portable.' 1>&2; \ - exit 1; \ - fi # The first s/// tries to account for usages like "$MAKE || st=$?". # 'DISTCHECK_CONFIGURE_FLAGS' and 'exp' are allowed to contain whitespace in # their definitions, hence the more complex last three substitutions below. @@ -386,16 +393,17 @@ sc_tests_overriding_macros_on_cmdline: -e "s/ exp='[^']*'/ /" \ -e 's/ exp="[^"]*"/ /' \ -e 's/ exp=[^ ]/ /' \ - $(xtests) | grep '\$$MAKE .*='; then \ - echo 'Rewrite "$$MAKE foo=bar" as "foo=bar $$MAKE -e" in the above lines,' 1>&2; \ - echo 'it is more portable.' 1>&2; \ + $(filter-out %/am-test-lib.sh,$(xtests)) \ + | grep '\$$MAKE .*='; then \ + echo 'Rewrite "$$MAKE foo=bar" as "run_make foo=bar" in the lines above,'; \ + echo 'it is more portable.'; \ exit 1; \ - fi + fi >&2 @if grep 'SHELL=.*\$$MAKE' $(xtests); then \ - echo '$$MAKE ignores the SHELL envvar, use "$$MAKE SHELL=$$SHELL" in' 1>&2; \ - echo 'the above lines.' 1>&2; \ + echo '$$MAKE ignores the SHELL envvar, use "run_make SHELL=$$SHELL"'; \ + echo 'in the above lines.'; \ exit 1; \ - fi + fi >&2 ## Prefer use of our 'is_newest' auxiliary script over the more hacky ## idiom "test $(ls -1t new old | sed 1q) = new", which is both more |