Subversion Repositories DevTools

Rev

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

Rev 4728 Rev 4761
Line 69... Line 69...
69
my %common_cmd;                             # Short circuit some commands
69
my %common_cmd;                             # Short circuit some commands
70
my %gbe_platform;                           # Nice form of GBE_PLATFORM
70
my %gbe_platform;                           # Nice form of GBE_PLATFORM
71
 
71
 
72
#
72
#
73
#   Known commands
73
#   Known commands
74
#   A hash of known commands an information about the commands
74
#   A hash of known commands and information about the commands
75
#       common      - Command is not executed for Debug and Production
75
#       common      - Command operation modifiers
76
#                     Flags: 1 - Command not executed for debug+prod
76
#                     Flags: 1 - Command not executed for debug+prod
77
#                     Flags: 2 - Command is only executed ONCE per platform
77
#                     Flags: 2 - Command is only executed ONCE per platform
78
#       local       - The command is handled locally.
78
#       local       - The command is handled locally.
79
#       nomakecheck - Don't check for makefile being out of date
79
#       nomakecheck - Don't check for makefile being out of date
80
#       IFLAG       - iteration flag,
80
#       IFLAG       - iteration flag,
Line 158... Line 158...
158
    #
158
    #
159
    'exec_tests'            => { 'nomakecheck' => 1, 'tag' => 1, 'IFLAG' => 3},
159
    'exec_tests'            => { 'nomakecheck' => 1, 'tag' => 1, 'IFLAG' => 3},
160
    'exec_unit_tests'       => { 'nomakecheck' => 1, 'tag' => 1, 'IFLAG' => 3},
160
    'exec_unit_tests'       => { 'nomakecheck' => 1, 'tag' => 1, 'IFLAG' => 3},
161
    'preprocess_tests'      => { 'nomakecheck' => 1, 'tag' => 'process_tests'},
161
    'preprocess_tests'      => { 'nomakecheck' => 1, 'tag' => 'process_tests'},
162
    'postprocess_tests'     => { 'nomakecheck' => 1, 'tag' => 'process_tests'},
162
    'postprocess_tests'     => { 'nomakecheck' => 1, 'tag' => 'process_tests'},
163
    'collate_test_results'  => { 'nomakecheck' => 1, 'tag' => 'process_tests'},
163
    'collate_test_results'  => { 'nomakecheck' => 1, 'tag' => 'process_tests', 'common' => 2},
164
    
164
    
165
    #
165
    #
166
    #   Following commands should NOT be a part of a composite command
166
    #   Following commands should NOT be a part of a composite command
167
    #
167
    #
168
    'clean'                 => { 'nomakecheck' => 1},
168
    'clean'                 => { 'nomakecheck' => 1},
Line 545... Line 545...
545
    {
545
    {
546
        $tag = $commands{$cmd}{tag};
546
        $tag = $commands{$cmd}{tag};
547
        $tag = $cmd if ( $tag eq '1' );
547
        $tag = $cmd if ( $tag eq '1' );
548
    }
548
    }
549
 
549
 
-
 
550
    #   Ensure this element is defined
-
 
551
    #       Simplifies testing in the remainder of the code
-
 
552
    $commands{$cmd}{'common'} = 0 
-
 
553
        unless exists($commands{$cmd}{'common'});
-
 
554
 
550
    if ( $commands{$cmd}{'common'} )
555
    if ( $commands{$cmd}{'common'} & 1 )
551
    {
556
    {
552
        InvokeSubMake( $::Cwd, $platform_ref ,$cmd, $tag, 1 );
557
        InvokeSubMake( $::Cwd, $platform_ref ,$cmd, $tag, 1, 'C' );
553
    }
558
    }
554
    else
559
    else
555
    {
560
    {
556
        InvokeSubMake( $::Cwd, $platform_ref ,$cmd, $tag, 1 ) if $do_debug;
561
        InvokeSubMake( $::Cwd, $platform_ref ,$cmd, $tag, 1, 'D' ) if $do_debug;
557
        InvokeSubMake( $::Cwd, $platform_ref ,$cmd, $tag, 0 ) if $do_prod;
562
        InvokeSubMake( $::Cwd, $platform_ref ,$cmd, $tag, 0, 'P' ) if $do_prod;
558
    }
563
    }
559
}
564
}
560
 
565
 
561
#-------------------------------------------------------------------------------
566
#-------------------------------------------------------------------------------
562
# Function        : InvokeSubMake
567
# Function        : InvokeSubMake
Line 567... Line 572...
567
#
572
#
568
# Inputs          : $dir
573
# Inputs          : $dir
569
#                   $pref                   - Ref to an array of platforms
574
#                   $pref                   - Ref to an array of platforms
570
#                   $cmd
575
#                   $cmd
571
#                   $tag
576
#                   $tag
572
#                   $do_prod
577
#                   $do_debug               - 0:Production, 1:Debug
-
 
578
#                   $text                   - Single Char display text (C, P or D)
573
#
579
#
574
# Returns         : 
580
# Returns         : 
575
#
581
#
576
sub InvokeSubMake
582
sub InvokeSubMake
577
{
583
{
578
    my ( $dir, $pref, $cmd, $tag, $do_debug) = @_;
584
    my ( $dir, $pref, $cmd, $tag, $do_debug, $text) = @_;
579
 
585
 
580
    #
586
    #
581
    #   Ensure the current directory is known to the Tags database
587
    #   Ensure the current directory is known to the Tags database
582
    #
588
    #
583
    $Tags = ReadMaketags( $dir );
589
    $Tags = ReadMaketags( $dir );
Line 586... Line 592...
586
    #
592
    #
587
    #   Process commands in the current directory
593
    #   Process commands in the current directory
588
    #   If the command is tagged, then we may be able to skip it
594
    #   If the command is tagged, then we may be able to skip it
589
    #   Otherwise we need to do it
595
    #   Otherwise we need to do it
590
    #
596
    #
591
    InvokeMake( $dir, $pref, $cmd, $tag, $do_debug );
597
    InvokeMake( $dir, $pref, $cmd, $tag, $do_debug, $text );
592
 
598
 
593
    #
599
    #
594
    #   Recurse into any subdirectories that may be a part of the build
600
    #   Recurse into any subdirectories that may be a part of the build
595
    #
601
    #
596
    unless ( exists $defs{NORECURSE} && $defs{NORECURSE}  )
602
    unless ( exists $defs{NORECURSE} && $defs{NORECURSE}  )
Line 601... Line 607...
601
        #   Otherwise we need to do it
607
        #   Otherwise we need to do it
602
        #
608
        #
603
        foreach my $subdir (@{$Tags->{$dir}{subdirs}} )
609
        foreach my $subdir (@{$Tags->{$dir}{subdirs}} )
604
        {
610
        {
605
 
611
 
606
            InvokeSubMake( CleanDirName( "$dir/$subdir"), $pref, $cmd, $tag, $do_debug );
612
            InvokeSubMake( CleanDirName( "$dir/$subdir"), $pref, $cmd, $tag, $do_debug, $text );
607
        }
613
        }
608
    }
614
    }
609
}
615
}
610
 
616
 
611
#-------------------------------------------------------------------------------
617
#-------------------------------------------------------------------------------
Line 615... Line 621...
615
#
621
#
616
# Inputs          : $dir
622
# Inputs          : $dir
617
#                   $pref
623
#                   $pref
618
#                   $cmd
624
#                   $cmd
619
#                   $tag
625
#                   $tag
620
#                   $do_debug
626
#                   $do_debug               - 0:Production, 1:Debug
-
 
627
#                   $text                   - Single Char display text (C, P or D)
621
#
628
#
622
#
629
#
623
# Returns         : 
630
# Returns         : 
624
#
631
#
625
sub InvokeMake
632
sub InvokeMake
626
{
633
{
627
    my ( $dir, $pref, $cmd, $tag, $do_debug ) = @_;
634
    my ( $dir, $pref, $cmd, $tag, $do_debug, $text ) = @_;
628
    my $text = 'C';
-
 
629
 
635
 
630
    Verbose2 ("InvokeMake: $dir");
636
    Verbose2 ("InvokeMake: $dir");
631
    #
637
    #
632
    #   Ensure that the current directory actually has makefile targets
638
    #   Ensure that the current directory actually has makefile targets
633
    #   Not all makefile.pl create .mk files
639
    #   Not all makefile.pl create .mk files
Line 668... Line 674...
668
                next;
674
                next;
669
            }
675
            }
670
        }
676
        }
671
 
677
 
672
        #
678
        #
673
        #   common mode == 2
679
        #   common modifier mask=2, (Bit-1)
674
        #   Only process target ONCE for each platform
680
        #       Only process target ONCE for each platform
675
        #   Don't care when its used
681
        #       Don't care when its used
676
        #
682
        #
677
        if ( exists $commands{$cmd}{'common'} && $commands{$cmd}{'common'} & 2 )
683
        if ( $commands{$cmd}{'common'} & 2 )
678
        {
684
        {
679
            if ( $common_cmd{$cmd}{$target} )
685
            if ( $common_cmd{$cmd}{$text}{$target} )
680
            {
686
            {
681
                Verbose2 "Already performed $cmd for $target";
687
                Verbose2 "Already performed $cmd for $target in mode $text";
682
                next;
688
                next;
683
            }
689
            }
684
            $common_cmd{$cmd}{$target} = 1;
690
            $common_cmd{$cmd}{$text}{$target} = 1;
685
        }
691
        }
686
 
692
 
687
        #
693
        #
688
        #   Is the build limited to only debug or production
694
        #   Is the build limited to only debug or production
689
        #
695
        #
690
        unless ( exists $commands{$cmd}{'common'} )
696
        unless ( $commands{$cmd}{'common'} & 1 )
691
        {
697
        {
692
            if ( $do_debug == 0 ) {
698
            if ( $do_debug == 0 ) {
693
                next unless ( $Tags->{$dir}{platforms}{$target}{prod} );
699
                next unless ( $Tags->{$dir}{platforms}{$target}{prod} );
694
                $text = 'P';
-
 
695
 
700
 
696
            } elsif  ( $do_debug == 1 ) {
701
            } elsif  ( $do_debug == 1 ) {
697
                next unless ( $Tags->{$dir}{platforms}{$target}{debug} );
702
                next unless ( $Tags->{$dir}{platforms}{$target}{debug} );
698
                $text = 'D';
-
 
699
            }
703
            }
700
        }
704
        }
701
 
705
 
702
        #
706
        #
703
        #   Final sanity test
707
        #   Final sanity test