VirtualBox

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

Last change on this file was 2591, checked in by bird, 13 years ago

kmk: Merged in changes from GNU make 3.82. Previous GNU make base version was gnumake-2008-10-28-CVS.

  • 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 implicit rules with '$' in the name (see se_implicit)
35
36run_make_test(q!
37%.foo : baz$$bar ; @echo 'done $<'
38%.foo : bar$$baz ; @echo 'done $<'
39test.foo:
40baz$$bar bar$$baz: ; @echo '$@'
41!,
42 '',
43 "baz\$bar\ndone baz\$bar");
44
45
46# Test implicit rules with '$' in the name (see se_implicit)
47# Use the '$' in the pattern.
48
49run_make_test(q!
50%.foo : %$$bar ; @echo 'done $<'
51test.foo:
52test$$bar: ; @echo '$@'
53!,
54 '',
55 "test\$bar\ndone test\$bar");
56
57# Make sure that subdirectories built as prerequisites are actually handled
58# properly... this time with '$'
59
60run_make_test(q!
61
62all: dir/subdir/file.$$a
63
64dir/subdir: ; @echo mkdir -p '$@'
65
66dir/subdir/file.$$b: dir/subdir ; @echo touch '$@'
67
68dir/subdir/%.$$a: dir/subdir/%.$$b ; @echo 'cp $< $@'
69!,
70 '', "mkdir -p dir/subdir\ntouch dir/subdir/file.\$b\ncp dir/subdir/file.\$b dir/subdir/file.\$a\n");
71
72# Test odd whitespace at the beginning of a line
73
74run_make_test("
75all:
76 \f
77
78 \\
79 \f \\
80 \013 \\
81all: ; \@echo hi
82",
83 '', "hi\n");
84
851;
Note: See TracBrowser for help on using the repository browser.

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