2 $description = "Test order-only prerequisites.";
5 Create makefiles with various combinations of normal and order-only
6 prerequisites and ensure they behave properly. Test the \$| variable.";
11 %r: | baz ; @echo $< $^ $|
17 # TEST #1 -- First try: the order-only prereqs need to be built.
29 '', "touch bar\ntouch baz\n\$^ = bar\n\$| = baz\ntouch foo\n");
32 # TEST #2 -- now we do it again: baz is PHONY but foo should _NOT_ be updated
34 run_make_test(undef, '', "touch baz\n");
36 unlink(qw(foo bar baz));
38 # TEST #3 -- Make sure the order-only prereq was promoted to normal.
52 '', "touch bar\ntouch baz\n\$^ = bar baz\n\$| = \ntouch foo\n");
55 # TEST #4 -- now we do it again
57 run_make_test(undef, '', "touch baz\n\$^ = bar baz\n\$| = \ntouch foo\n");
59 unlink(qw(foo bar baz));
61 # Test empty normal prereqs
63 # TEST #5 -- make sure the parser was correct.
75 '', "touch baz\n\$^ = \n\$| = baz\ntouch foo\n");
77 # TEST #6 -- now we do it again: this time foo won't be built
79 run_make_test(undef, '', "touch baz\n");
83 # Test order-only in pattern rules
85 # TEST #7 -- make sure the parser was correct.
99 "touch foo.x\ntouch baz\n\$^ = foo.x\n\$| = baz\ntouch foo.w\n");
101 # TEST #8 -- now we do it again: this time foo.w won't be built
103 run_make_test(undef, '', "touch baz\n");
105 unlink(qw(foo.w foo.x baz));
107 # TEST #9 -- make sure that $< is set correctly in the face of order-only
108 # prerequisites in pattern rules.
111 %r: | baz ; @echo $< $^ $|
115 '', "foo foo baz\n");