sbsv1/abld/platform/cl_x86gcc.pm
author jascui
Tue, 16 Nov 2010 15:54:07 +0800
changeset 682 2c32f186fa1f
parent 599 fa7a3cc6effd
permissions -rw-r--r--
Solving incorrect handling when processing ExportName=SymbolName@Ordinal syntax.
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_x86gcc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    18
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    19
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    20
my $GccPrefix='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    21
my $ToolPrefix='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    22
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    23
my $HelperLib='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    24
my %PlatOpt=(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    25
	'Dlltool'=>'',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    26
	'Entry'=>'--entry',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    27
	'Gcc'=>'',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    28
	'Ld'=>'',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    29
	'Petran'=>'',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    30
	'Optimize'=>'-O'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    31
);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    32
my $Dlltool;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    33
my $Archive;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    34
my $Link;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
my $Objcopy;
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
require Exporter;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
@ISA=qw(Exporter);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
@EXPORT=qw(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
	PMHelp_Mmp
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    42
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    43
	PMPlatProcessMmp
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    44
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
	PMUnderlyingABI
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47
	PMStartBldList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    48
		PMBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    49
	PMStartSrcList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    50
		PMBitMapBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    51
		PMResrcBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    52
		PMAifBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    53
		PMStartSrc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    54
		PMSrcDepend
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    55
			PMSrcBldDepend
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    56
			PMEndSrcBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    57
		PMEndSrc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    58
	PMEndSrcList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    59
	PMPrefixFile
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    60
);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    61
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    62
use cl_generic;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    63
use Genutl;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    64
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    65
use constant NOCOMPRESSIONMETHOD => 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    66
use constant INFLATECOMPRESSIONMETHOD => 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    67
use constant BYTEPAIRCOMPRESSIONMETHOD => 2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    68
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    69
use constant NOTPAGED => 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    70
use constant UNPAGED => 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    71
use constant PAGED => 2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    72
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    73
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    74
sub PMHelp_Mmp {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    75
	&Winutl_Help_Mmp;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    76
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    77
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    78
sub PMCheckPlatformL {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    79
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    80
sub PMPlatProcessMmp (@) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    81
	my $MMPFILE=&main::MmpFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    82
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    83
	# set up START MARM ... END block module variables
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    84
	my @MmpWarn=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    85
	my $Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    86
	LINE: foreach $Line (@_) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    87
		my $LineInfo=shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    88
		$_=shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    89
		push @MmpWarn, "$LineInfo : Unrecognised Keyword \"$_\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    90
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    91
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    92
	undef $Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    93
	if (@MmpWarn) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    94
		warn
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    95
			"\nMMPFILE \"$MMPFILE\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    96
			"START .. END BLOCK WARNINGS(S)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    97
			@MmpWarn,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    98
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    99
		;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   100
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   101
	undef @MmpWarn;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   102
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   103
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   104
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   105
sub SystemTarget() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   106
	return 1 if &main::SystemTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   107
	my $ExportLibrary=&main::ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   108
	# N.B. should get better way to detect kernel probably!!
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   109
	return 1 if ($ExportLibrary =~ /EKERN/i);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   110
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   111
	return 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   112
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   113
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   114
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   115
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   116
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   117
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   118
sub PMUnderlyingABI($) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   119
	my ($ABI) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   120
	if ($ABI eq 'X86gcc') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   121
			return 'X86gcc';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   122
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   123
	return $ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   124
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   125
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   126
my $Makecmd;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   127
my %ABILibPath=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   128
my $genDefFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   129
sub PMStartBldList($) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   130
	($Makecmd) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   131
	my $ABI=&main::ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   132
	my $UnderlyingABI=PMUnderlyingABI($ABI);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   133
	my $BaseTrg=&main::BaseTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   134
	my $BasicTrgType=&main::BasicTrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   135
	my @BldList=&main::BldList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   136
	my @ChopRTWSysIncPaths=&main::Path_Chop(&main::SysIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   137
	my @ChopRTWUserIncPaths=&main::Path_Chop(&main::UserIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   138
	my $DefFile=&main::DefFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   139
	my $EPOCPath=&main::EPOCPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   140
	my $LinkAs=&main::LinkAs;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   141
	my $LibPath=&main::LibPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   142
	my @MacroList=&main::MacroList();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   143
	my $VariantFile=&main::VariantFile();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   144
	my $Plat=&main::Plat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   145
	my $Trg=&main::Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   146
	my $TrgType=&main::TrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   147
	my @UidList=&main::UidList;	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   148
	my $WarningLevel=&main::CompilerOption("GCC");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   149
	my $ExportLibrary=&main::ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   150
	my $NoExportLibrary=&main::NoExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   151
	my $SystemTrg = SystemTarget();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   152
	my %Version = &main::Version();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   153
	my $ExtraExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   154
	my $PrimaryExportLibrary = $ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   155
	unless ($Version{explicit}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   156
		$ExtraExportLibrary = $ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   157
		$ExtraExportLibrary =~ s/\{(\d|a|b|c|d|e|f){8}\}//i;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   158
		$PrimaryExportLibrary = $ExtraExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   159
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   160
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   161
#	set up LinkAs
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   162
	$UidList[2]=~/^0x(.*)$/o;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   163
	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
   164
		$LinkAs=join '', &main::Path_Split('Base',$LinkAs),"[$1]",&main::Path_Split('Ext',$LinkAs);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   165
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   166
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   167
#	set up dlltool flag hash
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   168
	my %ABIDlltool=(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   169
		X86gcc=>' -m i386' 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   170
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   171
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   172
#	work out the flags for various platforms
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   173
	if ($ABI eq 'X86gcc') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   174
		$PlatOpt{Gcc}='-c  -masm=intel -B\\epoc32\\gcc_mingw\\_p';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   175
		$PlatOpt{Dlltool}=$ABIDlltool{X86gcc};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   176
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   177
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   178
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   179
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   180
		&main::FatalError("Platform module - ABI \"$ABI\" unrecognised");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   181
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   182
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   183
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   184
#	set up CompatibleABI lib path hash
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   185
	my %ABIRTWLibPath=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   186
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   187
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   188
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   189
	$Dlltool=$ToolPrefix.'dlltool';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   190
	$Archive=$ToolPrefix.'ar';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   191
	$Link=$ToolPrefix.'ld';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   192
	$Objcopy=$ToolPrefix.'objcopy';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   193
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   194
	&Generic_Header(0,$Makecmd);	# define standard things using absolute paths
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   195
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   196
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   197
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   198
		"# must set both PATH to make it work correctly\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   199
		"Path:=",&main::Path_Drive,$EPOCPath,"gcc_mingw\\bin;\$(Path)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   200
		"PATH:=\$(Path)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   201
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   202
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   203
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   204
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   205
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   206
		"INCDIR  ="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   207
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   208
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   209
	foreach (@ChopRTWUserIncPaths) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   210
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   211
			" -I \"$_\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   212
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   213
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   214
	foreach (@ChopRTWSysIncPaths) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   215
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   216
			" -isystem \"$_\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   217
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   218
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   219
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   220
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   221
		"\\\n -include \"", $EPOCPath, "include\\gcc.h\"",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   222
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   223
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   224
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   225
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   226
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   227
		"GCCFLAGS=$PlatOpt{Gcc} \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   228
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   229
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   230
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   231
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   232
		"GCCDEFS ="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   233
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   234
	foreach(@MacroList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   235
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   236
			" -D$_"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   237
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   238
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   239
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   240
		" -D PRODUCT_INCLUDE=\"\\\"$VariantFile\\\"\"",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   241
		" \$(USERDEFS)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   242
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   243
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   244
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   245
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   246
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   247
			"GCC$_ = ${GccPrefix}g++"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   248
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   249
		if (/REL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   250
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   251
				      ' ',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   252
				      $PlatOpt{Optimize}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   253
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   254
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   255
		elsif (/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   256
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   257
				' -g'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   258
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   259
			#unless (&main::SrcDbg) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   260
			#   &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   261
			#   	' ', $PlatOpt{Optimize}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   262
			#  );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   263
			#}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   264
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   265
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   266
			' $(GCCFLAGS)'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   267
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   268
		foreach (&main::MacroList($_)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   269
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   270
				" -D$_"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   271
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   272
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   273
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   274
			" \$(GCCDEFS)\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   275
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   276
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   277
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   278
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   279
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   280
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   281
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   282
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   283
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   284
			"$_ :"
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
		if ($BasicTrgType !~ /IMPLIB/io) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   288
			&main::Output (
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   289
				#" \\\n\t \"",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   290
				" \\\n\t ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   291
				&Generic_Quote("\$(EPOCTRG$_)\\$Trg")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   292
				#"\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   293
			);
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
#		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
   297
		if ($DefFile and not &main::ExportUnfrozen) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   298
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   299
				" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   300
				"\tLIBRARY\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   301
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   302
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   303
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   304
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   305
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   306
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   307
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   308
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   309
	# Resource building is done entirely via cl_generic.pm
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   310
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   311
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   312
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   313
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   314
			"RESOURCE$_ : MAKEWORK$_"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   315
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   316
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   317
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   318
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   319
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   320
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   321
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   322
	if (!-e $DefFile && scalar(&main::Exports)!=0)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   323
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   324
		# There are mandatory exports - generate a def file using the mandatory exports.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   325
		$genDefFile = "\$(EPOCBLD)\\$ExportLibrary.gen.def";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   326
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   327
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   328
	if (-e $DefFile || defined($genDefFile)) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   329
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   330
		#	Establish the entry point symbol
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   331
		my $EntrySymbol;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   332
		if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEDLL$/o ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   333
			$EntrySymbol = '_E32Dll';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   334
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   335
		elsif ($BasicTrgType=~/^EXE$/o || $TrgType=~/^EXEXP$/o ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   336
			$EntrySymbol = '_E32Startup';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   337
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   338
				
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   339
		&main::Output("\n", &Generic_Quote("\$(EPOCBLD)\\$ExportLibrary.prep.def"), " : ");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   340
		my $defFileToUse;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   341
		if (defined($genDefFile))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   342
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   343
			# The generated def file is not a dependency of the prep.def - don't add anyting after the ':' char
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   344
			&main::Output("\n\tperl -S gendef.pl $genDefFile ", join(' ', &main::Exports), "\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   345
			$defFileToUse = $genDefFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   346
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   347
		else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   348
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   349
			&main::Output(&Generic_Quote($DefFile), "\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   350
			$defFileToUse = "\$<";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   351
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   352
		&main::Output("\tperl -S prepdef.pl $defFileToUse \$@ nodatasizes $EntrySymbol\n\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   353
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   354
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   355
			&Generic_Quote("\$(EPOCBLD)\\$ExportLibrary.lib.exp"), " : ", &Generic_Quote("\$(EPOCBLD)\\$ExportLibrary.prep.def"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   356
			"\t$Dlltool $PlatOpt{Dlltool} --input-def \"\$<\"  --dllname \"$LinkAs\"  -e \"\$@\"  \n",			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   357
			"\t-\$(ERASE) \"\$(EPOCBLD)\\tmp.txt \"\n\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   358
		);
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
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   362
		"LIBRARY : MAKEWORKLIBRARY"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   363
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   364
	if ($BasicTrgType=~/^LIB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   365
#		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
   366
		foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   367
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   368
				" $_"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   369
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   370
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   371
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   372
	elsif ($DefFile and !$NoExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   373
		unless (&main::ExportUnfrozen) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   374
			if (-e $DefFile) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   375
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   376
					" ", &Generic_Quote("\$(EPOCLIB)\\LIB\\$PrimaryExportLibrary.lib")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   377
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   378
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   379
					"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   380
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   381
			} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   382
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   383
					"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   384
					"\t\@echo WARNING: Not attempting to create any import libraries.\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   385
					"\t\@echo When exports are frozen in \"$DefFile\", regenerate Makefile.\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   386
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   387
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   388
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   389
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   390
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   391
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   392
				"\t\@echo Not attempting to create \"\$(EPOCLIB)\\LIB\\$PrimaryExportLibrary.lib\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   393
				"\t\@echo from frozen .DEF file, since EXPORTUNFROZEN specified.\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   394
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   395
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   396
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   397
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   398
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   399
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   400
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   401
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   402
			"# REAL TARGET - LIBRARY\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   403
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   404
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   405
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   406
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   407
			&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExportLibrary.lib"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   408
			&Generic_Quote("\$(EPOCBLD)\\$ExportLibrary.prep.def"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   409
			"\t$Dlltool $PlatOpt{Dlltool} --input-def \"\$<\"  --dllname \"$LinkAs\"  --output-lib \"\$@\" \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   410
			"\t-\$(ERASE) \"\$(EPOCBLD)\\tmp.txt \"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   411
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   412
		if ($ExtraExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   413
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   414
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   415
				&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExtraExportLibrary.lib"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   416
				&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExportLibrary.lib"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   417
				"\tcopy \$< \$@\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   418
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   419
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   420
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   421
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   422
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   423
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   424
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   425
		"CLEANLIBRARY :\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   426
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   427
	if ($DefFile and !$NoExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   428
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   429
			"\t-\$(ERASE) \"\$(EPOCLIB)\\LIB\\$ExportLibrary.lib \"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   430
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   431
		if ($ExtraExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   432
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   433
				"\t-\$(ERASE) \"\$(EPOCLIB)\\LIB\\$ExtraExportLibrary.lib \"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   434
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   435
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   436
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   437
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   438
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   439
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   440
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   441
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   442
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   443
	&Generic_MakeWorkDir('MAKEWORKLIBRARY',"${LibPath}LIB");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   444
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   445
	&Generic_Releaseables;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   446
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   447
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   448
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   449
sub PMBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   450
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   451
	my @ASSPLibList=&main::ASSPLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   452
	my @SrcList=&main::SrcList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   453
	my $BaseTrg=&main::BaseTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   454
	my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   455
	my $ChopBldPath=&main::Path_Chop(&main::BldPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   456
	my $DefFile=&main::DefFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   457
	my $EPOCIncPath=&main::EPOCIncPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   458
	my $FirstLib=&main::FirstLib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   459
	my $BasicTrgType=&main::BasicTrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   460
	my @LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   461
	my $LibPath=&main::LibPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   462
	my $LinkAs=&main::LinkAs;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   463
	my $ChopRelPath=&main::Path_Chop(&main::RelPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   464
	my $RelPath=&main::RelPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   465
	my @StatLibList=&main::StatLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   466
	my $StatLinkPath=&main::StatLinkPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   467
	my $Trg=&main::Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   468
	my $TrgType=&main::TrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   469
	my @UidList=&main::UidList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   470
	my $ExportLibrary=&main::ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   471
	my $NoExportLibrary=&main::NoExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   472
	my $SystemTrg = SystemTarget();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   473
	my %Version = &main::Version();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   474
	my $ExtraExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   475
	unless ($Version{explicit}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   476
		$ExtraExportLibrary = $ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   477
		$ExtraExportLibrary =~ s/\{(\d|a|b|c|d|e|f){8}\}//i;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   478
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   479
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   480
	if ($Bld =~ /DEB/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   481
		@LibList = &main::DebugLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   482
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   483
		@LibList = &main::LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   484
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   485
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   486
#	set up $LinkAs
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   487
	$UidList[2]=~/^0x(.*)$/o;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   488
	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
   489
		$LinkAs=join '', &main::Path_Split('Base',$LinkAs),"[$1]",&main::Path_Split('Ext',$LinkAs);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   490
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   491
	
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   495
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   496
	# REAL TARGETS
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   497
	#-------------
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   498
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   499
		"# REAL TARGET - BUILD VARIANT $Bld\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   500
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   501
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   502
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   503
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   504
#	releasables
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   505
	my @releaseables;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   506
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   507
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   508
	push @releaseables, "$RelPath$Trg" if ($BasicTrgType!~/^IMPLIB$/io);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   509
	if ($BasicTrgType=~/^(DLL|EXE)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   510
		push @releaseables, "$RelPath$Trg.MAP";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   511
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   512
	if (-e $DefFile and !$NoExportLibrary) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   513
		push @releaseables, "$LibPath$ExportLibrary.lib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   514
		push @releaseables, "$LibPath$ExtraExportLibrary.lib" if ($ExtraExportLibrary);
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
		"WHAT$Bld : WHATGENERIC\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   519
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   520
		"CLEAN$Bld : CLEANBUILD$Bld CLEANRELEASE$Bld CLEANLIBRARY\n ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   521
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   522
		"CLEANBUILD$Bld : \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   523
		"\t\@perl -S ermdir.pl \"\$(EPOCBLD$Bld)\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   524
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   525
		"CLEANRELEASE$Bld : CLEANGENERIC\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   526
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   527
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   528
	&Generic_WhatCleanTargets($Bld, "WHAT$Bld", "CLEANRELEASE$Bld", @releaseables);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   529
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   530
	&Generic_MakeWorkDir("MAKEWORK$Bld",$ChopBldPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   531
	&Generic_MakeWorkDir("MAKEWORK$Bld",$ChopRelPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   532
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   533
	return if ($BasicTrgType=~/^IMPLIB$/io);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   534
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   535
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   536
		"LISTING$Bld : MAKEWORK$Bld"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   537
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   538
	foreach (@SrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   539
		my $BaseSrc = &main::Path_Split('Base', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   540
		my $Ext = &main::Path_Split('Ext', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   541
		$BaseSrc.='_' if (lc($Ext) eq '.cia');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   542
   		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   543
			" \\\n\tLISTING$Bld$BaseSrc"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   544
   		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   545
   	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   546
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   547
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   548
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   549
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   550
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   551
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   552
		"LIBS$Bld="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   553
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   554
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   555
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   556
	if ($BasicTrgType=~/^DLL$/o) { # Add the DLL stub library
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   557
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   558
			" \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   559
			&Generic_Quote("\$(EPOCSTATLINK$Bld)\\EDLLSTUB.LIB")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   560
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   561
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   562
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   563
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   564
	if ($HelperLib) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   565
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   566
			" \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   567
			&Generic_Quote("\$(EPOCSTATLINK$Bld)\\$HelperLib")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   568
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   569
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   570
	foreach (@StatLibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   571
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   572
			" \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   573
			&Generic_Quote("\$(EPOCSTATLINK$Bld)\\$_")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   574
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   575
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   576
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   577
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   578
	foreach (@ASSPLibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   579
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   580
			" \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   581
			&Generic_Quote("\$(EPOCASSPLINK$Bld)\\$_")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   582
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   583
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   584
	foreach (@LibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   585
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   586
			" \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   587
			&Generic_Quote("\$(EPOCLINK)\\LIB\\$_")
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
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   592
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   593
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   594
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   595
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   596
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   597
		"LINKLIBS$Bld="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   598
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   599
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   600
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   601
	if ($BasicTrgType=~/^DLL$/o) { # Add the DLL stub library
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   602
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   603
			" \\\n\t \"",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   604
			&Generic_Quote("\$(EPOCSTATLINK$Bld)\\EDLLSTUB.LIB"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   605
			" \""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   606
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   607
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   608
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   609
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   610
	if ($HelperLib) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   611
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   612
			" \\\n\t \"",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   613
			&Generic_Quote("\$(EPOCSTATLINK$Bld)\\$HelperLib"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   614
			" \""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   615
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   616
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   617
	foreach (@StatLibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   618
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   619
			" \\\n\t \"",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   620
			&Generic_Quote("\$(EPOCSTATLINK$Bld)\\$_"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   621
			" \""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   622
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   623
	}
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
	foreach (@ASSPLibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   627
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   628
			" \\\n\t \"",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   629
			&Generic_Quote("\$(EPOCASSPLINK$Bld)\\$_"),
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
	foreach (@LibList) {
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("\$(EPOCLINK)\\LIB\\$_"),
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
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   641
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   642
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   643
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   644
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   645
#	Establish the entry point symbol
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   646
	my $EntrySymbol;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   647
	if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEDLL$/o ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   648
		$EntrySymbol = '_E32Dll';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   649
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   650
	elsif ($BasicTrgType=~/^EXE$/o || $TrgType=~/^EXEXP$/o ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   651
		$EntrySymbol = '_E32Startup';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   652
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   653
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   654
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   655
		&Generic_Quote("\$(EPOCTRG$Bld)\\$Trg"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   656
		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseTrg.in")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   657
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   658
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   659
	if (-e $DefFile || defined($genDefFile)) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   660
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   661
			" ", &Generic_Quote("\$(EPOCBLD)\\$ExportLibrary.lib.exp")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   662
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   663
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   664
	if ($BasicTrgType=~/^(EXE|DLL)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   665
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   666
			" ", &Generic_Quote("\$(EPOCSTATLINK$Bld)\\$FirstLib")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   667
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   668
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   669
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   670
	if ($TrgType=~/^EXEXP$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   671
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   672
			" ", &Generic_Quote("\$(EPOCSTATLINK$Bld)\\$FirstLib")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   673
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   674
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   675
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   676
		" \$(LIBS$Bld)\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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   680
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   681
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   682
	if ($BasicTrgType=~/^(DLL|EXE)/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   683
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   684
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   685
#		call ld to link the target
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   686
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   687
			"\t$Link $PlatOpt{Ld}  -nostdlib   "
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   691
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   692
	if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/o || $TrgType=~/^EXEDLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   693
			if (-e $DefFile || defined($genDefFile)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   694
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   695
				"\"\$(EPOCBLD)\\$ExportLibrary.lib.exp \" \\\n"
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
			}		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   699
			if ($BasicTrgType=~/^DLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   700
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   701
					"--dll $PlatOpt{Entry} _$EntrySymbol  \\\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   702
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   703
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   704
			else{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   705
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   706
					" $PlatOpt{Entry} _$EntrySymbol  \\\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   707
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   708
						
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   709
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   710
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   711
		elsif ($BasicTrgType=~/^EXE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   712
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   713
				" $PlatOpt{Entry} _$EntrySymbol  \\\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   714
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   715
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   716
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   717
#		--whole-archive is required here apparently because of a defect in the gcc toolchain
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   718
#		the flag can probably be removed with a later version of gcc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   719
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   720
			"\t\t-Map \"\$(EPOCTRG$Bld)\\$Trg.map \" -o \"\$(EPOCBLD$Bld)\\$Trg \" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   721
			"\t\t\"\$(EPOCSTATLINK$Bld)\\$FirstLib \" --whole-archive \"\$(EPOCBLD$Bld)\\$BaseTrg.in \" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   722
			"\t\t--no-whole-archive"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   723
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   724
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   725
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   726
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   727
			" \$(LINKLIBS$Bld) \$(USERLDFLAGS)\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   728
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   729
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   730
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   731
		if (&main::CompressTarget) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   732
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   733
			"\tpetran $PlatOpt{Petran} -version ", &Genutl_VersionToUserString(%Version), " -sid ", &main::SecureId(), " -nocompress " ,  " \"\$(EPOCBLD$Bld)\\$Trg\" \"\$\@\" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   734
			"\t\t"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   735
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   736
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   737
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   738
			if(&main::CompressTargetMode==NOCOMPRESSIONMETHOD){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   739
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   740
					"\tpetran $PlatOpt{Petran} -version ", &Genutl_VersionToUserString(%Version), " -sid ", &main::SecureId(), " \"\$(EPOCBLD$Bld)\\$Trg\" \"\$\@\" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   741
					"\t\t"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   742
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   743
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   744
			elsif(&main::CompressTargetMode==INFLATECOMPRESSIONMETHOD){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   745
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   746
					"\tpetran $PlatOpt{Petran} -version ", &Genutl_VersionToUserString(%Version), " -sid ", &main::SecureId(), " ", "  -compressionmethod deflate", " \"\$(EPOCBLD$Bld)\\$Trg\" \"\$\@\" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   747
					"\t\t"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   748
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   749
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   750
			elsif(&main::CompressTargetMode==BYTEPAIRCOMPRESSIONMETHOD){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   751
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   752
					"\tpetran $PlatOpt{Petran} -version ", &Genutl_VersionToUserString(%Version), " -sid ", &main::SecureId(), " ", "  -compressionmethod bytepair", " \"\$(EPOCBLD$Bld)\\$Trg\" \"\$\@\" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   753
					"\t\t"
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
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   757
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   758
# ALWAYS ALLOW WRITEABLE DATA... PART OF THE VTABLE IMPORT WORKAROUND
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   759
#		if (&main::AllowDllData) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   760
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   761
				' -allow'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   762
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   763
#		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   764
		if (not &main::CallDllEntryPoints) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   765
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   766
				' -nocall'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   767
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   768
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   769
		if (&main::DataLinkAddress) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   770
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   771
				' -datalinkaddress ',&main::DataLinkAddress
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   772
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   773
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   774
		if (&main::FixedProcess) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   775
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   776
				' -fixed'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   777
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   778
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   779
		if (&main::HeapSize) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   780
			my %HeapSize=&main::HeapSize;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   781
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   782
				' -heap ',$HeapSize{Min},' ',$HeapSize{Max}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   783
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   784
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   785
		if (&main::ProcessPriority) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   786
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   787
				' -priority ',&main::ProcessPriority
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   788
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   789
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   790
		if (&main::SmpSafe) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   791
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   792
				' -smpsafe'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   793
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   794
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   795
		if (&main::StackSize) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   796
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   797
				' -stack ',&main::StackSize
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   798
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   799
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   800
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   801
		if (&main::CodePagingTargetMode == UNPAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   802
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   803
				' -codepaging unpaged'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   804
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   805
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   806
		elsif (&main::CodePagingTargetMode == PAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   807
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   808
				' -codepaging paged'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   809
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   810
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   811
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   812
		if (&main::DataPagingTargetMode == UNPAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   813
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   814
				' -datapaging unpaged'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   815
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   816
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   817
		elsif (&main::DataPagingTargetMode == PAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   818
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   819
				' -datapaging paged'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   820
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   821
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   822
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   823
		my $i=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   824
		foreach (@UidList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   825
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   826
				" -uid$i $_"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   827
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   828
			$i++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   829
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   830
		if(&main::VendorId) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   831
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   832
				' -vid ',&main::VendorId
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   833
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   834
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   835
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   836
			' -capability ',&main::Capability,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   837
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   838
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   839
	elsif ($BasicTrgType=~/^LIB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   840
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   841
			"\tcopy \"\$(EPOCBLD$Bld)\\$BaseTrg.in\" \"\$(EPOCSTATLINK$Bld)\\$Trg\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   842
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   843
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   844
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   845
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   846
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   847
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   848
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   849
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   850
	# TARGET *.IN
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   851
	#------------
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   852
	if (scalar @SrcList >100) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   853
		# deal with very long lists by splitting them into 150 file pieces, which allows
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   854
		# about 200 bytes per filename if the underlying max size is 32K
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   855
		#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   856
		my $counter1=100;	# i.e. trigger new variable immediately
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   857
		my $counter2=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   858
		my @objvarlist=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   859
		foreach (@SrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   860
			if ($counter1==100) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   861
				$counter1=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   862
				$counter2++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   863
				my $objvar = "OBJECTS$Bld$counter2";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   864
				push @objvarlist, " \$($objvar)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   865
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   866
					"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   867
					"$objvar="
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
			my $BaseSrc = &main::Path_Split('Base', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   871
			my $Ext = &main::Path_Split('Ext', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   872
			$BaseSrc.='_' if (lc($Ext) eq '.cia');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   873
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   874
				" \\\n\t", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   875
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   876
			$counter1++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   877
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   878
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   879
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   880
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   881
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseTrg.in"), " : ", @objvarlist,"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   882
			"\tif exist \"\$\@\" del \"\$\@\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   883
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   884
		foreach (@objvarlist) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   885
			# Add the files to the list in groups
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   886
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   887
				"\t$Archive cr \"\$\@ \" $_  \n"
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
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   891
			"\n\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   892
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   893
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   894
		# shorter lists remain unchanged
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   895
		# 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   896
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   897
			"OBJECTS$Bld="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   898
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   899
		foreach (@SrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   900
			my $BaseSrc = &main::Path_Split('Base', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   901
			my $Ext = &main::Path_Split('Ext', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   902
			$BaseSrc.='_' if (lc($Ext) eq '.cia');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   903
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   904
				" \\\n\t", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o")
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
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   908
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   909
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   910
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   911
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   912
		##Version of object list with quotes
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   913
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   914
			"ARCHIVEOBJECTS$Bld="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   915
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   916
		foreach (@SrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   917
			my $BaseSrc = &main::Path_Split('Base', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   918
			my $Ext = &main::Path_Split('Ext', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   919
			$BaseSrc.='_' if (lc($Ext) eq '.cia');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   920
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   921
				" \\\n\t \"", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   922
				" \""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   923
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   924
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   925
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   926
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   927
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   928
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   929
						
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   930
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   931
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseTrg.in"), " : \$(OBJECTS$Bld)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   932
			"\tif exist \"\$\@\" del \"\$\@\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   933
			"\t$Archive cr \"\$\@ \" \$(ARCHIVEOBJECTS$Bld)  \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   934
			"\n\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   935
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   936
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   937
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   938
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   939
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   940
sub PMStartSrcList {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   941
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   942
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   943
		"# SOURCES\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   944
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   945
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   946
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   947
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   948
sub PMBitMapBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   949
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   950
	&Generic_BitMapBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   951
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   952
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   953
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   954
sub PMResrcBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   955
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   956
	&Generic_ResrcBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   957
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   958
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   959
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   960
sub PMAifBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   961
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   962
	&Generic_AifBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   963
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   964
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   965
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   966
sub PMStartSrc {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   967
	my $Src=&main::Src;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   968
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   969
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   970
		"# Source $Src\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   971
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   972
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   973
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   974
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   975
sub PMSrcDepend {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   976
	my @BldList=&main::BldList;	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   977
	my @DepList=&main::DepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   978
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   979
	my $ExtSrc=&main::ExtSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   980
	my $cia = (lc($ExtSrc) eq '.cia') ? "_" : "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   981
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   982
	return if (@DepList == 0);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   983
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   984
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   985
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   986
			&Generic_Quote("\$(EPOCBLD$_)\\$BaseSrc$cia.lis"), " ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   987
			&Generic_Quote("\$(EPOCBLD$_)\\$BaseSrc$cia.o"), " \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   988
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   989
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   990
	&main::Output(
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
	foreach (@DepList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   994
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   995
		" \\\n\t", &Generic_Quote($_)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   996
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   997
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   998
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   999
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1000
		"\n"
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
sub PMSrcBldDepend {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1005
	my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1006
	my @DepList=&main::DepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1007
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1008
	my $ExtSrc=&main::ExtSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1009
	my $cia = (lc($ExtSrc) eq '.cia') ? "_" : "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1010
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1011
	return if (@DepList == 0);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1012
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1013
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1014
		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc$cia.lis"), " ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1015
		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc$cia.o"), " :",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1016
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1017
	foreach (@DepList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1018
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1019
			" \\\n\t", &Generic_Quote($_)
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
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1023
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1024
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1025
	);
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
sub SelectLangOptions {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1029
	my ($Ext) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1030
	if ($Ext=~/^.c$/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1031
		return '-x c';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1032
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1033
	return '-fno-rtti -fno-exceptions -fcheck-new';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1034
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1035
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1036
sub PMEndSrcBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1037
	my $ABI=&main::ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1038
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1039
	my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1040
	my $Src=ucfirst lc &main::Src;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1041
	my $SrcPath=&main::SrcPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1042
	my $Ext = &main::Path_Split('Ext', $Src);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1043
	my $Cia = (lc($Ext) eq '.cia') ? 1 : 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1044
	my $LangOptions = &SelectLangOptions($Ext);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1045
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1046
	my $RTWSrcPath=&main::Path_Chop(&main::Path_RltToWork($SrcPath));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1047
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1048
	# Use GCC trick to get assembler source files preprocessed with CPP
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1049
	$Src =~ s/\.s$/.S/i;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1050
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1051
	if ($Cia) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1052
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1053
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.o"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1054
			&Generic_Quote("$SrcPath$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1055
			"\techo $Src\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1056
			"\t\$(GCC$Bld) -fomit-frame-pointer -O1 -x c++  -D__CIA__ -I \"$RTWSrcPath\" \$(INCDIR)  -o \$\@ \"$RTWSrcPath\\$Src\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1057
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1058
	#		generate an assembly listing target too
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1059
			"LISTING$Bld$BaseSrc\_ : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.lis"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1060
			"\t", &Generic_CopyAction("$SrcPath$BaseSrc\_.$ABI.lst"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1061
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1062
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.lis"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1063
			&Generic_Quote("$SrcPath$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1064
			"\t\$(GCC$Bld) -fomit-frame-pointer -O1 -x c++  -D__CIA__ -Wa,-adln -I \"$RTWSrcPath\" \$(INCDIR)  -o nul: \"$RTWSrcPath\\$Src\" > \$\@\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1065
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1066
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1067
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1068
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1069
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1070
			&Generic_Quote("$SrcPath$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1071
			"\techo $Src\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1072
			"\t\$(GCC$Bld) $LangOptions -I \"$RTWSrcPath\" \$(INCDIR) -o \$\@ \"$RTWSrcPath\\$Src\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1073
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1074
	#		generate an assembly listing target too
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1075
			"LISTING$Bld$BaseSrc : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1076
			"\t", &Generic_CopyAction("$SrcPath$BaseSrc.$ABI.lst"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1077
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1078
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1079
			&Generic_Quote("$SrcPath$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1080
			"\t\$(GCC$Bld) $LangOptions -Wa,-adln -I \"$RTWSrcPath\" \$(INCDIR)  -o nul: \"$RTWSrcPath\\$Src\" > \$\@\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1081
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1082
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1083
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1084
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1085
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1086
sub PMEndSrc {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1087
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1088
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1089
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1090
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1091
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1092
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1093
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1094
sub PMEndSrcList {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1095
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1096
	# Deal with accumulated MAKEDIRS etc.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1097
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1098
	&Generic_End;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1099
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1100
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1101
sub PMPrefixFile 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1102
{ 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1103
    return &Generic_Quote(&main::Path_Drive.&main::EPOCIncPath."gcc.h");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1104
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1105
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1106
1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1107