1Panotools::Makefile::RuUlsee(r3)Contributed Perl DocumenPtaantoitoonols::Makefile::Rule(3)
2
3
4
6 Panotools::Makefile::Rule - Assemble Makefile rules
7
9 Simple interface for generating Makefile syntax
10
12 Writing Makefiles directly from perl scripts with print and "\t" etc...
13 is prone to error, this library provides a simple perl interface for
14 assembling Makefile rules.
15
17 my $rule = new Panotools::Makefile::Rule;
18
19 ..or additionally specify targets at creation time
20
21 my $rule = new Panotools::Makefile::Rule ('all');
22
23 A Makefile rule always has one or more 'targets', these are typically
24 filenames, but can be 'phony' non-files.
25
26 (phony targets should be listed as perequisites of the special .PHONY
27 target)
28
29 $rule->Targets ('output1.txt', 'output2.txt');
30
31 ..or equivalently:
32
33 $rule->Targets ('output1.txt');
34 $rule->Targets ('output2.txt');
35
36 Rules can have zero or more 'prerequisites', again these are typically
37 filenames, but can be 'phony' non-files.
38
39 $rule->Prerequisites ('input1.txt', 'input2.txt');
40
41 ..or equivalently:
42
43 $rule->Prerequisites ('input1.txt');
44 $rule->Prerequisites ('input2.txt');
45
46 Rules zero or more 'commands':
47
48 $rule->Command ('cp', 'input1.txt', 'output1.txt');
49 $rule->Command ('cp', 'input2.txt', 'output2.txt');
50
51 Assemble all this into string that can be written to a Makefile:
52
53 my $string = $rule->Assemble;
54
55
56
57perl v5.34.0 2021-07-22 Panotools::Makefile::Rule(3)