VirtualBox

source: kBuild/trunk/src/kmk/tests/scripts/misc/general4@ 1963

Last change on this file since 1963 was 1963, checked in by bird, 16 years ago

scripts/misc/general4: kmk adjustment - no default implicit rules.

  • Property svn:eol-style set to LF
File size: 2.0 KB
Line 
1# -*-perl-*-
2
3$description = "\
4This tests random features of make's algorithms, often somewhat obscure,
5which have either broken at some point in the past or seem likely to
6break.";
7
8run_make_test('
9# Make sure that subdirectories built as prerequisites are actually handled
10# properly.
11
12all: dir/subdir/file.a
13
14dir/subdir: ; @echo mkdir -p dir/subdir
15
16dir/subdir/file.b: dir/subdir ; @echo touch dir/subdir/file.b
17
18dir/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");
20
21# Test implicit rules
22# kmk: No default implicit rules.
23
24&touch('foo.c');
25run_make_test('foo: foo.o',
26 'CC="@echo cc" OUTPUT_OPTION=',
27 !$is_kmk ? 'cc -c foo.c
28cc foo.o -o foo' :
29"#MAKE#: *** No rule to make target `foo.o', needed by `foo'. Stop.",
30!$is_kmk ? 0 : 512);
31unlink('foo.c');
32
33
34# Test other implicit rule searching
35
36&touch('bar');
37run_make_test('
38test.foo:
39%.foo : baz ; @echo done $<
40%.foo : bar ; @echo done $<
41fox: baz
42',
43 '',
44 'done bar');
45unlink('bar');
46
47
48# Test implicit rules with '$' in the name (see se_implicit)
49
50run_make_test(q!
51%.foo : baz$$bar ; @echo 'done $<'
52%.foo : bar$$baz ; @echo 'done $<'
53test.foo:
54baz$$bar bar$$baz: ; @echo '$@'
55!,
56 '',
57 "baz\$bar\ndone baz\$bar");
58
59
60# Test implicit rules with '$' in the name (see se_implicit)
61# Use the '$' in the pattern.
62
63run_make_test(q!
64%.foo : %$$bar ; @echo 'done $<'
65test.foo:
66test$$bar: ; @echo '$@'
67!,
68 '',
69 "test\$bar\ndone test\$bar");
70
71# Make sure that subdirectories built as prerequisites are actually handled
72# properly... this time with '$'
73
74run_make_test(q!
75
76all: dir/subdir/file.$$a
77
78dir/subdir: ; @echo mkdir -p '$@'
79
80dir/subdir/file.$$b: dir/subdir ; @echo touch '$@'
81
82dir/subdir/%.$$a: dir/subdir/%.$$b ; @echo 'cp $< $@'
83!,
84 '', "mkdir -p dir/subdir\ntouch dir/subdir/file.\$b\ncp dir/subdir/file.\$b dir/subdir/file.\$a\n");
85
861;
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette