Subject: | MY::all_target doesn't override target 'all' |
Using the documented procedure to overload Makefile sections:
http://search.cpan.org/~mschwern/ExtUtils-MakeMaker-6.31/lib/ExtUtils/MakeMaker.pm#Overriding_MakeMaker_Methods
I am unable to override the 'all' section using MY::all_target. For
example, the following does not change the generated Makefile:
sub all_target {
my $inherited = shift->SUPER::all_target(@_);
$inherited .= '${ECHO} "I was able to override all_target!"';
$inherited;
};
whereas the following does:
sub clean {
my $inherited = shift->SUPER::clean(@_);
$inherited .= '${ECHO} "I was able to override clean!"';
$inherited;
};
As a dirty fix, I found that the following forced overload would work as
an alternative "override" of all_target:
package ExtUtils::MM_Any;
*__all_target = \&all_target;
*all_target = sub {
my $inherited = shift->__all_target(@_);
$inherited .= '${ECHO} "I was able to override clean!"';
$inherited;
};