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 "#MAKE#: *** [$dir/foo.bar] Error 1",
116 unlink("$dir/foo.bar");
119 # TEST #4: make sure targets of a matched implicit pattern rule are
120 # never considered intermediate (Savannah bug #13022).
144 echo foo.c foo.h >foo.o');
146 unlink('foo.in', 'foo.h', 'foo.c', 'foo.o');
148 # TEST #5: make sure both prefix and suffix patterns work with multiple
149 # target patterns (Savannah bug #26593).
152 all: foo.s1 foo.s2 p1.foo p2.foo
161 '', "foo.s1\np1.foo\n");
163 # TEST 6: Make sure that non-target files are still eligible to be created
164 # as part of implicit rule chaining. Savannah bug #17752.
170 allbroken: $(COPY) $(BIN) ; @echo ok
171 $(SRC): ; @echo 'main(){}' > $@
174 clean: ; @rm -rf $(SRC) $(COPY) $(BIN)
178 unlink(qw(xyz xyz.cp xyz.c));
180 # TEST 7: Make sure that all prereqs of all "also_make" targets get created
181 # before any of the things that depend on any of them. Savannah bug #19108.
185 x: x.t1 x.t2 ; @echo $@
188 %.t1 %.t2: ; @echo $*.t1 ; echo $*.t2
190 '', "dep\nx.t1\nx.t2\nx\nfinal\n");
193 # TEST 8: Verify we can remove pattern rules. Savannah bug #18622.
195 my @f = (qw(foo.w foo.ch));
201 # Disable builtin rules
206 "#MAKE#: *** No rule to make target `foo.tex'. Stop.", 512);
210 # TEST #9: Test shortest stem selection in pattern rules.
223 # This tells the test driver that the perl test script executed properly.