9 for my $val (qw
/PERL5LIB PERL_MB_OPT PERL_LOCAL_LIB_ROOT PERL_MM_OPT/) {
10 undef $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 printf $out " %s \\\n", $file;
28 printf $out " %s\n", $last if defined $last;
33 $found = 0 if $line =~ m/^\s*$/;
40 `mv Makefile.new Makefile`;
41 print "Makefile written\n";
43 print "MODULES = \\\n";
44 for my $file (@
{$sorted}) {
45 printf " %s \\\n", $file;
47 printf " %s\n", $last if defined $last;
48 print "\n\nuse -u to update Makefile automatically\n";