all: hello$s
%$s:$r %.c; \$(info hello.c)
%$s:$r %.f; \$(info hello.f)
-", '', "hello.f\n#MAKE#: Nothing to be done for 'all'.");
+", '-r', "hello.f\n#MAKE#: Nothing to be done for 'all'.");
# Test that make finds the intended implicit rule based on the explicit
# prerequisite of the top goal and despite the existence of a
hello$s: hello.c
%$s:$r %.c; \$(info hello.c)
%$s:$r %.f; \$(info hello.f)
-",
-'',
+", '-r',
"#MAKE#: *** No rule to make target 'hello.c', needed by 'hello$s'. Stop.\n",
512);
%$s:$r %.c; \$(info hello.c)
%$s:$r %.f; \$(info hello.f)
hello.c:; false
-", '', "false\n#MAKE#: *** [#MAKEFILE#:5: hello.c] Error 1\n", 512);
+", '-r', "false\n#MAKE#: *** [#MAKEFILE#:5: hello.c] Error 1\n", 512);
# Test that make finds the intended implicit rule based on existence of a
# prerequisite in the filesystem, even when the prerequisite of another
%$s:$r %.c; \$(info hello.c)
%$s:$r %.f; \$(info hello.f)
unrelated: hello.c
-", '', "hello.f\n#MAKE#: Nothing to be done for 'all'.");
+", '-r', "hello.f\n#MAKE#: Nothing to be done for 'all'.");
# Test that make finds the intended implicit rule based on existence of a
# prerequisite in the filesystem.
all: hello$s
%$s:$r %.c hello.c; \$(info hello.c)
%$s:$r %.f; \$(info hello.f)
-", '', "hello.f\n#MAKE#: Nothing to be done for 'all'.");
+", '-r', "hello.f\n#MAKE#: Nothing to be done for 'all'.");
# '%.o: %.c' rule is skipped and '%.o: %.f' rule is chosen.
# '%.o: %.f hello.f' rule has explicit prerequisite hello.f.
all: hello$s
%$s:$r %.c; \$(info hello.c)
%$s:$r %.f hello.f; \$(info hello.f)
-", '', "hello.f\n#MAKE#: Nothing to be done for 'all'.");
+", '-r', "hello.f\n#MAKE#: Nothing to be done for 'all'.");
# Rule '%: %.f' is chosen, because '%: %.f' requires no intermediates.
# '%: %.c', on the other hand, requires intemediate hello.c to be built by the
%$s:$r %.f; \$(info \$<)
.DEFAULT:; \$(info \$\@) true
unrelated: hello.c
-", '', "hello.f\n#MAKE#: Nothing to be done for 'all'.");
+", '-r', "hello.f\n#MAKE#: Nothing to be done for 'all'.");
# hello.f is missing.
%$s:$r %.f; \$(info \$<)
.DEFAULT:; \$(info \$\@) false
unrelated: hello.c
-", '', "hello.c\nfalse\n#MAKE#: *** [#MAKEFILE#:5: hello.c] Error 1\n", 512);
+", '-r', "hello.c\nfalse\n#MAKE#: *** [#MAKEFILE#:5: hello.c] Error 1\n", 512);
# hello.f is missing.
# No rule is found, because hello.c is not mentioned explicitly.
%$s:$r %.c; \$(info \$<)
%$s:$r %.f; \$(info \$<)
.DEFAULT:; \@\$(info \$\@) false
-",
-'',
-"hello$s\n#MAKE#: *** [#MAKEFILE#:5: hello$s] Error 1\n",
-512);
+", '-r', "hello$s\n#MAKE#: *** [#MAKEFILE#:5: hello$s] Error 1\n", 512);
}
}
%.tsk: %$s; \$(info hello.tsk)
%$s:$r %.c; \$(info hello.c)
%$s:$r %.f; \$(info hello.f)
-", '', "$result", $rcode);
+", '-r', "$result", $rcode);
run_make_test("
all: hello.tsk
%.tsk: %$s hello$s; \$(info hello.tsk)
%$s:$r %.c; \$(info hello.c)
%$s:$r %.f; \$(info hello.f)
-", '', $result, $rcode);
+", '-r', $result, $rcode);
run_make_test("
all: hello.tsk
%.tsk: %$s; \$(info hello.tsk)
%$s:$r %.c hello$s; \$(info hello.c)
%$s:$r %.f; \$(info hello.f)
-", '', $result, $rcode);
+", '-r', $result, $rcode);
}
}
%.tsk: %.o; \$(info hello.tsk)
%.o:$r %.c; \$(info hello.c)
%.o:$r %.f %.tsk; \$(info hello.f)
-",
-'-R',
+", '-r',
"#MAKE#: Circular hello.o <- hello.tsk dependency dropped.\nhello.f\nhello.tsk\n#MAKE#: Nothing to be done for 'all'.");
}
%.tsk: %$s; \$(info hello.tsk)
%$s:$r %.c; \$(info hello.c)
%$s:$r %.f; \$(info hello.f)
-",
-'',
+", '-r',
"#MAKE#: *** No rule to make target 'hello.c', needed by 'hello$s'. Stop.\n",
512);
}
%$s:$r %.c; \$(info hello.c)
%$s:$r %.f; \$(info hello.f)
hello.c:; false
-", '', $result, 512);
+", '-r', $result, 512);
}
}
%$s:$r %.c; \$(info hello.c)
%$s:$r %.f; \$(info hello.f)
unrelated: hello$s
-", '', "hello.f\nhello.tsk\n#MAKE#: Nothing to be done for 'all'.");
+", '-r', "hello.f\nhello.tsk\n#MAKE#: Nothing to be done for 'all'.");
}
}
%.tsk: %$s; \$(info hello.tsk)
%$s:$r %.c; \$(info hello.c)
%$s:$r %.f hello.f; \$(info hello.f)
-", '', $result, $rcode);
+", '-r', $result, $rcode);
}
}
%$s:$r %.f; \$(info hello.f)
unrelated: hello$s
%.x:$r %.z; \$(info hello.z)
-",
-'',
+", '-r',
"#MAKE#: *** No rule to make target 'hello$s', needed by 'hello.tsk'. Stop.\n",
512);
}
%.tsk: %.x; touch hello.tsk
%.x: ;
unrelated: hello.x
-", '', "touch hello.tsk\n");
+", '-r', "touch hello.tsk\n");
unlink('hello.tsk');
touch ('hello.f');
# hello.c prerequisite causes '%: %.c' rule to be chosen.
run_make_test(q!
hello: hello.c
-!,
-'FC="@echo f77" OUTPUT_OPTION=',
+!, 'FC="@echo f77" OUTPUT_OPTION=',
"#MAKE#: *** No rule to make target 'hello.c', needed by 'hello'. Stop.\n",
512);
# hello.c prerequisite causes '%.o: %.c' rule to be chosen.
run_make_test(q!
hello.o: hello.c
-!,
-'FC="@echo f77" OUTPUT_OPTION=',
+!, 'FC="@echo f77" OUTPUT_OPTION=',
"#MAKE#: *** No rule to make target 'hello.c', needed by 'hello.o'. Stop.\n",
512);
all: hello.o
unrelated: hello.c
%.o: %.f
-!,
-'',
+!, '',
"#MAKE#: *** No rule to make target 'hello.c', needed by 'hello.o'. Stop.\n",
512);
all: hello.tsk
%.tsk: %; $(info $@ from $<)
unrelated: hello
-!,
-'FC="@echo f77" OUTPUT_OPTION=',
+!, 'FC="@echo f77" OUTPUT_OPTION=',
"f77 hello.f -o hello\nhello.tsk from hello\n");
# In this test the builtin match-anything rule %: %.f cannot be used to build
run_make_test(q!
all: hello.tsk
%.tsk: %; $(info $@ from $<)
-!,
-'FC="@echo f77" OUTPUT_OPTION=',
+!, 'FC="@echo f77" OUTPUT_OPTION=',
"#MAKE#: *** No rule to make target 'hello.tsk', needed by 'all'. Stop.\n",
512);
%.tsk: % %.x; $(info $@ from $^)
unrelated: hello
%.x: %.xx; $(info $@ from $<)
-!,
-'FC="@echo f77" OUTPUT_OPTION=',
+!, 'FC="@echo f77" OUTPUT_OPTION=',
"f77 hello.f -o hello\nhello.x from hello.xx\nhello.tsk from hello hello.x\n");
unlink('bye.o', 'bye.tsk', 'bye.x');
%.tsk: %.o; $(info $@ from $<)
.DEFAULT:; $(info bye.o)
unrelated: bye.o
-!, '', "bye.o\nbye.tsk from bye.o\n#MAKE#: Nothing to be done for 'all'.");
+!, '-r', "bye.o\nbye.tsk from bye.o\n#MAKE#: Nothing to be done for 'all'.");
touch('bye.xx');
# This is just like the one above, but compatibility rule '%.tsk: %.o %.x' has 2
.DEFAULT:; $(info bye.o)
unrelated: bye.o
%.x: %.xx; $(info $@ from $<)
-!, '',
+!, '-r',
"bye.o\nbye.x from bye.xx\nbye.tsk from bye.o bye.x\n#MAKE#: Nothing to be done for 'all'.");
unlink('hello.f', 'hello.z', 'hello.xx', 'bye.xx');
%.tsk: hello.x; $(info $@)
%.x:; $(flags)
hello.x: flags:=true
-!, '', "true\nhello.tsk\n");
+!, '-r', "true\nhello.tsk\n");
# Similar to the one above, but this time 'hello.x' is derived from the stem.
run_make_test(q!
%.tsk: %.x; $(info $@)
%.x:; $(flags)
hello.x: flags:=true
-!, '', "true\nhello.tsk\n");
+!, '-r', "true\nhello.tsk\n");
# Similar to the one above, this time 'hello.x' is also mentioned explicitly on
# an unrelated rule.
%.x:; $(flags)
hello.x: flags:=true
unrelated: hello.x
-!, '', "true\nhello.tsk\n");
+!, '-r', "true\nhello.tsk\n");
# 'hello.x' has a pattern specific variable.
run_make_test(q!
%.tsk: %.x; $(info $@)
%.x:; $(flags)
%.x: flags:=true
-!, '', "true\nhello.tsk\n");
+!, '-r', "true\nhello.tsk\n");
# 'hello.x' has a target specific variable and a pattern specific variable.
run_make_test(q!
%.x:; $(flags)
hello.x: flags+=good
%.x: flags:=true
-!, '', "true good\nhello.tsk\n");
+!, '-r', "true good\nhello.tsk\n");
# Intermediate prerequisite 'hello.x' has a target specific variable, a pattern
# specfic variable, matches on both rules '%.tsk: %.x' and 'big_%.tsk: %.x'.
%.x:; $(flags)
hello.x: flags+=good
%.x: flags:=true
-!, '', "true good\nhello.tsk\nbig_hello.tsk\n");
+!, '-r', "true good\nhello.tsk\nbig_hello.tsk\n");
# This tells the test driver that the perl test script executed properly.