]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: fix a spurious grepping failure
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 27 Oct 2012 16:16:34 +0000 (18:16 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 27 Oct 2012 16:16:34 +0000 (18:16 +0200)
* t/per-target-flags.sh: Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
t/per-target-flags.sh

index 4114079cbf6131d180cc2ab81d50f8640deb0cb4..f5ca614757a3a8dc01334734ee9f6836ed86df3d 100755 (executable)
@@ -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