4 This tests random features of make's algorithms, often somewhat obscure,
5 which have either broken at some point in the past or seem likely to
9 # Make sure that subdirectories built as prerequisites are actually handled
12 all: dir/subdir/file.a
14 dir/subdir: ; @echo mkdir -p dir/subdir
16 dir/subdir/file.b: dir/subdir ; @echo touch dir/subdir/file.b
18 dir/subdir/%.a: dir/subdir/%.b ; @echo cp $< $@',
19 '', "mkdir -p dir/subdir\ntouch dir/subdir/file.b\ncp dir/subdir/file.b dir/subdir/file.a\n");
24 run_make_test('foo: foo.o',
25 'CC="@echo cc" OUTPUT_OPTION=',
31 # Test other implicit rule searching
36 %.foo : baz ; @echo done $<
37 %.foo : bar ; @echo done $<
45 # Test implicit rules with '$' in the name (see se_implicit)
48 %.foo : baz$$bar ; @echo 'done $<'
49 %.foo : bar$$baz ; @echo 'done $<'
51 baz$$bar bar$$baz: ; @echo '$@'
54 "baz\$bar\ndone baz\$bar");
57 # Test implicit rules with '$' in the name (see se_implicit)
58 # Use the '$' in the pattern.
61 %.foo : %$$bar ; @echo 'done $<'
63 test$$bar: ; @echo '$@'
66 "test\$bar\ndone test\$bar");
68 # Make sure that subdirectories built as prerequisites are actually handled
69 # properly... this time with '$'
73 all: dir/subdir/file.$$a
75 dir/subdir: ; @echo mkdir -p '$@'
77 dir/subdir/file.$$b: dir/subdir ; @echo touch '$@'
79 dir/subdir/%.$$a: dir/subdir/%.$$b ; @echo 'cp $< $@'
81 '', "mkdir -p dir/subdir\ntouch dir/subdir/file.\$b\ncp dir/subdir/file.\$b dir/subdir/file.\$a\n");
83 # Test odd whitespace at the beginning of a line