diff options
author | Nicholas Clark <nick@ccl4.org> | 2014-02-27 13:34:46 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2014-03-02 07:08:55 +0100 |
commit | d527ad5d98422a94e5002ab2b44b785b2518d1c1 (patch) | |
tree | 8a699dca23a3c7956dd2ba923a5251f42b36a43c /make_ext.pl | |
parent | 21fb4fa0a1c395401226f0dd3ec0b8f85eff4d2f (diff) | |
download | perl-d527ad5d98422a94e5002ab2b44b785b2518d1c1.tar.gz |
Generate fallback shell cleanup code for the extensions make_ext.pl handles.
These try to ensure that `make clean` followed by `make distclean` is the
same as running just `make distclean`.
Diffstat (limited to 'make_ext.pl')
-rw-r--r-- | make_ext.pl | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/make_ext.pl b/make_ext.pl index 00e2a9f953..b078b27f1d 100644 --- a/make_ext.pl +++ b/make_ext.pl @@ -342,7 +342,7 @@ sub build_extension { if (!-f $makefile) { NO_MAKEFILE: if (!-f 'Makefile.PL') { - unless (just_pm_to_blib($target, $ext_dir, $mname)) { + unless (just_pm_to_blib($target, $ext_dir, $mname, $return_dir)) { # No problems returned, so it has faked everything for us. :-) chdir $return_dir || die "Cannot cd to $return_dir: $!"; return; @@ -452,7 +452,7 @@ EOM |Search::Dict)\z/x) { # An explicit list of dual-life extensions that have a Makefile.PL # for CPAN, but we have verified can also be built using the fakery. - my ($problem) = just_pm_to_blib($target, $ext_dir, $mname); + my ($problem) = just_pm_to_blib($target, $ext_dir, $mname, $return_dir); # We really need to sanity test that we can fake it. # Otherwise "skips" will go undetected, and the build slow down for # everyone, defeating the purpose. @@ -593,7 +593,7 @@ sub _unlink { # savings are impressive. sub just_pm_to_blib { - my ($target, $ext_dir, $mname) = @_; + my ($target, $ext_dir, $mname, $return_dir) = @_; my ($has_lib, $has_top, $has_topdir); my ($last) = $mname =~ /([^:]+)$/; my ($first) = $mname =~ /^([^:]+)/; @@ -690,6 +690,14 @@ sub just_pm_to_blib { print $fh "$0 has handled pm_to_blib directly\n"; close $fh or die $!; + if ($is_Unix) { + # Fake the fallback cleanup + my $fallback + = join '', map {s!^\.\./\.\./!!; "rm -f $_\n"} sort values %pm; + foreach my $clean_target ('realclean', 'veryclean') { + fallback_cleanup($return_dir, $clean_target, $fallback); + } + } } else { # A clean target. # For now, make the targets behave the same way as ExtUtils::MakeMaker |