2 $description = "Test handling of static pattern rules.";
5 The makefile created in this test has three targets. The
6 filter command is used to get those target names ending in
7 .o and statically creates a compile command with the target
8 name and the target name with .c. It also does the same thing
9 for another target filtered with .elc and creates a command
12 &touch('bar.c', 'lose.c');
18 files = foo.elc bar.o lose.o
20 $(filter %.o,$(files)): %.o: %.c ; @echo CC -c $(CFLAGS) $< -o $@
22 $(filter %.elc,$(files)): %.elc: %.el ; @echo emacs $<
25 'CC -c bar.c -o bar.o');
30 run_make_test(undef, 'lose.o', 'CC -c lose.c -o lose.o');
37 run_make_test(undef, 'foo.elc', 'emacs foo.el');
39 # Clean up after the first tests.
40 unlink('foo.el', 'bar.c', 'lose.c');
43 # TEST #3 -- PR/1670: don't core dump on invalid static pattern rules
48 foo: foo%: % %.x % % % y.% % ; @echo $@
53 # TEST #4 -- bug #12180: core dump on a stat pattern rule with an empty
56 foo.x bar.x: %.x : ; @echo $@
62 # TEST #5 -- bug #13881: double colon static pattern rule does not
65 foo.bar:: %.bar: %.baz
71 # TEST #6: make sure the second stem does not overwrite the first
72 # perprerequisite's stem (Savannah bug #16053).
75 all.foo.bar: %.foo.bar: %.one
77 all.foo.bar: %.bar: %.two
87 all.one all.foo.two');
90 # TEST #7: make sure the second stem does not overwrite the first
91 # perprerequisite's stem when second expansion is enabled
92 # (Savannah bug #16053).
97 all.foo.bar: %.foo.bar: %.one $$*-one
99 all.foo.bar: %.bar: %.two $$*-two
109 all.one all-one all.foo.two all.foo-two');