From: Ralf Wildenhues Date: Sun, 3 Oct 2010 09:42:12 +0000 (+0200) Subject: Document and fix expansion of variables before rules. X-Git-Tag: v1.11.1b~47^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8c1325a9f839efbd7cbab203eca8d2a26e2ff66;p=thirdparty%2Fautomake.git Document and fix expansion of variables before rules. * doc/automake.texi (General Operation): Document that variables are expanded before rules. * lib/am/check.am (am__check_post): Reword a bit so it does not get matched as a rule. Suggestion by Ben Pfaff. Signed-off-by: Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index 82044a347..209038198 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-10-03 Ralf Wildenhues + + Document and fix expansion of variables before rules. + * doc/automake.texi (General Operation): Document that variables + are expanded before rules. + * lib/am/check.am (am__check_post): Reword a bit so it does not + get matched as a rule. + Suggestion by Ben Pfaff. + 2010-10-02 Ralf Wildenhues Revert "parallel-tests: avoid command-line length limit issue." diff --git a/doc/automake.texi b/doc/automake.texi index e3589d82f..8848dcd40 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -1763,7 +1763,8 @@ for compiling and linking programs to be generated. @trindex git-dist The variable definitions and rules in the @file{Makefile.am} are -copied verbatim into the generated file. This allows you to add +copied mostly verbatim into the generated file, with all variable +definitions preceding all rules. This allows you to add almost arbitrary code into the generated @file{Makefile.in}. For instance, the Automake distribution includes a non-standard rule for the @code{git-dist} target, which the Automake maintainer uses to make diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in index 09d3a6334..816778812 100644 --- a/lib/Automake/tests/Makefile.in +++ b/lib/Automake/tests/Makefile.in @@ -139,6 +139,35 @@ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; __SAVED_TERM=$$TERM; \ $(TESTS_ENVIRONMENT) +# To be appended to the command running the test. Handle the stdout +# and stderr redirection, and catch the exit status. +am__check_post = \ +>$@-t 2>&1; \ +estatus=$$?; \ +if test -n '$(DISABLE_HARD_ERRORS)' \ + && test $$estatus -eq 99; then \ + estatus=1; \ +fi; \ +TERM=$$__SAVED_TERM; export TERM; \ +$(am__tty_colors); \ +xfailed=PASS; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + xfailed=XFAIL;; \ +esac; \ +case $$estatus.$$xfailed in \ + 0.XFAIL) col=$$red; res=XPASS;; \ + 0.*) col=$$grn; res=PASS ;; \ + 77.*) col=$$blu; res=SKIP ;; \ + 99.*) col=$$red; res=FAIL ;; \ + *.XFAIL) col=$$lgn; res=XFAIL;; \ + *.*) col=$$red; res=FAIL ;; \ +esac; \ +echo "$${col}$$res$${std}: $$f"; \ +echo "$$res: $$f (exit: $$estatus)" | \ + $(am__rst_section) >$@; \ +cat $@-t >>$@; \ +rm -f $@-t RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check check-html recheck recheck-html TEST_SUITE_LOG = test-suite.log @@ -291,36 +320,6 @@ ctags: CTAGS CTAGS: -# To be appended to the command running the test. Handle the stdout -# and stderr redirection, and catch the exit status. -am__check_post = \ ->$@-t 2>&1; \ -estatus=$$?; \ -if test -n '$(DISABLE_HARD_ERRORS)' \ - && test $$estatus -eq 99; then \ - estatus=1; \ -fi; \ -TERM=$$__SAVED_TERM; export TERM; \ -$(am__tty_colors); \ -xfailed=PASS; \ -case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ - xfailed=XFAIL;; \ -esac; \ -case $$estatus:$$xfailed in \ - 0:XFAIL) col=$$red; res=XPASS;; \ - 0:*) col=$$grn; res=PASS ;; \ - 77:*) col=$$blu; res=SKIP ;; \ - 99:*) col=$$red; res=FAIL ;; \ - *:XFAIL) col=$$lgn; res=XFAIL;; \ - *:*) col=$$red; res=FAIL ;; \ -esac; \ -echo "$${col}$$res$${std}: $$f"; \ -echo "$$res: $$f (exit: $$estatus)" | \ - $(am__rst_section) >$@; \ -cat $@-t >>$@; \ -rm -f $@-t - $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__sh_e_setup); \ list='$(TEST_LOGS)'; \ diff --git a/lib/am/check.am b/lib/am/check.am index c612b2274..c953be877 100644 --- a/lib/am/check.am +++ b/lib/am/check.am @@ -128,13 +128,13 @@ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ xfailed=XFAIL;; \ esac; \ -case $$estatus:$$xfailed in \ - 0:XFAIL) col=$$red; res=XPASS;; \ - 0:*) col=$$grn; res=PASS ;; \ - 77:*) col=$$blu; res=SKIP ;; \ - 99:*) col=$$red; res=FAIL ;; \ - *:XFAIL) col=$$lgn; res=XFAIL;; \ - *:*) col=$$red; res=FAIL ;; \ +case $$estatus.$$xfailed in \ + 0.XFAIL) col=$$red; res=XPASS;; \ + 0.*) col=$$grn; res=PASS ;; \ + 77.*) col=$$blu; res=SKIP ;; \ + 99.*) col=$$red; res=FAIL ;; \ + *.XFAIL) col=$$lgn; res=XFAIL;; \ + *.*) col=$$red; res=FAIL ;; \ esac; \ echo "$${col}$$res$${std}: $$f"; \ echo "$$res: $$f (exit: $$estatus)" | \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 213f41a27..a9b1cbba5 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -142,6 +142,35 @@ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; __SAVED_TERM=$$TERM; \ $(TESTS_ENVIRONMENT) +# To be appended to the command running the test. Handle the stdout +# and stderr redirection, and catch the exit status. +am__check_post = \ +>$@-t 2>&1; \ +estatus=$$?; \ +if test -n '$(DISABLE_HARD_ERRORS)' \ + && test $$estatus -eq 99; then \ + estatus=1; \ +fi; \ +TERM=$$__SAVED_TERM; export TERM; \ +$(am__tty_colors); \ +xfailed=PASS; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + xfailed=XFAIL;; \ +esac; \ +case $$estatus.$$xfailed in \ + 0.XFAIL) col=$$red; res=XPASS;; \ + 0.*) col=$$grn; res=PASS ;; \ + 77.*) col=$$blu; res=SKIP ;; \ + 99.*) col=$$red; res=FAIL ;; \ + *.XFAIL) col=$$lgn; res=XFAIL;; \ + *.*) col=$$red; res=FAIL ;; \ +esac; \ +echo "$${col}$$res$${std}: $$f"; \ +echo "$$res: $$f (exit: $$estatus)" | \ + $(am__rst_section) >$@; \ +cat $@-t >>$@; \ +rm -f $@-t RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check check-html recheck recheck-html TEST_SUITE_LOG = test-suite.log @@ -1082,36 +1111,6 @@ ctags: CTAGS CTAGS: -# To be appended to the command running the test. Handle the stdout -# and stderr redirection, and catch the exit status. -am__check_post = \ ->$@-t 2>&1; \ -estatus=$$?; \ -if test -n '$(DISABLE_HARD_ERRORS)' \ - && test $$estatus -eq 99; then \ - estatus=1; \ -fi; \ -TERM=$$__SAVED_TERM; export TERM; \ -$(am__tty_colors); \ -xfailed=PASS; \ -case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ - xfailed=XFAIL;; \ -esac; \ -case $$estatus:$$xfailed in \ - 0:XFAIL) col=$$red; res=XPASS;; \ - 0:*) col=$$grn; res=PASS ;; \ - 77:*) col=$$blu; res=SKIP ;; \ - 99:*) col=$$red; res=FAIL ;; \ - *:XFAIL) col=$$lgn; res=XFAIL;; \ - *:*) col=$$red; res=FAIL ;; \ -esac; \ -echo "$${col}$$res$${std}: $$f"; \ -echo "$$res: $$f (exit: $$estatus)" | \ - $(am__rst_section) >$@; \ -cat $@-t >>$@; \ -rm -f $@-t - $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__sh_e_setup); \ list='$(TEST_LOGS)'; \