9 for my $val (qw
/PERL5LIB PERL_MB_OPT PERL_LOCAL_LIB_ROOT PERL_MM_OPT/) {
10 delete $ENV{$val} if defined $ENV{$val};
14 my($deps,$files) = BuildHelper
::get_all_deps
();
15 my $sorted = BuildHelper
::sort_deps
($deps, $files);
16 my $last = pop @
{$sorted};
18 if(defined $ARGV[0] and $ARGV[0] eq '-u') {
19 open(my $out, '>', 'Makefile.new') or die("cannot open Makefile.new: $!");
20 open(my $in, '<', 'Makefile') or die("cannot open Makefile: $!");
22 while(my $line = <$in>) {
23 if($line =~ m/^MODULES\s=/) {
24 print $out "MODULES = \\\n";
25 for my $file (@
{$sorted}) {
26 next if $file =~ m/^ExtUtils\-MakeMaker\-\d+/mx;
27 next if $file =~ m/^parent\-\d+/mx;
28 next if $file =~ m/^version\-\d+/mx;
29 next if $file =~ m/^Module\-CoreList\-\d+/mx;
30 next if $file =~ m/^JSON\-/mx;
31 next if $file =~ m/^Types\-Serialiser\-\d+/mx;
32 next if $file =~ m/^common\-sense\-\d+/mx;
33 printf $out " %s \\\n", $file;
35 printf $out " %s\n", $last if defined $last;
40 $found = 0 if $line =~ m/^\s*$/;
47 `mv Makefile.new Makefile`;
48 print "Makefile written\n";
50 print "MODULES = \\\n";
51 for my $file (@
{$sorted}) {
52 printf " %s \\\n", $file;
54 printf " %s\n", $last if defined $last;
55 print "\n\nuse -u to update Makefile automatically\n";