There's more than one way to do things | |
PerlMonks |
in reply to let Makefile.PL to do the Readme file for me -- new target?
MY::postamble is a fixed name. But the target name inside that postamble is not fixed, and there can actually be more than one.
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) );" another_target :: $(PERLRUN) -MPod::Text \ -e "Pod::Text->new (sentence => 1, width => 78)->parse_from_file( +qw( $(TO_INST_PM) Readme) );" third :: $(PERLRUN) -MPod::Text \ -e "Pod::Text->new (sentence => 1, width => 78)->parse_from_file( +qw( $(TO_INST_PM) Readme) );" MAKE_README }
... will create three new targets, all of which do the same thing (as written), with dmake postamble, dmake another_target, and dmake third.
See Win32::Mechanize::NotepadPlusPlus::Makefile.PL for an example of a bunch of extra targets, including ones to extract the README and LICENSE automagically from the POD.
edit: finished the last sentence; thanks hippo :/edit
edit2: replaced leading spaces with tabs to make it more portable; the actual commands listed were just copy/pasted from OP, and I didn't test/confirm; for known-working examples, see the linked Makefile.PL :/edit2
edit3: fixed per Re^2: let Makefile.PL to do the Readme file for me -- new target?; left original in spoiler for context :/edit3
|
---|