Imported Upstream version 4.0
[platform/upstream/make.git] / tests / scripts / targets / ONESHELL
index 997423f..87713da 100644 (file)
@@ -4,6 +4,10 @@ $description = "Test the behaviour of the .ONESHELL target.";
 
 $details = "";
 
+# Some shells (*shakes fist at Solaris*) cannot handle multiple flags in
+# separate arguments.
+my $t = `/bin/sh -e -c true 2>/dev/null`;
+my $multi_ok = $? == 0;
 
 # Simple
 
@@ -17,6 +21,21 @@ all:
 [ 0"$a" -eq "$$" ] || echo fail
 ');
 
+# Simple but use multi-word SHELLFLAGS
+
+if ($multi_ok) {
+    run_make_test(q!
+.ONESHELL:
+.SHELLFLAGS = -e -c
+all:
+       a=$$$$
+       [ 0"$$a" -eq "$$$$" ] || echo fail
+!,
+              '', 'a=$$
+[ 0"$a" -eq "$$" ] || echo fail
+');
+}
+
 # Again, but this time with inner prefix chars
 
 run_make_test(q!