Subversion Repositories DevTools

Rev

Rev 391 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 391 Rev 4001
Line 54... Line 54...
54
our $GBE_TOOLS;                             # Base of tools
54
our $GBE_TOOLS;                             # Base of tools
55
our $GBE_ABT;                               # Optional ABT indication
55
our $GBE_ABT;                               # Optional ABT indication
56
our $GBE_PLATFORM;                          # Optional GBE_PLATFORM
56
our $GBE_PLATFORM;                          # Optional GBE_PLATFORM
57
our $ScmInterface;                          # Current interface directory
57
our $ScmInterface;                          # Current interface directory
58
our $ScmRoot;                               # Build root
58
our $ScmRoot;                               # Build root
-
 
59
our $ScmNoBuild;                            # Dummy Build and Make
59
 
60
 
60
my $Tags;                                   # Reference to hash of tags
61
my $Tags;                                   # Reference to hash of tags
61
my %defs;                                   # Make definitions
62
my %defs;                                   # Make definitions
62
my @defs;                                   # Make definitions
63
my @defs;                                   # Make definitions
63
my @targets;                                # Make targets
64
my @targets;                                # Make targets
Line 302... Line 303...
302
#   Read in the global build variables
303
#   Read in the global build variables
303
#
304
#
304
ReadBuildConfig( "$::ScmRoot/$::ScmInterface" );
305
ReadBuildConfig( "$::ScmRoot/$::ScmInterface" );
305
 
306
 
306
#
307
#
307
#   Determine the max size of the target name
308
#   Process the user specified targets
308
#   Makes a nice display
-
 
309
#
309
#
310
foreach ( @BUILDPLATFORMS )
310
ProcessTargets();
-
 
311
 
311
{
312
#
312
    my $len = length ($_);
313
#   All done
-
 
314
#
313
    $tlen = $len if ( $len > $tlen );
315
exit (0);
314
}
316
 
315
 
317
 
316
#-------------------------------------------------------------------------------
318
#-------------------------------------------------------------------------------
317
#   Scan the list of targets and perform 'alias' expansion
-
 
318
#   targets are of the form
-
 
319
#       platform_command_type
319
# Function        : ProcessTargets
320
#       Where:
320
#
321
#           type        may be _prod or _debug or not present
321
# Description     : Process the user specified targets
322
#           command     may be either a composite command or a simple command
-
 
-
 
322
#
323
#           platform    may be a platform or an alias
323
# Inputs          :
324
#
324
#
-
 
325
# Returns         : 
325
#
326
#
326
foreach my $arg ( @targets )
327
sub ProcessTargets
327
{
328
{
328
    my $suffix = '';
-
 
329
    my @commands;
329
    if($ScmNoBuild)
330
    my @platforms;
-
 
331
 
-
 
332
    #
330
    {
333
    #   Remove the only available suffix ( _debug | _prod )
331
            Verbose2 ("Processing Skipped in noBuild");
334
    #   Also detect commnads of debug or prod
-
 
335
    #
-
 
336
    if ( $arg =~ m~(.+)_(debug)$~ ) {
-
 
337
        $suffix = $2;
-
 
338
        $arg = $1;
-
 
339
    } elsif ( $arg =~ m~(.+)_(prod)$~ ) {
-
 
340
        $suffix = $2;
-
 
341
        $arg = $1;
-
 
342
    } elsif ( $arg eq 'debug' ) {
-
 
343
        $suffix = $arg;
-
 
344
        $arg = '';
-
 
345
    } elsif ( $arg eq 'prod' ) {
-
 
346
        $suffix = $arg;
-
 
347
        $arg = '';
332
            return;
348
    }
333
    }
349
 
334
 
350
    #
335
    #
351
    #   Remove valid make commands from the remaining argument
336
    #   Determine the max size of the target name
352
    #   Have a hash of all known makefile commands
337
    #   Makes a nice display
353
    #
338
    #
354
    foreach my $cmd ( keys %composite_commands, keys %commands )
339
    foreach ( @BUILDPLATFORMS )
355
    {
340
    {
356
        if ( $arg eq $cmd )
-
 
357
        {
-
 
358
            @commands = ExpandComposite($cmd);
-
 
359
            $arg = '';
341
        my $len = length ($_);
360
        }
-
 
361
        elsif ( $arg =~ m~(.+)_($cmd)$~ )
342
        $tlen = $len if ( $len > $tlen );
362
        {
-
 
363
            $arg = $1;
-
 
364
            @commands = ExpandComposite($2);
-
 
365
            last;
-
 
366
        }
-
 
367
    }
343
    }
368
 
344
 
-
 
345
    #-------------------------------------------------------------------------------
-
 
346
    #   Scan the list of targets and perform 'alias' expansion
-
 
347
    #   targets are of the form
-
 
348
    #       platform_command_type
-
 
349
    #       Where:
-
 
350
    #           type        may be _prod or _debug or not present
-
 
351
    #           command     may be either a composite command or a simple command
-
 
352
    #           platform    may be a platform or an alias
369
    #
353
    #
370
    #   See of we can extract an platform alias from the command
-
 
371
    #   Rip into target + command
-
 
372
    #
354
    #
373
    if ( $arg )
355
    foreach my $arg ( @targets )
374
    {
356
    {
-
 
357
        my $suffix = '';
-
 
358
        my @commands;
-
 
359
        my @platforms;
-
 
360
 
-
 
361
        #
-
 
362
        #   Remove the only available suffix ( _debug | _prod )
375
        if ( exists $ScmBuildAliases{$arg}  )
363
        #   Also detect commnads of debug or prod
376
        {
364
        #
-
 
365
        if ( $arg =~ m~(.+)_(debug)$~ ) {
-
 
366
            $suffix = $2;
-
 
367
            $arg = $1;
377
            @platforms =  split (/ /, $ScmBuildAliases{$arg} );
368
        } elsif ( $arg =~ m~(.+)_(prod)$~ ) {
-
 
369
            $suffix = $2;
-
 
370
            $arg = $1;
-
 
371
        } elsif ( $arg eq 'debug' ) {
-
 
372
            $suffix = $arg;
-
 
373
            $arg = '';
-
 
374
        } elsif ( $arg eq 'prod' ) {
-
 
375
            $suffix = $arg;
-
 
376
            $arg = '';
378
        }
377
        }
-
 
378
 
-
 
379
        #
-
 
380
        #   Remove valid make commands from the remaining argument
379
        elsif ( exists $ScmBuildPlatforms{$arg} )
381
        #   Have a hash of all known makefile commands
-
 
382
        #
-
 
383
        foreach my $cmd ( keys %composite_commands, keys %commands )
380
        {
384
        {
-
 
385
            if ( $arg eq $cmd )
-
 
386
            {
-
 
387
                @commands = ExpandComposite($cmd);
-
 
388
                $arg = '';
-
 
389
            }
-
 
390
            elsif ( $arg =~ m~(.+)_($cmd)$~ )
-
 
391
            {
381
            @platforms = ($arg);
392
                $arg = $1;
-
 
393
                @commands = ExpandComposite($2);
-
 
394
                last;
-
 
395
            }
382
        }
396
        }
-
 
397
 
383
        else
398
        #
-
 
399
        #   See of we can extract an platform alias from the command
-
 
400
        #   Rip into target + command
-
 
401
        #
-
 
402
        if ( $arg )
384
        {
403
        {
385
            if ( @commands )
404
            if ( exists $ScmBuildAliases{$arg}  )
386
            {
405
            {
-
 
406
                @platforms =  split (/ /, $ScmBuildAliases{$arg} );
-
 
407
            }
-
 
408
            elsif ( exists $ScmBuildPlatforms{$arg} )
-
 
409
            {
387
                Error ("Unknown target: $arg");
410
                @platforms = ($arg);
388
            }
411
            }
389
            else
412
            else
390
            {
413
            {
-
 
414
                if ( @commands )
-
 
415
                {
-
 
416
                    Error ("Unknown target: $arg");
-
 
417
                }
-
 
418
                else
-
 
419
                {
391
                Message ("Unknown command. Passed to make: $arg");
420
                    Message ("Unknown command. Passed to make: $arg");
392
                @commands = $arg;
421
                    @commands = $arg;
-
 
422
                }
393
            }
423
            }
394
        }
424
        }
395
    }
-
 
396
 
425
 
397
    #
426
        #
398
    #   Insert defaults
427
        #   Insert defaults
399
    #
428
        #
400
    @platforms = @DEFBUILDPLATFORMS
429
        @platforms = @DEFBUILDPLATFORMS
401
        unless ( @platforms );
430
            unless ( @platforms );
402
 
-
 
403
    @commands = ExpandComposite('all')
431
        @commands = ExpandComposite('all')
404
        unless ( @commands);
432
            unless ( @commands);
405
 
433
 
406
    #
434
        #
407
    #   Perform GBE_PLATFORM filtering
435
        #   Perform GBE_PLATFORM filtering
408
    #
436
        #
409
    @platforms = grep ( exists $gbe_platform{$_} , @platforms )
437
        @platforms = grep ( exists $gbe_platform{$_} , @platforms )
410
        if ( %gbe_platform );
438
            if ( %gbe_platform );
411
 
439
 
412
    Error ("No platforms to be processed. Check GBE_PLATFORM")
440
        Error ("No platforms to be processed. Check GBE_PLATFORM")
413
        unless ( @platforms );
441
            unless ( @platforms );
414
 
442
 
415
    #
443
        #
416
    #   Iterate commands over platforms
444
        #   Iterate commands over platforms
417
    #
445
        #
418
    foreach my $cmd ( @commands )
446
        foreach my $cmd ( @commands )
419
    {
447
        {
420
        PerformCommand (\@platforms, $cmd, $suffix );
448
            PerformCommand (\@platforms, $cmd, $suffix );
-
 
449
        }
421
    }
450
    }
422
}
451
}
423
 
452
 
424
#
-
 
425
#   All done
-
 
426
#
-
 
427
exit (0);
-
 
428
 
-
 
429
#-------------------------------------------------------------------------------
453
#-------------------------------------------------------------------------------
430
# Function        : PerformCommand
454
# Function        : PerformCommand
431
#
455
#
432
# Description     : Perform the make on a platform command
456
# Description     : Perform the make on a platform command
433
#
457
#