Subversion Repositories DevTools

Rev

Rev 5619 | Rev 5708 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5619 Rev 5695
Line 44... Line 44...
44
my $opt_debug   = $ENV{'GBE_DEBUG'};        # Allow global debug
44
my $opt_debug   = $ENV{'GBE_DEBUG'};        # Allow global debug
45
my $opt_verbose = $ENV{'GBE_VERBOSE'};      # Allow global verbose
45
my $opt_verbose = $ENV{'GBE_VERBOSE'};      # Allow global verbose
46
my $opt_help = 0;
46
my $opt_help = 0;
47
my $opt_silent = 1;
47
my $opt_silent = 1;
48
my $opt_default;
48
my $opt_default;
-
 
49
my $opt_max_make;
49
 
50
 
50
#
51
#
51
#   Global variables
52
#   Global variables
52
#
53
#
53
our %cf_info;
54
our %cf_info;
54
our $GBE_TOOLS;                             # Base of tools
55
our $GBE_TOOLS;                             # Base of tools
55
our $GBE_ABT;                               # Optional ABT indication
56
our $GBE_ABT;                               # Optional ABT indication
56
our $GBE_PLATFORM;                          # Optional GBE_PLATFORM
57
our $GBE_PLATFORM;                          # Optional GBE_PLATFORM
-
 
58
our $GBE_MAXMAKE;                           # Optional GBE_MAXMAKE
57
our $ScmInterface;                          # Current interface directory
59
our $ScmInterface;                          # Current interface directory
58
our $ScmRoot;                               # Build root
60
our $ScmRoot;                               # Build root
59
our $ScmNoBuild;                            # Dummy Build and Make
61
our $ScmNoBuild;                            # Dummy Build and Make
60
 
62
 
61
my $Tags;                                   # Reference to hash of tags
63
my $Tags;                                   # Reference to hash of tags
Line 205... Line 207...
205
                "help:+"        => \$opt_help,              # flag, multiple use allowed
207
                "help:+"        => \$opt_help,              # flag, multiple use allowed
206
                "manual:3"      => \$opt_help,              # flag, multiple use allowed
208
                "manual:3"      => \$opt_help,              # flag, multiple use allowed
207
                "verbose:+"     => \$opt_verbose,           # flag, multiple use allowed
209
                "verbose:+"     => \$opt_verbose,           # flag, multiple use allowed
208
                "d|debug:+"     => \$opt_debug,             # flag, multiple use allowed
210
                "d|debug:+"     => \$opt_debug,             # flag, multiple use allowed
209
                "default=s"     => \$opt_default,           # string
211
                "default=s"     => \$opt_default,           # string
-
 
212
                "maxTime=s"     => \$opt_max_make,          # string
210
                );
213
                );
211
 
214
 
212
                #
215
                #
213
                #   UPDATE THE DOCUMENTATION AT THE END OF THIS FILE !!!
216
                #   UPDATE THE DOCUMENTATION AT THE END OF THIS FILE !!!
214
                #
217
                #
Line 225... Line 228...
225
#
228
#
226
ErrorConfig( 'name'    => 'Make',
229
ErrorConfig( 'name'    => 'Make',
227
             'verbose' => $opt_verbose,
230
             'verbose' => $opt_verbose,
228
             'debug'   => $opt_debug );
231
             'debug'   => $opt_debug );
229
 
232
 
-
 
233
# Global information
-
 
234
#
-
 
235
EnvImportOptional ( 'GBE_ABT' );
-
 
236
EnvImportOptional ( 'GBE_PLATFORM' );
-
 
237
EnvImportOptional ( 'GBE_MAXMAKE', '3h' );
-
 
238
 
-
 
239
#
-
 
240
#   Sanity check arguments
-
 
241
#
-
 
242
$opt_max_make = $GBE_MAXMAKE unless defined $opt_max_make;
-
 
243
Error ("Invalid maxTime: $opt_max_make") 
-
 
244
    unless ($opt_max_make =~ m~^[0-9]*\.?[0-9]+[smhd]?$~);
-
 
245
Warning("Time limit is disabled ") unless $opt_max_make;
-
 
246
#Information("Time limit: $opt_max_make");
-
 
247
 
230
#
248
#
231
#   Configure the 'System' process so that it will terminate on any error
249
#   Configure the 'System' process so that it will terminate on any error
232
#   and not report the complete command line
250
#   and not report the complete command line
233
#
251
#
234
SystemConfig ( 'ExitOnError' => 2);
252
SystemConfig ( 'ExitOnError' => 2);
Line 263... Line 281...
263
 
281
 
264
EnvImport( 'GBE_TOOLS' );
282
EnvImport( 'GBE_TOOLS' );
265
$makelib = "$GBE_TOOLS/makelib.pl";
283
$makelib = "$GBE_TOOLS/makelib.pl";
266
Error ("Cannot locate JATS file: $makelib") unless ( -f $makelib );
284
Error ("Cannot locate JATS file: $makelib") unless ( -f $makelib );
267
 
285
 
268
EnvImportOptional ( 'GBE_ABT' );
-
 
269
EnvImportOptional ( 'GBE_PLATFORM' );
-
 
270
 
-
 
271
#
286
#
272
#   Validate user options
287
#   Validate user options
273
#
288
#
274
@targets = ($opt_default)
289
@targets = ($opt_default)
275
    if ( $opt_default && ! @targets);
290
    if ( $opt_default && ! @targets);
Line 735... Line 750...
735
        my @args = @defs;
750
        my @args = @defs;
736
        push @args, "IFLAG=$commands{$cmd}{IFLAG}" if ( exists $commands{$cmd}{IFLAG} );
751
        push @args, "IFLAG=$commands{$cmd}{IFLAG}" if ( exists $commands{$cmd}{IFLAG} );
737
 
752
 
738
        my $cdir = CleanDirName ($dir);
753
        my $cdir = CleanDirName ($dir);
739
        my @make_command;
754
        my @make_command;
-
 
755
        push @make_command, "timeout", "-Time:$opt_max_make" if ($opt_max_make); 
740
        push @make_command, "$ENV{GBE_BIN}/xmake";
756
        push @make_command, "$ENV{GBE_BIN}/xmake";
741
        push @make_command, "-s" if $opt_silent;
757
        push @make_command, "-s" if $opt_silent;
742
        push @make_command, "--no-print-directory";
758
        push @make_command, "--no-print-directory";
743
        push @make_command, "-C", $cdir unless ( $cdir eq $::Cwd );
759
        push @make_command, "-C", $cdir unless ( $cdir eq $::Cwd );
744
        push @make_command, "-f", "$target.mk";
760
        push @make_command, "-f", "$target.mk";
Line 1553... Line 1569...
1553
 Where options:
1569
 Where options:
1554
    -h, -h -h, -man     - Help messages with increasing verbosity
1570
    -h, -h -h, -man     - Help messages with increasing verbosity
1555
    -verbose            - Verbose operation
1571
    -verbose            - Verbose operation
1556
    -debug              - Debug operation
1572
    -debug              - Debug operation
1557
    -default=target     - Default 'target' if none is supplied
1573
    -default=target     - Default 'target' if none is supplied
-
 
1574
    -maxTime=duration   - Maximum allowed duration of any make command
1558
    -- make options     - [Advanced] Options passed directly to make
1575
    -- make options     - [Advanced] Options passed directly to make
1559
 
1576
 
1560
 Where flags are of the form Name=Value
1577
 Where flags are of the form Name=Value
1561
    SHOWENV=1           - Show make environment
1578
    SHOWENV=1           - Show make environment
1562
    LEAVETMP=1          - Leave temp working files
1579
    LEAVETMP=1          - Leave temp working files
Line 1623... Line 1640...
1623
=item B<-default=target>
1640
=item B<-default=target>
1624
 
1641
 
1625
This options specifies the default target if none is provided on the command
1642
This options specifies the default target if none is provided on the command
1626
line. Used by the jats wrapper to simplify processing.
1643
line. Used by the jats wrapper to simplify processing.
1627
 
1644
 
-
 
1645
=item B<-maxTime=duration>
-
 
1646
 
-
 
1647
This option specifies the maximum allowed duration of any make sub command.
-
 
1648
 
-
 
1649
Some commands are composed of several subcommands, as are the production and 
-
 
1650
debug variants. The time lime is imposed on a sub commands and not the total
-
 
1651
collection of commands. The intent of the time limit is to prevent stalled builds 
-
 
1652
from hijacking the build process.
-
 
1653
 
-
 
1654
The default value will be taken from the EnvVar L<GBE_MAXMAKE>, if present, or 3 hours
-
 
1655
if the EnvVar is not present. A value of 0 (zero) will disable this feature.
-
 
1656
 
-
 
1657
The duration is specified as a positive floating point number with an optional
-
 
1658
modifing character. Valid modifiers are:
-
 
1659
 
-
 
1660
=over 4
-
 
1661
 
-
 
1662
=item   
-
 
1663
 
-
 
1664
B<s> - Seconds (default)
-
 
1665
 
-
 
1666
=item   
-
 
1667
 
-
 
1668
B<m> - Minutes
-
 
1669
 
-
 
1670
=item   
-
 
1671
 
-
 
1672
B<h> - hours
-
 
1673
 
-
 
1674
=item   
-
 
1675
 
-
 
1676
B<d> - Days
-
 
1677
 
-
 
1678
=back
-
 
1679
 
-
 
1680
Example: C<-MaxTime=5.h>. Will set a Maximum make time of 30 minutes.
-
 
1681
 
1628
=item B<-- Make Options>
1682
=item B<-- Make Options>
1629
 
1683
 
1630
Command line arguments that follow a '--' are passed directly to the GNU make
1684
Command line arguments that follow a '--' are passed directly to the GNU make
1631
program. This may be useful for advanced debugging of makefiles. These options
1685
program. This may be useful for advanced debugging of makefiles. These options
1632
include:
1686
include: