2 $description = "Test second expansion in ordinary rules.";
9 $dir =~ s,.*/([^/]+)$,../$1,;
12 # Test #1: automatic variables.
16 .DEFAULT: ; @echo '$@'
24 $$(addprefix 3.,$$^) \
25 $$(addprefix 4.,$$+) \
61 # Test #2: target/pattern -specific variables.
67 foo.%: $$(%_a) $$(%_b) bar
79 # Test #3: order of prerequisites.
83 .DEFAULT: ; @echo '$@'
130 # Test #4: stem splitting logic.
136 $(dir)/tmp/foo/bar.c: ; @echo '$@'
137 $(dir)/tmp/bar/bar.c: ; @echo '$@'
140 %.o: $$(addsuffix /%.c,foo bar) foo.h
143 "dir=$dir", "$dir/tmp/foo/bar.c
146 $dir/tmp/bar.o: {$dir/tmp/foo/bar.c} $dir/tmp/foo/bar.c $dir/tmp/bar/bar.c foo.h
150 # Test #5: stem splitting logic and order-only prerequisites.
154 $(dir)/tmp/foo.o: $(dir)/tmp/foo.c
155 $(dir)/tmp/foo.c: ; @echo '$@'
159 @echo '$@: {$<} {$|} $^'
162 "dir=$dir", "$dir/tmp/foo.c
164 $dir/tmp/foo.o: {$dir/tmp/foo.c} {bar.h} $dir/tmp/foo.c
168 # Test #6: lack of implicit prerequisites.
178 '', "foo.c\nfoo.o: {foo.c} foo.c\n");
181 # Test #7: Test stem from the middle of the name.
193 '', "bar\nbar.1\nbar\n");
196 # Test #8: Make sure stem triple-expansion does not happen.
214 # This tells the test driver that the perl test script executed properly.