Subversion Repositories DevTools

Rev

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

Rev 5726 Rev 5731
Line 180... Line 180...
180
 
180
 
181
ToolsetInit();
181
ToolsetInit();
182
 
182
 
183
sub ToolsetInit
183
sub ToolsetInit
184
{
184
{
185
    my( $GCCTarget, $GCCToolchain, $GCCRoot, $GCCBin, $GCCAr, $GCCObjCopy );
185
    my( $GCCTarget, $GCCToolchain, $GCCRoot, $GCCBin, $GCCAr, $GCCObjCopy, $GCCGcovTool );
186
    my( $GCCFlags,  $GCCFlagsP, $GCCFlagsD, $LDFlags );
186
    my( $GCCFlags,  $GCCFlagsP, $GCCFlagsD, $LDFlags );
187
    my( $GCCXXFlags );
187
    my( $GCCXXFlags );
188
    my( $PkgArch);
188
    my( $PkgArch);
189
    my( $arg_alias, $tools_found, $compiler_tool );
189
    my( $arg_alias, $tools_found, $compiler_tool );
190
 
190
 
Line 373... Line 373...
373
        #       GCCFlags    - Additional compiler flags. Also Production and Debug
373
        #       GCCFlags    - Additional compiler flags. Also Production and Debug
374
        #
374
        #
375
        $GCCRoot = $GCCToolchain->{ROOT};
375
        $GCCRoot = $GCCToolchain->{ROOT};
376
        $GCCBin = '${GCC_ROOT}/' . $GCCToolchain->{BASE} . 'gcc';
376
        $GCCBin = '${GCC_ROOT}/' . $GCCToolchain->{BASE} . 'gcc';
377
        $GCCAr =  '${GCC_ROOT}/' . $GCCToolchain->{BASE} . 'ar';
377
        $GCCAr =  '${GCC_ROOT}/' . $GCCToolchain->{BASE} . 'ar';
-
 
378
        $GCCGcovTool = '${GCC_ROOT}/' . $GCCToolchain->{BASE} . 'gcov';
378
        $GCCObjCopy =  '${GCC_ROOT}/' . $GCCToolchain->{BASE} . 'objcopy';
379
        $GCCObjCopy =  '${GCC_ROOT}/' . $GCCToolchain->{BASE} . 'objcopy';
379
        $GCCFlags = $GCCToolchain->{CC_OPTS};
380
        $GCCFlags = $GCCToolchain->{CC_OPTS};
380
        $GCCFlagsP = $GCCToolchain->{CC_OPTSP};
381
        $GCCFlagsP = $GCCToolchain->{CC_OPTSP};
381
        $GCCFlagsD = $GCCToolchain->{CC_OPTSD};
382
        $GCCFlagsD = $GCCToolchain->{CC_OPTSD};
382
        $GCCXXFlags = $GCCToolchain->{CXX_OPTS};
383
        $GCCXXFlags = $GCCToolchain->{CXX_OPTS};
Line 420... Line 421...
420
    PlatformDefine( "GCC_TARGET         := $GCCTarget" );
421
    PlatformDefine( "GCC_TARGET         := $GCCTarget" );
421
    PlatformDefine( "GCC_ROOT           := $GCCRoot" );
422
    PlatformDefine( "GCC_ROOT           := $GCCRoot" );
422
    PlatformDefine( "GCC_CC             := $GCCBin" );
423
    PlatformDefine( "GCC_CC             := $GCCBin" );
423
    PlatformDefine( "GCC_AR             := $GCCAr" );
424
    PlatformDefine( "GCC_AR             := $GCCAr" );
424
    PlatformDefine( "GCC_OBJCOPY        := $GCCObjCopy" );
425
    PlatformDefine( "GCC_OBJCOPY        := $GCCObjCopy" );
-
 
426
    PlatformDefine( "GCC_GCOVTOOL       := $GCCGcovTool" );
425
    PlatformDefine( "GCC_CFLAGS         := $GCCFlags" ) if defined $GCCFlags;
427
    PlatformDefine( "GCC_CFLAGS         := $GCCFlags" ) if defined $GCCFlags;
426
    PlatformDefine( "GCC_CFLAGSP        := $GCCFlagsP" ) if defined $GCCFlagsP;
428
    PlatformDefine( "GCC_CFLAGSP        := $GCCFlagsP" ) if defined $GCCFlagsP;
427
    PlatformDefine( "GCC_CFLAGSD        := $GCCFlagsD" ) if defined $GCCFlagsD;
429
    PlatformDefine( "GCC_CFLAGSD        := $GCCFlagsD" ) if defined $GCCFlagsD;
428
    PlatformDefine( "GCC_LDFLAGS        := $LDFlags" ) if defined $LDFlags;
430
    PlatformDefine( "GCC_LDFLAGS        := $LDFlags" ) if defined $LDFlags;
429
    PlatformDefine( "GCC_CXXFLAGS       := $GCCXXFlags" ) if defined $GCCXXFlags;
431
    PlatformDefine( "GCC_CXXFLAGS       := $GCCXXFlags" ) if defined $GCCXXFlags;
Line 1048... Line 1050...
1048
        while(($key, $value) = each(%::OBJSOURCE))
1050
        while(($key, $value) = each(%::OBJSOURCE))
1049
        {
1051
        {
1050
            $io->PrtLn("\t" . '$(XX_PRE)rm -f $(OBJDIR)/' . $key . ".gcda");
1052
            $io->PrtLn("\t" . '$(XX_PRE)rm -f $(OBJDIR)/' . $key . ".gcda");
1051
        }
1053
        }
1052
        $io->PrtLn("\t" . '${XX_PRE}$(rm) -f ' . $final);
1054
        $io->PrtLn("\t" . '${XX_PRE}$(rm) -f ' . $final);
-
 
1055
        $io->PrtLn("\t" . 'echo PREPROCESSING: $$PWD');
1053
        $io->PrtLn("\t" . '${XX_PRE}lcov'
1056
        $io->PrtLn("\t" . '${XX_PRE}lcov'
1054
                        . $LcovExplicitBranch
1057
                        . $LcovExplicitBranch
1055
                        . ' --capture'
1058
                        . ' --capture'
1056
                        . ' --initial'
1059
                        . ' --initial'
1057
                        . ' --base-directory ' . $::Cwd
1060
                        . ' --base-directory ' . $::Cwd
1058
                        . ' --directory $(OBJDIR)'
1061
                        . ' --directory $(OBJDIR)'
-
 
1062
                        . ' --gcov-tool $(GCC_GCOVTOOL)' 
1059
                        . ' --output-file $(OBJDIR)/lcov-baseline.info' );
1063
                        . ' --output-file $(OBJDIR)/lcov-baseline.info' );
-
 
1064
        $io->PrtLn("\t" . 'echo PREPROCESSING DONE');
1060
        $io->Newline();
1065
        $io->Newline();
1061
    }
1066
    }
1062
}
1067
}
1063
 
1068
 
1064
 
1069
 
Line 1097... Line 1102...
1097
        $io->PrtPart("\t\t" . 'else');
1102
        $io->PrtPart("\t\t" . 'else');
1098
        $io->PrtPart("\t\t\t" . 'lcov'
1103
        $io->PrtPart("\t\t\t" . 'lcov'
1099
                          . $LcovExplicitBranch
1104
                          . $LcovExplicitBranch
1100
                          . ' --add-tracefile $(OBJDIR)/lcov-baseline.info'
1105
                          . ' --add-tracefile $(OBJDIR)/lcov-baseline.info'
1101
                          . ' --add-tracefile ' . $final
1106
                          . ' --add-tracefile ' . $final
-
 
1107
                          . ' --gcov-tool $(GCC_GCOVTOOL)' 
1102
                          . ' --output-file $(OBJDIR)/lcov-merge.info'
1108
                          . ' --output-file $(OBJDIR)/lcov-merge.info'
1103
                          . ';'); 
1109
                          . ';'); 
1104
        $io->PrtPart("\t\t\t" . '$(rm) -f ' . $final . ';');
1110
        $io->PrtPart("\t\t\t" . '$(rm) -f ' . $final . ';');
1105
        $io->PrtPart("\t\t\t" . '$(mv) $(OBJDIR)/lcov-merge.info ' . $final . ';');
1111
        $io->PrtPart("\t\t\t" . '$(mv) $(OBJDIR)/lcov-merge.info ' . $final . ';');
1106
        $io->PrtPart("\t\t" . 'fi' . ';');
1112
        $io->PrtPart("\t\t" . 'fi' . ';');
Line 1108... Line 1114...
1108
        $io->PrtPart("\t\t" . 'lcov'
1114
        $io->PrtPart("\t\t" . 'lcov'
1109
                          . $LcovExplicitBranch
1115
                          . $LcovExplicitBranch
1110
                        . ' --capture'
1116
                        . ' --capture'
1111
                        . ' --base-directory ' . $::Cwd
1117
                        . ' --base-directory ' . $::Cwd
1112
                        . ' --directory $(OBJDIR)'
1118
                        . ' --directory $(OBJDIR)'
-
 
1119
                        . ' --gcov-tool $(GCC_GCOVTOOL)' 
1113
                        . ' --output-file $(OBJDIR)/lcov-capture.info' 
1120
                        . ' --output-file $(OBJDIR)/lcov-capture.info' 
1114
                        . ';'); 
1121
                        . ';'); 
1115
        $io->PrtPart("\t\t" . 'if [ ! -e ' . $final . " ]; then");
1122
        $io->PrtPart("\t\t" . 'if [ ! -e ' . $final . " ]; then");
1116
        $io->PrtPart("\t\t\t" . 'lcov'
1123
        $io->PrtPart("\t\t\t" . 'lcov'
1117
                          . $LcovExplicitBranch
1124
                          . $LcovExplicitBranch
1118
                          . ' --add-tracefile $(OBJDIR)/lcov-baseline.info'
1125
                          . ' --add-tracefile $(OBJDIR)/lcov-baseline.info'
1119
                          . ' --add-tracefile $(OBJDIR)/lcov-capture.info'
1126
                          . ' --add-tracefile $(OBJDIR)/lcov-capture.info'
-
 
1127
                          . ' --gcov-tool $(GCC_GCOVTOOL)' 
1120
                          . ' --output-file ' .  $final
1128
                          . ' --output-file ' .  $final
1121
                          . ';'); 
1129
                          . ';'); 
1122
        $io->PrtPart("\t\t" . 'else');
1130
        $io->PrtPart("\t\t" . 'else');
1123
        $io->PrtPart("\t\t\t" . 'lcov'
1131
        $io->PrtPart("\t\t\t" . 'lcov'
1124
                          . $LcovExplicitBranch
1132
                          . $LcovExplicitBranch
1125
                          . ' --add-tracefile $(OBJDIR)/lcov-baseline.info'
1133
                          . ' --add-tracefile $(OBJDIR)/lcov-baseline.info'
1126
                          . ' --add-tracefile $(OBJDIR)/lcov-capture.info'
1134
                          . ' --add-tracefile $(OBJDIR)/lcov-capture.info'
1127
                          . ' --add-tracefile ' . $final
1135
                          . ' --add-tracefile ' . $final
-
 
1136
                          . ' --gcov-tool $(GCC_GCOVTOOL)' 
1128
                          . ' --output-file $(OBJDIR)/lcov-merge.info'
1137
                          . ' --output-file $(OBJDIR)/lcov-merge.info'
1129
                          . ';'); 
1138
                          . ';'); 
1130
        $io->PrtPart("\t\t\t" . '$(rm) -f ' . $final . ';');
1139
        $io->PrtPart("\t\t\t" . '$(rm) -f ' . $final . ';');
1131
        $io->PrtPart("\t\t\t" . '$(mv) $(OBJDIR)/lcov-merge.info ' . $final . ';');
1140
        $io->PrtPart("\t\t\t" . '$(mv) $(OBJDIR)/lcov-merge.info ' . $final . ';');
1132
        $io->PrtPart("\t\t" . 'fi' . ';');
1141
        $io->PrtPart("\t\t" . 'fi' . ';');