Alberto Simões wrote:
Heyas

Michael G Schwern wrote:
I am using PL_FILES => { foo/bar.PL => foo/bar }, and foo/bar.PL uses a
lateral file (say, ugh.txt) on the distro to build the script foo/bar.

How can I force the dependency, so make knows it should rebuild foo/bar
when I change ugh.txt?
You should be able to add the dep in a postamble.

sub MY::postamble {
    return qq[

foo/bar.PL :: ugh.txt
    $(NOOP)
];
}


Unfortunately it is not working. Tried also foo/bar :: ugh.txt but
foo/bar is not rebuilt when I change ugh.txt

Ahh, it needs to be added as a dependency on the original statement.  That is:

foo/bar :: foo/bar.PL pm_to_blib
        $(PERLRUNINST) foo/bar.PL foo/bar

has to be changed to

foo/bar :: foo/bar.PL pm_to_blib ugh.txt
        $(PERLRUNINST) foo/bar.PL foo/bar

Unfortunately the only way to do this is to override processPL() and do a s/// on the output of $self->SUPER::processPL.

package MY;
sub processPL {
    my $self = shift;

    my $make = $self->SUPER::processPL(@_);
    $make =~ s{pm_to_blib}{pm_to_blib ugh.txt};

    return $make;
}

This simple s/// will break if you have more than one PL file. Repairing it is left as an exercise for the reader.


--
E: "Would you want to maintain a 5000 line Perl program?"
d: "Why would you write a 5000 line program?"

Reply via email to