Last change
on this file since 283 was 283, checked in by (none), 20 years ago |
This commit was manufactured by cvs2svn to create branch 'GNU'.
|
-
Property svn:eol-style
set to
native
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
1.3 KB
|
Line | |
---|
1 | # -*-perl-*-
|
---|
2 |
|
---|
3 | $description = "Test pattern rules.";
|
---|
4 |
|
---|
5 | $details = "";
|
---|
6 |
|
---|
7 | use Cwd;
|
---|
8 |
|
---|
9 | $dir = cwd;
|
---|
10 | $dir =~ s,.*/([^/]+)$,../$1,;
|
---|
11 |
|
---|
12 |
|
---|
13 | # TEST #1: Make sure that multiple patterns where the same target
|
---|
14 | # can be built are searched even if the first one fails
|
---|
15 | # to match properly.
|
---|
16 | #
|
---|
17 |
|
---|
18 | run_make_test('
|
---|
19 | .PHONY: all
|
---|
20 |
|
---|
21 | all: case.1 case.2 case.3
|
---|
22 | a: void
|
---|
23 |
|
---|
24 | # 1 - existing file
|
---|
25 | %.1: void
|
---|
26 | @false
|
---|
27 | %.1: #MAKEFILE#
|
---|
28 | @true
|
---|
29 |
|
---|
30 | # 2 - phony
|
---|
31 | %.2: void
|
---|
32 | @false
|
---|
33 | %.2: 2.phony
|
---|
34 | @true
|
---|
35 | .PHONY: 2.phony
|
---|
36 |
|
---|
37 | # 3 - implicit-phony
|
---|
38 | %.3: void
|
---|
39 | @false
|
---|
40 | %.3: 3.implicit-phony
|
---|
41 | @true
|
---|
42 |
|
---|
43 | 3.implicit-phony:
|
---|
44 | ',
|
---|
45 | '',
|
---|
46 | '');
|
---|
47 |
|
---|
48 | # TEST #2: make sure files that are built via implicit rules are marked
|
---|
49 | # as targets (Savannah bug #12202).
|
---|
50 | #
|
---|
51 | run_make_test('
|
---|
52 | TARGETS := foo foo.out
|
---|
53 |
|
---|
54 | .PHONY: all foo.in
|
---|
55 |
|
---|
56 | all: $(TARGETS)
|
---|
57 |
|
---|
58 | %: %.in
|
---|
59 | @echo $@
|
---|
60 |
|
---|
61 | %.out: %
|
---|
62 | @echo $@
|
---|
63 |
|
---|
64 | foo.in: ; @:
|
---|
65 |
|
---|
66 | ',
|
---|
67 | '',
|
---|
68 | 'foo
|
---|
69 | foo.out');
|
---|
70 |
|
---|
71 |
|
---|
72 | # TEST #3: make sure intermidite files that also happened to be
|
---|
73 | # prerequisites are not removed (Savannah bug #12267).
|
---|
74 | #
|
---|
75 | run_make_test('
|
---|
76 | $(dir)/foo.o:
|
---|
77 |
|
---|
78 | $(dir)/foo.y:
|
---|
79 | @echo $@
|
---|
80 |
|
---|
81 | %.c: %.y
|
---|
82 | touch $@
|
---|
83 |
|
---|
84 | %.o: %.c
|
---|
85 | @echo $@
|
---|
86 |
|
---|
87 | .PHONY: install
|
---|
88 | install: $(dir)/foo.c
|
---|
89 |
|
---|
90 | ',
|
---|
91 | "dir=$dir",
|
---|
92 | "$dir/foo.y
|
---|
93 | touch $dir/foo.c
|
---|
94 | $dir/foo.o");
|
---|
95 |
|
---|
96 | unlink("$dir/foo.c");
|
---|
97 |
|
---|
98 | # This tells the test driver that the perl test script executed properly.
|
---|
99 | 1;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.