3 $description = "Test pattern rules.";
10 $dir =~ s,.*/([^/]+)$,../$1,;
13 # TEST #0: Make sure that multiple patterns where the same target
14 # can be built are searched even if the first one fails
21 all: case.1 case.2 case.3
23 # We can't have this, due to "Implicit Rule Search Algorithm" step 5c
48 # TEST #1: make sure files that are built via implicit rules are marked
49 # as targets (Savannah bug #12202).
52 TARGETS := foo foo.out
72 # TEST #2: make sure intermediate files that also happened to be
73 # prerequisites are not removed (Savannah bug #12267).
99 # TEST #3: make sure precious flag is set properly for targets
100 # that are built via implicit rules (Savannah bug #13218).
107 %.bar:; @touch $@ && exit 1
113 "#MAKEFILE#:6: recipe for target `$dir/foo.bar' failed
114 #MAKE#: *** [$dir/foo.bar] Error 1",
117 unlink("$dir/foo.bar");
120 # TEST #4: make sure targets of a matched implicit pattern rule are
121 # never considered intermediate (Savannah bug #13022).
145 echo foo.c foo.h >foo.o');
147 unlink('foo.in', 'foo.h', 'foo.c', 'foo.o');
149 # TEST #5: make sure both prefix and suffix patterns work with multiple
150 # target patterns (Savannah bug #26593).
153 all: foo.s1 foo.s2 p1.foo p2.foo
162 '', "foo.s1\np1.foo\n");
164 # TEST 6: Make sure that non-target files are still eligible to be created
165 # as part of implicit rule chaining. Savannah bug #17752.
171 allbroken: $(COPY) $(BIN) ; @echo ok
172 $(SRC): ; @echo 'main(){}' > $@
175 clean: ; @rm -rf $(SRC) $(COPY) $(BIN)
179 unlink(qw(xyz xyz.cp xyz.c));
181 # TEST 7: Make sure that all prereqs of all "also_make" targets get created
182 # before any of the things that depend on any of them. Savannah bug #19108.
186 x: x.t1 x.t2 ; @echo $@
189 %.t1 %.t2: ; @echo $*.t1 ; echo $*.t2
191 '', "dep\nx.t1\nx.t2\nx\nfinal\n");
194 # TEST 8: Verify we can remove pattern rules. Savannah bug #18622.
196 my @f = (qw(foo.w foo.ch));
202 # Disable builtin rules
207 "#MAKE#: *** No rule to make target `foo.tex'. Stop.", 512);
211 # TEST #9: Test shortest stem selection in pattern rules.
224 # This tells the test driver that the perl test script executed properly.