unlink('inc.mk');
-# Test recursion when make doesn't think it exists.
+# Test recursion which is hidden from make.
# See Savannah bug #39934
# Or Red Hat bug https://bugzilla.redhat.com/show_bug.cgi?id=885474
-
-open(MAKEFILE,"> Makefile2");
-print MAKEFILE '
-vpath %.c ../
-foo:
-';
-close(MAKEFILE);
-
-run_make_test(q!
+# Windows doesn't use a pipe, and doesn't close access, so this won't happen.
+if ($port_type ne 'W32') {
+ open(MAKEFILE,"> Makefile2");
+ print MAKEFILE '
+ vpath %.c ../
+ foo:
+ ';
+ close(MAKEFILE);
+
+ run_make_test(q!
default: ; @ #MAKEPATH# -f Makefile2
!,
"-j2 $np",
"#MAKE#[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
#MAKE#[1]: Nothing to be done for 'foo'.");
-rmfiles('Makefile2');
+ rmfiles('Makefile2');
+}
1;
OK := $(.SHELLSTATUS)
$(shell exit 1)
BAD := $(.SHELLSTATUS)
-$(shell kill -2 $$$$)
-SIG := $(.SHELLSTATUS)
all: ; @echo PRE=$(PRE) OK=$(OK) BAD=$(BAD)
','','PRE= OK=0 BAD=1');
-run_make_test('.PHONY: all
-$(shell kill -2 $$$$)
-SIG := $(.SHELLSTATUS)
-all: ; @echo SIG=$(SIG)
- ','','SIG=130');
-
# Test unescaped comment characters in shells. Savannah bug #20513
run_make_test(q!
FOO := $(shell echo '#')
all: ; @echo $$HI
','','hi');
-# Test shell errors in recipes including offset
-# This needs to be ported to Windows, or else Windows error messages
-# need to converted to look like more normal make errors.
if ($port_type ne 'W32') {
+ # Test shell errors in recipes including offset
+ # This needs to be ported to Windows, or else Windows error messages
+ # need to converted to look like more normal make errors.
run_make_test('
all:
@echo hi
@echo there
',
'', "#MAKE#: ./basdfdfsed: Command not found\nhi\nthere\n");
+
+ # Test SHELLSTATUS for kill.
+ # This test could be ported to Windows, using taskkill ... ?
+ run_make_test('.PHONY: all
+$(shell kill -2 $$$$)
+SIG := $(.SHELLSTATUS)
+all: ; @echo SIG=$(SIG)
+ ','','SIG=130');
}
1;
run_make_test("dquote:;\@echo \"dqu\\\note\"\n",
'', 'dquote');
-run_make_test("squote:;\@echo 'squ\\\note'\n",
+# Single quotes don't behave the same in Windows
+if ($port_type ne 'W32') {
+ run_make_test("squote:;\@echo 'squ\\\note'\n",
'', "squ\\\note");
+}
# Ensure that a leading prefix character is omitted
run_make_test("fast:;\@echo fa\\\n\tst\n",
run_make_test("dquote:;\@echo \"dqu\\\n\tote\"\n",
'', 'dquote');
-run_make_test("squote:;\@echo 'squ\\\n\tote'\n",
+# Single quotes don't behave the same in Windows
+if ($port_type ne 'W32') {
+ run_make_test("squote:;\@echo 'squ\\\n\tote'\n",
'', "squ\\\note");
+}
# Ensure that ONLY the leading prefix character is omitted
run_make_test("fast:;\@echo fa\\\n\t st\n",
foo bar');
# Test the fastpath / single quotes
-run_make_test("
+# Single quotes don't behave the same in Windows
+if ($port_type ne 'W32') {
+ run_make_test("
all:
\@echo 'foo\\
bar'
bar
foo \
bar');
+}
# Test the fastpath / double quotes
run_make_test('
# If we don't have a POSIX shell available, never mind
$is_posix_sh or return -1;
+# On Windows, shell names might not match
+if ($port_type eq 'W32') {
+ return -1;
+}
+
$mshell = $sh_name;
# According to POSIX, the value of SHELL in the environment has no impact on