ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/BuildSystem/MakeInterface.pm
(Generate patch)

Comparing COMP/SCRAM/src/BuildSystem/MakeInterface.pm (file contents):
Revision 1.3 by sashby, Fri May 13 15:48:29 2005 UTC vs.
Revision 1.9 by muzaffar, Wed Apr 10 12:43:49 2013 UTC

# Line 3 | Line 3
3   #____________________________________________________________________
4   #  
5   # Author: Shaun Ashby <Shaun.Ashby@cern.ch>
6 # Update: 2004-06-22 14:49:43+0200
7 # Revision: $Id$
8 #
6   # Copyright: 2004 (C) Shaun Ashby
7   #
8   #--------------------------------------------------------------------
# Line 17 | Line 14 | use Exporter;
14   @EXPORT_OK=qw( );
15  
16   sub new()
20  ###############################################################
21  # new                                                         #
22  ###############################################################
23  # modified : Tue Jun 22 14:49:46 2004 / SFA                   #
24  # params   :                                                  #
25  #          :                                                  #
26  # function :                                                  #
27  #          :                                                  #
28  ###############################################################
17    {
18    my $proto=shift;
19    my $class=ref($proto) || $proto;
20 <  my $self={ GMAKECMD => 'gmake', CMDOPTS => ' -r' };
20 >  my $self={ GMAKECMD => '${SCRAM_GMAKE_PATH}gmake', CMDOPTS => ' -r' };
21    bless $self,$class;
22    $|=1;
35
36  # Useful help strings for the options we're supporting:
37  # %help = (
38  #        "s"     => " do not print any output",
39  #        "j <n>" => " the number of processes to run simultaneously",
40  #        "d"     => " run gmake in debug mode",
41  #        "k"     => " continue for as long as possible after an error",
42  #        "w"     => " print the working directory before and after entering it",
43  #        "n"     => " print the commands that would be executed but do not run them",
44  #        "p"     => " print the data base of rules after scanning makefiles, then build as normal"
45  #        );
46
47  # The options. These are collected in CMDOPTS:
48  my %options =
49     (
50      "make"        => sub { }, # dummy so we can use help opt just for MakeInterface
51      "s"           => sub { $self->{CMDOPTS}.=" -s" },
52      "j=s"         => sub { $self->{CMDOPTS}.=" -j ".$_[1] },
53      "d"           => sub { $self->{CMDOPTS}.=" -d" },
54      "k"           => sub { $self->{CMDOPTS}.=" -k" },
55      "printdir"    => sub { $self->{CMDOPTS}.=" -w" },
56      "n"           => sub { $self->{CMDOPTS}.=" -n" },
57      "printdb"     => sub { $self->{CMDOPTS}.=" -p" }
58      );
59  
60  Getopt::Long::config qw(default no_ignore_case require_order);
61  
62  if (! Getopt::Long::GetOptions(\%opts, %options))
63     {
64     print "SCRAM Warning: Ignoring unknown option.","\n";
65     }
66  
23    return $self;
24    }
25  
# Line 71 | Line 27 | sub exec()
27     {
28     my $self=shift;
29     my ($makefile)=@_;
74   my $PID;
30     my $makecmd=$self->{GMAKECMD}.$self->{CMDOPTS}." -f ".$makefile." ".join(" ",@ARGV);
31 <  
77 <   print "SCRAM MakeInterface::exec(): going to exec \"",$makecmd,"\"\n",if ($ENV{SCRAM_DEBUG});
78 <
79 <   # Try without forking:
80 <   exec "$makecmd" || die "SCRAM MakeInterface::exec(): Unable to exec()...$!","\n";
31 >   exec("$makecmd") || die "SCRAM MakeInterface::exec(): Unable to run gmake ...$!","\n";
32     }
33  
34   1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines