sbsv1/abld/platform/cl_arm.pm
author lorewang
Wed, 10 Nov 2010 14:19:09 +0800
changeset 676 b5e6747818a9
parent 631 9435b9008a58
permissions -rw-r--r--
add rofs image compare
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    17
package Cl_arm;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    18
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    19
my $ToolPrefix='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    20
my %PlatOpt=(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    21
	'Dlltool'=>'',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    22
	'Entry'=>'-e',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    23
	'Ld'=>'',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    24
	'Elftran'=>'',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    25
);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    26
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    27
# takes an 'expression'  to evaluate with $_ bound to each of the 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    28
# remaining args
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    29
sub PrintList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    30
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    31
    my $expr = shift @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    32
    foreach (@_) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    33
	my $str = eval($expr);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    34
	&main::Output($str);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    36
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    37
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    38
# specify floating point model here
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
my $floatingpointmodel = "softvfp";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
if (&main::ARMFPU && (&main::ARMFPU =~ /^VFPV2$/i)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    42
	$floatingpointmodel = "vfpv2";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    43
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    44
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
my $Archive;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
my $Link;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47
my $Objcopy;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    48
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    49
require Exporter;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    50
@ISA=qw(Exporter);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    51
@EXPORT=qw(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    52
	PMHelp_Mmp
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    53
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    54
	PMPlatProcessMmp
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    55
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    56
	PMStartBldList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    57
		PMBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    58
	PMStartSrcList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    59
		PMBitMapBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    60
		PMResrcBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    61
		PMStartSrc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    62
		PMAifBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    63
		PMSrcDepend
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    64
			PMSrcBldDepend
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    65
			PMEndSrcBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    66
		PMEndSrc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    67
	PMEndSrcList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    68
	PMPrefixFile
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    69
	PMSupportsFeatureVariants
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    70
);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    71
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    72
use Cwd;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    73
use Armutl;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    74
use RVCT_plat2set;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    75
use cl_generic;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    76
use E32env;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    77
use Genutl;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    78
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    79
use constant NOCOMPRESSIONMETHOD => 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    80
use constant INFLATECOMPRESSIONMETHOD => 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    81
use constant BYTEPAIRCOMPRESSIONMETHOD => 2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    82
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    83
use constant NON_DEBUGGABLE => 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    84
use constant DEBUGGABLE => 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    85
use constant DEBUGGABLE_UDEBONLY => 2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    86
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    87
use constant NOTPAGED => 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    88
use constant UNPAGED => 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    89
use constant PAGED => 2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    90
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    91
sub PMHelp_Mmp {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    92
    &Armutl_Help_Mmp;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    93
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    94
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    95
my $Plat=main::Plat();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    96
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    97
my ($RVCTMajorVersion, $RVCTMinorVersion, $RVCTBuildNumber) = RVCT_plat2set::get_version_list($Plat); 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    98
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    99
my $RVCTVersion = "${RVCTMajorVersion}_${RVCTMinorVersion}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   100
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   101
my $ARMCCVersion = "${RVCTMajorVersion}${RVCTMinorVersion}0${RVCTBuildNumber}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   102
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   103
my $oP = '--';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   104
$oP = '-' if ($RVCTMajorVersion == 2 && $RVCTMinorVersion < 2);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   105
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   106
#Check if Function call Logger is enabled
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   107
my $Function_Call_Logger=&main::IsFunctionCallLogging();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   108
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   109
# Get the information regarding supporting Compiler Wrapper Option
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   110
my $IsCompilerWrapperOption=&main::CompilerWrapperOption();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   111
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   112
#Check the existence of elf2e32.exe in the system path
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   113
my $IsExistELF2E32EXE = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   114
    open ELF2E32PIPE, "elf2e32 2>&1 |";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   115
    while (<ELF2E32PIPE>) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   116
	if($_=~/^Symbian Post Linker\, Elf2E32/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   117
	    $IsExistELF2E32EXE = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   118
	    last;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   119
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   120
	next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   121
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   122
    close ELF2E32PIPE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   123
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   124
my $ArmIncDir;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   125
my @ArmLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   126
my $ArmRT = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   127
my %AsmFiles = ();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   128
my %AsmDirs = ();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   129
my $oe_options = '';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   130
my $NamedSymLkup = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   131
my $symNameLkupOpt = '';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   132
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   133
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   134
sub PMPlatProcessMmp (@) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   135
        &Armutl_DoMmp(@_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   136
	$ArmIncDir = RVCT_plat2set::get_inc_path($Plat);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   137
	&main::SetStdIncPaths($ArmIncDir);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   138
	@ArmLibList = &Armutl_ArmLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   139
	$ArmRT = &Armutl_ArmRT;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   140
	my @AsmFileList = &Armutl_AsmFileList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   141
	foreach (@AsmFileList) { $AsmFiles{ucfirst lc $_} = 1; }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   142
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   143
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   144
sub SysTrg () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   145
	return 1 if &main::SystemTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   146
	my $ExportLibrary=&main::ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   147
	return 1 if ($ExportLibrary =~ /EKERN/i);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   148
	my $Trg=&main::Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   149
	return 1 if ($Trg =~ /KSRT/i);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   150
	return 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   151
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   152
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   153
my $RVCT20 = 0; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   154
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   155
# suppress these warnings & errors
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   156
#Warning: #66-D: enumeration value is out of "int" range 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   157
# "EUSER\CBASE\Ub_act.cpp", line 20: Warning:  #161-D: unrecognized #pragma
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   158
# 611: overloaded virtual function "entity" is only partially overridden in <entitykind> "entity"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   159
# "EUSER\CBASE\Ub_act.cpp", line 256: Warning:  #654-D: declaration modifiers are incompatible with previous declaration
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   160
# 997: <entity-kind> "entity" is hidden by "entity" -- virtual function override intended?
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   161
# "EPOC32\include\s32stor.h", line 354: Error:  #1152-D: polymorphic base classes need to be exported as well
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   162
# "INCLUDE\e32base.h", line 31: Warning:  #1300-D: ~CBufBase inherits implicit virtual
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   163
#"COMPSUPP\\RVCT2_1\\Dfpaeabi.cpp", line 87: Warning: A1488W: PROC/FUNC at line 9 without matching ENDP/ENDFUNC
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   164
#"COMPSUPP\\RVCT2_1\\Dfpaeabi.cpp", line 85: Warning: A1464W: ENDP/ENDFUNC without corresponding PROC/FUNC
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   165
#Warning: L6318W: _integrator_cm1136_ekern.in(.text) contains branch to a non-code symbol FindMostSignificantOne(unsigned long).
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   166
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   167
my $diag_suppressions = '--diag_suppress 66,161,611,654,997,1152,1300,1464,1488,6318,6331';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   168
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   169
# downgrade from errors to warnings
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   170
my $diag_warnings = '';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   171
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   172
# upgrade from warnings to errors
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   173
# Warning:  #1267-D: Implicit physical register R0 should be defined as a variable
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   174
my $diag_errors = '--diag_error 1267';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   175
  
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   176
my $commonOptions = $RVCT20 ?
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   177
  "$diag_suppressions $diag_warnings $diag_errors" :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   178
  "$diag_suppressions $diag_warnings $diag_errors";  
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   179
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   180
my @mmpOption = &main::ReplaceOptions("ARMCC");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   181
my $CompilerOption = &main::CompilerOption("ARMCC");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   182
my $contingentOptions;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   183
my $thumbOptions = $RVCT20 ? '-thumb' : '--thumb ';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   184
my $armOptions = $RVCT20 ? '-arm' : '--arm ';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   185
my $kernelOptions = $RVCT20 ? '-arm' : '--arm --no_exceptions --no_exceptions_unwind';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   186
my $invariantOptions = $RVCT20 ? 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   187
  '-cpu 5T --enum_is_int -Ono_known_library --export_vtbl -apcs /inter' :
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   188
  '--cpu 5T --enum_is_int -Ono_known_library --fpmode ieee_no_fenv --export_all_vtbl --no_vfe --apcs /inter';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   189
$invariantOptions .= ' --dllimport_runtime' unless ($RVCTMajorVersion == 2 && $RVCTMinorVersion < 2);  
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   190
my $exceptions = $RVCT20 ? '' : ' --exceptions --exceptions_unwind';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   191
my $floatingpoint = $RVCT20 ? '' : ' --fpu '.$floatingpointmodel.'';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   192
my @FCLogger_Macros; # Macros required to be passed to the FCLogger
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   193
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   194
my $useLinkerFeedBack = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   195
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   196
sub LinkerFeedBackFile() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   197
  return unless $useLinkerFeedBack;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   198
  my $Trg = &main::Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   199
  return "$Trg.lfb";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   200
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   201
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   202
sub LinkerFeedBackOption() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   203
  return "" unless $useLinkerFeedBack;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   204
  my $BasicTrgType=&main::BasicTrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   205
  return "" unless ($BasicTrgType=~/^(DLL|EXE)/o);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   206
  my $file = LinkerFeedBackFile();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   207
  return "--feedback $file ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   208
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   209
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   210
my %BSF_keywords = (
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   211
		    COMMON_OPTIONS => 1,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   212
		    THUMB_OPTIONS => 1,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   213
		    ARM_OPTIONS => 1,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   214
		    KERNEL_OPTIONS => 1,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   215
		    INVARIANT_OPTIONS => 1
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   216
		   );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   217
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   218
sub Read_BSF_Options() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   219
        my %plat = (main::PlatRec());
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   220
	my @Customization_Data = split(/\n/,$plat{'CUSTOMIZATION_DATA'});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   221
	foreach my $option (@Customization_Data) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   222
			next if ($option =~ /^$/);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   223
	        warn "Unrecognized BSF syntax: $option.\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   224
		        unless ($option =~ /\s*(\S+)\s+(.+)$/);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   225
		my $key = uc $1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   226
		my $val = $2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   227
	        warn "Unrecognized BSF keyword: $key.\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   228
		        unless ($BSF_keywords{$key});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   229
		if ($key =~ /COMMON_OPTIONS/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   230
		        Set_BSF_Options(\$commonOptions,$val);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   231
			next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   232
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   233
		if ($key =~ /THUMB_OPTIONS/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   234
		        Set_BSF_Options(\$thumbOptions,$val);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   235
			next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   236
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   237
		if ($key =~ /ARM_OPTIONS/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   238
		        Set_BSF_Options(\$armOptions,$val);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   239
			next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   240
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   241
		if ($key =~ /KERNEL_OPTIONS/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   242
		        Set_BSF_Options(\$kernelOptions,$val);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   243
			next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   244
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   245
		if ($key =~ /INVARIANT_OPTIONS/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   246
		        Set_BSF_Options(\$invariantOptions,$val);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   247
			next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   248
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   249
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   250
	}		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   251
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   252
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   253
# Set the options passed from BSF file 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   254
# @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
   255
# @param Options       - List of options read from the BSF keyword
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   256
sub Set_BSF_Options($$)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   257
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   258
	my ($OptionName,$Options) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   259
	my @Fragments=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   260
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   261
	# Check if the value of BSF option is to be set or added/removed.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   262
	if($Options =~ /\+\[.*\]\+|\-\[.*\]\-/)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   263
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   264
		if (@Fragments = Split_BSF_Options($Options,'RemoveOptions'))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   265
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   266
			foreach my $Opt (@Fragments) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   267
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   268
				# Remove trailing white spaces
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   269
				$Opt =~ s/\s+$//;				
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   270
				$$OptionName =~ s/$Opt//g;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   271
			}					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   272
			@Fragments=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   273
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   274
		if (@Fragments = Split_BSF_Options($Options,'AddOptions')) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   275
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   276
			$$OptionName .= " @Fragments";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   277
			@Fragments=();
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
		# Warn if options are not present in the form '+[...]+' or '-[...]-'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   281
		$Options =~ s/\+\[.*?\]\+|\-\[.*?\]\-//g;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   282
		if($Options !~ /^\s*$/)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   283
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   284
			print "Warning: Ignoring option(s) \"$Options\" specified in BSF as option(s) should be in the form '+[...]+' or '-[...]-.\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   285
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   286
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   287
	else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   288
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   289
		$$OptionName = $Options;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   290
	}		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   291
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   292
	&main::Output(					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   293
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   294
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   295
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   296
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   297
# Split BSF options to find options which are to be added/removed
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   298
# @param String      - List of options present in form '+[...]+' or '-[....]-'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   299
# @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
   300
sub Split_BSF_Options($$)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   301
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   302
	my ($String,$Task) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   303
    my @Result = ();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   304
	my @Fragments = ();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   305
	my $Pattern = '';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   306
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   307
	if ($Task eq 'AddOptions')
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   308
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   309
		# Get the options which are to be added (present in the form '+[...]+')
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   310
		@Fragments = $String =~ /\+\[(.*?)\]\+/g;	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   311
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   312
	elsif ($Task eq 'RemoveOptions') 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   313
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   314
		# Get the options which are to be removed (present in the form '-[...]-')
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   315
		@Fragments = $String =~ /\-\[(.*?)\]\-/g;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   316
	}	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   317
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   318
	# 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
   319
	# Option prefix for RVCT can be '-' or '--'.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   320
	$Pattern = '-{1,2}\S+\s*(?!-)\S*';	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   321
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   322
	foreach my $Val (@Fragments) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   323
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   324
		my @Opt = $Val =~ /$Pattern/g;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   325
		push @Result,@Opt;		 		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   326
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   327
	return @Result;	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   328
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   329
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   330
sub ComputeCompilerOpts() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   331
	my %plat = &main::PlatRec();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   332
	Read_BSF_Options() if ($plat{'CUSTOMIZES'});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   333
	my $ABI=&main::ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   334
	my $TrgType=&main::TrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   335
	if (SysTrg()) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   336
	        $contingentOptions = $kernelOptions.$floatingpoint;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   337
        } elsif (main::BuildAsARM() or ($ABI eq 'ARMV4')) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   338
	        $contingentOptions = $armOptions.$floatingpoint.$exceptions;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   339
	    } else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   340
			$contingentOptions = $thumbOptions.$floatingpoint.$exceptions.' -D__MARM_THUMB__';	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   341
			push @FCLogger_Macros, '__MARM_THUMB__';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   342
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   343
	# support for ARMV4
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   344
	my $invopts = "$invariantOptions";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   345
	if ($ABI eq 'ARMV4') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   346
		$invopts =~ s/5T/4/;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   347
		$invopts =~ s/inter/nointer/;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   348
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   349
		$contingentOptions .= ' -D__MARM_INTERWORK__';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   350
		push @FCLogger_Macros, '__MARM_INTERWORK__';
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
	#Options to export all the external symbols for OE DLL , OE Exe and OE Static Lib
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   354
	if ($TrgType=~/^STDDLL$/o || $TrgType=~/^STDEXE$/o || $TrgType=~/^STDLIB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   355
		$oe_options=' --no_hide_all';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   356
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   357
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   358
	return $commonOptions.' '.$contingentOptions.' '.$invopts.' '.$oe_options.' '.&main::CompilerOption("ARMCC");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   359
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   360
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   361
my $Makecmd;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   362
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   363
sub PMStartBldList($) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   364
	($Makecmd) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   365
	my $ABI=&main::ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   366
	my $BaseTrg=&main::BaseTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   367
	my $BasicTrgType=&main::BasicTrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   368
	my @BldList=&main::BldList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   369
	my @ChopSysIncPaths=&main::Path_Chop(&main::SysIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   370
	my @ChopUserIncPaths=&main::Path_Chop(&main::UserIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   371
	my $DefFile=&main::DefFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   372
	my $EPOCPath=&main::EPOCPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   373
	my $LinkAs=&main::LinkAs;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   374
	my $LibPath=&main::LibPath.'LIB\\';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   375
	my @MacroList=&main::MacroList();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   376
	push @MacroList, "__SUPPORT_CPP_EXCEPTIONS__";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   377
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   378
	my $VariantFile=&main::VariantFile();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   379
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   380
	my $Plat=&main::Plat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   381
	my $Trg=&main::Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   382
	if ($RVCTMajorVersion == 2 && $RVCTMinorVersion < 2) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   383
		if ($BasicTrgType=~/^LIB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   384
			# Temporary Workaround for RVCT2.1 static libs problem with RVCT2.2 builds
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   385
			# Rename all the static libs produced with RVCT2.1 as {libname}2_1.lib
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   386
		        if ($Trg=~/^\s*(\S+)(\.lib)$/io) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   387
			        if ($1!~/$RVCTVersion/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   388
				        $Trg=$1.$RVCTVersion.".lib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   389
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   390
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   391
			if ($BaseTrg!~/$RVCTVersion/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   392
			        $BaseTrg .= $RVCTVersion;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   393
			}
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   397
	my $TrgType=&main::TrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   398
	my @UidList=&main::UidList;	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   399
    my $SystemTrg = &main::SystemTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   400
    my $ExportLibrary=&main::ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   401
    my $NoExportLibrary=&main::NoExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   402
    # N.B. should get better way to detect kernel probably!!
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   403
    $SystemTrg = 1 if ($ExportLibrary =~ /EKERN/i);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   404
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   405
    # N.B. should get better way to detect this
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   406
    $SystemTrg = 1 if ($Trg =~ /KSRT/i);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   407
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   408
	my %Version = &main::Version();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   409
	my $ExtraExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   410
	my $PrimaryExportLibrary = $ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   411
	unless ($Version{explicit}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   412
		$ExtraExportLibrary = $ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   413
		$ExtraExportLibrary =~ s/\{(\d|a|b|c|d|e|f){8}\}//i;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   414
		$PrimaryExportLibrary = $ExtraExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   415
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   416
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   417
#	set up LinkAs
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   418
	$UidList[2]=~/^0x(.*)$/o;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   419
	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
   420
		$LinkAs=join '', &main::Path_Split('Base',$LinkAs),"[$1]",&main::Path_Split('Ext',$LinkAs);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   421
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   422
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   423
#	work out the flags for various platforms
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   424
	unless ($ABI eq 'ARMV5' or $ABI eq 'ARMV4') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   425
		&main::FatalError("Platform module - ABI \"$ABI\" unrecognised");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   426
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   427
	my $ComputeCompilerOpts=ComputeCompilerOpts();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   428
	if (@mmpOption) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   429
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   430
		my $pattern = '-{1,2}\S+\s*(?!-)\S*';	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   431
		foreach my $options (@mmpOption) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   432
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   433
			my @opts = $options =~ /$pattern/g;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   434
			my $count = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   435
			while ($count <= $#opts) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   436
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   437
				my $opt;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   438
				my $rep;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   439
				if ($opts[$count] =~ /^(\S+)\s+(\S+)$/) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   440
				{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   441
					$opt = $1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   442
					$rep = $2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   443
					$ComputeCompilerOpts =~ s/$opt\s+\S+\s+/ $opt $rep /g;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   444
					$count++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   445
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   446
				else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   447
				{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   448
					$opt = $opts[$count];
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   449
					$rep = $opts[$count+1];
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   450
					$ComputeCompilerOpts =~ s/$opt/$rep/g;					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   451
					$count+=2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   452
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   453
			}		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   454
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   455
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   456
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   457
	$PlatOpt{Arm} = $ComputeCompilerOpts;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   458
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   459
	my $InterWorking = ($ABI eq 'ARMV4') ? "" : "--inter";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   460
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   461
	$Archive=$ToolPrefix.'armar';
631
9435b9008a58 ROM Tools 13.1.0.1
Zheng Shen <zheng.shen@nokia.com>
parents: 599
diff changeset
   462
	$Link=$ToolPrefix."armlink ${oP}diag_suppress 6331,6780,6319 --keep *(.init) --keep *(.fini) --keep *(.init_array) --keep *(.fini_array)";
599
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   463
	$Objcopy=$ToolPrefix.'objcopy';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   464
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   465
	&Generic_Header(0,$Makecmd);	# define standard things using absolute paths
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   466
		 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   467
	if ($Makecmd eq "nmake") {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   468
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   469
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   470
  			"PATH=",&main::Path_Drive,$EPOCPath,"gcc\$(PBUILDPID)\\bin;\$(PATH)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   471
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   472
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   473
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   474
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   475
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   476
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   477
			"# must set both PATH and Path to make it work correctly\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   478
  			"Path:=",&main::Path_Drive,$EPOCPath,"gcc\$(PBUILDPID)\\bin;\$(Path)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   479
			"PATH:=\$(Path)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   480
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   481
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   482
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   483
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   484
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   485
		"INCDIR  ="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   486
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   487
	PrintList("\" -J \$_\"", @ChopUserIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   488
	PrintList("\" -J \$_\"", @ChopSysIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   489
	if ($ArmIncDir) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   490
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   491
		    " -J \"$ArmIncDir\" ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   492
		);	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   493
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   494
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   495
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   496
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   497
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   498
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   499
	#Function Call Logger
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   500
	if ($Function_Call_Logger)	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   501
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   502
			"INCDIR_FCLOGGER  ="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   503
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   504
		PrintList("\" -I \$_\"", @ChopUserIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   505
		PrintList("\" -I \$_\"", @ChopSysIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   506
		if ($ArmIncDir) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   507
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   508
				" -I \"$ArmIncDir\" "
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
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   512
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   513
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   514
		);
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
		"ARMCCFLAGS=$PlatOpt{Arm} -c\\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   519
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   520
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   521
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   522
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   523
		"ARMCCDEFS = "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   524
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   525
	PrintList("\" -D\$_\"", @MacroList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   526
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   527
	if($VariantFile) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   528
		if ($Function_Call_Logger) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   529
			#FC Logger accepts product include file without path
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   530
			my $file=&main::Path_Split('File', ${VariantFile});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   531
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   532
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   533
				" -D\"__PRODUCT_INCLUDE__=\\\"${file}\\\"\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   534
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   535
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   536
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   537
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   538
				" -D__PRODUCT_INCLUDE__=\\\"${VariantFile}\\\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   539
			);
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
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   544
		" \$(USERDEFS)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   545
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   546
	);
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 ($TrgType=~/^STDDLL$/o || $TrgType=~/^STDEXE$/o){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   550
#	For now, named symbol lookup is enabled only for the STD binaries. Later, it may be enabled based on an mmp 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   551
#	keyword.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   552
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   553
		$NamedSymLkup = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   554
		$symNameLkupOpt = '--sym_name_lkup';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   555
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   556
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   557
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   558
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   559
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   560
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   561
			"ARMCC$_ = armcc"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   562
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   563
		if(&main::DebugSwitchUsed() ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   564
#			when the debug switch is specified and enabled, set the compiler's debug flag for both udeb or urel.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   565
#			when the debug switch is disabled, don't set the compiler's debug flag for either udeb or urel.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   566
#			The optimization option is set only based on the build i.e., Udeb or Urel and is independent of
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   567
#			whether debug is enabled or not. This might give a poorer debug view for debug-enabled Urel build.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   568
			if(&main::SymbolicDebugEnabled() ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   569
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   570
						  ' -g'
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
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   574
		elsif (/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   575
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   576
				      ' -g'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   577
			);
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
		if (/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   581
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   582
				      ' -O0'
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
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   586
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   587
				      ' -O2'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   588
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   589
		}		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   590
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   591
			' $(ARMCCFLAGS)'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   592
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   593
		my @ml = &main::MacroList($_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   594
		PrintList("\" -D\$_\"", @ml);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   595
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   596
			" \$(ARMCCDEFS)\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   597
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   598
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   599
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   600
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   601
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   602
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   603
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   604
	#Function call logger
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   605
	if ($Function_Call_Logger)	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   606
		#Send all the debug macros to logger
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   607
		foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   608
			&main::Output (
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   609
				"FCLOGGER$_ = ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   610
				$EPOCPath, 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   611
				"tools\\fc_logger\\edgcpfe"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   612
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   613
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   614
			my @ml = &main::MacroList($_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   615
			push @ml, "__ARMCC_VERSION=$ARMCCVersion";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   616
			PrintList("\" -D\$_\"", @ml);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   617
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   618
				" \$(ARMCCDEFS)"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   619
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   620
			PrintList("\" -D\$_\"", @FCLogger_Macros);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   621
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   622
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   623
				"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   624
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   625
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   626
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   627
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   628
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   629
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   630
			"$_ :"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   631
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   632
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   633
		if ($BasicTrgType !~ /IMPLIB/io) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   634
			&main::Output (
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   635
				" \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   636
				&Generic_Quote("\$(EPOCTRG$_)\\".&main::Trg($_))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   637
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   638
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   639
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   640
#		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
   641
		if ($DefFile and not &main::ExportUnfrozen) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   642
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   643
				" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   644
				"\tLIBRARY\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   645
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   646
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   647
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   648
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   649
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   650
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   651
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   652
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   653
	# Resource building is done entirely via cl_generic.pm
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   654
	PrintList("\"\nRESOURCE\$_ : MAKEWORK\$_\"", @BldList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   655
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   656
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   657
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   658
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   659
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   660
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   661
		"LIBRARY : MAKEWORKLIBRARY"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   662
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   663
	if ($BasicTrgType=~/^LIB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   664
#		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
   665
	        PrintList("\" \$_\"", @BldList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   666
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   667
	elsif ($DefFile and !$NoExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   668
		unless (&main::ExportUnfrozen) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   669
			if (-e $DefFile) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   670
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   671
					" ", &Generic_Quote("\$(EPOCLIB)\\LIB\\$PrimaryExportLibrary.lib"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   672
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   673
				# if elf2e32.exe(postlinker) exists, then generate .dso along with .lib
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   674
				if ($IsExistELF2E32EXE) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   675
					&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   676
						" ", &Generic_Quote("\$(EPOCLIB)\\LIB\\$PrimaryExportLibrary.dso"), "\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   677
					);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   678
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   679
				else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   680
					&main::Output("\n");
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
			else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   684
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   685
					"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   686
					"\t\@echo WARNING: Not attempting to create any import libraries.\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   687
					"\t\@echo When exports are frozen in \"$DefFile\", regenerate Makefile.\n"
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
		} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   691
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   692
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   693
				"\t\@echo Not attempting to create \"\$(EPOCLIB)\\LIB\\$PrimaryExportLibrary.lib\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   694
				"\t\@echo from frozen .DEF file, since EXPORTUNFROZEN specified.\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   695
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   696
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   697
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   698
		my $theDefFile = $DefFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   699
		$theDefFile = "\$(EPOCBLD)\\$BaseTrg.def" unless (-e $DefFile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   700
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   701
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   702
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   703
			"# REAL TARGET - LIBRARY\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   704
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   705
			&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExportLibrary.lib"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   706
			&Generic_Quote($DefFile), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   707
				"\tperl -S prepdef.pl ", &Generic_Quote($DefFile), " \"\$(EPOCBLD)\\$ExportLibrary.prep.def\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   708
				"\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
   709
			"\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
   710
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   711
		 );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   712
		if ($ExtraExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   713
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   714
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   715
				&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExtraExportLibrary.lib"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   716
				&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExportLibrary.lib"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   717
				"\tcopy \"\$<\" \"\$@\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   718
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   719
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   720
		#if elf2e32.exe(postlinker) exists, then generate .dso(which will be used by ABIV2 platforms)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   721
		if ($IsExistELF2E32EXE) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   722
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   723
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   724
				&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExportLibrary.dso"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   725
				&Generic_Quote($DefFile), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   726
					"\telf2e32 --definput=\"\$(EPOCBLD)\\$ExportLibrary.prep.def\" --dso=",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   727
					&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExportLibrary.dso"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   728
					" --linkas=$LinkAs\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   729
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   730
			if ($ExtraExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   731
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   732
					"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   733
					&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExtraExportLibrary.dso"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   734
					&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExportLibrary.dso"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   735
					"\tcopy \"\$<\" \"\$@\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   736
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   737
			}		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   738
		}		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   739
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   740
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   741
	my $freezeDir = &main::Path_Split('Path', $DefFile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   742
	chop($freezeDir);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   743
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   744
	# dummy rule for def files to cope with filename case differences
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   745
	unless (&main::ExportUnfrozen) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   746
		if (-e $DefFile) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   747
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   748
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   749
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   750
				&Generic_Quote($DefFile), " : ", "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   751
				"\t\@rem Do nothing\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   752
			);
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   756
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   757
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   758
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   759
		&Generic_Quote($freezeDir), " : ", "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   760
		"\tperl -S emkdir.pl \$\@\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   761
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   762
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   763
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   764
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   765
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   766
		"FREEZE : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   767
		&Generic_Quote($freezeDir), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   768
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   769
	if ($DefFile and $BasicTrgType!~/^IMPLIB$/io) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   770
# 	    call perl on the script here so make will die if there are errors 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   771
#           - this doesn't happen if calling perl in a batch file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   772
	    &main::Output( "\tperl -S efreeze.pl \$(EFREEZE_ALLOW_REMOVE) \"$DefFile\" \"\$(EPOCBLD)\\$ExportLibrary.def\" \n" );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   773
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   774
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   775
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   776
		"CLEANLIBRARY :\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   777
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   778
	if ($DefFile and !$NoExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   779
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   780
			"\t-\$(ERASE) \"\$(EPOCLIB)\\LIB\\$ExportLibrary.lib\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   781
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   782
		if ($ExtraExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   783
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   784
				"\t-\$(ERASE) \"\$(EPOCLIB)\\LIB\\$ExtraExportLibrary.lib\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   785
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   786
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   787
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   788
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   789
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   790
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   791
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   792
	&Generic_MakeWorkDir('MAKEWORKLIBRARY',"${LibPath}");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   793
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   794
	&Generic_Releaseables;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   795
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   796
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   797
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   798
sub PMBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   799
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   800
	my $ABI=&main::ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   801
    my @ASSPLibList=&main::ASSPLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   802
    my @SrcList=&main::SrcList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   803
    my @StringTables=&main::StringTables;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   804
    my $BaseTrg=&main::BaseTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   805
	my $FeatureVariantBaseTrg=&main::FeatureVariantBaseTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   806
    my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   807
    my $ChopBldPath=&main::Path_Chop(&main::BldPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   808
    my $DefFile=&main::DefFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   809
    my $EPOCIncPath=&main::EPOCIncPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   810
    my $FirstLib=&main::FirstLib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   811
    if ($RVCTMajorVersion == 2 && $RVCTMinorVersion < 2) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   812
	    # Temporary Workaround for RVCT2.1 static libs problem with RVCT2.2 builds
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   813
	    # Rename all the static libs used with RVCT2.1 as {libname}2_1.lib
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   814
	    if ($FirstLib=~/^\s*(\S+)(\.lib)$/io) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   815
		    if ($1!~/$RVCTVersion/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   816
			    $FirstLib=$1."${RVCTVersion}.lib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   817
		    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   818
	    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   819
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   820
    my $BasicTrgType=&main::BasicTrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   821
    my @LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   822
    my @RTLibList = $RVCT20 ?
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   823
      ('udfp.lib', 'udrt.lib', 'udrt.lib(VtblExports.o)'):
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   824
      ('dfpaeabi.lib', "dfprvct${RVCTVersion}.lib", 'drtaeabi.lib', 'drtaeabi.lib(VtblExports.o)');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   825
    if ( $RVCTVersion lt "2_2" ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   826
		push @RTLibList, "dfprvct${RVCTVersion}-thunk.lib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   827
		push @RTLibList, "drtrvct${RVCTVersion}.lib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   828
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   829
    else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   830
		# The scppnwdl.lib should come before drtrvct2_2.lib
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   831
		push @RTLibList, "scppnwdl.lib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   832
		push @RTLibList, "drtrvct${RVCTVersion}.lib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   833
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   834
    my $SystemTrg = &main::SystemTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   835
    my $LibPath= &main::LibPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   836
    my $LinkAs=&main::LinkAs;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   837
    my $ExportLibrary=&main::ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   838
    my $NoExportLibrary=&main::NoExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   839
    # N.B. should get better way to detect kernel probably!!
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   840
    $SystemTrg = 1 if ($ExportLibrary =~ /EKERN/i);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   841
    my $ChopRelPath=&main::Path_Chop(&main::RelPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   842
    my $RelPath=&main::RelPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   843
    my @StatLibList=&main::StatLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   844
    if ($RVCTMajorVersion == 2 && $RVCTMinorVersion < 2) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   845
	    # Temporary Workaround for RVCT2.1 static libs problem with RVCT2.2 builds
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   846
	    # Rename all the static libs used with RVCT2.1 as {libname}2_1.lib
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   847
	    for (my $i =0; $i < scalar(@StatLibList); $i++) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   848
		    if ($StatLibList[$i]=~/^\s*(\S+)(\.lib)$/io) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   849
			    if ($1!~/$RVCTVersion/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   850
				    $StatLibList[$i]=$1."${RVCTVersion}.lib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   851
			    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   852
		    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   853
	    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   854
    }	     
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   855
    my $StatLinkPath=&main::StatLinkPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   856
    my $Trg=&main::Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   857
    if ($RVCTMajorVersion == 2 && $RVCTMinorVersion < 2) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   858
	    if ($BasicTrgType=~/^LIB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   859
		    # Temporary Workaround for RVCT2.1 static libs problem with RVCT2.2 builds
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   860
		    # Rename all the static libs produced with RVCT2.1 as {libname}2_1.lib
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   861
		    if ($Trg=~/^\s*(\S+)(\.lib)$/io) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   862
			    if ($1!~/$RVCTVersion/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   863
				    $Trg=$1.$RVCTVersion.".lib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   864
			    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   865
		    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   866
		    if ($BaseTrg!~/$RVCTVersion/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   867
			    $BaseTrg .= $RVCTVersion;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   868
		    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   869
	    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   870
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   871
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   872
	#OE Glue Code
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   873
	my @oe_exe_libs=("libcrt0.lib");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   874
	my @oe_exe_libs_wchar=("libwcrt0.lib");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   875
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   876
	#OE Import Library List
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   877
	my @oe_import_library_list=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   878
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   879
    my $TrgType=&main::TrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   880
    my @UidList=&main::UidList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   881
	my $InterWorking = ($ABI eq 'ARMV4') ? "" : "--inter";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   882
	my %Version = &main::Version();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   883
	my $ExtraExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   884
	unless ($Version{explicit}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   885
		$ExtraExportLibrary = $ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   886
		$ExtraExportLibrary =~ s/\{(\d|a|b|c|d|e|f){8}\}//i;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   887
	}	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   888
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   889
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   890
    my $linkerDebugOpt = "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   891
    if(&main::DebugSwitchUsed() ){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   892
		if(&main::SymbolicDebugEnabled ()){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   893
#		set the linker's debug flag if the debug switch is specified and enabled.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   894
		$linkerDebugOpt = "${oP}debug ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   895
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   896
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   897
	elsif ($Bld =~ /DEB/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   898
	$linkerDebugOpt = "${oP}debug ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   899
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   900
    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   901
	if ($Bld =~ /DEB/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   902
	@LibList = &main::DebugLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   903
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   904
	@LibList = &main::LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   905
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   906
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   907
	if(not(grep /^euser.lib$/, @LibList)){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   908
		push @oe_import_library_list, "euser.lib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   909
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   910
	if(not (grep /^libc.lib$/i, @LibList)){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   911
		push @oe_import_library_list, "libc.lib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   912
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   913
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   914
#	set up $LinkAs
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   915
    $UidList[2]=~/^0x(.*)$/o;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   916
    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
   917
	$LinkAs=join '', &main::Path_Split('Base',$LinkAs),"[$1]",&main::Path_Split('Ext',$LinkAs);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   918
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   919
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   920
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   921
    # REAL TARGETS
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   922
    #-------------
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   923
    &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   924
		  "# REAL TARGET - BUILD VARIANT $Bld\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   925
		  "\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   926
		  );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   927
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   928
#	releasables
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   929
	my @releaseables;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   930
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   931
	push @releaseables, "$RelPath$Trg" if ($BasicTrgType!~/^IMPLIB$/io);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   932
	if ($BasicTrgType=~/^(DLL|EXE)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   933
		push @releaseables, "$RelPath$Trg.map";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   934
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   935
	if (-e $DefFile and !$NoExportLibrary) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   936
		push @releaseables, "$LibPath$ExportLibrary.lib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   937
		push @releaseables, "$LibPath$ExtraExportLibrary.lib" if ($ExtraExportLibrary);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   938
		#if elf2e32.exe(postlinker) exists in the $PATH, then include .dsos also into releasables list
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   939
		if ($IsExistELF2E32EXE) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   940
			push @releaseables, "$LibPath$ExportLibrary.dso";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   941
			push @releaseables, "$LibPath$ExtraExportLibrary.dso" if ($ExtraExportLibrary);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   942
		}		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   943
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   944
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   945
	push @releaseables, &main::FeatureVariantVMapFile() if &main::FeatureVariantVMapFile();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   946
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   947
		"WHAT$Bld : WHATGENERIC\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   948
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   949
		"CLEAN$Bld : CLEANBUILD$Bld CLEANRELEASE$Bld\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   950
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   951
		"CLEANBUILD$Bld : \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   952
		"\t\@perl -S ermdir.pl \"\$(EPOCBLD$Bld)\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   953
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   954
		"CLEANRELEASE$Bld : CLEANGENERIC\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   955
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   956
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   957
	&Generic_WhatCleanTargets($Bld, "WHAT$Bld", "CLEANRELEASE$Bld", @releaseables);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   958
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   959
	&Generic_MakeWorkDir("MAKEWORK$Bld",$ChopBldPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   960
	&Generic_MakeWorkDir("MAKEWORK$Bld",$ChopRelPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   961
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   962
	return if ($BasicTrgType=~/^IMPLIB$/io);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   963
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   964
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   965
		"LISTING$Bld : MAKEWORK$Bld"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   966
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   967
	foreach (@SrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   968
	    	my $BaseSrc = &main::Path_Split('Base', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   969
	    	my $Ext = &main::Path_Split('Ext', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   970
		if ($Ext =~ /cia/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   971
		    $BaseSrc = "$BaseSrc\_";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   972
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   973
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   974
			" \\\n\tLISTING$Bld$BaseSrc"
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
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   978
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   979
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   980
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   981
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   982
	# Compiler wrapper support starts
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   983
	if($IsCompilerWrapperOption)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   984
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   985
	 	my $Platcmpwrap=&main::Plat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   986
	 	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   987
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   988
			"COMPWRAP$Bld : OUTPUT_NAME = ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   989
			"$Platcmpwrap\_$Bld",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   990
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   991
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   992
	 	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   993
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   994
			"COMPWRAP$Bld : MAKEWORK$Bld"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   995
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   996
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   997
		foreach (@SrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   998
			my $BaseSrc = &main::Path_Split('Base', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   999
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1000
				" \\\n\tCOMPWRAP$Bld$BaseSrc"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1001
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1002
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1003
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1004
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1005
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1006
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1007
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1008
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1009
	# Compiler wrapper support
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1010
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1011
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1012
		"LIBS$Bld="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1013
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1014
	if ($BasicTrgType=~/^DLL$/o) { # Add the DLL stub library
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1015
		if ($RVCTMajorVersion == 2 && $RVCTMinorVersion < 2) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1016
			# Temporary Workaround for RVCT2.1 static libs problem with RVCT2.2 builds
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1017
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1018
				" \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1019
				&Generic_Quote("\$(EPOCSTATLINK$Bld)\\EDLLSTUB$RVCTVersion.lib")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1020
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1021
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1022
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1023
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1024
				" \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1025
				&Generic_Quote("\$(EPOCSTATLINK$Bld)\\EDLLSTUB.lib")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1026
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1027
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1028
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1029
	    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1030
        PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\\\$\(EPOCSTATLINK$Bld\)\\\\\$_\"\)", @StatLibList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1031
        PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\\\$\(EPOCLIB\)\\\\LIB\\\\\$_\"\)", @LibList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1032
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1033
		#OE Import Libraries 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1034
		if ( $TrgType=~/^STDEXE$/o || $TrgType=~/^STDDLL$/o ) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1035
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1036
			PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\\\$\(EPOCLIB\)\\\\LIB\\\\\$_\"\)", @oe_import_library_list);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1037
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1038
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1039
		#OE Glue Code
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1040
		if ($TrgType=~/^STDEXE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1041
			if (&main::IsWideCharMain()) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1042
				PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\\\$\(EPOCLIB\)\\\\$Bld\\\\\$_\"\)", @oe_exe_libs_wchar);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1043
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1044
			else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1045
				PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\\\$\(EPOCLIB\)\\\\$Bld\\\\\$_\"\)", @oe_exe_libs);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1046
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1047
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1048
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1049
        my $StaticRTLib = $RVCT20 ? "usrt20" : "usrt${RVCTVersion}" ;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1050
        # use ksrt for system code and usrt for user ARM code
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1051
        $StaticRTLib = "ksrt${RVCTVersion}" if ($SystemTrg);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1052
        &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1053
	        " \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1054
		&Generic_Quote("\$(EPOCSTATLINK$Bld)\\$StaticRTLib\.lib")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1055
		) unless ($Trg =~ /(U|K)SRT/i || ($BasicTrgType=~/^LIB$/o));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1056
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1057
	unless ($ArmRT || ($BasicTrgType=~/^LIB$/o)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1058
	    my $TargLib = "$ExportLibrary.lib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1059
		$TargLib =~ s/\{(\d|a|b|c|d|e|f){8}\}//i;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1060
	    unless ($SystemTrg) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1061
			foreach (@RTLibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1062
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1063
					" \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1064
					&Generic_Quote("\$(EPOCLIB)\\LIB\\$_")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1065
				) unless ($_ =~ /$TargLib/i);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1066
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1067
	    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1068
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1069
        PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\$_\"\)", @ArmLibList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1070
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1071
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1072
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1073
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1074
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1075
   	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1076
 		"\n# ADDITIONAL LINKER OPTIONS",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1077
 		"\nUSERLDFLAGS = ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1078
 		&main::LinkerOption("ARMCC"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1079
  		"\n\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1080
  	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1081
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1082
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1083
		"VTBLEXPORTS$Bld="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1084
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1085
        my $vtobj = quotemeta("(VtblExports.o)");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1086
        PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\\\$\(EPOCLIB\)\\\\LIB\\\\\$_$vtobj\"\)", @LibList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1087
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1088
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1089
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1090
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1091
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1092
	my $objectFiles = "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1093
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1094
	my $bldPath =	&main::BldPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1095
	my $replacement;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1096
# If LOCAL_BUILD_PATH is set replace the \epoc32\build with local setting
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1097
	if ( defined( $ENV{LOCAL_BUILD_PATH} ) )  {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1098
		$replacement = 	$ENV{"LOCAL_BUILD_PATH"};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1099
		my $epocroot=$ENV{"EPOCROOT"};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1100
		my $match = "\Q${epocroot}\EEPOC32\\\\BUILD";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1101
		$bldPath =~ s/${match}/${replacement}/;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1102
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1103
#	Must add StringTable obj files first to preserve Evalid results consistency.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1104
	foreach my $item (@StringTables) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1105
		$objectFiles .= $bldPath.$$item{BaseTrg}.".o\n" if !($$item{Hdronly});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1106
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1107
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1108
        &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1109
	        "OBJECTS$Bld="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1110
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1111
        foreach (@SrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1112
	    	my $BaseSrc = &main::Path_Split('Base', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1113
	    	my $Ext = &main::Path_Split('Ext', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1114
		if ($Ext =~ /cia/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1115
		    $BaseSrc = "$BaseSrc\_";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1116
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1117
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1118
	        &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1119
		        " \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1120
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1121
		      );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1122
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1123
#	Only add if not already added from @StringTables
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1124
	my $objectFile = $bldPath.$BaseSrc.".o\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1125
	$objectFile=~ s/\\/\\\\/g;    # escape the '\'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1126
	if ($objectFiles !~ m/$objectFile/i){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1127
		$objectFiles .= &main::BldPath.$BaseSrc.".o\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1128
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1129
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1130
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1131
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1132
        &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1133
	        "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1134
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1135
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1136
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1137
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1138
	# Create "via" file containing all object files in order to reduce
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1139
	# command line lengths in pertinent calls
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1140
	my $objectsViaFile = &main::CommandFile();	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1141
	&main::CreateExtraFile($objectsViaFile, $objectFiles);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1142
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1143
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1144
        if ($BasicTrgType=~/^LIB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1145
	        &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1146
		      &Generic_Quote("\$(EPOCTRG$Bld)\\$Trg"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1147
		      " : \$(OBJECTS$Bld)"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1148
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1149
        } else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1150
	        &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1151
		      &Generic_Quote("\$(EPOCTRG$Bld)\\$Trg"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1152
		      &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseTrg.in")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1153
	        );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1154
        }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1155
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1156
	if (-e $DefFile) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1157
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1158
			" ", &Generic_Quote($DefFile)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1159
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1160
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1161
	if ($BasicTrgType=~/^(EXE|DLL)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1162
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1163
			" ", &Generic_Quote("\$(EPOCSTATLINK$Bld)\\$FirstLib")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1164
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1165
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1166
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1167
		" \$(LIBS$Bld)"
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
#	generate an export object from the ordered .DEF file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1171
        if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/o || $TrgType=~/^EXEDLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1172
#       	make the .exp file a dependency for targets that have exports		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1173
		&main::Output(" ", &Generic_Quote("\$(EPOCBLD$Bld)\\$ExportLibrary.exp"), "\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1174
		if (&main::ExportUnfrozen) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1175
		    &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1176
			"\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
  1177
			"\t\t--deffile=\$(EPOCBLD$Bld)\\$ExportLibrary.def \\\n\t\t--linkAs=$LinkAs \\\n\t\t$InterWorking $symNameLkupOpt\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1178
		    );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1179
		    &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1180
		        "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1181
		        "\tcopy ", " \"\$(EPOCBLD$Bld)\\$ExportLibrary.lib\" ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1182
		        "\"\$(EPOCLIB)\\LIB\\$ExportLibrary.lib\"",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1183
		        "\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1184
		    );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1185
		    if ($ExtraExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1186
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1187
			    "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1188
			    "\tcopy \"\$(EPOCLIB)\\LIB\\$ExportLibrary.lib\" ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1189
			    "\"\$(EPOCLIB)\\LIB\\$ExtraExportLibrary.lib\"",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1190
			    "\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1191
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1192
		    }			    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1193
		    #if elf2e32.exe(postlinker) exists, then generate .dso(which will be used by ABIV2 platforms)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1194
		    if ($IsExistELF2E32EXE) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1195
			    &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1196
				    "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1197
				    "\telf2e32 --definput=\"\$(EPOCBLD$Bld)\\$ExportLibrary.def\" --dso=",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1198
				    "\$(EPOCLIB)\\LIB\\$ExportLibrary.dso --linkas=$LinkAs\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1199
			    );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1200
			    if ($ExtraExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1201
				    &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1202
					    "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1203
					    "\tcopy \"\$(EPOCLIB)\\LIB\\$ExportLibrary.dso\" ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1204
					    "\"\$(EPOCLIB)\\LIB\\$ExtraExportLibrary.dso\"",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1205
					    "\n"
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
		    }		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1209
	        }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1210
	} elsif($NamedSymLkup){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1211
#		For an EXE, generate the .exp to accomodate 0th ordinal
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1212
		&main::Output(" ", &Generic_Quote("\$(EPOCBLD$Bld)\\$ExportLibrary.exp"), "\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1213
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1214
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1215
	    &main::Output("\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1216
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1217
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1218
#       get rid of any -symbols produced .map file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1219
        if ($BasicTrgType=~/^(DLL|EXE)/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1220
	        &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1221
			"\t-\$(ERASE) \"\$(EPOCTRG$Bld)\\$Trg.map\" \n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1222
		);	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1223
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1224
#		Generate the dependency info - This is required to put the libraries in the same order
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1225
#		as mentioned in mmp.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1226
		if($NamedSymLkup) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1227
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1228
			"\tperl -S deputil.pl $InterWorking --path=\$(EPOCBLD$Bld) \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1229
			 "\t\t--out=$ExportLibrary \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1230
			 "\t\t--libpath=\$(EPOCLIB)\\LIB \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1231
			 "\t\t\$(LIBS$Bld)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1232
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1233
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1234
		my $AbsentSubst = '';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1235
        if ($BasicTrgType=~/^(DLL|EXE)/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1236
	        my $datalinkbase = "0x400000";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1237
	        $datalinkbase = &main::DataLinkAddress if (&main::DataLinkAddress);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1238
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1239
#               make sure the linker feedback file is writable if it exists.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1240
		my $lfbfile = LinkerFeedBackFile();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1241
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1242
			"\t\@if exist $lfbfile attrib -r $lfbfile\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1243
			) if $useLinkerFeedBack;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1244
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1245
		my $lfboption = LinkerFeedBackOption();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1246
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1247
	        &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1248
		        "\t$Link $linkerDebugOpt ${oP}shl ${oP}reloc ${oP}split ${oP}rw-base $datalinkbase  \\\n\t\t$lfboption${oP}noscanlib $PlatOpt{Ld}\\\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1249
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1250
			my $EntrySymbol;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1251
			if ($BasicTrgType=~/^DLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1252
				$EntrySymbol = '_E32Dll';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1253
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1254
			elsif ($BasicTrgType=~/^EXE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1255
				$EntrySymbol = '_E32Startup';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1256
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1257
			if ($EntrySymbol) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1258
				$AbsentSubst = " -absent $EntrySymbol";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1259
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1260
	        if ($BasicTrgType=~/^DLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1261
	            # get the right object file for the entry point
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1262
	            my $ObjFile = "UC_DLL_.o";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1263
	            if ($FirstLib =~ /EDEV/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1264
		            $ObjFile = "D_ENTRY_.o";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1265
	            }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1266
	            if ($FirstLib =~ /EKLL/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1267
		            $ObjFile = "L_ENTRY_.o";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1268
	            }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1269
	            if ($FirstLib =~ /EEXT/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1270
		            $ObjFile = "X_ENTRY_.o";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1271
	            }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1272
	            if ($FirstLib =~ /EVAR/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1273
		            $ObjFile = "V_ENTRY_.o";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1274
	            }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1275
	            &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1276
				    "\t\t${oP}entry _E32Dll \$(EPOCSTATLINK$Bld)\\$FirstLib($ObjFile) \$(EPOCSTATLINK$Bld)\\$FirstLib \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1277
				    "\t\t\$(EPOCBLD$Bld)\\$ExportLibrary.exp \\\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1278
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1279
	        } elsif ($BasicTrgType=~/^EXE$/o || $TrgType=~/^EXEXP$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1280
			    # get the right object file for the entry point
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1281
			    my $ObjFile = "UC_EXE_.o" ;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1282
			    if ($FirstLib =~ /KC_EXE/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1283
					$ObjFile = "K_ENTRY_.o";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1284
			    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1285
				# If building user-side under RVCT2.0.x, use 2.0.1 static library	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1286
				if ($RVCT20) { 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1287
					if ($ObjFile =~/UC_EXE_.o/i) { 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1288
						$FirstLib = "EEXE20.LIB"; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1289
					} 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1290
				} 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1291
			    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1292
			    &main::Output( "\t\t${oP}entry _E32Startup \$(EPOCSTATLINK$Bld)\\$FirstLib($ObjFile) \$(EPOCSTATLINK$Bld)\\$FirstLib \\\n" );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1293
			    if ($TrgType=~/^EXEXP$/o || $TrgType=~/^EXEDLL$/o || $NamedSymLkup) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1294
					&main::Output( "\t\t\$(EPOCBLD$Bld)\\$ExportLibrary.exp \\\n" );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1295
			    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1296
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1297
			if($NamedSymLkup) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1298
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1299
				"\t\t--edit \"\$(EPOCBLD$Bld)\\$ExportLibrary.dep\" \\\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1300
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1301
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1302
	        &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1303
		        "\t\t-o \"\$(EPOCBLD$Bld)\\$Trg\" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1304
		        "\t\t${oP}symbols ${oP}list \"\$(EPOCTRG$Bld)\\$Trg.map\" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1305
				"\t\t\$(EPOCBLD$Bld)\\$BaseTrg.in \\\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1306
			);
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\t\$(LIBS$Bld) \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1309
				"\t\t\$(VTBLEXPORTS$Bld) \$(USERLDFLAGS) \n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1310
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1311
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1312
	        if(&main::DebugSwitchUsed() ){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1313
				if(&main::SymbolicDebugEnabled() ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1314
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1315
					"\tcopy \"\$(EPOCBLD$Bld)\\$Trg\" \"\$(EPOCTRG$Bld)\\$FeatureVariantBaseTrg.sym\"\n"
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
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1319
	        elsif ($Bld=~/^UDEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1320
	               &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1321
			       "\tcopy \"\$(EPOCBLD$Bld)\\$Trg\" \"\$(EPOCTRG$Bld)\\$FeatureVariantBaseTrg.sym\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1322
		       );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1323
	        }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1324
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1325
		if (&main::CompressTarget) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1326
		    &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1327
			    "\telftran $PlatOpt{Elftran} -version ", &Genutl_VersionToUserString(%Version), " -sid ", &main::SecureId(), " ", " -nocompress "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1328
				 );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1329
		    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1330
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1331
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1332
			if(&main::CompressTargetMode==NOCOMPRESSIONMETHOD){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1333
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1334
					"\telftran $PlatOpt{Elftran} -version ", &Genutl_VersionToUserString(%Version), " -sid ", &main::SecureId(), " "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1335
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1336
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1337
			elsif(&main::CompressTargetMode==INFLATECOMPRESSIONMETHOD){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1338
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1339
				"\telftran $PlatOpt{Elftran} -version ", &Genutl_VersionToUserString(%Version), " -sid ", &main::SecureId(), " ", "  -compressionmethod deflate"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1340
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1341
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1342
			elsif(&main::CompressTargetMode==BYTEPAIRCOMPRESSIONMETHOD){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1343
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1344
					"\telftran $PlatOpt{Elftran} -version ", &Genutl_VersionToUserString(%Version), " -sid ", &main::SecureId(), " ", "  -compressionmethod bytepair"
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
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1348
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1349
		if (&main::IsDebuggable eq DEBUGGABLE) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1350
 			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1351
 				' -debuggable '
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1352
 			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1353
 		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1354
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1355
		if (&main::SmpSafe) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1356
 			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1357
 				' -smpsafe'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1358
 			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1359
 		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1360
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1361
		if (&main::IsDebuggable eq DEBUGGABLE_UDEBONLY) {		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1362
			if ($Bld=~/^UDEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1363
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1364
				' -debuggable '
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1365
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1366
			}
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
		# change - exexps are allowed data, but they look like dlls to elftran....
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1370
		if (&main::AllowDllData || $TrgType=~/^EXEXP$/o || $TrgType=~/^EXEDLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1371
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1372
				' -allow'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1373
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1374
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1375
		if (not &main::CallDllEntryPoints ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1376
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1377
				' -nocall'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1378
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1379
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1380
		if (&main::DataLinkAddress) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1381
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1382
				' -datalinkaddress ',&main::DataLinkAddress
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1383
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1384
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1385
		if (&main::FixedProcess) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1386
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1387
				' -fixed'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1388
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1389
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1390
		if (&main::HeapSize) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1391
			my %HeapSize=&main::HeapSize;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1392
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1393
				' -heap ',$HeapSize{Min},' ',$HeapSize{Max}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1394
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1395
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1396
		if (&main::ProcessPriority) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1397
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1398
				' -priority ',&main::ProcessPriority
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1399
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1400
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1401
		if (&main::StackSize) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1402
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1403
				' -stack ',&main::StackSize
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1404
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1405
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1406
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1407
		if (&main::CodePagingTargetMode == UNPAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1408
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1409
				' -codepaging unpaged'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1410
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1411
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1412
		elsif (&main::CodePagingTargetMode == PAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1413
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1414
				' -codepaging paged'
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1418
		if (&main::DataPagingTargetMode == UNPAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1419
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1420
				' -datapaging unpaged'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1421
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1422
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1423
		elsif (&main::DataPagingTargetMode == PAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1424
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1425
				' -datapaging paged'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1426
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1427
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1428
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1429
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1430
			"\\\n\t\t"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1431
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1432
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1433
		my $i=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1434
		foreach (@UidList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1435
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1436
				" -uid$i $_"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1437
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1438
			$i++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1439
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1440
		if(&main::VendorId) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1441
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1442
				' -vid ',&main::VendorId
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1443
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1444
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1445
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1446
			"\\\n\t\t"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1447
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1448
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1449
			' -fpu ',$floatingpointmodel
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1450
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1451
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1452
			' -capability ',&main::Capability
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1453
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1454
		if($NamedSymLkup) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1455
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1456
				' -sym_name_lkup'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1457
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1458
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1459
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1460
			"\\\n\t\t"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1461
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1462
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1463
			" \"\$(EPOCBLD$Bld)\\$Trg\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1464
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1465
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1466
			"\\\n\t\t"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1467
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1468
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1469
			" \"\$\@\" \n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1470
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1471
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1472
			"\n"
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
         }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1476
         elsif ($BasicTrgType=~/^LIB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1477
	        &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1478
		        "\tarmar ${oP}create \$(EPOCSTATLINK$Bld)\\$Trg ${oP}via $objectsViaFile\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1479
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1480
         }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1481
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1482
         &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1483
		 "\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1484
	 );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1485
	 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1486
#	add static lib into the object via file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1487
	my $libViaFiles=$objectFiles;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1488
	if (@StatLibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1489
		foreach (@StatLibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1490
			$libViaFiles.= &main::RelPath."$_ \n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1491
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1492
		&main::CreateExtraFile($objectsViaFile, $libViaFiles);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1493
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1494
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1495
    # TARGET *.IN
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1496
    #------------
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1497
	 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1498
    &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1499
		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseTrg.in"), ": \$(OBJECTS$Bld)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1500
 	    "\t$Link $linkerDebugOpt ${oP}partial \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1501
	    "\t\t-o \$\@ \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1502
	    "\t\t${oP}via $objectsViaFile\n\n",
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1506
#   reorder the .DEF file taking frozen exports into account if there are any
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1507
    if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/o || $TrgType=~/^EXEDLL$/o || $NamedSymLkup) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1508
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1509
	    # TARGET *.EXP
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1510
	    #------------
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1511
	    &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1512
		    &Generic_Quote("\$(EPOCBLD$Bld)\\$ExportLibrary.exp"), ": \$(EPOCBLD$Bld)\\$BaseTrg.in"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1513
	    );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1514
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1515
# if project is frozen, makedef (and hence the .exp file) are dependent upon it
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1516
		unless (&main::ExportUnfrozen) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1517
			if (-e $DefFile) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1518
			    &main::Output(" $DefFile");
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1522
	    &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1523
		"\n\tperl -S elf2inf.pl -o \$(EPOCBLD$Bld)\\$ExportLibrary.inf \\\n", 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1524
		"\t\t\$\<",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1525
		"\n\tperl -S makedef.pl $AbsentSubst -Inf \$(EPOCBLD$Bld)\\$ExportLibrary.inf \\\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1526
	    );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1527
    	if (!$DefFile || $NoExportLibrary) {    			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1528
    		&main::Output( "\t\t-ignore_unfrozen_noncallable \\\n" );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1529
    	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1530
	if (SysTrg()) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1531
    		&main::Output( "\t\t-SystemTargetType \\\n" );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1532
    	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1533
    		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1534
	    if (-e $DefFile) {	# effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1535
	            &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1536
			"\t\t-Frzfile \"$DefFile\" \\\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1537
		    );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1538
	    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1539
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1540
		if($NamedSymLkup && !$DefFile){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1541
#		For an EXE with named lookup, suppress the 'unfrozen exports' makedef warnings.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1542
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1543
			"\t\t-ignore_unfrozen_exports \\\n",
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1547
	    # freeze ordinals, a maximum of 2, for polymorphic dlls
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1548
	    my $Ordinal;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1549
	    my $Num=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1550
	    foreach $Ordinal (&main::Exports) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1551
	            &main::Output( "\t\t-$Num $Ordinal \\\n" );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1552
		    $Num++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1553
	    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1554
	    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1555
	    my $theDefFile = "\$(EPOCBLD$Bld)\\$ExportLibrary.def";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1556
	    $theDefFile = $DefFile if (-e $DefFile && !&main::ExportUnfrozen);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1557
	    &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1558
		"\t\t\"\$(EPOCBLD$Bld)\\$ExportLibrary.def\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1559
		"\tcopy \"\$(EPOCBLD$Bld)\\$ExportLibrary.def\" \"\$(EPOCBLD)\\$ExportLibrary.def\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1560
		"\tdef2dll.bat $AbsentSubst \\\n\t\t--path=\$(EPOCBLD$Bld) \\\n\t\t--bldpath=\$(EPOCBLD$Bld) \\\n\t\t--export=$ExportLibrary \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1561
		"\t\t--deffile=$theDefFile \\\n\t\t--linkAs=$LinkAs \\\n\t\t$InterWorking $symNameLkupOpt\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1562
	    );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1563
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1564
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1565
    &main::Output( "\n" );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1566
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1567
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1568
# Set to 1 if multifile compilation wanted
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1569
my $domultifile = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1570
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1571
sub DoMultiFile () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1572
        return $ENV{RVCTMultiFile} if (defined $ENV{RVCTMultiFile});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1573
	return $domultifile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1574
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1575
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1576
my %CompilationGroups = ();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1577
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1578
sub InitMultiFileCompilation() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1579
#	Do preparatory work for multifile compilation
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1580
	my $SourceStructRef=&main::SourceStructRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1581
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1582
#	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
  1583
	my %PathToSourceMap = ();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1584
	foreach my $SourceRef (@$SourceStructRef) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1585
		my $SrcFile = $$SourceRef{CurFile};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1586
		my $Ext = &main::Path_Split('Ext', $SrcFile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1587
	        push @{$PathToSourceMap{$$SourceRef{SrcPath}}{$Ext}}, $SrcFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1588
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1589
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1590
#	Now we split each group into sets of 10. 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1591
	foreach my $SrcPath (keys %PathToSourceMap) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1592
		foreach my $Ext (keys %{$PathToSourceMap{$SrcPath}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1593
			my @FileList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1594
			my @ObjectList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1595
			my @SourceList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1596
			my $NumToGo = 10;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1597
			foreach my $File (@{$PathToSourceMap{$SrcPath}{$Ext}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1598
				my $base = &main::Path_Split('Base', $File);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1599
				my $cia = ($Ext =~ /cia/i);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1600
				$base .= "_" if $cia;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1601
				push @FileList, $File;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1602
				push @ObjectList, "$base.o";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1603
#				this gives us our source files xxx				
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1604
				push @SourceList, $cia ? "$base.cpp" : "$SrcPath$base$Ext";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1605
				$NumToGo--;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1606
				unless ($NumToGo) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1607
#				       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
  1608
#				       info will have been generated for the earlier files in the list
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1609
				       push @{$CompilationGroups{$FileList[$#FileList]}{Sources}}, @SourceList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1610
       				       push @{$CompilationGroups{$FileList[$#FileList]}{Objects}}, @ObjectList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1611
				       $NumToGo = 10;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1612
				       undef @FileList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1613
				       undef @ObjectList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1614
				       undef @SourceList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1615
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1616
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1617
			push @{$CompilationGroups{$FileList[$#FileList]}{Sources}}, @SourceList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1618
			push @{$CompilationGroups{$FileList[$#FileList]}{Objects}}, @ObjectList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1619
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1620
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1621
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1622
#	debug print out	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1623
	if (0) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1624
	foreach my $keyfile (keys %CompilationGroups) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1625
		print "$keyfile :\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1626
		foreach my $class (keys %{$CompilationGroups{$keyfile}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1627
			print "\t$class:\n\t\t";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1628
			print join " ", @{$CompilationGroups{$keyfile}{$class}}, "\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1629
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1630
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1631
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1632
			
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
sub PMStartSrcList {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1636
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1637
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1638
		"# SOURCES\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1639
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1640
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1641
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1642
	InitMultiFileCompilation() if DoMultiFile();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1643
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1644
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1645
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1646
sub PMBitMapBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1647
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1648
	&Generic_BitMapBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1649
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1650
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1651
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1652
sub PMResrcBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1653
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1654
	&Generic_ResrcBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1655
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1656
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1657
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1658
sub PMAifBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1659
	&Generic_AifBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1660
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1661
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1662
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1663
sub PMStartSrc {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1664
	my $Src=&main::Src;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1665
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1666
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1667
		"# Source $Src\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1668
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1669
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1670
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1671
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1672
sub PMSrcDepend {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1673
	my @DepList=&main::DepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1674
	return if (@DepList == 0);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1675
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1676
	my @BldList=&main::BldList;	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1677
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1678
	my $ExtSrc=&main::ExtSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1679
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1680
	my $BaseObj=$BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1681
	my $cia = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1682
	if ($ExtSrc =~ /cia/i ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1683
		$cia = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1684
		$BaseObj .= '_';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1685
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1686
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1687
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1688
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1689
			&Generic_Quote("\$(EPOCBLD$_)\\$BaseSrc.pre"), " ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1690
			&Generic_Quote("\$(EPOCBLD$_)\\$BaseObj.cpp"), " ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1691
		) if $cia;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1692
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1693
			&Generic_Quote("\$(EPOCBLD$_)\\$BaseSrc.lis"), " ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1694
			&Generic_Quote("\$(EPOCBLD$_)\\$BaseObj.o"), " \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1695
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1696
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1697
	&main::Output(
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
        PrintList("\' \\\n\t\'\.\&Generic_Quote\(\$_\)", @DepList);
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
		"\n"
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1707
sub PMSrcBldDepend {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1708
	my @DepList=&main::DepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1709
	return if (@DepList == 0);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1710
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1711
	my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1712
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1713
	my $ExtSrc=&main::ExtSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1714
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1715
	my $BaseObj=$BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1716
	my $cia = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1717
	if ($ExtSrc =~ /cia/i ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1718
		$cia = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1719
		$BaseObj .= '_';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1720
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1721
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1722
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1723
		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.pre"), " ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1724
		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseObj.cpp"), " ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1725
	) if $cia;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1726
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1727
		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), " ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1728
		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseObj.o"), " :",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1729
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1730
        PrintList("\' \\\n\t\'\.\&Generic_Quote\(\$_\)", @DepList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1731
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1732
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1733
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1734
	);
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
my $curdrive = "x";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1738
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1739
sub quoted_path
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1740
    {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1741
    my ($arg) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1742
    return "\"$arg\"" if ($arg !~ /^\\[^\\]/);	# not an absolute path
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1743
    if ($curdrive eq "x")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1744
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1745
		$curdrive="";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1746
		$curdrive=$1 if (cwd =~ /^(.:)/);	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1747
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1748
    return "\"$curdrive$arg\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1749
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1750
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1751
sub PMPrefixFile 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1752
{ 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1753
    my $IncPath = &main::EPOCIncPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1754
    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1755
    return quoted_path(&Generic_Quote("$IncPath"."rvct\\rvct.h"));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1756
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1757
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1758
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1759
my $preinclude =   "--preinclude \$(EPOCINC)\\rvct\\rvct.h";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1760
my $edg_preinclude = "-I \$(EPOCINC)\\RVCT${RVCTVersion} --preinclude edg_rvct${RVCTVersion}.h";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1761
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1762
sub SelectLangOptions {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1763
	my ($Ext) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1764
	if ($Ext=~/^.cpp$/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1765
		# In case of function call logger, the preinclude file is passed to the function call logger
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1766
		# hence it is not required to pass the same file to the compiler.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1767
		return "--cpp "	if ($Function_Call_Logger);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1768
		return "--cpp $preinclude ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1769
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1770
	if ($Ext=~/^.cia$/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1771
		return "--cpp ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1772
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1773
	if ($Ext=~/^.c$/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1774
		if($CompilerOption =~/--cpp/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1775
			#Function Call Logger
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1776
			return "--cpp " if ($Function_Call_Logger);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1777
			return "--cpp $preinclude ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1778
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1779
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1780
			#Function Call Logger
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1781
			return "--c90 " if ($Function_Call_Logger);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1782
			return "--c90 $preinclude ";
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
	# To support .cc, .cxx, .c++ file extensions for Open Environment
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1786
	elsif ($Ext=~/^(.cc|.cxx|.c\+\+)$/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1787
		#Function Call Logger
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1788
		return "--cpp " if ($Function_Call_Logger);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1789
		return "--cpp $preinclude ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1790
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1791
	return '';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1792
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1793
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1794
sub PMEndSrcBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1795
#       Generate multifile compilation stuff if needed.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1796
        if (DoMultiFile()) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1797
	       MultiFileEndSrcBld();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1798
	       return;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1799
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1800
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1801
	my $ABI=&main::ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1802
	my $Plat=&main::Plat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1803
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1804
	my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1805
	my $Src=lc &main::Src;	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1806
	my $SrcPath=&main::Path_Chop(&main::SrcPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1807
	my $Ext = &main::Path_Split('Ext', $Src);	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1808
	my $BaseTrg=&main::BaseTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1809
	my $BldPath = &main::BldPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1810
	$Src = ucfirst $Src if ($Ext !~ /\.(cpp|c)$/);		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1811
	my $LangOptions = &SelectLangOptions($Ext);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1812
	# support for auto 'translated' ASM 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1813
	my $AsmFilep = $AsmFiles{$Src};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1814
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1815
	# Logger Ouput filename 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1816
	my $Logger_Output = lc ($BaseSrc) . ".int.cpp";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1817
	my $LstExt ;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1818
	if($Plat =~ /^(ARMV[6-9])/i){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1819
		$LstExt = $1 ;	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1820
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1821
	else{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1822
		$LstExt = $ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1823
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1824
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1825
	my $lfboption = LinkerFeedBackOption();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1826
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1827
	#Function Call Logger
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1828
	my $FC_Logger_Option=" --wchar_t_keyword --microsoft_version=1300 --dictionary_file_name $BldPath$BaseTrg.txt --diag_suppress 66,161,611,654,815,830,997,1152,1300,1390";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1829
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1830
	if ($AsmFilep || $Ext =~ /cia/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1831
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1832
# compile the translated, preprocessed source
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1833
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.o"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1834
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1835
			"\t\@echo $Src\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1836
			"\t\$(ARMCC$Bld) $lfboption$LangOptions -J $SrcPath \$(INCDIR) -o \$\@ \$(EPOCBLD$Bld)\\$BaseSrc\_.cpp\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1837
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1838
# rule to translate the preprocessed source
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1839
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1840
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.pre"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1841
			"\ttranasm.bat -n -s -o=\$\@ \$(EPOCBLD$Bld)\\$BaseSrc.pre\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1842
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1843
# rule to preprocess the source
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1844
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.pre"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1845
			&Generic_Quote("$SrcPath\\$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1846
  			"\t\$(ARMCC$Bld) -D__CIA__ -E $preinclude $LangOptions -J $SrcPath \$(INCDIR) $SrcPath\\$Src -o \$\@ \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1847
# generate an assembly listing target too
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1848
			"LISTING$Bld$BaseSrc\_ : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.lis"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1849
			"\t", &Generic_CopyAction("$SrcPath\\$BaseSrc\_.$LstExt.lst"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1850
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1851
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.lis"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1852
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1853
			"\t\$(ARMCC$Bld) $LangOptions -S -J $SrcPath \$(INCDIR) -o \$\@ \$(EPOCBLD$Bld)\\$BaseSrc\_.cpp\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1854
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1855
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1856
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1857
		#If Function Call logging is enabled, add call to function call logger
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1858
		if ($Function_Call_Logger) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1859
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1860
				&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1861
				" : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1862
				&Generic_Quote("\$(EPOCBLD$Bld)\\$Logger_Output"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1863
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1864
				"\t\@echo $Logger_Output\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1865
				"\t\$(ARMCC$Bld) $lfboption$LangOptions -J $SrcPath \$(INCDIR) -o \$\@ \$(EPOCBLD$Bld)\\$Logger_Output\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1866
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1867
# generate an assembly listing target too
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1868
				"LISTING$Bld$BaseSrc : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1869
				"\t", &Generic_CopyAction("$SrcPath\\$BaseSrc.$LstExt.lst"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1870
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1871
				&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1872
				&Generic_Quote("$SrcPath\\$Logger_Output"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1873
				"\t\$(ARMCC$Bld) $LangOptions -S -J $SrcPath \$(INCDIR) -o \$\@ \$(EPOCBLD$Bld)\\$Logger_Output \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1874
				"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1875
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1876
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1877
			#Call to Function Call Logger
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1878
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1879
				&Generic_Quote("\$(EPOCBLD$Bld)\\$Logger_Output"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1880
				&Generic_Quote("$SrcPath\\$Src"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1881
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1882
				"\t \@echo $Logger_Output\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1883
				"\t \$(FCLOGGER$Bld) $lfboption$edg_preinclude \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1884
			    "\t -I $SrcPath  \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1885
				"\t \$(INCDIR_FCLOGGER) $FC_Logger_Option \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1886
			    "\t --gen_c_file_name \$\@ $SrcPath\\$Src\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1887
				"\n\n",
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
		else {			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1891
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1892
				&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1893
				&Generic_Quote("$SrcPath\\$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1894
				"\t\@echo $Src\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1895
				"\t\$(ARMCC$Bld) $lfboption$LangOptions -J $SrcPath \$(INCDIR) -o \$\@ $SrcPath\\$Src\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1896
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1897
# generate an assembly listing target too
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1898
			"LISTING$Bld$BaseSrc : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1899
			"\t", &Generic_CopyAction("$SrcPath\\$BaseSrc.$LstExt.lst"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1900
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1901
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1902
			&Generic_Quote("$SrcPath\\$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1903
			"\t\$(ARMCC$Bld) $LangOptions -S -J $SrcPath \$(INCDIR) -o \$\@ $SrcPath\\$Src \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1904
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1905
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1906
			#Compiler wrapper support starts
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1907
			if($IsCompilerWrapperOption)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1908
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1909
				my $Platcmpwrap=&main::Plat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1910
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1911
					"COMPWRAP$Bld$BaseSrc : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1912
					&Generic_Quote("$SrcPath\\$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1913
					"\t\@echo Analysing $Src\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1914
					"\t\$(COMPWRAP) \$(ARMCC$Bld) $LangOptions -S -J $SrcPath \$(INCDIR) -o \$\@ $SrcPath\\$Src \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1915
					"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1916
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1917
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1918
			#Compiler wrapper support ends
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1919
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1920
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1921
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1922
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1923
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1924
my $MFVarN = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1925
sub MultiFileEndSrcBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1926
	my $ABI=&main::ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1927
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1928
	my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1929
        my $KeyFile = &main::Src;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1930
	my $Src=ucfirst lc $KeyFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1931
	my $SrcPath=&main::Path_Chop(&main::SrcPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1932
	my $Ext = &main::Path_Split('Ext', $Src);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1933
	my $LangOptions = &SelectLangOptions($Ext);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1934
	# support for auto 'translated' ASM 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1935
	my $AsmFilep = $AsmFiles{$Src};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1936
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1937
	my $lfboption = LinkerFeedBackOption();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1938
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1939
	if ($AsmFilep || $Ext =~ /cia/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1940
		if ($CompilationGroups{$KeyFile}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1941
# compile the translated, preprocessed source
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1942
		       &main::Output( "OBJECTS$MFVarN = ");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1943
		       foreach my $obj (@{$CompilationGroups{$KeyFile}{Objects}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1944
			       &main::Output( &Generic_Quote("\\\n\t\$(EPOCBLD$Bld)\\$obj"), " "); 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1945
		       }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1946
       		       &main::Output( "\n\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1947
		       &main::Output( "SOURCES$MFVarN = ");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1948
		       foreach my $src (@{$CompilationGroups{$KeyFile}{Sources}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1949
			       &main::Output( &Generic_Quote("\\\n\t\$(EPOCBLD$Bld)\\$src", " "));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1950
		       }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1951
       		       &main::Output( "\n\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1952
		       &main::Output( "\$(OBJECTS$MFVarN) : \$(SOURCES$MFVarN) \n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1953
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1954
		       &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1955
				     "\t\@echo Compiling \$(SOURCES$MFVarN)\n", 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1956
				     "\t\$(ARMCC$Bld) -J $SrcPath \$(INCDIR) $lfboption\\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1957
				     "\t\t$LangOptions -o \$\@ --multifile \$(SOURCES$MFVarN)"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1958
		      );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1959
       		       &main::Output( "\n\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1960
		       $MFVarN++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1961
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1962
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1963
# rule to translate the preprocessed source
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1964
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1965
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.pre"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1966
			"\ttranasm.bat -n -s -o=\$\@ \$(EPOCBLD$Bld)\\$BaseSrc.pre\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1967
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1968
# rule to preprocess the source
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1969
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.pre"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1970
			&Generic_Quote("$SrcPath\\$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1971
  			"\t\$(ARMCC$Bld) -D__CIA__ -E $preinclude $LangOptions -J $SrcPath \$(INCDIR) $SrcPath\\$Src -o \$\@ \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1972
# generate an assembly listing target too
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1973
			"LISTING$Bld$BaseSrc\_ : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.lis"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1974
			"\t", &Generic_CopyAction("$SrcPath\\$BaseSrc\_.$LstExt.lst"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1975
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1976
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.lis"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1977
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1978
			"\t\$(ARMCC$Bld) $LangOptions -S -J $SrcPath \$(INCDIR) -o \$\@ \$(EPOCBLD$Bld)\\$BaseSrc\_.cpp\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1979
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1980
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1981
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1982
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1983
		if ($CompilationGroups{$KeyFile}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1984
#                      compile the source
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1985
		       &main::Output( "OBJECTS$MFVarN = ");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1986
		       foreach my $obj (@{$CompilationGroups{$KeyFile}{Objects}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1987
			       &main::Output( &Generic_Quote("\\\n\t\$(EPOCBLD$Bld)\\$obj"), " "); 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1988
		       }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1989
       		       &main::Output( "\n\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1990
		       &main::Output( "SOURCES$MFVarN = ");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1991
		       foreach my $src (@{$CompilationGroups{$KeyFile}{Sources}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1992
			       &main::Output( &Generic_Quote("\\\n\t$src"), " ");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1993
		       }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1994
       		       &main::Output( "\n\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1995
		       &main::Output( "\$(OBJECTS$MFVarN) : \$(SOURCES$MFVarN) \n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1996
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1997
		       &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1998
				     "\t\@echo Compiling \$(SOURCES$MFVarN)\n", 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1999
				     "\t\$(ARMCC$Bld) -J $SrcPath \$(INCDIR) $lfboption\\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2000
				     "\t\t$LangOptions -o \$\@ --multifile \$(SOURCES$MFVarN)"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2001
		      );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2002
       		       &main::Output( "\n\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2003
		       $MFVarN++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2004
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2005
#		generate an assembly listing target too
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2006
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2007
			"LISTING$Bld$BaseSrc : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2008
			"\t", &Generic_CopyAction("$SrcPath\\$BaseSrc.$LstExt.lst"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2009
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2010
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2011
			&Generic_Quote("$SrcPath\\$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2012
			"\t\$(ARMCC$Bld) $LangOptions -S -J $SrcPath \$(INCDIR) -o \$\@ $SrcPath\\$Src \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2013
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2014
			);
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2018
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2019
sub PMEndSrc {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2020
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2021
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2022
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2023
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2024
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2025
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2026
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2027
sub PMEndSrcList {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2028
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2029
	# Deal with accumulated MAKEDIRS etc.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2030
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2031
	&Generic_End;
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 PMSupportsFeatureVariants
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2035
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2036
	return 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2037
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2038
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2039
1;
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2043
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2044
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2045
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2046