#!/usr/local/bin/new/perl -w open(STDERR,">&STDOUT") || die "Cannot redirect STDERR"; $| = 1; use Cwd; my $host = `uname -n`; chomp($host); my $cwd = getcwd(); print "$host in $cwd executing $0\n"; print $ENV{'PATH'},"\n"; #System("make",'-f','Makefile.old',"clean") if -f "Makefile.old"; #System("make","clean") if -f "Makefile"; System("cleanup"); System("$^X","Makefile.PL"); System("time","make","parallel"); sub System { print join(' ',@_),"\n"; my $pid = fork; if ($pid) { local %SIG; $SIG{INT} = sub { warn "\nInterrupt"; kill 9,$pid; exit 1 }; wait; die "Error $?" if ($?); } else { exec(@_) || die "Cannot exec".join(' ',@_).":$!"; } }