Commit | Line | Data |
17af6fb0 |
1 | use File::Basename; |
2 | use Cwd; |
8e232993 |
3 | use FindExt; |
17af6fb0 |
4 | my $here = getcwd(); |
5 | my $perl = $^X; |
6 | $here =~ s,/,\\,g; |
7 | if ($perl =~ m#^\.\.#) |
8 | { |
9 | $perl = "$here\\$perl"; |
10 | } |
11 | my $make = shift; |
f76dcffd |
12 | $make .= " ".shift while $ARGV[0]=~/^-/; |
17af6fb0 |
13 | my $dep = shift; |
14 | my $dmod = -M $dep; |
15 | my $dir = shift; |
16 | chdir($dir) || die "Cannot cd to $dir\n"; |
17 | (my $ext = getcwd()) =~ s,/,\\,g; |
8e232993 |
18 | FindExt::scan_ext($ext); |
17af6fb0 |
19 | |
8e232993 |
20 | my @ext = FindExt::extensions(); |
21 | |
22 | foreach my $dir (sort @ext) |
17af6fb0 |
23 | { |
24 | if (chdir("$ext\\$dir")) |
25 | { |
26 | my $mmod = -M 'Makefile'; |
27 | if (!(-f 'Makefile') || $mmod > $dmod) |
28 | { |
0026721a |
29 | print "\nRunning Makefile.PL in $dir\n"; |
17af6fb0 |
30 | my $code = system($perl,"-I$here\\..\lib",'Makefile.PL','INSTALLDIRS=perl'); |
31 | warn "$code from $dir's Makefile.PL" if $code; |
32 | $mmod = -M 'Makefile'; |
33 | if ($mmod > $dmod) |
34 | { |
35 | warn "Makefile $mmod > $dmod ($dep)\n"; |
36 | } |
37 | } |
38 | print "\nMaking $dir\n"; |
39 | system($make); |
40 | chdir($here) || die "Cannot cd to $here:$!"; |
41 | } |
42 | else |
43 | { |
44 | warn "Cannot cd to $ext\\$dir:$!"; |
45 | } |
46 | } |
47 | |