2010-07-06 14:37:42 +08:00
|
|
|
# -*-perl-*-
|
|
|
|
|
|
|
|
$description = "Test the behaviour of the .PHONY target.";
|
|
|
|
|
|
|
|
$details = "";
|
|
|
|
|
|
|
|
|
|
|
|
# Ensure turning on .POSIX enables the -e flag for the shell
|
2010-07-28 13:39:50 +08:00
|
|
|
# We can't assume the exit value of "false" because on different systems it's
|
|
|
|
# different.
|
|
|
|
|
|
|
|
my $script = 'false; true';
|
|
|
|
my $flags = '-ec';
|
|
|
|
my $out = `/bin/sh $flags '$script' 2>&1`;
|
|
|
|
my $err = $? >> 8;
|
|
|
|
run_make_test(qq!
|
2010-07-06 14:37:42 +08:00
|
|
|
.POSIX:
|
2010-07-28 13:39:50 +08:00
|
|
|
all: ; \@$script
|
2010-07-06 14:37:42 +08:00
|
|
|
!,
|
2012-03-04 08:24:20 +08:00
|
|
|
'', "#MAKEFILE#:3: recipe for target 'all' failed
|
2010-08-30 07:05:26 +08:00
|
|
|
#MAKE#: *** [all] Error $err\n", 512);
|
2010-07-06 14:37:42 +08:00
|
|
|
|
|
|
|
# User settings must override .POSIX
|
2010-07-28 13:39:50 +08:00
|
|
|
$flags = '-xc';
|
|
|
|
$out = `/bin/sh $flags '$script' 2>&1`;
|
|
|
|
run_make_test(qq!
|
|
|
|
.SHELLFLAGS = $flags
|
2010-07-06 14:37:42 +08:00
|
|
|
.POSIX:
|
2010-07-28 13:39:50 +08:00
|
|
|
all: ; \@$script
|
2010-07-06 14:37:42 +08:00
|
|
|
!,
|
2010-07-28 13:39:50 +08:00
|
|
|
'', $out);
|
2010-07-06 14:37:42 +08:00
|
|
|
|
|
|
|
# This tells the test driver that the perl test script executed properly.
|
|
|
|
1;
|