Panotoo...le::Rule(3)
π NAME π
Panotools::Makefile::Rule β bestie, this is the little Perl module that assembles Makefile rules for you. That's it. That's the whole job. It's giving tiny but mighty. β¨
It lives in section 3 of the manual (the Perl-library section, iykyk), and yes it's a User Contributed Perl Documentation page, so give the contributors a lil π«Ά.
π SYNOPSIS π
A simple interface for generating Makefile syntax:
Simple interface for generating Makefile syntax
π¦ DESCRIPTION π¦
Okay so picture this: you're writing Makefiles directly from perl scripts with print and "\t" and all that jazz. Bestie. That is prone to error. Tabs vs spaces jumpscare every single time, no cap. π
So this library swoops in like the main character and gives you a simple perl interface for assembling Makefile rules. Obsessed. π
πΈ USAGE πΈ
Make yourself a rule:
my $rule = new Panotools::Makefile::Rule;
..or, if you're feeling extra, specify targets right at creation time:
my $rule = new Panotools::Makefile::Rule ('all');
So here's the tea: a Makefile rule always has one or more 'targets'. These are typically filenames, but they can also be 'phony' non-files. π
Heads up bestie β phony targets should be listed as perequisites of the special .PHONY target. (That's perequisites exactly as written in the original, I'm not fixing it, I don't make the rules, I just relay them fr fr. π)
Set those targets up like:
$rule->Targets ('output1.txt', 'output2.txt');
..or equivalently, one at a time, no pressure:
$rule->Targets ('output1.txt');
$rule->Targets ('output2.txt');
Rules can also have zero or more 'prerequisites' β and yeah, again these are typically filenames, but they can be 'phony' non-files. Same energy. β¨
$rule->Prerequisites ('input1.txt', 'input2.txt');
..or equivalently:
$rule->Prerequisites ('input1.txt');
$rule->Prerequisites ('input2.txt');
And then rules get zero or more 'commands':
$rule->Command ('cp', 'input1.txt', 'output1.txt');
$rule->Command ('cp', 'input2.txt', 'output2.txt');
Now assemble all of that into a string you can actually write to a Makefile:
my $string = $rule->Assemble;
And that's the whole vibe. Slay. π
Written up by the User Contributed Perl Documentation crew, running on perl v5.42.0, dated 2025-07-25. Mwah, take care of her. ππβ¨
π¦ where this page comes from
- fedora 43: perl-Panotools-Script 0.29-20.fc43 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms