summaryrefslogtreecommitdiff
path: root/tests/scripts
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2012-09-09 19:19:15 +0000
committerPaul Smith <psmith@gnu.org>2012-09-09 19:19:15 +0000
commit30b2e4207d2f41c64e843959119a03307e06aa9a (patch)
treec858ba345b9986ce82e3bde71a0f92a3d20aca3d /tests/scripts
parent7f5309ebb4e2b3c57035a3b12f72d2f26cfee91b (diff)
downloadgunmake-30b2e4207d2f41c64e843959119a03307e06aa9a.tar.gz
When .POSIX: is specified use POSIX-standard macro values by default.
Diffstat (limited to 'tests/scripts')
-rw-r--r--tests/scripts/targets/POSIX25
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/scripts/targets/POSIX b/tests/scripts/targets/POSIX
index 35c59b1..a24e3bc 100644
--- a/tests/scripts/targets/POSIX
+++ b/tests/scripts/targets/POSIX
@@ -1,6 +1,6 @@
# -*-perl-*-
-$description = "Test the behaviour of the .PHONY target.";
+$description = "Test the behaviour of the .POSIX target.";
$details = "";
@@ -30,5 +30,28 @@ all: ; \@$script
!,
'', $out);
+# Test the default value of various POSIX-specific variables
+my %POSIX = (AR => 'ar', ARFLAGS => '-rv',
+ YACC => 'yacc', YFLAGS => '',
+ LEX => 'lex', LFLAGS => '',
+ LDFLAGS => '',
+ CC => 'c99', CFLAGS => '-O',
+ FC => 'fort77', FFLAGS => '-O 1',
+ GET => 'get', GFLAGS => '',
+ SCCSFLAGS => '', SCCSGETFLAGS => '-s');
+my $make = join('', map { "\t\@echo '$_=\$($_)'\n" } sort keys %POSIX);
+my $r = join('', map { "$_=$POSIX{$_}\n"} sort keys %POSIX);
+run_make_test(qq!
+.POSIX:
+all:
+$make
+!,
+ '', $r);
+
+# Make sure that local settings take precedence
+%extraENV = map { $_ => "xx-$_" } keys %POSIX;
+$r = join('', map { "$_=xx-$_\n"} sort keys %POSIX);
+run_make_test(undef, '', $r);
+
# This tells the test driver that the perl test script executed properly.
1;