|Welcome to the Monastery|
let Makefile.PL to do the Readme file for me -- new target?by Discipulus (Abbot)
|on Jan 19, 2021 at 16:36 UTC||Need Help??|
Discipulus has asked for the wisdom of the Perl Monks concerning the following question:
Despite many years programming in Perl I'm at my second real module. I'm used to module-starter that uses ExtUtils::MakeMaker as default builder.
My laziness got suddenly annoyed to maintain a Readme file manually: I brutally copy my pod output to this file, but I must remember to do it anytime I modify the doc.
I supposed to automate this and I asked here and there. I was pointed to Overriding-MakeMaker-Methods where is stated:
> Here is a simple example of how to add a new target to the generated Makefile:
The only working (for my purpose) modification to my Makefile.PL is the following
Which modify the end of resulting Makefile generated by perl Makefile.PL from:
Then I can succesfully run dmake postamble (yes strawberry perl has dmake) to have my Readme updated.
MY::postamble is a fixed name? Both the class MY and the postamble name are fixed? I tried different names and it always complains: dmake: Error: -- Don't know how to make `customname' Cannot the creation of the Readme integrated inside make dist or other similar steps?
Or should I treat Makefile.PL as a normal perl program putting my custom do_readme sub call before WriteMakefile one?
It's only me or the docs are sybilline and stingy of words?
PS I have chatted a bit on #perl channel about this and the discussion diverged on authoring tools (where ExtUtils::MakeMaker is not an authoring tool). mbtiny was suggested and also Distar with some interesting read: A-BRIEF-HISTORY-OF-AUTHORING and a COMPARISON
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.