| 1 |
#!/usr/local/bin/new/perl -w |
| 2 |
open(STDERR,">&STDOUT") || die "Cannot redirect STDERR"; |
| 3 |
$| = 1; |
| 4 |
use Cwd; |
| 5 |
my $host = `uname -n`; |
| 6 |
chomp($host); |
| 7 |
my $cwd = getcwd(); |
| 8 |
print "$host in $cwd executing $0\n"; |
| 9 |
print $ENV{'PATH'},"\n"; |
| 10 |
#System("make",'-f','Makefile.old',"clean") if -f "Makefile.old"; |
| 11 |
#System("make","clean") if -f "Makefile"; |
| 12 |
System("cleanup"); |
| 13 |
System("$^X","Makefile.PL"); |
| 14 |
System("time","make","parallel"); |
| 15 |
|
| 16 |
sub System |
| 17 |
{ |
| 18 |
print join(' ',@_),"\n"; |
| 19 |
my $pid = fork; |
| 20 |
if ($pid) |
| 21 |
{ |
| 22 |
local %SIG; |
| 23 |
$SIG{INT} = sub { warn "\nInterrupt"; kill 9,$pid; exit 1 }; |
| 24 |
wait; |
| 25 |
die "Error $?" if ($?); |
| 26 |
} |
| 27 |
else |
| 28 |
{ |
| 29 |
exec(@_) || die "Cannot exec".join(' ',@_).":$!"; |
| 30 |
} |
| 31 |
} |
| 32 |
|
| 33 |
|