summaryrefslogtreecommitdiff
path: root/tests/scripts/features/implicit_prereq_eval
blob: f549a79c315d2ef9b1231d590d66990b4f594575 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
$description = "Test implicit rule prerequisite evaluation code.";

$details = "The makefile created by this test has a set of implicit rule
 pairs with the first rule usually not applying because its prerequisites
 cannot be made and the second rule which should succeed.";

open(MAKEFILE,"> $makefile");

# The contents of the Makefile ...

print MAKEFILE <<EOF;

.PHONY: all

all: case.1 case.2 case.3

a: void

# 1 - existing file
#
%.1: void
	\@false

%.1: $makefile
	\@true


# 2 - phony
#
%.2: void
	\@false

%.2: 2.phony
	\@true

.PHONY: 2.phony


# 3 - implicit-phony
#
%.3: void
	\@false

%.3: 3.implicit-phony
	\@true

3.implicit-phony:

EOF

close(MAKEFILE);

&run_make_with_options($makefile,
                       "",
                       &get_logfile,
                       0);


# This makefile doesn't produce anything except exit code.
#
&compare_output("",&get_logfile(1));

# This tells the test driver that the perl test script executed properly.
1;