automake-ng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-NG] [FYI] tests: fix a spurious grepping failure


From: Stefano Lattarini
Subject: [Automake-NG] [FYI] tests: fix a spurious grepping failure
Date: Sat, 27 Oct 2012 18:17:01 +0200

* t/per-target-flags.sh: Here.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 t/per-target-flags.sh | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/t/per-target-flags.sh b/t/per-target-flags.sh
index 4114079..f5ca614 100755
--- a/t/per-target-flags.sh
+++ b/t/per-target-flags.sh
@@ -83,7 +83,16 @@ $EGREP '[^-](foo|bar)\.[o$]' $makefiles && exit 1
 
 # All our programs and libraries have per-target flags, so all
 # the compilers invocations must use an explicit '-c' option.
-grep '\$.COMPILE' $makefiles | grep -v ' -c' && exit 1
+# We must be careful to take line continuations into account.
+grep . $makefiles | $PERL -ne '
+  use warnings FATAL => "all";
+  /\$.COMPILE/ or next;
+  $_ .= <STDIN> while (/\\$/);
+  s/\n/[cont]/g;
+  print;
+' > output
+cat output # For debugging.
+grep -v ' -c' output && exit 1
 
 $FGREP 'foo-foo.$(OBJEXT)' Makefile.in
 $FGREP 'foo-foo.$(OBJEXT)' Makefile2.in
-- 
1.8.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]