3 buildext.pl - build extensions
7 buildext.pl make [-make_opts] dep directory [target]
11 buildext.pl nmake -nologo perldll.def ..\ext
13 buildext.pl nmake -nologo perldll.def ..\ext clean
15 buildext.pl dmake perldll.def ..\ext
17 buildext.pl dmake perldll.def ..\ext clean
27 if ($perl =~ m#^\.\.#)
29 $perl = "$here\\$perl";
31 (my $topdir = $perl) =~ s/\\[^\\]+$//;
32 $ENV{PATH} = "$topdir;$ENV{PATH}"; # so miniperl can find perlglob.exe
33 #print "PATH=$ENV{PATH}\n";
35 $make .= " ".shift while $ARGV[0]=~/^-/;
39 chdir($dir) || die "Cannot cd to $dir\n";
41 (my $ext = getcwd()) =~ s,/,\\,g;
42 FindExt::scan_ext($ext);
44 my @ext = FindExt::extensions();
46 foreach my $dir (sort @ext)
48 if (chdir("$ext\\$dir"))
50 my $mmod = -M 'Makefile';
51 if (!(-f 'Makefile') || $mmod > $dmod)
53 print "\nRunning Makefile.PL in $dir\n";
54 my @perl = ($perl, "-I$here\\..\\lib", 'Makefile.PL',
55 'INSTALLDIRS=perl', 'PERL_CORE=1');
56 print join(' ', @perl), "\n";
57 my $code = system(@perl);
58 warn "$code from $dir's Makefile.PL" if $code;
59 $mmod = -M 'Makefile';
62 warn "Makefile $mmod > $dmod ($dep)\n";
67 print "Making $targ in $dir\n$make $targ\n";
68 system("$make $targ");
72 print "Making $dir\n$make\n";
75 chdir($here) || die "Cannot cd to $here:$!";
79 warn "Cannot cd to $ext\\$dir:$!";