Re: GTK2, XML, perl




On Mar 17, 2006, at 2:12 AM, Ari Jolma wrote:

Ari Jolma wrote:

how do I put this into Makefile.PL?


to answer myself: One way is to use MY::postamble and add rules to cat .pm from .pm.in and .glade

perhaps a more elegant solution is to use filters in build, perhaps using PM_FILTER of MakeMaker but that seems to be somewhat deprecated

Mmmmm...

ExtUtils::PkgConfig uses a PREOP rule in the call to WriteMakefile() to generate README from the pod before dist. However, this doesn't help if you're not using a dist tarball... So a postamble rule is probably best.

Here's an untested example... it tries to put the pms first to avoid execution order problems, and collects the glade files in __DATA__... your code would have to handle this, of course.

sub MY::postable {
    return '

script_included_pls = main.pl
script_included_pms = lib/Foo/Bar.pm lib/Foo/Baz.pm
script_included_glades = glade/*.glade
my_cool_installable_script : $(script_included_pls) $ (script_included_pms) $(script_included_glades)
        $(PERLRUN) -e "print \'#!$(PERLRUN) -w\\n\'" > $@
        perl -MExtUtils::Command -e cat $(script_included_pms) >> $@
        perl -MExtUtils::Command -e cat $(script_included_pls) >> $@
        $(PERLRUN) -e "print \'__DATA__\'" > $@
        perl -MExtUtils::Command -e cat $(script_included_glades) >> $@

';
}

--
Our enemies are innovative and resourceful, and so are we. They never stop thinking about new ways to harm our country and our people, and neither do we.
  -- President George W. Bush




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]