VirtualBox

source: kBuild/vendor/gnumake/3.82-cvs/tests/scripts/misc/general4

Last change on this file was 2581, checked in by bird, 12 years ago

Sync'ed svn:eol-style with trunk.

  • Property svn:eol-style set to LF
File size: 1.8 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
23&touch('foo.c');
24run_make_test('foo: foo.o',
25 'CC="@echo cc" OUTPUT_OPTION=',
26 'cc -c foo.c
27cc foo.o -o foo');
28unlink('foo.c');
29
30
31# Test implicit rules with '$' in the name (see se_implicit)
32
33run_make_test(q!
34%.foo : baz$$bar ; @echo 'done $<'
35%.foo : bar$$baz ; @echo 'done $<'
36test.foo:
37baz$$bar bar$$baz: ; @echo '$@'
38!,
39 '',
40 "baz\$bar\ndone baz\$bar");
41
42
43# Test implicit rules with '$' in the name (see se_implicit)
44# Use the '$' in the pattern.
45
46run_make_test(q!
47%.foo : %$$bar ; @echo 'done $<'
48test.foo:
49test$$bar: ; @echo '$@'
50!,
51 '',
52 "test\$bar\ndone test\$bar");
53
54# Make sure that subdirectories built as prerequisites are actually handled
55# properly... this time with '$'
56
57run_make_test(q!
58
59all: dir/subdir/file.$$a
60
61dir/subdir: ; @echo mkdir -p '$@'
62
63dir/subdir/file.$$b: dir/subdir ; @echo touch '$@'
64
65dir/subdir/%.$$a: dir/subdir/%.$$b ; @echo 'cp $< $@'
66!,
67 '', "mkdir -p dir/subdir\ntouch dir/subdir/file.\$b\ncp dir/subdir/file.\$b dir/subdir/file.\$a\n");
68
69# Test odd whitespace at the beginning of a line
70
71run_make_test("
72all:
73 \f
74
75 \\
76 \f \\
77 \013 \\
78all: ; \@echo hi
79",
80 '', "hi\n");
81
821;
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