Subversion Repositories DevTools

Rev

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

Rev 335 Rev 343
Line 19... Line 19...
19
my $pdb_first_lib;
19
my $pdb_first_lib;
20
my $target_file_lib;
20
my $target_file_lib;
21
my $target_file_dll;
21
my $target_file_dll;
22
my $target_file_exe;
22
my $target_file_exe;
23
my $pdb_none;
23
my $pdb_none;
-
 
24
my $toolset_name = 'vcwce';                           # Toolset name : Error reporting
24
 
25
 
25
##############################################################################
26
##############################################################################
26
#   Toolchain information
27
#   Toolchain information
27
#   Abstract out minor toolchain differences into a data structure
28
#   Abstract out minor toolchain differences into a data structure
28
#
29
#
Line 30... Line 31...
30
my %ToolChainData =
31
my %ToolChainData =
31
    (
32
    (
32
        'EVC4'      =>  {  'def'        => 'vcwce.def' ,
33
        'EVC4'      =>  {  'def'        => 'vcwce.def' ,
33
                           'initDef'    => 'vcembedded',
34
                           'initDef'    => 'vcembedded',
34
                           'wceroot'    => 'Microsoft eMbedded C++ 4.0',
35
                           'wceroot'    => 'Microsoft eMbedded C++ 4.0',
35
                           'buildcmd'   => 'evc =DSW= /make "ALL - =TYPE=" /use_env /CEConfig="=CEPLATFORM=" /out =LOG=',
36
                           'buildcmd'   => 'evc =DSW= /make =TYPE= /use_env /CEConfig="=CEPLATFORM=" /out =LOG=',
36
                           'cleancmd'   => 'evc =DSW= /make "ALL - =TYPE=" /clean /use_env /CEConfig="=CEPLATFORM="',
37
                           'cleancmd'   => 'evc =DSW= /make =TYPE= /clean /use_env /CEConfig="=CEPLATFORM="',
37
                           'tmp'        => 'vc60',
38
                           'tmp'        => 'vc60',
38
                           'VSCOMPILER' => '1',
39
                           'VSCOMPILER' => '1',
-
 
40
                           'def_targets' => [ 'ALL - RELEASE','ALL - DEBUG' ],
39
                           },
41
                           },
40
 
42
 
41
 
43
 
42
        'VS2005'    =>  {  'def'        => 'vcembedded2005.def' ,
44
        'VS2005'    =>  {  'def'        => 'vcembedded2005.def' ,
43
                           'initDef'    => 'vcembedded',
45
                           'initDef'    => 'vcembedded',
Line 99... Line 101...
99
    $::ScmToolsetGenerate = 0;                  # generate optional
101
    $::ScmToolsetGenerate = 0;                  # generate optional
100
    $::ScmToolsetProgDependancies = 0;          # handle Prog dependancies myself
102
    $::ScmToolsetProgDependancies = 0;          # handle Prog dependancies myself
101
 
103
 
102
#.. Parse arguments
104
#.. Parse arguments
103
#
105
#
104
    Debug( "vcwce(ToolsetArgs=@::ScmToolsetArgs)" );
106
    Debug( "$toolset_name(ToolsetArgs=@::ScmToolsetArgs)" );
105
 
107
 
106
    foreach ( @::ScmToolsetArgs ) {
108
    foreach ( @::ScmToolsetArgs ) {
107
        Message( "vcwce toolset: unknown option $_ -- ignored\n" );
109
        Message( "$toolset_name toolset: unknown option $_ -- ignored\n" );
108
    }
110
    }
109
 
111
 
110
    Debug( "vcwce(PlatformArgs=@::ScmPlatformArgs)" );
112
    Debug( "$toolset_name(PlatformArgs=@::ScmPlatformArgs)" );
111
 
113
 
112
    foreach ( @::ScmPlatformArgs ) {
114
    foreach ( @::ScmPlatformArgs ) {
113
        if (/^--Version=(.*)/) {                # OS Version
115
        if (/^--Version=(.*)/) {                # OS Version
114
            $WCEVersion     = "$1";
116
            $WCEVersion     = "$1";
115
 
117
 
Line 127... Line 129...
127
 
129
 
128
        } elsif (/^--product=(.*)/) {           # GBE product
130
        } elsif (/^--product=(.*)/) {           # GBE product
129
 
131
 
130
        } elsif (/^--NoDinkumware/) {           # Deprecated switch
132
        } elsif (/^--NoDinkumware/) {           # Deprecated switch
131
        } else {
133
        } else {
132
            Message( "vcwce toolset: unknown platform argument $_ -- ignored\n" );
134
            Message( "$toolset_name toolset: unknown platform argument $_ -- ignored\n" );
133
        }
135
        }
134
    }
136
    }
135
 
137
 
136
#.. Select toolchain, based on targetCPU
138
#.. Select toolchain, based on targetCPU
137
#       1) EVC            - As provided via Embedded Visual C++
139
#       1) EVC            - As provided via Embedded Visual C++
Line 148... Line 150...
148
#   ARM         ARMV4, ARMV4I, ARMV4T
150
#   ARM         ARMV4, ARMV4I, ARMV4T
149
#   MIPS        MIPSII, MIPSII_FP, MIPSIV, MIPSIV_FP, MIPS16
151
#   MIPS        MIPSII, MIPSII_FP, MIPSIV, MIPSIV_FP, MIPS16
150
#   Hitachi     SH3, SH4
152
#   Hitachi     SH3, SH4
151
#   x86         x86, x86 emulation
153
#   x86         x86, x86 emulation
152
#..
154
#..
153
    Error ("TOOLSET/vcwce - Version undefined")
155
    Error ("TOOLSET/$toolset_name - Version undefined")
154
        if ($WCEVersion eq "");
156
        if ($WCEVersion eq "");
155
 
157
 
156
    Error ("TOOLSET/vcwce - SDK undefined")
158
    Error ("TOOLSET/$toolset_name - SDK undefined")
157
        if ($WCEPlatform eq "");
159
        if ($WCEPlatform eq "");
158
 
160
 
159
    Error ("TOOLSET/vcwce - TargetCPU undefined")
161
    Error ("TOOLSET/$toolset_name - TargetCPU undefined")
160
        if ($WCETargetCPU eq "");
162
        if ($WCETargetCPU eq "");
161
 
163
 
162
    Error ("TOOLSET/vcwce - HostCPU undefined")
164
    Error ("TOOLSET/$toolset_name - HostCPU undefined")
163
        if ($WCEPlatform eq "emulator" && $WCEHostCPU eq "");
165
        if ($WCEPlatform eq "emulator" && $WCEHostCPU eq "");
164
 
166
 
165
    Error ("TOOLSET/vcwce - Toolchain undefined")
167
    Error ("TOOLSET/$toolset_name - Toolchain undefined")
166
        unless ( $WCEToolchain );
168
        unless ( $WCEToolchain );
167
 
169
 
168
 
170
 
169
# .. Generate CE Platform definition based on the selected SDK
171
# .. Generate CE Platform definition based on the selected SDK
170
#    The following is a list of known defintions for some SDKs
172
#    The following is a list of known defintions for some SDKs
Line 190... Line 192...
190
        'PA962 WINCE 500'   => 'WCE_PLATFORM_PA962',
192
        'PA962 WINCE 500'   => 'WCE_PLATFORM_PA962',
191
    );
193
    );
192
 
194
 
193
    $WCEPlatformDefine = $PlatformSDKDefinitions{$WCEPlatform};
195
    $WCEPlatformDefine = $PlatformSDKDefinitions{$WCEPlatform};
194
 
196
 
195
    Error ("TOOLSET/vcwce - SDK not defined. Extend table",
197
    Error ("TOOLSET/$toolset_name - SDK not defined. Extend table",
196
           "SDK: $WCEPlatform" )
198
           "SDK: $WCEPlatform" )
197
        unless ( defined $WCEPlatformDefine );
199
        unless ( defined $WCEPlatformDefine );
198
 
200
 
199
    $WCEPlatformClean = $WCEPlatform;
201
    $WCEPlatformClean = $WCEPlatform;
200
    $WCEPlatformClean =~ s/\s/_/g;
202
    $WCEPlatformClean =~ s/\s/_/g;
Line 378... Line 380...
378
            push( @ldflags, 'aygshell.lib' );
380
            push( @ldflags, 'aygshell.lib' );
379
 
381
 
380
            push( @libflags,'-MACHINE:IX86' );
382
            push( @libflags,'-MACHINE:IX86' );
381
            
383
            
382
        } else {
384
        } else {
383
            Error ("TOOLSET/vcwce - unknown HostCPU '$WCEHostCPU'");
385
            Error ("TOOLSET/$toolset_name - unknown HostCPU '$WCEHostCPU'");
384
        }
386
        }
385
 
387
 
386
    } else {
388
    } else {
387
        Error ("TOOLSET/vcwce - unknown TargetCPU '$WCETargetCPU'");
389
        Error ("TOOLSET/$toolset_name - unknown TargetCPU '$WCETargetCPU'");
388
    }
390
    }
389
 
391
 
390
#.. Define eMebbed C/C+ environment
392
#.. Define eMebbed C/C+ environment
391
#
393
#
392
 
394
 
Line 662... Line 664...
662
            $cflags = "$cflags \$(SHCFLAGS)";
664
            $cflags = "$cflags \$(SHCFLAGS)";
663
            $pdb = $::SHOBJ_LIB{$obj}
665
            $pdb = $::SHOBJ_LIB{$obj}
664
                if (exists $::SHOBJ_LIB{$obj} );
666
                if (exists $::SHOBJ_LIB{$obj} );
665
 
667
 
666
        } else {
668
        } else {
667
            Message( "vcwce $name: unknown option $_ -- ignored\n" );
669
            Message( "$toolset_name $name: unknown option $_ -- ignored\n" );
668
        }
670
        }
669
    }
671
    }
670
 
672
 
671
    MakePrint( "\n\t\$($name)\n" );
673
    MakePrint( "\n\t\$($name)\n" );
672
    MakePadded( 4, "\$(OBJDIR)/$obj.$::o:", "\tCFLAGS +=$cflags\n" )
674
    MakePadded( 4, "\$(OBJDIR)/$obj.$::o:", "\tCFLAGS +=$cflags\n" )
Line 797... Line 799...
797
 
799
 
798
        } elsif (/^--Resource=(.*)/) {          # Resource definition
800
        } elsif (/^--Resource=(.*)/) {          # Resource definition
799
            ($res, @reslist) = ToolsetRClist( "$name", $1 );
801
            ($res, @reslist) = ToolsetRClist( "$name", $1 );
800
 
802
 
801
        } else {                                # unknown
803
        } else {                                # unknown
802
            Message( "vcwce AR: unknown option $_ -- ignored\n" );
804
            Message( "$toolset_name AR: unknown option $_ -- ignored\n" );
803
        }
805
        }
804
    }
806
    }
805
 
807
 
806
#.. Resource Creation
808
#.. Resource Creation
807
#
809
#
Line 1024... Line 1026...
1024
            #
1026
            #
1025
            next unless ($2);
1027
            next unless ($2);
1026
            if ( $3 =~ /^--MutualDll$/ ) {
1028
            if ( $3 =~ /^--MutualDll$/ ) {
1027
                $mutual_dll = 1;
1029
                $mutual_dll = 1;
1028
            } else {
1030
            } else {
1029
                Message( "vcwce SHLD: unknown option $_ -- ignored\n" );
1031
                Message( "$toolset_name SHLD: unknown option $_ -- ignored\n" );
1030
            }
1032
            }
1031
 
1033
 
1032
        } elsif (/^--Resource=(.*)/) {          # Resource definition
1034
        } elsif (/^--Resource=(.*)/) {          # Resource definition
1033
            ($res, @reslist) = ToolsetRClist( "$name/$name", $1 );
1035
            ($res, @reslist) = ToolsetRClist( "$name/$name", $1 );
1034
 
1036
 
Line 1055... Line 1057...
1055
 
1057
 
1056
        } elsif (/^--Stubonly/) {
1058
        } elsif (/^--Stubonly/) {
1057
            $stub_only = 1;
1059
            $stub_only = 1;
1058
 
1060
 
1059
        } else {                                # unknown
1061
        } else {                                # unknown
1060
            Message( "vcwce SHLD: unknown option $_ -- ignored\n" );
1062
            Message( "$toolset_name SHLD: unknown option $_ -- ignored\n" );
1061
        }
1063
        }
1062
    }
1064
    }
1063
 
1065
 
1064
    #
1066
    #
1065
    #   Sanity test
1067
    #   Sanity test
1066
    #
1068
    #
1067
    Error ("vcwce SHLD:Stubonly option requires --Def=file ")
1069
    Error ("$toolset_name SHLD:Stubonly option requires --Def=file ")
1068
        if ( $stub_only && ! $def );
1070
        if ( $stub_only && ! $def );
1069
 
1071
 
1070
    Error ("vcwce SHLD:MutualDll option requires --Def=file ")
1072
    Error ("$toolset_name SHLD:MutualDll option requires --Def=file ")
1071
        if ( $mutual_dll && ! $def );
1073
        if ( $mutual_dll && ! $def );
1072
        
1074
        
1073
 
1075
 
1074
 
1076
 
1075
#.. Build rules
1077
#.. Build rules
Line 1375... Line 1377...
1375
 
1377
 
1376
        } elsif (/^--NoAddLib/) {
1378
        } elsif (/^--NoAddLib/) {
1377
            $noaddlibs = 1;
1379
            $noaddlibs = 1;
1378
 
1380
 
1379
        } else {
1381
        } else {
1380
            Message( "vcwce LD: unknown option $_ -- ignored\n" );
1382
            Message( "$toolset_name LD: unknown option $_ -- ignored\n" );
1381
 
1383
 
1382
        }
1384
        }
1383
    }
1385
    }
1384
 
1386
 
1385
#.. Names of important files
1387
#.. Names of important files
Line 1655... Line 1657...
1655
sub ToolsetPROJECT
1657
sub ToolsetPROJECT
1656
{
1658
{
1657
    my( $name, $project, $pArgs ) = @_;
1659
    my( $name, $project, $pArgs ) = @_;
1658
    my $buildcmd = $toolchain_info->{'buildcmd'};
1660
    my $buildcmd = $toolchain_info->{'buildcmd'};
1659
    my $cleancmd = $toolchain_info->{'cleancmd'};
1661
    my $cleancmd = $toolchain_info->{'cleancmd'};
-
 
1662
    my $release = ${$toolchain_info->{'def_targets'}}[0] || 'RELEASE';
-
 
1663
    my $debug =   ${$toolchain_info->{'def_targets'}}[1] || 'DEBUG';
1660
 
1664
 
1661
    #
1665
    #
1662
    #   Process options
1666
    #   Process options
1663
    #
1667
    #
1664
    foreach ( @$pArgs ) {
1668
    foreach ( @$pArgs ) {
-
 
1669
        if ( m/^--TargetProd*=(.+)/ ) {
-
 
1670
            $release = $1;
-
 
1671
 
-
 
1672
        } elsif ( m/^--TargetDebug=(.+)/ ) {
-
 
1673
            $debug = $1;
-
 
1674
            
-
 
1675
        } else {
1665
        Message( "vcwce PROJECT: unknown option $_ -- ignored\n" );
1676
            Message( "$toolset_name PROJECT: unknown option $_ -- ignored\n" );
-
 
1677
        }
1666
    }
1678
    }
-
 
1679
 
1667
    my ($io) = ToolsetPrinter::New();
1680
    my ($io) = ToolsetPrinter::New();
1668
 
1681
 
1669
    #
1682
    #
1670
    #   Setup toolset pecific difinitions. Once
1683
    #   Setup toolset specific difinitions. Once
1671
    #
1684
    #
1672
    unless( $project_defines_done )
1685
    unless( $project_defines_done )
1673
    {
1686
    {
1674
        $project_defines_done = 1;
1687
        $project_defines_done = 1;
1675
        $io->PrtLn( "ifeq \"\$(DEBUG)\" \"1\"");
1688
        $io->PrtLn( 'project_target = $(if $(findstring 1,$(DEBUG)),$2,$1)' );
1676
        $io->PrtLn( "PROJECT_CMD\t:= DEBUG");
-
 
1677
        $io->PrtLn( "else");
-
 
1678
        $io->PrtLn( "PROJECT_CMD\t:= RELEASE");
-
 
1679
        $io->PrtLn( "endif");
-
 
1680
        $io->Newline();
1689
        $io->Newline();
1681
    }
1690
    }
1682
 
1691
 
1683
    #
1692
    #
1684
    #   Process the build and clean commands
1693
    #   Process the build and clean commands
Line 1686... Line 1695...
1686
    #           =TYPE=
1695
    #           =TYPE=
1687
    #           =LOG=
1696
    #           =LOG=
1688
    #           =DSW=
1697
    #           =DSW=
1689
    #           =CEPLATFORM=
1698
    #           =CEPLATFORM=
1690
    #
1699
    #
1691
    $buildcmd =~ s~=TYPE=~\$\(PROJECT_CMD)~g;
1700
    $buildcmd =~ s~=TYPE=~"\$(call project_target,$release,$debug)"~g;
1692
    $buildcmd =~ s~=LOG=~$name\$(GBE_TYPE).log~g;
1701
    $buildcmd =~ s~=LOG=~$name\$(GBE_TYPE).log~g;
1693
    $buildcmd =~ s~=DSW=~$project~g;
1702
    $buildcmd =~ s~=DSW=~$project~g;
1694
    $buildcmd =~ s~=CEPLATFORM=~\$(WCE_PLATFORM)~g;
1703
    $buildcmd =~ s~=CEPLATFORM=~\$(WCE_PLATFORM)~g;
1695
 
1704
 
1696
    $cleancmd =~ s~=TYPE=~\$\(PROJECT_CMD)~g;
1705
    $cleancmd =~ s~=TYPE=~"\$(call project_target,$release,$debug)"~g;
1697
    $cleancmd =~ s~=LOG=~$name\$(GBE_TYPE).log~g;
1706
    $cleancmd =~ s~=LOG=~$name\$(GBE_TYPE).log~g;
1698
    $cleancmd =~ s~=DSW=~$project~g;
1707
    $cleancmd =~ s~=DSW=~$project~g;
1699
    $cleancmd =~ s~=CEPLATFORM=~\$(WCE_PLATFORM)~g;
1708
    $cleancmd =~ s~=CEPLATFORM=~\$(WCE_PLATFORM)~g;
1700
    
1709
    
1701
    #
1710
    #