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
sub MY::postamble { return <<'MAKE_README'; postamble :: $(PERLRUN) -MPod::Text \ -e "Pod::Text->new (sentence => 1, width => 78)->parse_from_file( +qw( $(TO_INST_PM) Readme) );" MAKE_README }
Which modify the end of resulting Makefile generated by perl Makefile.PL from:
# --- MakeMaker postamble section: # End.
to this:
# --- MakeMaker postamble section: postamble :: $(PERLRUN) -MPod::Text \ -e "Pod::Text->new (sentence => 1, width => 78)->parse_from_file( +qw( $(TO_INST_PM) Readme) );" # End.
Then I can succesfully run dmake postamble (yes strawberry perl has dmake) to have my Readme updated.
Questions
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
L*
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.