sbsv1/abld/platform/cl_bpabi.pm
author jjkang
Wed, 30 Jun 2010 11:35:58 +0800
changeset 607 378360dbbdba
parent 599 fa7a3cc6effd
permissions -rw-r--r--
Merge missed changeset 11 (raptor v2.14 and helium 10.0)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
599
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     1
# Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     2
# All rights reserved.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     3
# This component and the accompanying materials are made available
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     4
# under the terms of "Eclipse Public License v1.0"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     5
# which accompanies this distribution, and is available
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     7
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     8
# Initial Contributors:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     9
# Nokia Corporation - initial contribution.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    10
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    11
# Contributors:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    12
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    13
# Description:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    14
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    15
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    16
# This package contains routines to handle Base Platform ABI (BPABI) Platforms.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    17
package Cl_bpabi;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    18
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    19
my @commonOptions;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    20
my @thumbOptions;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    21
my @armOptions;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    22
my @kernelOptions;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    23
my @invariantOptions;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    24
my @linkerOptions;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    25
my @archiverOptions;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    26
my @debugFormat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    27
my $ArmIncDir;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    28
my @ArmLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    29
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    30
my %configVariables;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    31
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    32
#Check if Function call Logger is enabled
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    33
my $Function_Call_Logger=&main::IsFunctionCallLogging();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    34
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
# Get the information regarding supporting Compiler Wrapper Option
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    36
my $IsCompilerWrapperOption=&main::CompilerWrapperOption();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    37
my $IsProxyWrapperOption=&main::ProxyWrapperOption();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    38
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
# takes an 'expression'  to evaluate with $_ bound to each of the
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
# remaining args
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
sub PrintList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    42
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    43
    my $expr = shift @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    44
    foreach (@_) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
	my $str = eval($expr);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
	&main::Output($str);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    48
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    49
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    50
sub DepLinkList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    51
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    52
    my $expr = shift @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    53
    my @arr;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    54
    foreach (@_) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    55
	my $str = eval($expr);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    56
	push @arr, $str;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    57
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    58
    return @arr;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    59
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    60
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    61
require Exporter;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    62
@ISA=qw(Exporter);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    63
@EXPORT=qw(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    64
	PMHelp_Mmp
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    65
	PMPlatProcessMmp
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    66
	PMStartBldList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    67
		PMBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    68
	PMStartSrcList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    69
		PMBitMapBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    70
		PMResrcBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    71
		PMStartSrc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    72
		PMAifBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    73
		PMSrcDepend
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    74
			PMSrcBldDepend
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    75
			PMEndSrcBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    76
		PMEndSrc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    77
	PMEndSrcList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    78
	PMPrefixFile
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    79
	PMToolChainIncDir
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    80
	PMSupportsFeatureVariants
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    81
);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    82
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    83
use Cwd;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    84
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    85
# Armutl package does various ancillary things for armedg modules
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    86
use Armutl;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    87
use BPABIutl;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    88
use E32Plat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    89
use RVCT_plat2set;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    90
use gcce_plat2set;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    91
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    92
# This is the RVCT Version information required by Armutl package
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    93
my $RVCTMajorVersion;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    94
my $RVCTMinorVersion;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    95
my $RVCTVersion;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    96
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    97
my $GCCEMajorVersion;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    98
my $GCCEMinorVersion;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    99
my $GCCEVersion;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   100
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   101
# The name of the build platform, e.g. ARMV6.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   102
my $PlatName = main::Plat();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   103
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   104
# The name of the root platform. This is useful if the plaform is derived using a
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   105
# BSF file. If the current platform is not derived, $RootName will be the same as
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   106
# $PlatName.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   107
my $RootName = E32Plat::Plat_Root($PlatName);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   108
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   109
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   110
# cl_generic package contains generic routines to handle bits of makefiles which are
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   111
# common to all of the platforms. Currently it deals with AIF, MBM amd RSC files.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   112
use cl_generic;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   113
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   114
# E32env package contains information for makmake and associated e32tools perl programs
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   115
# within the Epoc32 Environment
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   116
use E32env;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   117
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   118
# Genutl package contains utility subroutines for MAKMAKE and associated scripts
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   119
use Genutl;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   120
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   121
# Modload package is the runtime module-loading routine for loading e32tools modules into
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   122
# 'main' module
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   123
use Modload;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   124
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   125
use constant NOCOMPRESSIONMETHOD => 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   126
use constant INFLATECOMPRESSIONMETHOD => 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   127
use constant BYTEPAIRCOMPRESSIONMETHOD => 2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   128
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   129
use constant NOTPAGED => 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   130
use constant UNPAGED => 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   131
use constant PAGED => 2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   132
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   133
use constant NON_DEBUGGABLE => 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   134
use constant DEBUGGABLE => 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   135
use constant DEBUGGABLE_UDEBONLY => 2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   136
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   137
my %plat = &main::PlatRec();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   138
my $CustomizedARMV5Plat = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   139
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   140
if (($plat{'CUSTOMIZES'}) && (($plat{'ROOTPLATNAME'} eq "ARMV5") || ($plat{'ROOTPLATNAME'} eq "ARMV5_ABIV2"))) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   141
# The following flag is set to handle the exceptions related to ARMV5 toolchain.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   142
	$CustomizedARMV5Plat = 1;		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   143
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   144
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   145
#this fucntion will be used for cw_ide platform to update the PlatName and reinitialize the hashtable
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   146
sub getVariableForNewPlat
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   147
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   148
	$PlatName = main::Plat();	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   149
	undef(%configVariables);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   150
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   151
sub PMHelp_Mmp {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   152
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   153
# Help Text for ARM Platform, lists out the MMP keywords used incase of ARM Compiler
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   154
	if($PlatName eq "ARMV5" || $PlatName eq "ARMV5_ABIV2" || $CustomizedARMV5Plat)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   155
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   156
		return &Armutl_Help_Mmp;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   157
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   158
	else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   159
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   160
		return "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   161
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   162
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   163
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   164
my $ToolChainIncDir;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   165
my @ToolChainLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   166
my $ArmRT = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   167
my %AsmFiles = ();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   168
my %AsmDirs = ();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   169
my $NamedSymLkup = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   170
my $InterWorking = '';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   171
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   172
sub PMPlatProcessMmp (@) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   173
	&InitToolChain(@_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   174
	$ToolChainIncDir = &GetToolChainIncDir;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   175
	&main::SetStdIncPaths($ToolChainIncDir);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   176
	@ToolChainLibList = &GetLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   177
# Variable to check if the target forms part of the run time libraries, if it is so
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   178
# shouldn't be linked against itself or other runtime libs
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   179
	$ArmRT = &IsTargetRT;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   180
	my @AsmFileList = &GetToolChainAsmFileList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   181
	foreach (@AsmFileList) { $AsmFiles{ucfirst lc $_} = 1; }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   182
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   183
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   184
my $preinclude;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   185
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   186
my $Makecmd;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   187
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   188
sub PMStartBldList($) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   189
	($Makecmd) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   190
	my $ABI=&main::ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   191
	my $BaseTrg=&main::BaseTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   192
	my $BasicTrgType=&main::BasicTrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   193
	my @BldList=&main::BldList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   194
	my @ChopSysIncPaths=&main::Path_Chop(&main::SysIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   195
	my @ChopUserIncPaths=&main::Path_Chop(&main::UserIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   196
	my $DefFile=&main::DefFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   197
	my $EPOCPath=&main::EPOCPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   198
	my $LinkAs=&main::LinkAs;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   199
	my $LibPath=&main::LibPath.'LIB\\';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   200
	my @MacroList=&main::MacroList();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   201
	push @MacroList, "__SUPPORT_CPP_EXCEPTIONS__";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   202
	push @MacroList, "__SYMBIAN_STDCPP_SUPPORT__" if ( StdCppTarget() );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   203
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   204
  	my $Plat=&main::Plat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   205
  	my $Trg=&main::Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   206
  	my $TrgType=&main::TrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   207
  
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   208
  # This horrible change (presumably to allow GCCE to work with edll.lib etc.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   209
  # produced by RVCT breaks SMP (and also breaks any optimized platform
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   210
  # builds such as ARMV6, and also Thumb2 builds).
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   211
  # Work round for now by conditioning the horrible change on the absence of
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   212
  # SMP in the platform definition.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   213
  	my %PlatHash = &main::PlatRec();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   214
  	unless ($PlatHash{SMP}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   215
		my $myStatLinkPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   216
		$myStatLinkPath = "$E32env::Data{LinkPath}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   217
		$myStatLinkPath .= "ARMV5";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   218
		&main::SetStatLinkPath($myStatLinkPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   219
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   220
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   221
	my $VariantFile=&ChangeSlash(&main::VariantFile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   222
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   223
	my @UidList=&main::UidList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   224
    my $SystemTrg = &main::SystemTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   225
    my $ExportLibrary=&main::ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   226
    my $NoExportLibrary=&main::NoExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   227
    # N.B. should get better way to detect kernel probably!!
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   228
    $SystemTrg = 1 if ($ExportLibrary =~ /EKERN/i);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   229
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   230
    # N.B. should get better way to detect this
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   231
    $SystemTrg = 1 if ($Trg =~ /KSRT/i);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   232
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   233
	my %Version = &main::Version();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   234
	my $ExtraExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   235
	my $PrimaryExportLibrary = $ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   236
	unless ($Version{explicit}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   237
		$ExtraExportLibrary = $ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   238
		$ExtraExportLibrary =~ s/\{(\d|a|b|c|d|e|f){8}\}//i;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   239
		$PrimaryExportLibrary = $ExtraExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   240
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   241
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   242
#	set up LinkAs
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   243
	$UidList[2]=~/^0x(.*)$/o;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   244
	if ($1 ne '00000000') { # have to make sure than series of noughts in brackets doesn't appear in name for null uids
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   245
		$LinkAs=join '', &main::Path_Split('Base',$LinkAs),"[$1]",&main::Path_Split('Ext',$LinkAs);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   246
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   247
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   248
	# Required for .lib generation
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   249
	$InterWorking = ($ABI eq 'ARMV4') ? "" : "--inter";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   250
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   251
	# need to add config file for makmake invocation
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   252
	my $config_file = BPABIutl_Config_Path($PlatName);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   253
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   254
	&main::Output("\n", "include $config_file\n", "\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   255
	&Generic_Header(0,$Makecmd, 1);	# define standard things using absolute paths and request that a make function
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   256
									# is provided to provide optional conversion of absolute paths to Unix slashes
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   257
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   258
# modified start: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   259
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   260
		"CHECKVMAP : CHECKVMAPUDEB CHECKVMAPUREL",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   261
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   262
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   263
# modified end: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   264
	if ($Makecmd eq "nmake") {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   265
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   266
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   267
  			"PATH=",&main::Path_Drive,$EPOCPath,"gcc\$(PBUILDPID)\\bin;\$(PATH)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   268
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   269
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   270
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   271
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   272
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   273
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   274
			"# must set both PATH and Path to make it work correctly\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   275
  			"Path:=",&main::Path_Drive,$EPOCPath,"gcc\$(PBUILDPID)\\bin;\$(Path)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   276
			"PATH:=\$(Path)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   277
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   278
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   279
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   280
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   281
	if ($BasicTrgType=~/^(DLL|EXE)/o)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   282
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   283
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   284
		my $OtherLinkerOpts;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   285
		my $toolchain = getConfigVariable('COMPILER_PLAT');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   286
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   287
		# In case of GCCE releases, '--map' option was supported only from build 3.4.3 Q1C release
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   288
		# Hence this is a special case, where GCCE platform is checked to ensure that the --map option
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   289
		# is accepted in the correct relase. Even if the option is provided in the config file, it will be
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   290
		# ignored for versions before 3.4.3 Q1C 2005 release.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   291
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   292
		# Check to be included in the Makefile, so that the map filename is provided as input only
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   293
		# when the MAP option is supplied
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   294
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   295
		&main::Output("ifdef LINKER_SYMBOLS_MAP_OPTION\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   296
		foreach (@BldList)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   297
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   298
			&main::Output("\t$_"."_MAP_FILE=\"\$(EPOCTRG$_)\\".&main::Trg($_).".map\"\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   299
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   300
		&main::Output("else\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   301
		foreach (@BldList)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   302
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   303
			&main::Output("\t$_"."_MAP_FILE=\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   304
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   305
		&main::Output("endif\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   306
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   307
		#	In some compiler toolchains, the start address may be required to be provided using the appropriate option.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   308
		#	Incase if the option is provided by the toolchain, then pass we need to pass in the start address.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   309
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   310
			"\nifdef CODE_SEGMENT_START\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   311
			"\tCODE_SEGMENT_START += 0x8000 \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   312
			"endif\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   313
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   314
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   315
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   316
		# In some compiler toolchain, the symboled archives may have to be listed
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   317
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   318
			"ifdef START_GROUP_SYMBOL\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   319
			"\tEEXE_OBJECT=\$(START_GROUP_SYMBOL)UC_EXE_.o\$(END_GROUP_SYMBOL)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   320
			"\tEDLL_OBJECT=\$(START_GROUP_SYMBOL)UC_DLL_.o\$(END_GROUP_SYMBOL)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   321
			"\tDENTRY_OBJECT=\$(START_GROUP_SYMBOL)D_ENTRY_.o\$(END_GROUP_SYMBOL)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   322
			"\tLENTRY_OBJECT=\$(START_GROUP_SYMBOL)L_ENTRY_.o\$(END_GROUP_SYMBOL)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   323
			"\tXENTRY_OBJECT=\$(START_GROUP_SYMBOL)X_ENTRY_.o\$(END_GROUP_SYMBOL)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   324
			"\tVENTRY_OBJECT=\$(START_GROUP_SYMBOL)V_ENTRY_.o\$(END_GROUP_SYMBOL)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   325
			"\tKENTRY_OBJECT=\$(START_GROUP_SYMBOL)K_ENTRY_.o\$(END_GROUP_SYMBOL)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   326
			"endif\n\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   327
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   328
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   329
		# put the extra linker options from MMP file into the linker flags
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   330
		$OtherLinkerOpts=&main::LinkerOption($toolchain);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   331
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   332
		if($OtherLinkerOpts) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   333
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   334
				"\n# ADDITIONAL LINKER OPTIONS\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   335
				"ifdef SYMBIAN_UREL_LINK_FLAGS\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   336
				"\tSYMBIAN_UREL_LINK_FLAGS += $OtherLinkerOpts \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   337
				"else\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   338
				"\tSYMBIAN_UREL_LINK_FLAGS = $OtherLinkerOpts \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   339
				"endif\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   340
				"ifdef SYMBIAN_UDEB_LINK_FLAGS\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   341
				"\tSYMBIAN_UDEB_LINK_FLAGS += $OtherLinkerOpts \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   342
				"else\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   343
				"\tSYMBIAN_UDEB_LINK_FLAGS = $OtherLinkerOpts \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   344
				"endif\n\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   345
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   346
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   347
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   348
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   349
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   350
		"INCDIR ="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   351
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   352
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   353
	PrintList("\"  \\\$(INCLUDE_OPTION) \$_\"", @ChopUserIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   354
	PrintList("\" \\\$(INCLUDE_OPTION) \$_\"", @ChopSysIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   355
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   356
	$ToolchainIncDir = &GetToolChainIncDir;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   357
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   358
	if($ToolchainIncDir ne '')
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   359
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   360
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   361
			" \$(INCLUDE_OPTION) ","\"$ToolchainIncDir\"");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   362
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   363
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   364
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   365
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   366
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   367
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   368
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   369
	#Function call logger takes -I as include option
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   370
	my $FCLogger_inc_option = getConfigVariable('FC_LOGGER_INCLUDE_OPTION'); 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   371
	if ($Function_Call_Logger)	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   372
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   373
			"INCDIR_FCLOGGER  ="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   374
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   375
		PrintList("\" $FCLogger_inc_option \$_\"", @ChopUserIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   376
		PrintList("\" $FCLogger_inc_option \$_\"", @ChopSysIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   377
		$ToolchainIncDir = &GetToolChainIncDir;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   378
		if($ToolchainIncDir ne '')	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   379
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   380
				" $FCLogger_inc_option \"$ToolchainIncDir\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   381
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   382
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   383
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   384
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   385
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   386
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   387
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   388
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   389
  	# Set control warnings and errors options for building Standard C++ application
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   390
  	if( StdCppTarget() ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   391
  		&main::Output("CC_WARNINGS_CONTROL_OPTION=\$(CC_STDCPP_WARNINGS_CONTROL_OPTION)","\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   392
  		&main::Output("CC_ERRORS_CONTROL_OPTION=\$(CC_STDCPP_ERRORS_CONTROL_OPTION)","\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   393
  		&main::Output("\n",	"\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   394
  	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   395
  	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   396
	Read_BSF_Options() if ($plat{'CUSTOMIZES'});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   397
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   398
	my $kernelOption=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   399
	my $buildAsArmOption=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   400
	my $thumbOption=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   401
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   402
	if (SysTrg())
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   403
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   404
		$kernelOption=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   405
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   406
	elsif (main::BuildAsARM() or ($ABI eq 'ARMV4'))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   407
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   408
		$buildAsArmOption=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   409
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   410
	else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   411
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   412
		$thumbOption=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   413
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   414
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   415
	my $OtherOpts = undef;	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   416
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   417
	my $toolchain = getConfigVariable('COMPILER_PLAT');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   418
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   419
	$OtherOpts = &main::CompilerOption($toolchain);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   420
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   421
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   422
	if($kernelOption==1)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   423
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   424
		if(@kernelOptions) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   425
# Kernel options as read from BSF file (KERNEL_OPTIONS keyword)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   426
			Set_BSF_Options('KERNEL_OPTIONS',\@kernelOptions);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   427
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   428
		$OtherOpts .= " \$(KERNEL_OPTIONS) ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   429
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   430
	elsif($buildAsArmOption==1)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   431
	{	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   432
		if(@armOptions) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   433
# Arm options as read from BSF file (ARM_OPTIONS keyword)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   434
			Set_BSF_Options('ARM_OPTIONS',\@armOptions);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   435
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   436
		$OtherOpts .= " \$(ARM_OPTIONS) ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   437
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   438
	elsif($thumbOption==1)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   439
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   440
		if(@thumbOptions) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   441
# Thumb options as read from BSF file (THUMB_OPTIONS keyword)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   442
			Set_BSF_Options('THUMB_OPTIONS',\@thumbOptions);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   443
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   444
		$OtherOpts .= " \$(THUMB_OPTIONS) ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   445
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   446
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   447
	if($thumbOption==1 || $buildAsArmOption==1 || $kernelOption ==1 )
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   448
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   449
		if (&main::ARMFPU && (&main::ARMFPU =~ /^VFPV2$/i))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   450
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   451
			$OtherOpts .=	" \$(VFP2MODE_OPTION) ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   452
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   453
		else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   454
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   455
			$OtherOpts .=	" \$(SOFTVFPMODE_OPTION) ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   456
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   457
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   458
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   459
	if ($thumbOption==1)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   460
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   461
		$OtherOpts .= " \$(COMPILER_THUMB_DEFINES) ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   462
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   463
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   464
	$OtherOpts .= " \$(COMPILER_INTERWORK_DEFINES) ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   465
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   466
	# Options to export symbols by default, for OE
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   467
	if($TrgType=~/^STDDLL$/o || $TrgType=~/^STDEXE$/o || $TrgType=~/^STDLIB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   468
		$OtherOpts .= " \$(OE_OPTIONS) ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   469
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   470
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   471
	if($OtherOpts)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   472
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   473
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   474
			"OTHEROPTIONS=$OtherOpts",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   475
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   476
			"CCFLAGS += \$(OTHEROPTIONS)",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   477
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   478
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   479
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   480
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   481
	if(@invariantOptions) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   482
# Invariant options as read from BSF file (INVARIANT_OPTIONS keyword)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   483
		Set_BSF_Options('INVARIANT_OPTIONS',\@invariantOptions);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   484
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   485
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   486
	if(@commonOptions) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   487
# Common options as read from BSF file (COMMON_OPTIONS keyword)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   488
		Set_BSF_Options('COMMON_OPTIONS',\@commonOptions);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   489
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   490
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   491
	if(@linkerOptions) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   492
# Linker options as read from BSF file (LD_OPTIONS keyword)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   493
		Set_BSF_Options('LD_OPTIONS',\@linkerOptions);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   494
	}	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   495
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   496
	if ($BasicTrgType=~/^LIB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   497
		if(@archiverOptions) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   498
# Archiver options as read from BSF file (AR_OPTIONS keyword)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   499
		Set_BSF_Options('AR_OPTIONS',\@archiverOptions);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   500
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   501
	}		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   502
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   503
	if(@debugFormat) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   504
		Set_BSF_Options('DEBUG_FORMAT',\@debugFormat);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   505
	}	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   506
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   507
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   508
		"CCDEFS = \$(COMPILER_DEFINES) "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   509
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   510
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   511
	PrintList("\" -D\$_\"", @MacroList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   512
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   513
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   514
		" \$(PLATFORM_DEFINES) "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   515
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   516
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   517
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   518
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   519
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   520
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   521
	if($kernelOption==1)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   522
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   523
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   524
			"-D__KERNEL_MODE__ "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   525
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   526
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   527
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   528
	if($VariantFile){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   529
		#Function Call Logger
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   530
		if ($Function_Call_Logger) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   531
			#FC Logger accepts product include file without path
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   532
			my $file=&main::Path_Split('File', &main::VariantFile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   533
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   534
				" -D\"__PRODUCT_INCLUDE__=\\\"${file}\\\"\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   535
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   536
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   537
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   538
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   539
				" -D__PRODUCT_INCLUDE__=\\\"${VariantFile}\\\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   540
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   541
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   542
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   543
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   544
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   545
		" \$(USERDEFS)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   546
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   547
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   548
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   549
	if ( $RootName =~ /^ARMV5$/ ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   550
		# Now we know that the platform is either ARMV5 or a platform derived from
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   551
		# ARMV5 (BSF).
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   552
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   553
		# See if an environment variable overrides the default DWARF version for
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   554
		# this platform.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   555
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   556
		my $env_dwarf_key = "ABLD_${PlatName}_DWARF";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   557
		my $env_dwarf_val = $ENV{$env_dwarf_key};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   558
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   559
		if ($env_dwarf_val) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   560
			main::FatalError("The value of $env_dwarf_key is invalid.") unless ($env_dwarf_val =~ /^[23]$/);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   561
			main::FatalError("We don't support DWARF-2 on ARMV7.") if ($PlatName =~ /^ARMV7/ && $env_dwarf_val == 2);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   562
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   563
			&main::Output( "DEBUG_FORMAT=\$(DEBUG_FORMAT_DWARF$env_dwarf_val)\n\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   564
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   565
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   566
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   567
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   568
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   569
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   570
			"CC$_ = ", $IsProxyWrapperOption ? "$ENV{ABLD_COMPWRAP} ":"", "\$(CC) "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   571
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   572
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   573
		# SYMBIAN_UDEB/UREL_CCFLAGS don't have the optimisation levels.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   574
		if(&main::DebugSwitchUsed() ){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   575
			if(&main::SymbolicDebugEnabled() ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   576
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   577
					" \$(SYMBIAN_UDEB_CCFLAGS) "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   578
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   579
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   580
			else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   581
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   582
					" \$(SYMBIAN_UREL_CCFLAGS) "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   583
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   584
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   585
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   586
		elsif (/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   587
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   588
				" \$(SYMBIAN_UDEB_CCFLAGS) "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   589
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   590
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   591
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   592
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   593
				" \$(SYMBIAN_UREL_CCFLAGS) "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   594
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   595
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   596
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   597
		#Set the optimisation levels depending on whether it is a UREL or a UDEB build
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   598
		if (/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   599
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   600
				" \$(DEBUG_OPTIMISATION) "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   601
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   602
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   603
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   604
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   605
				" \$(REL_OPTIMISATION) "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   606
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   607
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   608
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   609
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   610
			"\$(RUNTIME_SYMBOL_VISIBILITY_OPTION) "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   611
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   612
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   613
		if($kernelOption == 0)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   614
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   615
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   616
				"\$(EXCEPTIONS) "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   617
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   618
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   619
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   620
			'$(CCFLAGS) '
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   621
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   622
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   623
		my @ml = &main::MacroList($_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   624
		PrintList("\" -D\$_\"", @ml);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   625
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   626
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   627
			" \$(CCDEFS)\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   628
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   629
		my @mmpReplaceOptions = &main::ReplaceOptions($toolchain);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   630
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   631
		if (@mmpReplaceOptions)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   632
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   633
			my $OptionPrefix = getConfigVariable('OPTION_PREFIX');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   634
			my $Pattern;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   635
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   636
			# Set the value of '$Pattern' which is required to segregate one option from another based on the option prefix.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   637
			if($OptionPrefix) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   638
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   639
				$Pattern = $OptionPrefix.'\S+\s*(?!'.$OptionPrefix.')\S*';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   640
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   641
			else 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   642
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   643
				# If option prefix is not set in the configuration make file, then set default
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   644
				# option prefix as '-' or '--'.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   645
				$Pattern = '-{1,2}\S+\s*(?!-)\S*';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   646
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   647
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   648
			foreach my $options (@mmpReplaceOptions) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   649
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   650
				my @opts = $options =~ /$Pattern/g;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   651
				my $count = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   652
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   653
				while ($count <= $#opts) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   654
				{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   655
					my $opt;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   656
					my $rep;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   657
					if ($opts[$count] =~ /^(\S+)\s+(\S+)$/) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   658
					{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   659
						$opt = $1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   660
						$rep = $2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   661
						&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   662
							"CC$_ := \$(subst $opt ,@@,\$(CC$_))\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   663
							"CC$_ := \$(CC$_:@@%=$opt $rep)",							
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   664
							"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   665
						);			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   666
						$count++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   667
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   668
					else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   669
					{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   670
						$opt = $opts[$count];
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   671
						$rep = $opts[$count+1];
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   672
						
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   673
						# Substitute '=' with '%' which is a wild card character in makefile.					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   674
						$opt =~ s/=/%/;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   675
					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   676
						&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   677
							"CC$_ := \$(CC$_:$opt=$rep)",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   678
							"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   679
						);							
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   680
						$count+=2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   681
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   682
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   683
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   684
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   685
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   686
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   687
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   688
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   689
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   690
	&main::Output(		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   691
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   692
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   693
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   694
	#Function call logger
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   695
	if ($Function_Call_Logger)	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   696
		#Send all the debug macros to logger
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   697
		foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   698
			&main::Output
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   699
			(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   700
				"FCLOGGER$_ = ", 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   701
				$EPOCPath, 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   702
				"tools\\fc_logger\\edgcpfe"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   703
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   704
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   705
			my @ml = &main::MacroList($_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   706
			PrintList("\" -D\$_\"", @ml);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   707
			if ($thumbOption==1) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   708
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   709
					" \$(COMPILER_THUMB_DEFINES)"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   710
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   711
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   712
			&main::Output(" \$(COMPILER_INTERWORK_DEFINES)",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   713
						  " \$(CCDEFS)",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   714
						  " \$(FC_LOGGER_DEFINES)",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   715
						  " \$(FC_LOGGER_OPTION)");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   716
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   717
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   718
				"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   719
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   720
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   721
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   722
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   723
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   724
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   725
			"$_ :"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   726
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   727
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   728
		if ($BasicTrgType !~ /IMPLIB/io) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   729
			&main::Output (
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   730
				" \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   731
				&Generic_Quote("\$(EPOCTRG$_)\\".&main::Trg($_))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   732
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   733
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   734
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   735
#		lib has to come after the main target so that a .DEF file will be generated if the project is not frozen
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   736
		if ($DefFile and not &main::ExportUnfrozen) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   737
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   738
				" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   739
				"\tLIBRARY\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   740
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   741
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   742
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   743
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   744
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   745
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   746
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   747
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   748
	# Resource building is done entirely via cl_generic.pm
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   749
	PrintList("\"\nRESOURCE\$_ : MAKEWORK\$_\"", @BldList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   750
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   751
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   752
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   753
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   754
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   755
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   756
		"LIBRARY : MAKEWORKLIBRARY"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   757
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   758
	if ($BasicTrgType=~/^LIB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   759
#		code to ensure that the static libraries for all builds are built at the library stage
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   760
			PrintList("\" \$_\"", @BldList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   761
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   762
	elsif ($DefFile and !$NoExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   763
		unless (&main::ExportUnfrozen) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   764
			if (-e $DefFile) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   765
				if ($PlatName =~ /^ARMV5$/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   766
					&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   767
						" ", &Generic_Quote("\$(EPOCLIB)\\LIB\\$PrimaryExportLibrary.dso"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   768
						" ", &Generic_Quote("\$(EPOCLIB)\\LIB\\$PrimaryExportLibrary.lib"), "\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   769
					);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   770
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   771
				else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   772
					&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   773
						" ", &Generic_Quote("\$(EPOCLIB)\\LIB\\$PrimaryExportLibrary.dso"), "\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   774
					);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   775
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   776
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   777
			else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   778
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   779
					"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   780
					"\t\@echo WARNING: Not attempting to create any import libraries.\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   781
					"\t\@echo When exports are frozen in \"$DefFile\", regenerate Makefile.\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   782
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   783
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   784
		} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   785
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   786
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   787
				"\t\@echo Not attempting to create \"\$(EPOCLIB)\\LIB\\$PrimaryExportLibrary.dso\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   788
				"\t\@echo from frozen .DEF file, since EXPORTUNFROZEN specified.\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   789
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   790
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   791
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   792
		my $theDefFile = $DefFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   793
		$theDefFile = "\$(EPOCBLD)\\$BaseTrg.def" unless (-e $DefFile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   794
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   795
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   796
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   797
			"# REAL TARGET - LIBRARY (.dso) \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   798
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   799
			&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExportLibrary.dso"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   800
			&Generic_Quote($DefFile), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   801
				"\tperl -S prepdef.pl ", &Generic_Quote($DefFile), " \"\$(EPOCBLD)\\$ExportLibrary.prep.def\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   802
				"\telf2e32 --definput=\"\$(EPOCBLD)\\$ExportLibrary.prep.def\" --dso=",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   803
				&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExportLibrary.dso"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   804
				" --linkas=$LinkAs\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   805
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   806
		 );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   807
		if ($ExtraExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   808
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   809
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   810
				&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExtraExportLibrary.dso"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   811
				&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExportLibrary.dso"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   812
				"\tcopy \"\$<\" \"\$@\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   813
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   814
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   815
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   816
		# Generate .lib files which will be used for ARMV5_ABIV1 platform (ABIV1 mode toolchain)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   817
		# Only for ARMV5 platform
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   818
		if ($PlatName =~ /^ARMV5$/)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   819
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   820
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   821
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   822
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   823
				"# REAL TARGET - LIBRARY (.lib) \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   824
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   825
				&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExportLibrary.lib"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   826
				&Generic_Quote($DefFile), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   827
					"\tperl -S prepdef.pl ", &Generic_Quote($DefFile), " \"\$(EPOCBLD)\\$ExportLibrary.prep.def\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   828
					"\tdef2dll.bat --path=\$(EPOCLIB)\\LIB \\\n\t\t--bldpath=\$(EPOCBLD) \\\n\t\t--import=$ExportLibrary \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   829
					"\t\t--deffile=\"\$(EPOCBLD)\\$ExportLibrary.prep.def\" \\\n\t\t--linkAs=$LinkAs \\\n\t\t$InterWorking\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   830
					"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   831
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   832
			if ($ExtraExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   833
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   834
					"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   835
					&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExtraExportLibrary.lib"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   836
					&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExportLibrary.lib"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   837
					"\tcopy \"\$<\" \"\$@\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   838
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   839
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   840
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   841
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   842
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   843
	my $freezeDir = &main::Path_Split('Path', $DefFile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   844
	chop($freezeDir);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   845
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   846
	# dummy rule for def files to cope with filename case differences
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   847
	unless (&main::ExportUnfrozen) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   848
		if (-e $DefFile) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   849
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   850
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   851
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   852
				&Generic_Quote($DefFile), " : ", "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   853
				"\t\@rem Do nothing\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   854
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   855
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   856
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   857
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   858
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   859
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   860
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   861
		&Generic_Quote($freezeDir), " : ", "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   862
		"\tperl -S emkdir.pl \$\@\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   863
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   864
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   865
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   866
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   867
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   868
		"FREEZE : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   869
		&Generic_Quote($freezeDir), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   870
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   871
	if ($DefFile and $BasicTrgType!~/^IMPLIB$/io) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   872
#		call perl on the script here so make will die if there are errors
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   873
#           - this doesn't happen if calling perl in a batch file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   874
		&main::Output( "\tperl -S efreeze.pl \$(EFREEZE_ALLOW_REMOVE) \"$DefFile\" \"\$(EPOCBLD)\\$ExportLibrary.def\" \n" );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   875
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   876
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   877
		&main::Output( "\tperl -e \"print \\\"warning: freeze could not be supported or \\
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   878
		         you need to declare an explicitly specified def file using the keyword \\
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   879
			 DEFFILE in the MMP file!\\n\\\"\""); 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   880
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   881
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   882
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   883
		"CLEANLIBRARY :\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   884
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   885
	if ($DefFile and !$NoExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   886
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   887
			"\t-\$(ERASE) \"\$(EPOCLIB)\\LIB\\$ExportLibrary.dso\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   888
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   889
		if ($ExtraExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   890
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   891
				"\t-\$(ERASE) \"\$(EPOCLIB)\\LIB\\$ExtraExportLibrary.dso\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   892
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   893
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   894
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   895
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   896
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   897
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   898
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   899
	&Generic_MakeWorkDir('MAKEWORKLIBRARY',"${LibPath}");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   900
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   901
	&Generic_Releaseables;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   902
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   903
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   904
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   905
sub PMBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   906
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   907
    my $ABI=&main::ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   908
    my @ASSPLibList=&main::ASSPLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   909
    my @SrcList=&main::SrcList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   910
    my $FeatureVariantBaseTrg=&main::FeatureVariantBaseTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   911
    my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   912
    my $ChopBldPath=&main::Path_Chop(&main::BldPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   913
    my $DefFile=&main::DefFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   914
    my $EPOCIncPath=&main::EPOCIncPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   915
    my $FirstLib=&main::FirstLib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   916
    my $BasicTrgType=&main::BasicTrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   917
    my @LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   918
    my @RTLibList = &GetRTLibList();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   919
    my $SystemTrg = &main::SystemTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   920
    my $LibPath= &main::LibPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   921
    my $LinkAs=&main::LinkAs;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   922
    my $ExportLibrary=&main::ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   923
    my $NoExportLibrary=&main::NoExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   924
    # N.B. should get better way to detect kernel probably!!
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   925
    $SystemTrg = 1 if ($ExportLibrary =~ /EKERN/i);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   926
    my $ChopRelPath=&main::Path_Chop(&main::RelPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   927
    my $RelPath=&main::RelPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   928
    my @StatLibList=&main::StatLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   929
    my $StatLinkPath=&main::StatLinkPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   930
    my $Trg=&main::Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   931
    my $TrgType=&main::TrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   932
    my @UidList=&main::UidList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   933
	my %Version = &main::Version();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   934
	my $ExtraExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   935
	unless ($Version{explicit}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   936
		$ExtraExportLibrary = $ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   937
		$ExtraExportLibrary =~ s/\{(\d|a|b|c|d|e|f){8}\}//i;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   938
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   939
	my $objectFiles;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   940
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   941
    if ($Bld =~ /DEB/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   942
	@LibList = &main::DebugLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   943
    } else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   944
	@LibList = &main::LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   945
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   946
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   947
#	set up $LinkAs
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   948
    $UidList[2]=~/^0x(.*)$/o;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   949
    if ($1 ne '00000000') {	# have to make sure than series of noughts in brackets doesn't appear in name for null uids
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   950
	$LinkAs=join '', &main::Path_Split('Base',$LinkAs),"[$1]",&main::Path_Split('Ext',$LinkAs);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   951
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   952
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   953
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   954
    # REAL TARGETS
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   955
    #-------------
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   956
    &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   957
		  "# REAL TARGET - BUILD VARIANT $Bld\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   958
		  "\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   959
		  );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   960
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   961
#	releasables
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   962
	my @releaseables;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   963
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   964
	push @releaseables, "$RelPath$Trg" if ($BasicTrgType!~/^IMPLIB$/io);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   965
	if ($BasicTrgType=~/^(DLL|EXE)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   966
		push @releaseables, "$RelPath$Trg.map";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   967
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   968
	if (-e $DefFile and !$NoExportLibrary) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   969
		push @releaseables, "$LibPath$ExportLibrary.dso";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   970
		push @releaseables, "$LibPath$ExtraExportLibrary.dso" if ($ExtraExportLibrary);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   971
		if ($PlatName =~ /^ARMV5$/)	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   972
			push @releaseables, "$LibPath$ExportLibrary.lib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   973
			push @releaseables, "$LibPath$ExtraExportLibrary.lib" if ($ExtraExportLibrary);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   974
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   975
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   976
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   977
	push @releaseables, &main::FeatureVariantVMapFile() if &main::FeatureVariantVMapFile();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   978
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   979
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   980
		"WHAT$Bld : WHATGENERIC\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   981
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   982
		"CLEAN$Bld : CLEANBUILD$Bld CLEANRELEASE$Bld\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   983
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   984
		"CLEANBUILD$Bld : \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   985
		"\t\@perl -S ermdir.pl \"\$(EPOCBLD$Bld)\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   986
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   987
		"CLEANRELEASE$Bld : CLEANGENERIC\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   988
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   989
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   990
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   991
	&Generic_WhatTargets($Bld, "WHAT$Bld", @releaseables);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   992
	my @cleantargets = (@releaseables, "$RelPath$ExtraExportLibrary.sym");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   993
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   994
	if (-e $DefFile and !$NoExportLibrary) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   995
		&Generic_CleanTargets($Bld, "CLEANRELEASE$Bld", @cleantargets);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   996
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   997
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   998
		push @cleantargets, "$LibPath$ExportLibrary.dso";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   999
			push @cleantargets, "$LibPath$ExtraExportLibrary.dso" if ($ExtraExportLibrary);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1000
		if ($PlatName =~ /^ARMV5$/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1001
            push @cleantargets, "$LibPath$ExportLibrary.lib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1002
            push @cleantargets, "$LibPath$ExtraExportLibrary.lib" if ($ExtraExportLibrary);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1003
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1004
			&Generic_CleanTargets($Bld, "CLEANRELEASE$Bld", @cleantargets);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1005
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1006
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1007
	&Generic_MakeWorkDir("MAKEWORK$Bld",$ChopBldPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1008
	&Generic_MakeWorkDir("MAKEWORK$Bld",$ChopRelPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1009
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1010
	return if ($BasicTrgType=~/^IMPLIB$/io);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1011
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1012
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1013
		"LISTING$Bld : MAKEWORK$Bld"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1014
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1015
	foreach (@SrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1016
			my $BaseSrc = &main::Path_Split('Base', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1017
			my $Ext = &main::Path_Split('Ext', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1018
		if ($Ext =~ /cia/i && ($PlatName ne "GCCE")) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1019
			$BaseSrc = "$BaseSrc\_";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1020
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1021
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1022
			" \\\n\tLISTING$Bld$BaseSrc"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1023
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1024
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1025
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1026
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1027
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1028
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1029
	#Compiler wrapper support starts
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1030
	if($IsCompilerWrapperOption)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1031
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1032
		my $Platcmpwrap=&main::Plat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1033
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1034
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1035
			"COMPWRAP$Bld : OUTPUT_NAME = ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1036
			"$Platcmpwrap\_$Bld",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1037
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1038
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1039
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1040
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1041
			"COMPWRAP$Bld : MAKEWORK$Bld"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1042
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1043
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1044
		foreach (@SrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1045
			my $BaseSrc = &main::Path_Split('Base', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1046
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1047
				" \\\n\tCOMPWRAP$Bld$BaseSrc"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1048
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1049
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1050
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1051
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1052
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1053
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1054
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1055
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1056
	#--Compiler wrapper support ends
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1057
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1058
	# Flag that tells us wheter to run checklib.exe on user-added static libraries.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1059
	my $run_checklib = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1060
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1061
  	if (@StatLibList && $BasicTrgType =~ /^(EXE|DLL)$/o && !$SystemTrg && main::StdCppSupport()) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1062
		# There are user-added static libraries. They should be checked for
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1063
		# consistent use of operator new.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1064
		$run_checklib = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1065
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1066
		#Create a make variable for the libraries.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1067
		main::Output("\nUSER_ADDED_ARCHIVES_$Bld=");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1068
		PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\\\$\(EPOCSTATLINK$Bld\)\\\\\$_\"\)", @StatLibList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1069
		main::Output("\n\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1070
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1071
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1072
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1073
		"LIBS$Bld="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1074
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1075
        
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1076
	my @depLibs;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1077
	if ($BasicTrgType=~/^DLL$/o) { # Add the DLL stub library
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1078
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1079
			" \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1080
			&Generic_Quote("\$(EPOCSTATLINK$Bld)\\EDLLSTUB.lib")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1081
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1082
		push @depLibs, &Generic_Quote("\$(EPOCSTATLINK$Bld)\\EDLLSTUB.lib");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1083
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1084
        
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1085
	my $StaticRTLib = "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1086
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1087
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1088
	if ($SystemTrg) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1089
		$StaticRTLib = "ksrt";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1090
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1091
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1092
		$StaticRTLib = "usrt";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1093
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1094
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1095
	if ($RVCTVersion) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1096
		$StaticRTLib .= $RVCTVersion;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1097
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1098
	elsif ($GCCEVersion) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1099
		if ($GCCEMajorVersion < 4) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1100
			$StaticRTLib .= "2_2";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1101
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1102
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1103
			$StaticRTLib .= "3_1";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1104
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1105
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1106
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1107
		$StaticRTLib .= "2_2";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1108
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1109
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1110
	&main::Output(" \\\n\$(EPOCSTATLINK$Bld)\\$StaticRTLib\.lib");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1111
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1112
	&main::Output(" \\\n\t",getConfigVariable('VIA_FILE_PREFIX'));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1113
	PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\\\$\(EPOCBSFSTATLINK$Bld\)\\\\\$_\"\)", @StatLibList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1114
	&main::Output(" \\\n\t",getConfigVariable('VIA_FILE_SUFFIX'));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1115
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1116
	@depLibs = (@depLibs, DepLinkList("\&Generic_Quote\(\"\\\$\(EPOCBSFSTATLINK$Bld\)\\\\\$_\"\)", @StatLibList));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1117
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1118
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1119
	my @ImportLibList = ImportLibraryList(@LibList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1120
	PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\\\$\(EPOCLIB\)\\\\LIB\\\\\$_\"\)", @ImportLibList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1121
	@depLibs = (@depLibs, DepLinkList("\&Generic_Quote\(\"\\\$\(EPOCLIB\)\\\\LIB\\\\\$_\"\)", @ImportLibList));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1122
        
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1123
	if ($TrgType=~/^STDEXE$/o || $TrgType=~/^STDDLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1124
		$NamedSymLkup = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1125
		my @OEImportLibraryList = &GetOEImportLibList();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1126
		@OEImportLibraryList = ImportLibraryList(@OEImportLibraryList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1127
		if(not (grep /^libc.dso$/i, @LibList)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1128
				push @OEImportLibraryList, "libc.dso";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1129
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1130
		PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\\\$\(EPOCLIB\)\\\\LIB\\\\\$_\"\)", @OEImportLibraryList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1131
		@depLibs = (@depLibs, DepLinkList("\&Generic_Quote\(\"\\\$\(EPOCLIB\)\\\\LIB\\\\\$_\"\)", @OEImportLibraryList));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1132
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1133
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1134
	unless ($ArmRT || ($BasicTrgType=~/^LIB$/o)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1135
		my $TargLib = "$ExportLibrary.dso";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1136
		$TargLib =~ s/\{(\d|a|b|c|d|e|f){8}\}//i;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1137
		unless ($SystemTrg) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1138
			foreach (@RTLibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1139
  				# Ignore the empty file name      Modified by Kun Xu for DEF126030 on 06/08/2008
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1140
  				if(!$_) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1141
  				{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1142
  					next;		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1143
  				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1144
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1145
					" \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1146
					&Generic_Quote("\$(EPOCLIB)\\LIB\\$_")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1147
				) unless ($_ =~ /$TargLib/i);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1148
				push @depLibs, &Generic_Quote("\$(EPOCLIB)\\LIB\\$_") unless ($_ =~ /$TargLib/i);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1149
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1150
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1151
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1152
    #OE Glue Code 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1153
	if ($TrgType=~/^STDEXE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1154
		my @OELibList = &GetOELibList();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1155
		foreach (@OELibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1156
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1157
				" \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1158
				&Generic_Quote("\$(EPOCSTATLINK$Bld)\\$_"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1159
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1160
			push @depLibs, &Generic_Quote("\$(EPOCSTATLINK$Bld)\\$_");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1161
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1162
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1163
	PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\$_\"\)", @ToolChainLibList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1164
                
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1165
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1166
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1167
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1168
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1169
        
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1170
	main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1171
                "LIBS$Bld" . "DEPS="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1172
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1173
        
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1174
	my @tmp;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1175
	for my $lib (@depLibs)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1176
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1177
            $lib =~ s/\(.*\.o\)//;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1178
            $lib =~ s/\\$//;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1179
            push @tmp, $lib unless ($lib =~ /-\(/ || $lib =~ /-\)/);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1180
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1181
                
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1182
	PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\$_\"\)", @tmp);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1183
        
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1184
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1185
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1186
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1187
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1188
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1189
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1190
		"VTBLEXPORTS$Bld="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1191
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1192
        my $vtobj = quotemeta("(VtblExports.o)");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1193
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1194
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1195
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1196
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1197
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1198
        &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1199
			"OBJECTS$Bld="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1200
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1201
        foreach (@SrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1202
			my $BaseSrc = &main::Path_Split('Base', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1203
			my $Ext = &main::Path_Split('Ext', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1204
		if ($Ext =~ /cia/i && ($PlatName ne "GCCE")) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1205
			$BaseSrc = "$BaseSrc\_";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1206
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1207
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1208
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1209
				" \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1210
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1211
			  );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1212
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1213
			$objectFiles .= &main::BldPath.$BaseSrc.".o ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1214
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1215
        &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1216
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1217
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1218
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1219
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1220
	# IsCustomDllUseCase() subroutine is called to check if the given executable 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1221
	# is a custom dll or not.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1222
	my $IsCustomDll = IsCustomDllUseCase();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1223
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1224
	if ($IsCustomDll) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1225
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1226
		# Generate ".bin" file(assembly listing file) only if frozen deffile is present and EXPORTUNFROZEN is not specified
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1227
		# in the Mmp file.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1228
		if((-e $DefFile) && (!&main::ExportUnfrozen))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1229
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1230
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1231
				"EXPFILE$Bld = \$(EPOCBLD$Bld)\\$ExportLibrary.bin \n",			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1232
				"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1233
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1234
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1235
		else 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1236
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1237
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1238
				"EXPFILE$Bld = \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1239
				"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1240
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1241
		}		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1242
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1243
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1244
	# Create "via" file containing all object files in order to reduce
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1245
	# command line lengths in pertinent calls
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1246
	my $objectsViaFile = &main::CommandFile();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1247
	my $viaoption = getConfigVariable('COMMANDFILE_OPTION');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1248
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1249
    if ($BasicTrgType=~/^LIB$/o && StdCppTarget() ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1250
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1251
        # Add the magic object that identifies the library as a STDLIB.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1252
        $objectFiles .= "$ENV{EPOCROOT}epoc32/tools/tag/tag_elf";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1253
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1254
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1255
	$objectFiles =~ s/\\/\//g ;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1256
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1257
	&main::CreateExtraFile($objectsViaFile, $objectFiles);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1258
		 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1259
		   &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1260
			 &Generic_Quote("\$(EPOCTRG$Bld)\\$Trg"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1261
			 " : \$(OBJECTS$Bld) \$(LIBS". $Bld . "DEPS)"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1262
            );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1263
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1264
	if (-e $DefFile) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1265
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1266
			" ", &Generic_Quote($DefFile)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1267
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1268
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1269
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1270
	if($IsCustomDll eq 1)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1271
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1272
		&main::Output( " \$(EXPFILE$Bld) " );	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1273
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1274
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1275
    &main::Output("\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1276
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1277
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1278
#       get rid of any -symbols produced .map file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1279
        if ($BasicTrgType=~/^(DLL|EXE)/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1280
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1281
			"\t-\$(ERASE) \"\$(EPOCTRG$Bld)\\$Trg.map\" \n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1282
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1283
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1284
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1285
		my $AbsentSubst = '';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1286
		if ($BasicTrgType=~/^(DLL|EXE)/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1287
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1288
			if ($run_checklib) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1289
				my $checklib = "checklib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1290
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1291
				if ( StdCppTarget() ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1292
					$checklib .= " stdc++ --elf";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1293
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1294
				else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1295
					$checklib .= " symc++ --elf";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1296
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1297
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1298
				&main::Output( "\t$checklib ","\$(USER_ADDED_ARCHIVES_$Bld)\n" );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1299
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1300
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1301
			my $WrapLD = $IsProxyWrapperOption ? "$ENV{ABLD_COMPWRAP} " : "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1302
			if ($Bld =~ /DEB/)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1303
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1304
				if($PlatName ne "GCCE"){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1305
					# if the compiler is RVCT then append SYMBIAN_UDEB_LINK_FLAGS to option string 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1306
					# in order to override the default ones. 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1307
					&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1308
						"\t", $WrapLD, "\$(LD) ","\$(STATIC_LIBS) ", "\$(SHARED_OBJECT_OPTION) ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1309
						"\$(CODE_SEGMENT_START) ", "\$(DATA_SEGMENT_START) 0x400000 ", "\$(SYMVER_OPTION) ", "\$(SYMBIAN_UDEB_LINK_FLAGS) ", "\$(SO_NAME_OPTION) ","$LinkAs"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1310
					); 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1311
				} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1312
					&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1313
						"\t", $WrapLD, "\$(LD) ","\$(STATIC_LIBS) ","\$(SYMBIAN_UDEB_LINK_FLAGS) ", "\$(SHARED_OBJECT_OPTION) ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1314
						"\$(CODE_SEGMENT_START) ", "\$(DATA_SEGMENT_START) 0x400000 ", "\$(SYMVER_OPTION) ","\$(SO_NAME_OPTION) ","$LinkAs"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1315
					);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1316
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1317
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1318
			else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1319
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1320
				if($PlatName ne "GCCE"){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1321
					# if the compiler is RVCT then append SYMBIAN_UREL_LINK_FLAGS to option string 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1322
					# in order to override the default ones. 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1323
					&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1324
						"\t", $WrapLD, "\$(LD) ","\$(STATIC_LIBS) ","\$(SHARED_OBJECT_OPTION) ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1325
						"\$(CODE_SEGMENT_START) ", "\$(DATA_SEGMENT_START) 0x400000 ", "\$(SYMVER_OPTION) ", "\$(SYMBIAN_UREL_LINK_FLAGS) ", "\$(SO_NAME_OPTION) ", "$LinkAs"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1326
					);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1327
				} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1328
					&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1329
						"\t", $WrapLD, "\$(LD) ","\$(STATIC_LIBS) ","\$(SYMBIAN_UREL_LINK_FLAGS) ","\$(SHARED_OBJECT_OPTION) ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1330
						"\$(CODE_SEGMENT_START) ", "\$(DATA_SEGMENT_START) 0x400000 ", "\$(SYMVER_OPTION) ","\$(SO_NAME_OPTION) ","$LinkAs"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1331
					);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1332
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1333
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1334
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1335
			if(&main::DebugSwitchUsed()){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1336
				if(&main::SymbolicDebugEnabled() ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1337
					&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1338
						" \$(LINKER_DEBUG_OPTION) "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1339
					);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1340
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1341
				else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1342
					&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1343
						" \$(LINKER_NODEBUG_OPTION) "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1344
					);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1345
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1346
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1347
			elsif($Bld =~/DEB/){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1348
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1349
					" \$(LINKER_DEBUG_OPTION) "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1350
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1351
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1352
			else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1353
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1354
					" \$(LINKER_NODEBUG_OPTION) "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1355
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1356
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1357
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1358
			my $EntrySymbol;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1359
			if ($BasicTrgType=~/^DLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1360
				$EntrySymbol = '_E32Dll';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1361
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1362
			elsif ($BasicTrgType=~/^EXE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1363
				$EntrySymbol = '_E32Startup';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1364
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1365
			if ($EntrySymbol) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1366
				$AbsentSubst = " --absent $EntrySymbol";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1367
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1368
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1369
			if (($BasicTrgType=~/^DLL$/o) || ($BasicTrgType=~/^EXE$/o)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1370
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1371
					" \$(LINKER_ENTRY_OPTION)",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1372
					" $EntrySymbol "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1373
					);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1374
				my $undefined_option = getConfigVariable('UNDEFINED_SYMBOL_REF_OPTION');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1375
				if ($undefined_option)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1376
				{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1377
					&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1378
						" \$(UNDEFINED_SYMBOL_REF_OPTION)",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1379
						" $EntrySymbol "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1380
					);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1381
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1382
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1383
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1384
			if ($BasicTrgType=~/^DLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1385
				# get the right object file for the entry point
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1386
				my $ObjFile="\$(EDLL_OBJECT)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1387
				if ($FirstLib =~ /EDEV/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1388
					$ObjFile="\$(DENTRY_OBJECT)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1389
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1390
				if ($FirstLib =~ /EKLL/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1391
					$ObjFile="\$(LENTRY_OBJECT)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1392
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1393
				if ($FirstLib =~ /EEXT/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1394
					$ObjFile="\$(XENTRY_OBJECT)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1395
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1396
				if ($FirstLib =~ /EVAR/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1397
					$ObjFile="\$(VENTRY_OBJECT)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1398
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1399
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1400
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1401
					" \$(EPOCSTATLINK$Bld)\\$FirstLib", "$ObjFile",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1402
					" \$(EPOCSTATLINK$Bld)\\$FirstLib", " \\", "\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1403
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1404
			} elsif ($BasicTrgType=~/^EXE$/o || $TrgType=~/^EXEXP$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1405
				# get the right object file for the entry point
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1406
				my $ObjFile="\$(EEXE_OBJECT)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1407
				if ($FirstLib =~ /KC_EXE/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1408
					$ObjFile="\$(KENTRY_OBJECT)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1409
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1410
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1411
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1412
					" \$(EPOCSTATLINK$Bld)\\$FirstLib", "$ObjFile",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1413
					" \$(EPOCSTATLINK$Bld)\\$FirstLib", " \\", "\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1414
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1415
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1416
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1417
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1418
				"\t\t\$(LINKER_OUTPUT_OPTION) \"\$(EPOCBLD$Bld)\\$Trg\" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1419
#				"\t\t\$(OBJECTS$Bld) \\\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1420
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1421
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1422
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1423
			"\t\t\$(LINKER_SYMBOLS_MAP_OPTION) ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1424
			"\$(","$Bld","_MAP_FILE) \\\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1425
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1426
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1427
		# Pass in the command file if the command file option is passed in
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1428
		if($viaoption) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1429
                        #'@' is for GCCE whos version is not 3.4.3
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1430
			if($viaoption eq '@'){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1431
				main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1432
					"\t\t$viaoption$objectsViaFile \\\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1433
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1434
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1435
                        #'-via' is for RVCT 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1436
			else{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1437
				main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1438
					"\t\t$viaoption $objectsViaFile \\\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1439
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1440
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1441
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1442
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1443
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1444
				"\t\t\$(OBJECTS$Bld) \\\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1445
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1446
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1447
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1448
		if($IsCustomDll eq 1) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1449
			&main::Output( "\t\t\$(EXPFILE$Bld) \\\n" );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1450
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1451
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1452
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1453
				"\t\t\$(LIBS$Bld) \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1454
				"\t\t\$(VTBLEXPORTS$Bld) \$(USERLDFLAGS) \n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1455
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1456
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1457
			if(&main::DebugSwitchUsed() ){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1458
				if(&main::SymbolicDebugEnabled() ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1459
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1460
					"\tcopy \"\$(EPOCBLD$Bld)\\$Trg\" \"\$(EPOCTRG$Bld)\\$FeatureVariantBaseTrg.sym\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1461
					);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1462
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1463
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1464
			elsif ($Bld=~/^U?DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1465
				   &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1466
				   "\tcopy \"\$(EPOCBLD$Bld)\\$Trg\" \"\$(EPOCTRG$Bld)\\$FeatureVariantBaseTrg.sym\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1467
			   );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1468
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1469
		if (-e $DefFile) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1470
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1471
				"\tcopy ", &Generic_Quote(("\"$DefFile\"")), " \"\$(EPOCBLD)\\$ExportLibrary.prep.def\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1472
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1473
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1474
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1475
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1476
			"\telf2e32 --sid=", &main::SecureId(), " "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1477
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1478
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1479
		if (&main::IsDebuggable eq DEBUGGABLE) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1480
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1481
				' --debuggable '
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1482
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1483
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1484
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1485
		if (&main::IsDebuggable eq DEBUGGABLE_UDEBONLY) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1486
			if ($Bld=~/^UDEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1487
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1488
				' --debuggable '
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1489
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1490
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1491
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1492
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1493
		# Do not export Arm Static Library Symbols
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1494
		if (&Armutl_ArmLibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1495
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1496
				' --excludeunwantedexports'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1497
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1498
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1499
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1500
		if ($IsCustomDll eq 1) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1501
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1502
				' --customdlltarget'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1503
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1504
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1505
		if (keys(%Version)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1506
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1507
				' --version=', &Genutl_VersionToUserString(%Version)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1508
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1509
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1510
		# exexps are allowed data, but they look like dlls to elftran....
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1511
		if (&main::AllowDllData || $TrgType=~/^EXEXP$/o || $TrgType=~/^EXEDLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1512
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1513
				' --dlldata'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1514
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1515
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1516
		if (&main::DataLinkAddress) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1517
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1518
				' --datalinkaddress=',&main::DataLinkAddress
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1519
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1520
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1521
		if (&main::FixedProcess) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1522
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1523
				' --fixedaddress'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1524
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1525
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1526
		if (&main::HeapSize) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1527
			my %HeapSize=&main::HeapSize;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1528
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1529
				' --heap=',$HeapSize{Min},',',$HeapSize{Max}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1530
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1531
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1532
		if (&main::ProcessPriority) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1533
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1534
				' --priority=',&main::ProcessPriority
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1535
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1536
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1537
		if (&main::StackSize) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1538
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1539
				' --stack=',&main::StackSize
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1540
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1541
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1542
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1543
			"\\\n\t\t"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1544
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1545
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1546
		my $i=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1547
		foreach (@UidList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1548
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1549
				" --uid$i=$_"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1550
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1551
			$i++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1552
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1553
		if(&main::VendorId) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1554
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1555
				' --vid=',&main::VendorId
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1556
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1557
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1558
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1559
			"\\\n\t\t"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1560
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1561
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1562
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1563
			' --capability=',&main::Capability
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1564
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1565
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1566
		my $vfpv2_support = getConfigVariable('VFP2MODE_OPTION');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1567
		if ($vfpv2_support && &main::ARMFPU && (&main::ARMFPU =~ /^VFPV2$/i))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1568
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1569
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1570
				' --fpu=vfpv2'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1571
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1572
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1573
		else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1574
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1575
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1576
				' --fpu=softvfp'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1577
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1578
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1579
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1580
		if (&main::SmpSafe)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1581
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1582
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1583
				' --smpsafe'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1584
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1585
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1586
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1587
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1588
		if(($BasicTrgType=~/^DLL/ && $TrgType!~/^DLL/ ) || $TrgType=~/^EXEXP/ || $TrgType=~/^STDEXE/){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1589
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1590
				' --targettype=',$TrgType
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1591
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1592
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1593
		else{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1594
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1595
				' --targettype=',$BasicTrgType
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1596
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1597
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1598
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1599
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1600
			' --output=',"\"\$\@\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1601
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1602
		if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/o || $TrgType=~/^EXEDLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1603
			if (-e $DefFile) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1604
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1605
					' --definput=',"\"\$(EPOCBLD)\\$ExportLibrary.prep.def\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1606
					);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1607
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1608
			# Non-callable exports will be ignored if the MMP file does not contain the DEFFILE keyword or contains the NOEXPORTLIBRARY keyword			 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1609
			if (!($DefFile) || $NoExportLibrary) {				
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1610
				&main::Output( " --ignorenoncallable" );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1611
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1612
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1613
				' --dso=',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1614
				&Generic_Quote("\$(EPOCBLD$Bld)\\$ExportLibrary.dso")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1615
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1616
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1617
				' --defoutput=',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1618
				&Generic_Quote("\$(EPOCBLD$Bld)\\$ExportLibrary.def")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1619
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1620
				if(&main::ExportUnfrozen) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1621
					&main::Output( ' --unfrozen ');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1622
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1623
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1624
		#the input elf file - as the last arg
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1625
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1626
			" --elfinput=","\"\$(EPOCBLD$Bld)\\$Trg\"",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1627
			" --linkas=$LinkAs"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1628
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1629
		if (&main::CompressTarget)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1630
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1631
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1632
			" --uncompressed"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1633
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1634
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1635
		else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1636
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1637
			if(&main::CompressTargetMode == NOCOMPRESSIONMETHOD)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1638
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1639
				# Do nothing
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1640
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1641
			elsif(&main::CompressTargetMode == INFLATECOMPRESSIONMETHOD)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1642
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1643
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1644
				" --compressionmethod inflate"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1645
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1646
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1647
			elsif(&main::CompressTargetMode == BYTEPAIRCOMPRESSIONMETHOD)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1648
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1649
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1650
				" --compressionmethod bytepair"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1651
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1652
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1653
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1654
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1655
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1656
		if($NamedSymLkup){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1657
			&main::Output(" --namedlookup"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1658
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1659
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1660
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1661
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1662
		" --libpath=", "\"\$(EPOCLIB)\\LIB\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1663
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1664
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1665
		if($BasicTrgType=~/^DLL/ && $TrgType!~/^DLL/){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1666
			my $Export;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1667
			my $Ordinal=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1668
			foreach $Export (&main::Exports) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1669
				if($Ordinal == 1) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1670
				&main::Output(" --sysdef=");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1671
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1672
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1673
					"$Export,$Ordinal; "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1674
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1675
				$Ordinal++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1676
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1677
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1678
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1679
		if (&main::CodePagingTargetMode == UNPAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1680
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1681
				' --codepaging=unpaged'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1682
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1683
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1684
		elsif (&main::CodePagingTargetMode == PAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1685
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1686
				' --codepaging=paged'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1687
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1688
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1689
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1690
		if (&main::DataPagingTargetMode == UNPAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1691
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1692
				' --datapaging=unpaged'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1693
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1694
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1695
		elsif (&main::DataPagingTargetMode == PAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1696
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1697
				' --datapaging=paged'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1698
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1699
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1700
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1701
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1702
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1703
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1704
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1705
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1706
         elsif ($BasicTrgType=~/^LIB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1707
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1708
			"\t\$(AR) ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1709
				" \$(ARCHIVER_CREATE_OPTION) ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1710
				" \$(EPOCBSFSTATLINK$Bld)\\$Trg \\\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1711
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1712
		# Pass in the command file if the command file option is passed in
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1713
		if($viaoption) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1714
                        #'@' is for GCCE whos version is not 3.4.3
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1715
			if($viaoption eq '@'){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1716
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1717
					"\t\t$viaoption$objectsViaFile\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1718
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1719
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1720
                        #'-via' is for RVCT  
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1721
			else{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1722
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1723
					"\t\t$viaoption $objectsViaFile\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1724
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1725
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1726
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1727
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1728
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1729
				"\t\t\$(OBJECTS$Bld) \n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1730
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1731
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1732
		# Pass the archiver options which can be customized form BSF file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1733
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1734
			"\t\t\$(AR_OPTIONS) \n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1735
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1736
         }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1737
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1738
         &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1739
		 "\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1740
	 );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1741
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1742
	if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/o || $TrgType=~/^EXEDLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1743
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1744
			"\tcopy ", " \"\$(EPOCBLD$Bld)\\$ExportLibrary.def\" ", "\"\$(EPOCBLD)\\$ExportLibrary.def\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1745
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1746
		if  (&main::ExportUnfrozen) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1747
			if ($PlatName =~ /^ARMV5$/)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1748
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1749
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1750
				"\tdef2dll.bat --path=\$(EPOCBLD$Bld) \\\n\t\t--bldpath=\$(EPOCBLD$Bld) \\\n\t\t--export=$ExportLibrary \\\n\t\t--import=$ExportLibrary \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1751
				"\t\t--deffile=\$(EPOCBLD)\\$ExportLibrary.def \\\n\t\t--linkAs=$LinkAs \\\n\t\t$InterWorking \\\n\t\t--absent=undef \n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1752
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1753
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1754
					"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1755
					"\tcopy ", " \"\$(EPOCBLD$Bld)\\$ExportLibrary.lib\" ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1756
					"\"\$(EPOCLIB)\\LIB\\$ExportLibrary.lib\"",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1757
					"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1758
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1759
				if ($ExtraExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1760
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1761
					"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1762
					"\tcopy ", " \"\$(EPOCLIB)\\LIB\\$ExportLibrary.lib\" ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1763
					"\"\$(EPOCLIB)\\LIB\\$ExtraExportLibrary.lib\"",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1764
					"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1765
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1766
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1767
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1768
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1769
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1770
					  "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1771
				  "\tcopy ", " \"\$(EPOCBLD$Bld)\\$ExportLibrary.dso\" ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1772
				  "\"\$(EPOCLIB)\\LIB\\$ExportLibrary.dso\"",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1773
				  "\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1774
				 );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1775
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1776
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1777
					  "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1778
				  "\tcopy ", " \"\$(EPOCBLD$Bld)\\$ExportLibrary.dso\" ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1779
				  "\"\$(EPOCLIB)\\LIB\\$ExtraExportLibrary.dso\"",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1780
				  "\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1781
				 ) if ($ExtraExportLibrary);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1782
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1783
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1784
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1785
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1786
	if($IsCustomDll eq 1)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1787
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1788
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1789
			&Generic_Quote("\$(EPOCBLD$Bld)\\$ExportLibrary.bin"), ": $DefFile\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1790
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1791
	    my $theDefFile = "\$(EPOCBLD)\\$ExportLibrary.def";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1792
	    $theDefFile = $DefFile if (-e $DefFile && !&main::ExportUnfrozen);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1793
	    my $theAssembler = " \$(ASM) ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1794
	    &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1795
		"\telf2e32  \\\n\t\t--definput=$theDefFile \\\n\t\t--dump=a \\\n\t\t--output=\$(EPOCBLD$Bld)\\$ExportLibrary.s \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1796
  		"\t$theAssembler \$(AAPCS_OPTION) \\\n\t\t \$(ASM_OUTPUT_OPTION) \$(EPOCBLD$Bld)\\$ExportLibrary.bin  \$(EPOCBLD$Bld)\\$ExportLibrary.s\n\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1797
	    );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1798
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1799
			"\t-\$(ERASE) \"\$(EPOCBLD$Bld)\\$ExportLibrary.s\"\n\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1800
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1801
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1802
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1803
    &main::Output( "\n" );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1804
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1805
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1806
# Set to 1 if multifile compilation wanted
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1807
my $domultifile = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1808
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1809
sub DoMultiFile () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1810
        return $ENV{RVCTMultiFile} if (defined $ENV{RVCTMultiFile});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1811
	return $domultifile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1812
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1813
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1814
my %CompilationGroups = ();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1815
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1816
sub InitMultiFileCompilation() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1817
#	Do preparatory work for multifile compilation
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1818
	my $SourceStructRef=&main::SourceStructRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1819
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1820
#	We sort the source files by path and extension. These form natural groups to compile together.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1821
	my %PathToSourceMap = ();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1822
	foreach my $SourceRef (@$SourceStructRef) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1823
		my $SrcFile = $$SourceRef{CurFile};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1824
		my $Ext = &main::Path_Split('Ext', $SrcFile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1825
			push @{$PathToSourceMap{$$SourceRef{SrcPath}}{$Ext}}, $SrcFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1826
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1827
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1828
#	Now we split each group into sets of 10.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1829
	foreach my $SrcPath (keys %PathToSourceMap) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1830
		foreach my $Ext (keys %{$PathToSourceMap{$SrcPath}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1831
			my @FileList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1832
			my @ObjectList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1833
			my @SourceList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1834
			my $NumToGo = 10;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1835
			foreach my $File (@{$PathToSourceMap{$SrcPath}{$Ext}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1836
				my $base = &main::Path_Split('Base', $File);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1837
				my $cia = ($Ext =~ /cia/i);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1838
				$base .= "_" if $cia && ($PlatName ne "GCCE");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1839
				push @FileList, $File;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1840
				push @ObjectList, "$base.o";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1841
#				this gives us our source files xxx
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1842
				push @SourceList, ($cia && ($PlatName ne "GCCE")) ? "$base.cpp" : "$SrcPath$base$Ext";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1843
				$NumToGo--;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1844
				unless ($NumToGo) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1845
#					   Use the last file as the key. This means e.g that all the dependency
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1846
#					   info will have been generated for the earlier files in the list
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1847
					   push @{$CompilationGroups{$FileList[$#FileList]}{Sources}}, @SourceList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1848
						   push @{$CompilationGroups{$FileList[$#FileList]}{Objects}}, @ObjectList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1849
					   $NumToGo = 10;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1850
					   undef @FileList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1851
					   undef @ObjectList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1852
					   undef @SourceList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1853
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1854
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1855
			push @{$CompilationGroups{$FileList[$#FileList]}{Sources}}, @SourceList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1856
			push @{$CompilationGroups{$FileList[$#FileList]}{Objects}}, @ObjectList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1857
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1858
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1859
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1860
#	debug print out
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1861
	if (0) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1862
	foreach my $keyfile (keys %CompilationGroups) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1863
		print "$keyfile :\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1864
		foreach my $class (keys %{$CompilationGroups{$keyfile}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1865
			print "\t$class:\n\t\t";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1866
			print join " ", @{$CompilationGroups{$keyfile}{$class}}, "\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1867
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1868
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1869
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1870
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1871
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1872
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1873
sub PMStartSrcList {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1874
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1875
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1876
		"# SOURCES\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1877
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1878
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1879
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1880
	InitMultiFileCompilation() if DoMultiFile();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1881
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1882
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1883
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1884
sub PMBitMapBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1885
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1886
	&Generic_BitMapBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1887
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1888
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1889
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1890
sub PMResrcBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1891
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1892
	&Generic_ResrcBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1893
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1894
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1895
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1896
sub PMAifBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1897
	&Generic_AifBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1898
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1899
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1900
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1901
sub PMStartSrc {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1902
	my $Src=&main::Src;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1903
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1904
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1905
		"# Source $Src\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1906
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1907
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1908
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1909
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1910
sub PMSrcDepend {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1911
	my @DepList=&main::DepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1912
	return if (@DepList == 0);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1913
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1914
	my @BldList=&main::BldList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1915
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1916
	my $ExtSrc=&main::ExtSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1917
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1918
	my $BaseObj=$BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1919
	my $cia = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1920
	if ($ExtSrc =~ /cia/i ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1921
		$cia = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1922
		$BaseObj .= '_' if ($PlatName ne "GCCE");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1923
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1924
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1925
  	foreach my $Bld (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1926
		my $tranasm = getConfigVariable('TRANASM');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1927
		if ($tranasm)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1928
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1929
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1930
				&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.pre"), " ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1931
			) if $cia && ($PlatName ne "GCCE");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1932
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1933
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1934
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1935
  			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseObj.cpp"), " ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1936
		) if $cia && ($PlatName ne "GCCE");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1937
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1938
  			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), " ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1939
  			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseObj.o"), " \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1940
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1941
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1942
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1943
		":"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1944
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1945
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1946
	my $prefix_file=getConfigVariable('PREFIXFILE');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1947
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1948
	my @tempdeplist = &main::DepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1949
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1950
	my $totalcount = $#tempdeplist;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1951
	my $count = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1952
	while( $totalcount >= $count )
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1953
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1954
		my $dependencyfile = shift(@tempdeplist);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1955
		if($dependencyfile eq $prefix_file )
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1956
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1957
			$DepList[$count]="\$(PREFIXFILE)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1958
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1959
		$count += 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1960
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1961
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1962
        PrintList("\' \\\n\t\'\.\&Generic_Quote\(\$_\)", @DepList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1963
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1964
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1965
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1966
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1967
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1968
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1969
sub PMSrcBldDepend {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1970
	my @DepList=&main::DepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1971
	return if (@DepList == 0);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1972
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1973
	my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1974
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1975
	my $ExtSrc=&main::ExtSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1976
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1977
	my $BaseObj=$BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1978
	my $cia = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1979
	if ($ExtSrc =~ /cia/i ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1980
		$cia = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1981
		$BaseObj .= '_' if ($PlatName ne "GCCE");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1982
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1983
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1984
	my $tranasm = getConfigVariable('TRANASM');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1985
	if ($tranasm)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1986
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1987
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1988
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.pre"), " ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1989
		) if $cia && ($PlatName ne "GCCE");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1990
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1991
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1992
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1993
		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseObj.cpp"), " ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1994
	) if $cia && ($PlatName ne "GCCE");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1995
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1996
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1997
		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), " ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1998
		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseObj.o"), " :",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1999
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2000
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2001
	my $prefix_file=getConfigVariable('PREFIXFILE');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2002
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2003
	my @tempdeplist = &main::DepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2004
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2005
	my $totalcount = $#tempdeplist;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2006
	my $count = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2007
	while( $totalcount >= $count )
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2008
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2009
		my $dependencyfile = shift(@tempdeplist);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2010
		if($dependencyfile eq $prefix_file )
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2011
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2012
			$DepList[$count]="\$(PREFIXFILE)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2013
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2014
		$count += 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2015
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2016
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2017
        PrintList("\' \\\n\t\'\.\&Generic_Quote\(\$_\)", @DepList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2018
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2019
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2020
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2021
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2022
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2023
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2024
sub quoted_path
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2025
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2026
    my $curdrive="";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2027
    my ($arg) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2028
    return "\"$arg\"" if ($arg !~ /^\\[^\\]/);	# not an absolute path
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2029
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2030
		$curdrive=$1 if (cwd =~ /^(.:)/);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2031
    return "\"$curdrive$arg\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2032
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2033
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2034
sub PMPrefixFile
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2035
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2036
# Prefix Header File passed to the preprocessor
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2037
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2038
	my $prefix_file=getConfigVariable('PREFIXFILE');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2039
	return quoted_path($prefix_file) if defined $prefix_file;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2040
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2041
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2042
sub PMToolChainIncDir
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2043
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2044
	# Extra system include directories dictated by the toolchain
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2045
	return $ToolChainIncDir;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2046
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2047
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2048
sub PMEndSrcBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2049
#       Generate multifile compilation stuff if needed.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2050
        if (DoMultiFile()) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2051
		   MultiFileEndSrcBld();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2052
		   return;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2053
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2054
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2055
	my $ABI=&main::ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2056
	my $Plat=&main::Plat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2057
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2058
	my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2059
	my $Src=lc &main::Src;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2060
	my $SrcPath=&main::SrcPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2061
	my $BaseTrg=&main::BaseTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2062
	my $BldPath = &main::BldPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2063
	my $Ext = &main::Path_Split('Ext', $Src);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2064
	$Src = ucfirst $Src if ($Ext !~ /\.(cpp|c)$/);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2065
	my $LangOptions = &SelectLangOptions($Ext);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2066
	# support for auto 'translated' ASM
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2067
	my $AsmFilep = $AsmFiles{$Src};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2068
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2069
	$preinclude = &GetToolChainPreInclude();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2070
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2071
	#Function call logger takes -I as include option
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2072
	my $FCLogger_inc_option = getConfigVariable('FC_LOGGER_INCLUDE_OPTION'); 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2073
	my $logger_preinclude = getConfigVariable('PREINCLUDE_OPTION_FCLOGGER'); 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2074
	my $Dictionary_File_Name = getConfigVariable('FC_LOGGER_DICTIONARY_FILE_NAME');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2075
	my $Generated_C_File_Name = getConfigVariable('FC_LOGGER_GENERATED_C_FILE_NAME');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2076
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2077
	my $ChopSrcPath=&main::Path_Chop($SrcPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2078
	my $lfboption = LinkerFeedBackOption();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2079
	my $LstExt ;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2080
	if($Plat =~ /^(ARMV[6-9])/i){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2081
		$LstExt = $1 ;	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2082
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2083
	else{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2084
		$LstExt = $ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2085
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2086
	if ($AsmFilep || ($Ext =~ /cia/i && ($PlatName ne "GCCE"))) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2087
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2088
# compile the translated, preprocessed source
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2089
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.o"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2090
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2091
			"\t\@echo $Src\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2092
			"\t\$(CC$Bld) $lfboption $LangOptions ", "\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR) \$(OUTPUT_OPTION) \$\@ \$(EPOCBLD$Bld)\\$BaseSrc\_.cpp)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2093
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2094
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2095
# rule to translate the preprocessed source
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2096
			my $tranasm = getConfigVariable('TRANASM');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2097
			if ($tranasm)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2098
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2099
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2100
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2101
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.pre"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2102
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2103
				"\t\$(TRANASM) \$(TRANASM_FLAGS) \$(TRANASM_OUTPUT_OPTION)\$\@ \$(TRANASM_INPUT_OPTION)\$(EPOCBLD$Bld)\\$BaseSrc.pre\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2104
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2105
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2106
# rule to preprocess the source
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2107
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2108
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.pre"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2109
			&Generic_Quote("$SrcPath$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2110
			"\t\$(CC$Bld) \$(PREPROCESSOR_OPTION) $preinclude $LangOptions ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR) $ChopSrcPath\\$Src \$(OUTPUT_OPTION) \$\@) \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2111
# generate an assembly listing target too
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2112
			"LISTING$Bld$BaseSrc\_ : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.lis"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2113
			"\t", &Generic_CopyAction("$SrcPath$BaseSrc\_.$LstExt.lst"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2114
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2115
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.lis"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2116
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2117
			"\t\$(CC$Bld) $LangOptions ", "\$(ASSEMBLER_LISTING_OPTION) ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR) \$(OUTPUT_OPTION) \$\@ \$(EPOCBLD$Bld)\\$BaseSrc\_.cpp)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2118
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2119
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2120
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2121
			else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2122
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2123
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2124
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2125
			&Generic_Quote("$SrcPath$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2126
			"\t\$(CC$Bld) \$(PREPROCESSOR_OPTION) $preinclude $LangOptions ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR) $ChopSrcPath\\$Src \$(OUTPUT_OPTION) \$\@) \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2127
# generate an assembly listing target too
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2128
			"LISTING$Bld$BaseSrc\_ : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.lis"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2129
			"\t", &Generic_CopyAction("$SrcPath$BaseSrc\_.$LstExt.lst"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2130
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2131
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.lis"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2132
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2133
			"\t\$(CC$Bld) $LangOptions ", "\$(ASSEMBLER_LISTING_OPTION) ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR) \$(OUTPUT_OPTION) \$\@ \$(EPOCBLD$Bld)\\$BaseSrc\_.cpp)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2134
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2135
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2136
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2137
	} 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2138
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2139
		#If Function call logging is enabled, add call to function call logger
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2140
		if ($Function_Call_Logger)	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2141
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2142
				&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o"), 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2143
				" : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2144
				&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.int.cpp"), 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2145
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2146
				"\t\@echo $BaseSrc.int.cpp\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2147
				"\t\$(CC$Bld) $lfboption$LangOptions ", 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2148
				" \$(INCLUDE_OPTION) ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2149
				"\$(call absolutePaths, $ChopSrcPath \$(INCDIR) \$(OUTPUT_OPTION) \$\@ \$(EPOCBLD$Bld)\\$BaseSrc.int.cpp)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2150
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2151
# generate an assembly listing target too
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2152
				"LISTING$Bld$BaseSrc : ", 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2153
				&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2154
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2155
				"\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2156
				&Generic_CopyAction("$SrcPath$BaseSrc.$LstExt.lst"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2157
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2158
				&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2159
				" : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2160
				&Generic_Quote("$SrcPath$Src"), 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2161
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2162
				"\t\$(CC$Bld) $LangOptions ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2163
				"\$(ASSEMBLER_LISTING_OPTION) ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2164
				"\$(INCLUDE_OPTION)",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2165
				" \$(call absolutePaths,$ChopSrcPath \$(INCDIR) \$(OUTPUT_OPTION) \$\@ $ChopSrcPath\\$Src) \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2166
				"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2167
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2168
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2169
			#Call to Function Call Logger
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2170
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2171
				&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.int.cpp"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2172
				" : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2173
				&Generic_Quote("$SrcPath\\$Src"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2174
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2175
				"\t\@echo $BaseSrc.int.cpp\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2176
				"\t\$(FCLOGGER$Bld) $lfboption \\\n" ,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2177
				"\t$FCLogger_inc_option $ChopSrcPath \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2178
				"\t$logger_preinclude \\\n ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2179
				"\t\$(INCDIR_FCLOGGER) \\\n" ,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2180
				"\t$Dictionary_File_Name $BldPath$BaseTrg.txt \\\n" ,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2181
				"\t$Generated_C_File_Name \$\@ $ChopSrcPath\\$Src \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2182
				"\n\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2183
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2184
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2185
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2186
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2187
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2188
			&Generic_Quote("$SrcPath$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2189
			"\t\@echo $Src\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2190
			"\t\$(CC$Bld) $lfboption $LangOptions ", "\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR) \$(OUTPUT_OPTION) \$\@ $ChopSrcPath\\$Src)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2191
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2192
# generate an assembly listing target too
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2193
			"LISTING$Bld$BaseSrc : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2194
			"\t", &Generic_CopyAction("$SrcPath$BaseSrc.$LstExt.lst"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2195
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2196
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2197
			&Generic_Quote("$SrcPath$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2198
			"\t\$(CC$Bld) $LangOptions ","\$(ASSEMBLER_LISTING_OPTION) ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR) \$(OUTPUT_OPTION) \$\@ $ChopSrcPath\\$Src) \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2199
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2200
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2201
			# Compiler wrapper support starts...
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2202
			if($IsCompilerWrapperOption)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2203
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2204
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2205
					"COMPWRAP$Bld$BaseSrc : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2206
					&Generic_Quote("$SrcPath$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2207
					"\t\@echo Analysing $Src\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2208
					"\t\$(COMPWRAP) \$(CC$Bld) $lfboption $LangOptions ", "\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR) \$(OUTPUT_OPTION) \$\@ $ChopSrcPath\\$Src)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2209
					"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2210
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2211
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2212
			# Compiler wrapper support ends...
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2213
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2214
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2215
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2216
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2217
my $MFVarN = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2218
sub MultiFileEndSrcBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2219
	my $ABI=&main::ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2220
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2221
	my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2222
        my $KeyFile = &main::Src;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2223
	my $Src=ucfirst lc $KeyFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2224
	my $SrcPath=&main::SrcPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2225
	my $Ext = &main::Path_Split('Ext', $Src);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2226
	my $LangOptions = &SelectLangOptions($Ext);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2227
	# support for auto 'translated' ASM
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2228
	my $AsmFilep = $AsmFiles{$Src};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2229
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2230
	my $ChopSrcPath=&main::Path_Chop($SrcPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2231
	my $lfboption = LinkerFeedBackOption();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2232
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2233
	if ($AsmFilep || ($Ext =~ /cia/i && ($PlatName ne "GCCE"))) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2234
		if ($CompilationGroups{$KeyFile}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2235
# compile the translated, preprocessed source
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2236
			   &main::Output( "OBJECTS$MFVarN = ");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2237
			   foreach my $obj (@{$CompilationGroups{$KeyFile}{Objects}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2238
				   &main::Output( &Generic_Quote("\\\n\t\$(EPOCBLD$Bld)\\$obj"), " ");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2239
			   }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2240
				   &main::Output( "\n\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2241
			   &main::Output( "SOURCES$MFVarN = ");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2242
			   foreach my $src (@{$CompilationGroups{$KeyFile}{Sources}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2243
				   &main::Output( &Generic_Quote("\\\n\t\$(EPOCBLD$Bld)\\$src", " "));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2244
			   }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2245
				   &main::Output( "\n\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2246
			   &main::Output( "\$(OBJECTS$MFVarN) : \$(SOURCES$MFVarN) \n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2247
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2248
			   &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2249
					 "\t\@echo Compiling \$(SOURCES$MFVarN)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2250
					 "\t\$(CC$Bld) ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR)) $lfboption\\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2251
					 "\t\t$LangOptions \$(OUTPUT_OPTION) \$\@ --multifile \$(SOURCES$MFVarN)"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2252
			  );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2253
				   &main::Output( "\n\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2254
			   $MFVarN++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2255
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2256
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2257
# rule to translate the preprocessed source
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2258
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2259
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.pre"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2260
			"\ttranasm -n -s -o=\$\@ \$(EPOCBLD$Bld)\\$BaseSrc.pre\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2261
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2262
# rule to preprocess the source
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2263
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.pre"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2264
			&Generic_Quote("$SrcPath$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2265
			"\t\$(CC$Bld) \$(PREPROCESSOR_OPTION) $preinclude $LangOptions ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR)) $ChopSrcPath\\$Src \$(OUTPUT_OPTION) \$\@ \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2266
# generate an assembly listing target too
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2267
			"LISTING$Bld$BaseSrc\_ : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.lis"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2268
			"\t", &Generic_CopyAction("$SrcPath$BaseSrc\_.$LstExt.lst"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2269
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2270
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.lis"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2271
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2272
			"\t\$(CC$Bld) $LangOptions ", "\$(ASSEMBLER_LISTING_OPTION) ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR)) \$(OUTPUT_OPTION) \$\@ \$(EPOCBLD$Bld)\\$BaseSrc\_.cpp\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2273
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2274
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2275
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2276
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2277
		if ($CompilationGroups{$KeyFile}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2278
#                      compile the source
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2279
			   &main::Output( "OBJECTS$MFVarN = ");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2280
			   foreach my $obj (@{$CompilationGroups{$KeyFile}{Objects}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2281
				   &main::Output( &Generic_Quote("\\\n\t\$(EPOCBLD$Bld)\\$obj"), " ");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2282
			   }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2283
				   &main::Output( "\n\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2284
			   &main::Output( "SOURCES$MFVarN = ");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2285
			   foreach my $src (@{$CompilationGroups{$KeyFile}{Sources}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2286
				   &main::Output( &Generic_Quote("\\\n\t$src"), " ");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2287
			   }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2288
				   &main::Output( "\n\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2289
			   &main::Output( "\$(OBJECTS$MFVarN) : \$(SOURCES$MFVarN) \n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2290
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2291
			   &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2292
					 "\t\@echo Compiling \$(SOURCES$MFVarN)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2293
					 "\t\$(CC$Bld) ", "\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR)) $lfboption\\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2294
					 "\t\t$LangOptions \$(OUTPUT_OPTION) \$\@ --multifile \$(SOURCES$MFVarN)"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2295
			  );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2296
				   &main::Output( "\n\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2297
			   $MFVarN++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2298
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2299
#		generate an assembly listing target too
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2300
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2301
			"LISTING$Bld$BaseSrc : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2302
			"\t", &Generic_CopyAction("$SrcPath$BaseSrc.$LstExt.lst"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2303
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2304
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2305
			&Generic_Quote("$SrcPath$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2306
			"\t\$(CC$Bld) $LangOptions ","\$(ASSEMBLER_LISTING_OPTION) ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR)) \$(OUTPUT_OPTION) \$\@ $ChopSrcPath\\$Src \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2307
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2308
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2309
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2310
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2311
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2312
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2313
sub PMEndSrc {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2314
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2315
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2316
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2317
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2318
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2319
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2320
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2321
sub PMEndSrcList {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2322
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2323
	# Deal with accumulated MAKEDIRS etc.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2324
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2325
	&Generic_End;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2326
# modified start: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2327
	&checkVMAPFiles;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2328
# modified end: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2329
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2330
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2331
sub ImportLibraryList {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2332
	my $dso;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2333
	my $base;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2334
	my @ImportLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2335
	foreach $dso (@_) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2336
		$base = &main::Path_Split('Base', $dso);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2337
		$dso = $base.".dso";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2338
		push @ImportLibList, $dso;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2339
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2340
	return @ImportLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2341
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2342
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2343
sub ChangeSlash($) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2344
	my $abspath = $_[0];
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2345
	$abspath =~ s/\\/\//g ;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2346
	return $abspath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2347
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2348
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2349
# System libraries such as the standard C++ libraries or floating point libraries or any other
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2350
# static libraries are made into DLLs by linking its export table against them. Such DLLs that are
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2351
# created from a static library is known as a Custom DLL. The ARM libraries can be supplied using
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2352
# the ARMLIBS mmp keyword  A DLL is considered to be a customdll based on the presence of ARMLIBS
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2353
# keyword and also the presence of DEFFILE keyword.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2354
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2355
sub IsCustomDllUseCase()
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2356
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2357
	# To check if ARMLIBS keyword is passed in the MMP file.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2358
	# Armutl_ArmLibList() gets the list of static arm libraries, if used by an executable.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2359
	my $armliblist = &Armutl_ArmLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2360
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2361
	# To check if DEFFILE keyword is used in the MMP file to supply the def file.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2362
	my $deffile = &main::DefFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2363
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2364
	if ($armliblist && $deffile)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2365
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2366
		return 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2367
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2368
	return 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2369
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2370
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2371
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2372
sub GetToolChainPreInclude {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2373
	my $preinclude_file = getConfigVariable('PREINCLUDE_OPTION');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2374
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2375
	$preinclude_file =~ s/\\/\//g;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2376
	return "$preinclude_file";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2377
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2378
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2379
sub SelectLangOptions {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2380
	my ($Ext) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2381
	$preinclude = &GetToolChainPreInclude;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2382
	if ($Ext=~/^.cpp$/ || ($Ext=~/^.cia$/ && ($PlatName eq "GCCE"))) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2383
		#Function Call Logger
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2384
		return " \$(CPP_LANG_OPTION) " if ($Function_Call_Logger);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2385
		return " \$(CPP_LANG_OPTION) $preinclude ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2386
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2387
	if ($Ext=~/^.cia$/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2388
		return " \$(CIA_LANG_OPTION) ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2389
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2390
	if ($Ext=~/^.c$/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2391
		my $CompilerOption = &main::CompilerOption("ARMCC");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2392
		if($CompilerOption =~ /--cpp/){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2393
			#Function Call Logger
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2394
			return " \$(CPP_LANG_OPTION) " if ($Function_Call_Logger);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2395
			return " \$(CPP_LANG_OPTION) $preinclude ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2396
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2397
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2398
			#Function Call Logger
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2399
			return " \$(C_LANG_OPTION) " if ($Function_Call_Logger);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2400
			return " \$(C_LANG_OPTION) $preinclude ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2401
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2402
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2403
	# To support .cc, .cxx, .c++ file extensions for Open Environment
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2404
	elsif ($Ext=~/^(.cc|.cxx|.c\+\+)$/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2405
		#Function Call Logger
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2406
		return " \$(CPP_LANG_OPTION) " if ($Function_Call_Logger);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2407
		return " \$(CPP_LANG_OPTION) $preinclude ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2408
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2409
	return '';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2410
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2411
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2412
sub IsMapOptAvail() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2413
	open PIPE, "arm-none-symbianelf-g++ -v 2>&1 | ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2414
	while(<PIPE>){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2415
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2416
		if($_ =~ /gcc version (.*) \(release\).*/i)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2417
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2418
			if($1 lt "3.4.3")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2419
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2420
				return 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2421
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2422
			elsif($_ =~ /gcc version (.*) \(release\) \(CodeSourcery ARM (.*) (\d*)\)/i)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2423
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2424
				if($1 eq "3.4.3" && uc $2 ne "Q1B" && $3 ge 2005)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2425
				{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2426
					return 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2427
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2428
				elsif($1 gt "3.4.3")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2429
				{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2430
					return 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2431
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2432
				else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2433
				{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2434
					return 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2435
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2436
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2437
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2438
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2439
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2440
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2441
	close PIPE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2442
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2443
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2444
sub StdCppTarget() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2445
    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2446
    # STDCPP is supported
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2447
    return 0 if (! main::StdCppSupport());
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2448
    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2449
  	if ( main::NoStdCpp() ) { #MMP keyword NOSTDCPP set
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2450
  	       return 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2451
  	}	       
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2452
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2453
	if ( main::StdCpp() ) { # MMP keyword STDCPP set.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2454
		return 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2455
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2456
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2457
		return ( main::TrgType() =~ /^(STDEXE|STDDLL|STDLIB)$/io );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2458
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2459
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2460
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2461
sub GetRTLibList() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2462
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2463
	my $newlib = main::NewLib(); # Could have been set in the MMP file.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2464
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2465
	unless ($newlib) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2466
		if ( StdCppTarget() ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2467
			$newlib = getConfigVariable('OE_NEW_LIB');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2468
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2469
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2470
			$newlib = getConfigVariable('SYM_NEW_LIB');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2471
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2472
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2473
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2474
	my @RtLib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2475
	my $list = "$newlib " . getConfigVariable('RUNTIME_LIBS_LIST') ;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2476
	if (length($list) >0)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2477
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2478
		@RtLib = split(/\s+/, $list);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2479
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2480
	return @RtLib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2481
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2482
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2483
sub GetOELibList() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2484
	my @OELib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2485
	my $list;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2486
	if (&main::IsWideCharMain()) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2487
		$list = getConfigVariable('OE_EXE_LIBS_WCHAR');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2488
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2489
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2490
		$list = getConfigVariable('OE_EXE_LIBS');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2491
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2492
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2493
	if (length($list) >0)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2494
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2495
		@OELib = split(/\s+/, $list);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2496
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2497
	return @OELib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2498
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2499
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2500
sub GetOEImportLibList() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2501
	my @OEImportLib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2502
	my $list;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2503
	$list = getConfigVariable('OE_IMPORT_LIBS');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2504
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2505
	if (length($list) >0)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2506
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2507
		@OEImportLib = split(/\s+/, $list);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2508
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2509
	return @OEImportLib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2510
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2511
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2512
sub InitToolChain(@) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2513
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2514
	if($PlatName eq "ARMV5" || $PlatName eq "ARMV5_ABIV2" || $CustomizedARMV5Plat)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2515
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2516
		my $RVCTBuildNumber;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2517
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2518
		($RVCTMajorVersion, $RVCTMinorVersion, $RVCTBuildNumber) = RVCT_plat2set::get_version_list($PlatName);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2519
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2520
		$RVCTVersion = "${RVCTMajorVersion}_${RVCTMinorVersion}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2521
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2522
		my $aRVCTVersion = "${RVCTMajorVersion}.${RVCTMinorVersion}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2523
		if (($aRVCTVersion == 2.2) && ($RVCTBuildNumber < 559))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2524
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2525
			warn "WARNING: When building using ABIV2 mode toolchain Compiler RVCT2.2 Build 559 or later is required.\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2526
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2527
		&Armutl_DoMmp(@_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2528
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2529
	elsif ($RootName eq "GCCE")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2530
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2531
		($GCCEMajorVersion, $GCCEMinorVersion) = gcce_plat2set::get_version_list($Platname);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2532
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2533
		$GCCEVersion = "${GCCEMajorVersion}_${GCCEMinorVersion}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2534
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2535
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2536
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2537
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2538
my %BSF_keywords = (
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2539
			COMMON_OPTIONS => 1,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2540
			THUMB_OPTIONS => 1,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2541
			ARM_OPTIONS => 1,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2542
			KERNEL_OPTIONS => 1,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2543
			INVARIANT_OPTIONS => 1,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2544
			LD_OPTIONS => 1,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2545
			AR_OPTIONS => 1,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2546
			DEBUG_FORMAT => 1
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2547
		   );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2548
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2549
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2550
sub Read_BSF_Options() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2551
        my %plat = (main::PlatRec());
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2552
		my @Customization_Data = split(/\n/,$plat{'CUSTOMIZATION_DATA'});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2553
	foreach my $option (@Customization_Data) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2554
			next if ($option =~ /^$/);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2555
			warn "Unrecognized BSF syntax: $option.\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2556
				unless ($option =~ /\s*(\S+)\s+(.+)$/);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2557
		my $key = uc $1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2558
		my $val = $2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2559
			warn "Unrecognized BSF keyword: $key.\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2560
				unless ($BSF_keywords{$key});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2561
		if ($key =~ /COMMON_OPTIONS/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2562
				push @commonOptions, $val;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2563
			next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2564
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2565
		if ($key =~ /THUMB_OPTIONS/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2566
				push @thumbOptions, $val;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2567
			next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2568
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2569
		if ($key =~ /ARM_OPTIONS/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2570
				push @armOptions, $val;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2571
			next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2572
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2573
		if ($key =~ /KERNEL_OPTIONS/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2574
				push @kernelOptions, $val;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2575
			next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2576
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2577
		if ($key =~ /INVARIANT_OPTIONS/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2578
				push @invariantOptions, $val;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2579
			next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2580
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2581
		if ($key =~ /LD_OPTIONS/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2582
				push @linkerOptions, $val;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2583
			next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2584
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2585
		if ($key =~ /AR_OPTIONS/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2586
				push @archiverOptions, $val;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2587
			next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2588
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2589
		if ($key =~ /DEBUG_FORMAT/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2590
				push @debugFormat, $val;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2591
			next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2592
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2593
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2594
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2595
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2596
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2597
# Set the options passed from BSF file 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2598
# @param OptionName    - BSF Keyword using which the options would be overridden in the BSF file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2599
# @param Options       - List of options read from the BSF keyword
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2600
sub Set_BSF_Options($$)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2601
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2602
	my ($OptionName,$Options) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2603
	my @Fragments=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2604
	foreach my $val (@{$Options})
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2605
	{		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2606
		# Check if the value of BSF option is to be set or added/removed.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2607
		if($val =~ /\+\[.*\]\+|\-\[.*\]\-/)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2608
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2609
			if (@Fragments = Split_BSF_Options($val,'RemoveOptions'))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2610
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2611
				foreach my $Opt (@Fragments) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2612
				{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2613
					# Remove trailing white spaces
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2614
					$Opt =~ s/\s+$//;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2615
					# Substitute '=' with '%' which is a wild card character in makefile.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2616
					# This is required for cases where option to be removed contains '=' (e.g.'-march=armv5t').
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2617
					# When such options are to be removed, "$(INVARIANT_OPTIONS:-march=armv5t=)" is written in the makefile.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2618
					# However, because of the occurence of '=', pattern match fails in the makefile and such options are not removed. 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2619
					# To resolve this, '=' is replaced with '%'  in the makefile so that the substitution pattern looks like 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2620
					# "$(INVARIANT_OPTIONS:-march%armv5t=)" in makefile (e.g."$(INVARIANT_OPTIONS:-march%armv5t=)").
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2621
					$Opt =~ s/=/%/;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2622
					&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2623
						"$OptionName := \$($OptionName:$Opt=)",					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2624
						"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2625
					);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2626
				}					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2627
				@Fragments=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2628
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2629
			if (@Fragments = Split_BSF_Options($val,'AddOptions')) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2630
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2631
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2632
					"$OptionName += @Fragments ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2633
					"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2634
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2635
				@Fragments=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2636
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2637
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2638
			# Warn if options are not present in the form '+[...]+' or '-[...]-'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2639
			$val =~ s/\+\[.*?\]\+|\-\[.*?\]\-//g;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2640
			if($val !~ /^\s*$/)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2641
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2642
				print "Warning: Ignoring option(s) \"$val\" for $OptionName as option(s) should be in the form '+[...]+' or '-[...]-.\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2643
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2644
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2645
		else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2646
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2647
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2648
				"$OptionName = $val ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2649
				"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2650
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2651
		}		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2652
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2653
	&main::Output(					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2654
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2655
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2656
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2657
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2658
# Split BSF options to find options which are to be added/removed
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2659
# @param String      - List of options present in form '+[...]+' or '-[....]-'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2660
# @param $Task       - Variable to decide whether to return options to be addded or options to be removed
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2661
sub Split_BSF_Options($$)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2662
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2663
	my ($String,$Task) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2664
    my @Result = ();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2665
	my @Fragments = ();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2666
	my $Pattern = '';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2667
	# Get the toolchain specific option prefix to segregate the options.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2668
	my $OptionPrefix = getConfigVariable('OPTION_PREFIX');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2669
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2670
	if ($Task eq 'AddOptions')
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2671
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2672
		# Get the options which are to be added (present in the form '+[...]+')
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2673
		@Fragments = $String =~ /\+\[(.*?)\]\+/g;	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2674
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2675
	elsif ($Task eq 'RemoveOptions') 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2676
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2677
		# Get the options which are to be removed (present in the form '-[...]-')
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2678
		@Fragments = $String =~ /\-\[(.*?)\]\-/g;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2679
	}	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2680
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2681
	# Set the value of '$Pattern' which is required to segregate one option from another based on the option prefix.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2682
	if($OptionPrefix) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2683
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2684
		$Pattern = $OptionPrefix.'\S+\s*(?!'.$OptionPrefix.')\S*';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2685
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2686
	else 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2687
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2688
		# If option prefix is not set in the configuration make file, then set default
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2689
		# option prefix as '-' or '--'.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2690
		$Pattern = '-{1,2}\S+\s*(?!-)\S*';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2691
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2692
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2693
	foreach my $Val (@Fragments) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2694
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2695
		my @Opt = $Val =~ /$Pattern/g;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2696
		push @Result,@Opt;				
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2697
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2698
	return @Result;	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2699
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2700
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2701
sub SysTrg () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2702
	return 1 if &main::SystemTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2703
	my $ExportLibrary=&main::ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2704
	return 1 if ($ExportLibrary =~ /EKERN/i);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2705
	my $Trg=&main::Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2706
	return 1 if ($Trg =~ /KSRT/i);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2707
	return 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2708
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2709
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2710
sub GetLibList() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2711
	my @LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2712
	my @StaticLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2713
	my $list = getConfigVariable('STATIC_LIBS_LIST') ;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2714
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2715
	if (length($list) >0)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2716
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2717
		@StaticLibList = split(/\s+/, $list);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2718
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2719
	if($PlatName eq "ARMV5" || $PlatName eq "ARMV5_ABIV2" || $CustomizedARMV5Plat) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2720
		@LibList=&Armutl_ArmLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2721
		if(@LibList==0) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2722
			my $LibDir = Armutl_ArmLibDir();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2723
			# convert '/' to  '\'  if there are some '/'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2724
			$LibDir =~ s#/#\\#g;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2725
			if (@StaticLibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2726
				foreach my $lib (@StaticLibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2727
					push @LibList, ("$LibDir\\$lib");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2728
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2729
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2730
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2731
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2732
	else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2733
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2734
		@LibList = ('$(STATIC_LIBS_LIST)');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2735
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2736
	return @LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2737
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2738
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2739
sub GetToolChainAsmFileList() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2740
	my @FileList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2741
	@FileList=&Armutl_AsmFileList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2742
	if(@FileList)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2743
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2744
		return @FileList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2745
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2746
	return;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2747
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2748
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2749
sub IsTargetRT() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2750
	my $RTtarget=&Armutl_ArmRT;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2751
	if($RTtarget)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2752
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2753
		return $RTtarget;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2754
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2755
	return;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2756
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2757
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2758
sub GetToolChainIncDir {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2759
	if($PlatName eq "ARMV5" || $PlatName eq "ARMV5_ABIV2" || $CustomizedARMV5Plat)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2760
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2761
  		#the ToolChainIncDir's value depends on the key word ARMINC in mmp file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2762
  		return &Armutl_ArmIncDir;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2763
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2764
	else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2765
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2766
		my $compiler_inc_path = getConfigVariable('COMPILER_INCLUDE_PATH');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2767
		$compiler_inc_path =~ s/^\s+//g;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2768
		return ($compiler_inc_path);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2769
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2770
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2771
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2772
my $useLinkerFeedBack = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2773
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2774
sub LinkerFeedBackFile() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2775
  return unless $useLinkerFeedBack;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2776
  my $Trg = &main::Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2777
  return "$Trg.lfb";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2778
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2779
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2780
sub LinkerFeedBackOption() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2781
	return "" unless $useLinkerFeedBack;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2782
	my $BasicTrgType=&main::BasicTrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2783
	return "" unless ($BasicTrgType=~/^(DLL|EXE)/o);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2784
	my $file = LinkerFeedBackFile();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2785
	return "/$(FEEDBACK_FILE_OPTION) $file ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2786
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2787
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2788
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2789
sub getConfigVariable
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2790
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2791
    my ($variable) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2792
    initialiseConfigVariables();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2793
    return $configVariables{$variable};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2794
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2795
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2796
sub initialiseConfigVariables()
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2797
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2798
    if (!keys(%configVariables))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2799
    {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2800
		%configVariables = BPABIutl_Get_Config_Variables($PlatName);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2801
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2802
		if (!keys(%configVariables))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2803
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2804
			# no variables were extracted from configuration file.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2805
			&main::FatalError("Cannot extract configuration variables for $PlatName");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2806
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2807
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2808
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2809
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2810
sub PMSupportsFeatureVariants
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2811
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2812
	return 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2813
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2814
# modified start: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2815
sub checkVMAPFiles
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2816
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2817
	my %srcSet = %{&main::getSrcSet};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2818
	my %featureVariantInfo = &main::FeatureVariantInfo();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2819
	my $vmapfile = &main::Trg.".".$featureVariantInfo{NAME}.".vmap";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2820
	my $mmpFile = &main::MmpFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2821
	if ( $vmapfile ){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2822
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2823
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2824
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2825
			"# Rules to check out the VMAP files",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2826
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2827
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2828
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2829
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2830
			"CHECKVMAPUREL : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2831
			"\$(EPOCTRG)\\urel\\",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2832
			$vmapfile,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2833
			" \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2834
			"\$(EPOCTRG)\\urel\\",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2835
			$vmapfile,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2836
			" : \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2837
			"\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2838
			$mmpFile,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2839
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2840
		foreach my $srcfile (sort keys(%srcSet))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2841
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2842
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2843
				" \\\n \t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2844
				$srcfile,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2845
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2846
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2847
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2848
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2849
			"\t-\$(ERASE) \$(EPOCTRG)\\urel\\",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2850
			$vmapfile,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2851
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2852
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2853
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2854
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2855
			"CHECKVMAPUDEB : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2856
			"\$(EPOCTRG)\\udeb\\",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2857
			$vmapfile,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2858
			" \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2859
			"\$(EPOCTRG)\\udeb\\",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2860
			$vmapfile,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2861
			" : \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2862
			"\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2863
			$mmpFile,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2864
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2865
		foreach my $srcfile (sort keys(%srcSet))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2866
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2867
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2868
				" \\\n \t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2869
				$srcfile,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2870
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2871
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2872
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2873
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2874
			"\t-\$(ERASE) \$(EPOCTRG)\\udeb\\",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2875
			$vmapfile,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2876
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2877
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2878
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2879
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2880
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2881
# modified by SV end: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2882
# modified end: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2883
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2884
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2885
1;