sbsv1/abld/platform/cl_gcc.pm
author Zheng Shen <zheng.shen@nokia.com>
Mon, 30 Aug 2010 15:04:06 +0800
changeset 631 9435b9008a58
parent 599 fa7a3cc6effd
permissions -rw-r--r--
ROM Tools 13.1.0.1 Bug468 initialized static data built into a static library does not get initialized correctly
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_gcc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    18
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    19
my $GccPrefix='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    20
my $ToolPrefix='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    21
my $HelperLib='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    22
my %PlatOpt=(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    23
	'Dlltool'=>'',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    24
	'Entry'=>'-e',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    25
	'Gcc'=>'',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    26
	'Ld'=>'',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    27
	'Petran'=>'',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    28
	'Optimize'=>'-O'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    29
);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    30
my $Dlltool;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    31
my $Archive;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    32
my $Link;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    33
my $Objcopy;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    34
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
require Exporter;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    36
@ISA=qw(Exporter);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    37
@EXPORT=qw(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    38
	PMHelp_Mmp
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
	PMPlatProcessMmp
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    42
	PMUnderlyingABI
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    43
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    44
	PMStartBldList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
		PMBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
	PMStartSrcList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47
		PMBitMapBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    48
		PMResrcBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    49
		PMAifBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    50
		PMStartSrc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    51
		PMSrcDepend
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    52
			PMSrcBldDepend
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    53
			PMEndSrcBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    54
		PMEndSrc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    55
	PMEndSrcList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    56
);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    57
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    58
use cl_generic;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    59
use Genutl;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    60
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    61
use constant NOCOMPRESSIONMETHOD => 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    62
use constant INFLATECOMPRESSIONMETHOD => 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    63
use constant BYTEPAIRCOMPRESSIONMETHOD => 2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    64
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    65
use constant NOTPAGED => 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    66
use constant UNPAGED => 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    67
use constant PAGED => 2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    68
sub PMHelp_Mmp {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    69
	print "// No additional keywords for this platform\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    70
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    71
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    72
sub PMPlatProcessMmp (@) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    73
	my $MMPFILE=&main::MmpFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    74
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    75
	# set up START MARM ... END block module variables
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    76
	my @MmpWarn=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    77
	my $Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    78
	LINE: foreach $Line (@_) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    79
		my $LineInfo=shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    80
		$_=shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    81
		push @MmpWarn, "$LineInfo : Unrecognised Keyword \"$_\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    82
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    83
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    84
	undef $Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    85
	if (@MmpWarn) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    86
		warn
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    87
			"\nMMPFILE \"$MMPFILE\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    88
			"START .. END BLOCK WARNINGS(S)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    89
			@MmpWarn,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    90
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    91
		;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    92
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    93
	undef @MmpWarn;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    94
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    95
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    96
sub SystemTarget() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    97
	return 1 if &main::SystemTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    98
	my $ExportLibrary=&main::ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    99
	# N.B. should get better way to detect kernel probably!!
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   100
	return 1 if ($ExportLibrary =~ /EKERN/i);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   101
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   102
	return 0;
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
my %CompatibleABIs=(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   106
	ARMI=>['ARM4', 'THUMB'],
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   107
	ARM4=>['ARMI'],
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   108
	THUMB=>['ARMI']
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   109
);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   110
my @CompatibleABIs;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   111
sub PMUnderlyingABI($) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   112
	my ($ABI) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   113
	if ($ABI eq 'ARM4T') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   114
		if (&main::BuildAsARM) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   115
			return 'ARMI';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   116
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   117
		elsif (SystemTarget()) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   118
			return 'ARM4';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   119
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   120
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   121
			return 'THUMB';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   122
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   123
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   124
	return $ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   125
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   126
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   127
my $Makecmd;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   128
my %ABILibPath=();
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::Path_RltToWork(&main::SysIncPaths));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   137
	my @ChopRTWUserIncPaths=&main::Path_Chop(&main::Path_RltToWork(&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
		ARMI=>'-m arm_interwork',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   170
		ARM4=>'-m arm',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   171
		THUMB=>'-m thumb'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   172
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   173
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   174
#	work out the flags for various platforms
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   175
	if ($ABI eq 'ARMI') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   176
		$PlatOpt{Gcc}='-march=armv4t -mthumb-interwork';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   177
		$PlatOpt{Dlltool}=$ABIDlltool{ARMI};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   178
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   179
	elsif ($ABI eq 'ARM4T') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   180
		if (&main::BuildAsARM) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   181
			$PlatOpt{Gcc}='-march=armv4t -mthumb-interwork';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   182
			$PlatOpt{Dlltool}=$ABIDlltool{ARMI};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   183
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   184
		elsif ($SystemTrg) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   185
			$PlatOpt{Gcc}='-march=armv4';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   186
#			allow thumb for ARM4 ABI where necessary
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   187
			unless (&main::PlatABI eq 'ARM4') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   188
				$PlatOpt{Gcc}.='t';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   189
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   190
			$PlatOpt{Dlltool}=$ABIDlltool{ARM4};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   191
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   192
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   193
			$GccPrefix='thumb-epoc-pe-';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   194
			$PlatOpt{Gcc}='-mthumb-interwork -D__MARM_THUMB__';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   195
			$PlatOpt{Dlltool}=$ABIDlltool{THUMB};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   196
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   197
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   198
	elsif ($ABI eq 'ARM4') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   199
		$PlatOpt{Gcc}='-march=armv4';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   200
#		allow thumb for ARM4 ABI where necessary
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   201
		unless (&main::PlatABI eq 'ARM4') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   202
			$PlatOpt{Gcc}.='t';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   203
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   204
		$PlatOpt{Dlltool}=$ABIDlltool{ARM4};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   205
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   206
	elsif ($ABI eq 'THUMB') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   207
		$GccPrefix='thumb-epoc-pe-';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   208
		$PlatOpt{Gcc}='-mthumb-interwork';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   209
		$PlatOpt{Dlltool}=$ABIDlltool{THUMB};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   210
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   211
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   212
		&main::FatalError("Platform module - ABI \"$ABI\" unrecognised");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   213
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   214
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   215
	@CompatibleABIs=@{$CompatibleABIs{$UnderlyingABI}};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   216
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   217
#	set up CompatibleABI lib path hash
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   218
	foreach (@CompatibleABIs) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   219
		$ABILibPath{$_}=&main::Path_Strip("$LibPath..\\$_\\");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   220
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   221
	my %ABIRTWLibPath=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   222
	foreach (@CompatibleABIs) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   223
		$ABIRTWLibPath{$_}=&main::Path_RltToWork($ABILibPath{$_});
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
	$Dlltool=$ToolPrefix.'dlltool';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   227
	$Archive=$ToolPrefix.'ar';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   228
	$Link=$ToolPrefix.'ld';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   229
	$Objcopy=$ToolPrefix.'objcopy';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   230
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   231
	&Generic_Header(1,$Makecmd);	# define standard things using relative paths
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   232
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   233
#	GCC needs a fully-qualified path
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   234
	if ($ENV{'PATH'} !~ m/[a-zA-z]{1}:{1}.[^;]*epoc32\\gcc\\bin/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   235
		if ($Makecmd eq "nmake") {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   236
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   237
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   238
				"PATH=",&main::Path_Drive,$EPOCPath,"gcc\\bin;\$(PATH)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   239
				"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   240
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   241
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   242
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   243
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   244
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   245
				"# must set both PATH and Path to make it work correctly\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   246
				"Path:=",&main::Path_Drive,$EPOCPath,"gcc\\bin;\$(Path)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   247
				"PATH:=\$(Path)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   248
				"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   249
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   250
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   251
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   252
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   253
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   254
		"INCDIR  ="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   255
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   256
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   257
	foreach (@ChopRTWUserIncPaths) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   258
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   259
			" -I \"$_\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   260
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   261
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   262
	foreach (@ChopRTWSysIncPaths) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   263
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   264
			" -I \"$_\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   265
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   266
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   267
	if($VariantFile){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   268
	    # gcc needs a relativ path
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   269
	    $VariantFile = &main::Path_RltToWork($VariantFile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   270
	    &main::Output("\\\n  -include \"$VariantFile\"");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   271
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   272
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   273
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   274
		"\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
		"GCCFLAGS=$PlatOpt{Gcc} \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   279
		"\t\t-pipe -c -nostdinc -Wall -Wno-ctor-dtor-privacy -Wno-unknown-pragmas $WarningLevel\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   280
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   281
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   282
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   283
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   284
		"GCCDEFS ="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   285
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   286
	foreach(@MacroList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   287
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   288
			" -D$_"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   289
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   290
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   291
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   292
		" \$(USERDEFS)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   293
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   294
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   295
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   296
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   297
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   298
			"GCC$_ = ${GccPrefix}gcc"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   299
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   300
		if (/REL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   301
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   302
				      ' -s -fomit-frame-pointer ',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   303
				      $PlatOpt{Optimize}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   304
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   305
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   306
		elsif (/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   307
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   308
				' -g'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   309
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   310
			unless (&main::SrcDbg) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   311
			    &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   312
			    	' ', $PlatOpt{Optimize}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   313
			    );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   314
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   315
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   316
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   317
			' $(GCCFLAGS)'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   318
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   319
		foreach (&main::MacroList($_)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   320
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   321
				" -D$_"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   322
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   323
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   324
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   325
			" \$(GCCDEFS)\n"
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
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   329
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   330
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   331
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   332
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   333
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   334
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   335
			"$_ :"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   336
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   337
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   338
		if ($BasicTrgType !~ /IMPLIB/io) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   339
			&main::Output (
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   340
				" \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   341
				&Generic_Quote("\$(EPOCTRG$_)\\$Trg")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   342
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   343
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   344
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   345
#		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
   346
		if ($DefFile and not &main::ExportUnfrozen) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   347
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   348
				" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   349
				"\tLIBRARY\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   350
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   351
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   352
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   353
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   354
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   355
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   356
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   357
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   358
	# Resource building is done entirely via cl_generic.pm
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   359
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   360
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   361
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   362
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   363
			"RESOURCE$_ : MAKEWORK$_"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   364
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   365
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   366
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   367
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   368
		"\n",
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
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   372
		"LIBRARY : MAKEWORK"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   373
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   374
	if ($BasicTrgType=~/^LIB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   375
#		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
   376
		foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   377
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   378
				" $_"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   379
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   380
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   381
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   382
	elsif ($DefFile and !$NoExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   383
		unless (&main::ExportUnfrozen) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   384
			if (-e $DefFile) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   385
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   386
					" ", &Generic_Quote("\$(EPOCLIB)\\UREL\\$PrimaryExportLibrary.lib")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   387
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   388
				foreach (@CompatibleABIs) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   389
					&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   390
						" ", &Generic_Quote("$ABILibPath{$_}UREL\\$PrimaryExportLibrary.lib")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   391
					);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   392
					&Generic_MakeWorkDir('MAKEWORKLIBRARY',"$ABILibPath{$_}UREL");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   393
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   394
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   395
					"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   396
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   397
			} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   398
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   399
					"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   400
					"\t\@echo WARNING: Not attempting to create any import libraries.\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   401
					"\t\@echo When exports are frozen in \"$DefFile\", regenerate Makefile.\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   402
				);
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
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   406
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   407
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   408
				"\t\@echo Not attempting to create \"\$(EPOCLIB)\\UREL\\$PrimaryExportLibrary.lib\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   409
				"\t\@echo from frozen .DEF file, since EXPORTUNFROZEN specified.\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   410
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   411
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   412
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   413
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   414
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   415
			"# REAL TARGET - LIBRARY\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   416
			"# EPOCBLDP = ", &Generic_Definition('EPOCBLDP'), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   417
			"# EPOCLIB = ", &Generic_Definition('EPOCLIB'), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   418
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   419
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   420
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   421
			&Generic_Quote("\$(EPOCBLDP)\\$ExportLibrary.prep.def"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   422
			&Generic_Quote($DefFile), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   423
			"\tperl -S prepdef.pl \$< \$@\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   424
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   425
			&Generic_Quote("\$(EPOCLIB)\\UREL\\$ExportLibrary.lib"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   426
			&Generic_Quote("\$(EPOCBLDP)\\$ExportLibrary.prep.def"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   427
			"\tpushd ".&Generic_Quote("\$(EPOCBLDP)")." && \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   428
			"\t$Dlltool $PlatOpt{Dlltool} --output-lib \"$ExportLibrary.tmp.lib\" --def \"$ExportLibrary.prep.def\" --dllname \"$LinkAs\" && popd && move ", &Generic_Quote("\$(EPOCBLDP)\\$ExportLibrary.tmp.lib"), " \$@\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   429
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   430
		if ($ExtraExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   431
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   432
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   433
				&Generic_Quote("\$(EPOCLIB)\\UREL\\$ExtraExportLibrary.lib"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   434
				&Generic_Quote("\$(EPOCLIB)\\UREL\\$ExportLibrary.lib"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   435
				"\tcopy \$< \$@\n"
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
		foreach (@CompatibleABIs) {
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
				&Generic_Quote("$ABILibPath{$_}UREL\\$ExportLibrary.lib"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   442
				&Generic_Quote("\$(EPOCBLDP)\\$ExportLibrary.prep.def"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   443
				"\tpushd ".&Generic_Quote("\$(EPOCBLDP)")." && \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   444
				"\t$Dlltool $ABIDlltool{$_} --output-lib \"$ExportLibrary.tmp.lib\" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   445
				"\t\t--def \"$ExportLibrary.prep.def\" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   446
				"\t\t--dllname \"$LinkAs\" && popd && move ", &Generic_Quote("\$(EPOCBLDP)\\$ExportLibrary.tmp.lib"), " \$@\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   447
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   448
			if ($ExtraExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   449
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   450
					"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   451
					&Generic_Quote("$ABILibPath{$_}UREL\\$ExtraExportLibrary.lib"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   452
					&Generic_Quote("$ABILibPath{$_}UREL\\$ExportLibrary.lib"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   453
					"\tcopy \$< \$@\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   454
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   455
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   456
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   457
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   458
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   459
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   460
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   461
		"FREEZE :\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   462
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   463
	if ($DefFile and $BasicTrgType!~/^IMPLIB$/io) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   464
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   465
#			call perl on the script here so nmake will die if there are errors - this doesn't happen if calling perl in a batch file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   466
			"\tperl -S efreeze.pl \$(EFREEZE_ALLOW_REMOVE) \"$DefFile\" \"\$(EPOCBLDP)\\$ExportLibrary.def\" \n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   467
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   468
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   469
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   470
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   471
		"CLEANLIBRARY :\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   472
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   473
	if ($DefFile and !$NoExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   474
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   475
			"\t-\$(ERASE) \"\$(EPOCLIB)\\UREL\\$ExportLibrary.lib\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   476
			"\t-\$(ERASE) \"\$(EPOCBLDP)\\$ExportLibrary.prep.def\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   477
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   478
		if ($ExtraExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   479
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   480
				"\t-\$(ERASE) \"\$(EPOCLIB)\\UREL\\$ExtraExportLibrary.lib\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   481
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   482
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   483
		foreach (@CompatibleABIs) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   484
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   485
				"\t-\$(ERASE) \"$ABILibPath{$_}UREL\\$ExportLibrary.lib\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   486
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   487
			if ($ExtraExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   488
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   489
					"\t-\$(ERASE) \"$ABILibPath{$_}UREL\\$ExtraExportLibrary.lib\"\n"
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
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   495
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   496
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   497
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   498
	&Generic_MakeWorkDir('MAKEWORKLIBRARY',"${LibPath}UREL");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   499
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   500
	&Generic_Releaseables;
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
sub PMBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   505
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   506
	my @ASSPLibList=&main::ASSPLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   507
	my @SrcList=&main::SrcList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   508
	my $BaseTrg=&main::BaseTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   509
	my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   510
	my $ChopBldPath=&main::Path_Chop(&main::BldPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   511
	my $DefFile=&main::DefFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   512
	my $EPOCIncPath=&main::EPOCIncPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   513
	my $FirstLib=&main::FirstLib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   514
	my $BasicTrgType=&main::BasicTrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   515
	my @LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   516
	my $LibPath=&main::LibPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   517
	my $LinkAs=&main::LinkAs;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   518
	my $ChopRelPath=&main::Path_Chop(&main::RelPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   519
	my $RelPath=&main::RelPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   520
	my @StatLibList=&main::StatLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   521
	my $StatLinkPath=&main::StatLinkPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   522
	my $Trg=&main::Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   523
	my $TrgType=&main::TrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   524
	my @UidList=&main::UidList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   525
	my $ExportLibrary=&main::ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   526
	my $NoExportLibrary=&main::NoExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   527
	my $SystemTrg = SystemTarget();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   528
	my %Version = &main::Version();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   529
	my $ExtraExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   530
	unless ($Version{explicit}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   531
		$ExtraExportLibrary = $ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   532
		$ExtraExportLibrary =~ s/\{(\d|a|b|c|d|e|f){8}\}//i;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   533
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   534
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   535
	if ($Bld =~ /DEB/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   536
		@LibList = &main::DebugLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   537
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   538
		@LibList = &main::LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   539
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   540
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   541
#	set up $LinkAs
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   542
	$UidList[2]=~/^0x(.*)$/o;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   543
	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
   544
		$LinkAs=join '', &main::Path_Split('Base',$LinkAs),"[$1]",&main::Path_Split('Ext',$LinkAs);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   545
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   546
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   547
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   548
	# REAL TARGETS
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   549
	#-------------
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   550
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   551
		"# REAL TARGET - BUILD VARIANT $Bld\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   552
		"\n"
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
#	releasables
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   556
	my @releaseables;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   557
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   558
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   559
	push @releaseables, "$RelPath$Trg" if ($BasicTrgType!~/^IMPLIB$/io);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   560
	if ($BasicTrgType=~/^(DLL|EXE)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   561
		push @releaseables, "$RelPath$Trg.MAP";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   562
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   563
	if (-e $DefFile and !$NoExportLibrary) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   564
		push @releaseables, "$LibPath$ExportLibrary.lib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   565
		push @releaseables, "$LibPath$ExtraExportLibrary.lib" if ($ExtraExportLibrary);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   566
		foreach (@CompatibleABIs) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   567
			push @releaseables, "$ABILibPath{$_}UREL\\$ExportLibrary.lib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   568
			push @releaseables, "$ABILibPath{$_}UREL\\$ExtraExportLibrary.lib" if ($ExtraExportLibrary);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   569
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   570
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   571
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   572
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   573
		"WHAT$Bld : WHATGENERIC\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   574
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   575
		"CLEAN$Bld : CLEANBUILD$Bld CLEANRELEASE$Bld\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   576
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   577
		"CLEANBUILD$Bld : \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   578
		"\t\@perl -S ermdir.pl \"\$(EPOCBLDP$Bld)\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   579
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   580
		"CLEANRELEASE$Bld : CLEANGENERIC\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   581
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   582
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   583
	&Generic_WhatCleanTargets($Bld, "WHAT$Bld", "CLEANRELEASE$Bld", @releaseables);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   584
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   585
	&Generic_MakeWorkDir("MAKEWORK$Bld",$ChopBldPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   586
	if (defined $ENV{PBUILDPID}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   587
		my $ChopBldPPath = $ChopBldPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   588
		$ChopBldPPath =~ s/(.*)\\(\w+)\\$Bld$/$1\\$2\$\(PBUILDPID\)\\$Bld/i;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   589
		&Generic_MakeWorkDir("MAKEWORK$Bld",$ChopBldPPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   590
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   591
	&Generic_MakeWorkDir("MAKEWORK$Bld",$ChopRelPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   592
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   593
	return if ($BasicTrgType=~/^IMPLIB$/io);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   594
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   595
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   596
		"LISTING$Bld : MAKEWORK$Bld"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   597
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   598
	foreach (@SrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   599
		my $BaseSrc = &main::Path_Split('Base', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   600
		my $Ext = &main::Path_Split('Ext', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   601
		$BaseSrc.='_' if (lc($Ext) eq '.cia');
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\tLISTING$Bld$BaseSrc"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   604
   		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   605
   	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   606
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   607
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   608
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   609
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   610
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   611
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   612
		"LIBS$Bld="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   613
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   614
	if ($BasicTrgType=~/^DLL$/o) { # Add the DLL stub library
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   615
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   616
			" \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   617
			&Generic_Quote("\$(EPOCSTATLINK$Bld)\\EDLLSTUB.LIB")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   618
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   619
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   620
	if ($HelperLib) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   621
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   622
			" \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   623
			&Generic_Quote("\$(EPOCSTATLINK$Bld)\\$HelperLib")
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 (@StatLibList) {
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("\$(EPOCSTATLINK$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
	if ($BasicTrgType=~/^(DLL|EXE)/o) { # Add the GCC helper fns
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   633
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   634
			" \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   635
			&Generic_Quote("\$(EPOCSTATLINK$Bld)\\EGCC.LIB")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   636
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   637
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   638
	foreach (@ASSPLibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   639
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   640
			" \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   641
			&Generic_Quote("\$(EPOCASSPLINK$Bld)\\$_")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   642
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   643
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   644
	foreach (@LibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   645
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   646
			" \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   647
			&Generic_Quote("\$(EPOCLINK$Bld)\\$_")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   648
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   649
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   650
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   651
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   652
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   653
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   654
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   655
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   656
		"# EPOCBLDP$Bld = ", &main::Path_AbsToWork(&Generic_Definition("EPOCBLDP$Bld")), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   657
		"# EPOCSTATLINK$Bld = ", &main::Path_AbsToWork(&Generic_Definition("EPOCSTATLINK$Bld")), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   658
		"# EPOCLIB = ", &main::Path_AbsToWork(&Generic_Definition("EPOCLIB")), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   659
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   660
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   661
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   662
		&Generic_Quote("\$(EPOCTRG$Bld)\\$Trg"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   663
		&Generic_Quote("\$(EPOCBLDP$Bld)\\$BaseTrg.in")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   664
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   665
	if (-e $DefFile) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   666
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   667
			" ", &Generic_Quote($DefFile)
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 ($BasicTrgType=~/^(EXE|DLL)$/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
#	Establish the entry point symbol
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   681
	my $EntrySymbol;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   682
	if ($BasicTrgType=~/^DLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   683
		$EntrySymbol = '_E32Dll';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   684
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   685
	elsif ($BasicTrgType=~/^EXE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   686
		$EntrySymbol = '_E32Startup';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   687
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   688
	my $AbsentSubst = '';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   689
	if ($EntrySymbol) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   690
		$AbsentSubst = " -absent $EntrySymbol";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   691
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   692
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   693
	if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/o || $TrgType=~/^EXEDLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   694
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   695
#		generate a .DEF file from the objects and static libraries
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   696
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   697
			"\tpushd ".&Generic_Quote("\$(EPOCBLDP$Bld)")." && \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   698
			"\t$Dlltool $PlatOpt{Dlltool} --output-def \"$ExportLibrary.inf\" \"$BaseTrg.in\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   699
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   700
		foreach (@StatLibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   701
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   702
				" \"", &main::Path_MakeRltToBase(&main::Path_AbsToWork(&Generic_Definition("EPOCBLDP$Bld")."\\"), &main::Path_AbsToWork(&Generic_Definition("EPOCSTATLINK$Bld")."\\"))."$_\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   703
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   704
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   705
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   706
			" && popd\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
#		reorder the .DEF file taking frozen exports into account if there are any
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   710
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   711
#			call perl on the script here so nmake will die if there are errors - this doesn't happen if calling perl in a batch file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   712
			"\tperl -S makedef.pl -Deffile \"\$(EPOCBLDP$Bld)\\$ExportLibrary.inf\"$AbsentSubst"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   713
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   714
		if (SystemTarget()) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   715
    			&main::Output( "\t\t-SystemTargetType \\\n" );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   716
	    	}		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   717
		if (-e $DefFile) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   718
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   719
				" -Frzfile \"$DefFile\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   720
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   721
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   722
		# freeze ordinals, a maximum of 2, for polymorphic dlls
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   723
		my $Ordinal;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   724
		my $Num=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   725
		foreach $Ordinal (&main::Exports) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   726
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   727
				" -$Num $Ordinal"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   728
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   729
			$Num++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   730
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   731
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   732
			"  \"\$(EPOCBLDP)\\$ExportLibrary.def\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   733
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   734
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   735
#		delete the unordered definition file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   736
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   737
			"\t-\$(ERASE) \"\$(EPOCBLDP$Bld)\\$ExportLibrary.inf\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   738
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   739
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   740
#		generate an export object from the ordered .DEF file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   741
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   742
			"\tpushd ".&Generic_Quote("\$(EPOCBLDP$Bld)")." && \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   743
			"\t$Dlltool $PlatOpt{Dlltool} --def \"..\\$ExportLibrary.def\" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   744
			"\t\t--output-exp \"$ExportLibrary.exp\" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   745
			"\t\t--dllname \"$LinkAs\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   746
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   747
		if (&main::ExportUnfrozen) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   748
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   749
				"\\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   750
				"\t\t--output-lib \"", &main::Path_MakeRltToBase(&main::Path_AbsToWork(&Generic_Definition("EPOCBLDP$Bld")."\\"), &main::Path_AbsToWork(&Generic_Definition("EPOCLIB")."\\"))."UREL\\$ExportLibrary.lib\"",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   751
				" && popd\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   752
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   753
			if ($ExtraExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   754
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   755
					"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   756
					"\tcopy \$(EPOCLIB)\\UREL\\$ExportLibrary.lib ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   757
				       	"\$(EPOCLIB)\\UREL\\$ExtraExportLibrary.lib",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   758
					"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   759
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   760
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   761
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   762
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   763
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   764
				" && popd\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   765
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   766
		}				
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
#	call ld to do base relocations (and dll exports)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   770
	if ($BasicTrgType=~/^(DLL|EXE)/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   771
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   772
			"\t$Link $PlatOpt{Ld} -s"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   773
			);	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   774
		if ($BasicTrgType=~/^DLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   775
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   776
				" $PlatOpt{Entry} $EntrySymbol -u $EntrySymbol \"\$(EPOCBLDP$Bld)\\$ExportLibrary.exp\" --dll \\\n"
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
		elsif ($BasicTrgType=~/^EXE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   780
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   781
				" $PlatOpt{Entry} $EntrySymbol -u $EntrySymbol \\\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   782
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   783
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   784
#		--whole-archive is required here apparently because of a defect  in the gcc toolchain
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   785
#		the flag can probably be removed with a later version of gcc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   786
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   787
			"\t\t--base-file \"\$(EPOCBLDP$Bld)\\$BaseTrg.bas\" -o \"\$(EPOCBLDP$Bld)\\$Trg\" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   788
			"\t\t\"\$(EPOCSTATLINK$Bld)\\$FirstLib\" --whole-archive \"\$(EPOCBLDP$Bld)\\$BaseTrg.in\" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   789
			"\t\t--no-whole-archive"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   790
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   791
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   792
			" \$(LIBS$Bld) \$(USERLDFLAGS)\n"
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
#		delete temporary files
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   796
		if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/o || $TrgType=~/^EXEDLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   797
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   798
				"\t-\$(ERASE) \"\$(EPOCBLDP$Bld)\\$ExportLibrary.exp\"\n"
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
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   802
			"\t-\$(ERASE) \"\$(EPOCBLDP$Bld)\\$Trg\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   803
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   804
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   805
#		call dlltool to do base relocations (and dll exports)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   806
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   807
			"\tpushd ".&Generic_Quote("\$(EPOCBLDP$Bld)")." && \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   808
			"\t$Dlltool $PlatOpt{Dlltool} \\\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   809
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   810
		if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/o || $TrgType=~/^EXEDLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   811
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   812
				"\t\t--def \"..\\$ExportLibrary.def\" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   813
				"\t\t--dllname \"$LinkAs\" \\\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   814
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   815
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   816
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   817
			"\t\t--base-file \"$BaseTrg.bas\" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   818
			"\t\t--output-exp \"$ExportLibrary.exp\" && popd\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   819
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   820
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   821
#		delete temporary files
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   822
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   823
			"\t-\$(ERASE) \"\$(EPOCBLDP$Bld)\\$BaseTrg.bas\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   824
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   825
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   826
#		call ld to link the target
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   827
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   828
			"\t$Link $PlatOpt{Ld}"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   829
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   830
		if ($Bld=~/^U?REL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   831
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   832
				" -s"
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
		if ($BasicTrgType=~/^DLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   836
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   837
				" $PlatOpt{Entry} $EntrySymbol -u $EntrySymbol --dll \\\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   838
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   839
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   840
		elsif ($BasicTrgType=~/^EXE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   841
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   842
				" $PlatOpt{Entry} $EntrySymbol -u $EntrySymbol \\\n"
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
#		--whole-archive is required here apparently because of a defect in the gcc toolchain
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   846
#		the flag can probably be removed with a later version of gcc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   847
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   848
			"\t\t\"\$(EPOCBLDP$Bld)\\$ExportLibrary.exp\" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   849
			"\t\t-Map \"\$(EPOCTRG$Bld)\\$Trg.map\" -o \"\$(EPOCBLDP$Bld)\\$Trg\" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   850
			"\t\t\"\$(EPOCSTATLINK$Bld)\\$FirstLib\" --whole-archive \"\$(EPOCBLDP$Bld)\\$BaseTrg.in\" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   851
			"\t\t--no-whole-archive"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   852
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   853
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   854
			" \$(LIBS$Bld) \$(USERLDFLAGS)\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   855
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   856
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   857
#		delete temporary files
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   858
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   859
			"\t-\$(ERASE) \"\$(EPOCBLDP$Bld)\\$ExportLibrary.exp\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   860
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   861
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   862
		if ($Bld=~/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   863
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   864
				"\t$Objcopy -X \"\$(EPOCBLDP$Bld)\\$Trg\" \"\$(EPOCTRG$Bld)\\$BaseTrg.sym\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   865
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   866
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   867
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   868
		if (&main::CompressTarget) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   869
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   870
			"\tpetran $PlatOpt{Petran} -version ", &Genutl_VersionToUserString(%Version), " -sid ", &main::SecureId(), " -nocompress " ,  " \"\$(EPOCBLDP$Bld)\\$Trg\" \"\$\@\" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   871
			"\t\t"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   872
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   873
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   874
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   875
			if(&main::CompressTargetMode==NOCOMPRESSIONMETHOD){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   876
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   877
					"\tpetran $PlatOpt{Petran} -version ", &Genutl_VersionToUserString(%Version), " -sid ", &main::SecureId(), " \"\$(EPOCBLDP$Bld)\\$Trg\" \"\$\@\" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   878
					"\t\t"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   879
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   880
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   881
			elsif(&main::CompressTargetMode==INFLATECOMPRESSIONMETHOD){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   882
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   883
					"\tpetran $PlatOpt{Petran} -version ", &Genutl_VersionToUserString(%Version), " -sid ", &main::SecureId(), " ", "  -compressionmethod deflate", " \"\$(EPOCBLDP$Bld)\\$Trg\" \"\$\@\" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   884
					"\t\t"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   885
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   886
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   887
			elsif(&main::CompressTargetMode==BYTEPAIRCOMPRESSIONMETHOD){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   888
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   889
					"\tpetran $PlatOpt{Petran} -version ", &Genutl_VersionToUserString(%Version), " -sid ", &main::SecureId(), " ", "  -compressionmethod bytepair", " \"\$(EPOCBLDP$Bld)\\$Trg\" \"\$\@\" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   890
					"\t\t"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   891
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   892
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   893
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   894
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   895
		if (&main::AllowDllData) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   896
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   897
				' -allow'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   898
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   899
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   900
		if (not &main::CallDllEntryPoints) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   901
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   902
				' -nocall'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   903
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   904
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   905
		if (&main::DataLinkAddress) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   906
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   907
				' -datalinkaddress ',&main::DataLinkAddress
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   908
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   909
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   910
		if (&main::FixedProcess) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   911
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   912
				' -fixed'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   913
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   914
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   915
		if (&main::HeapSize) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   916
			my %HeapSize=&main::HeapSize;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   917
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   918
				' -heap ',$HeapSize{Min},' ',$HeapSize{Max}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   919
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   920
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   921
		if (&main::ProcessPriority) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   922
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   923
				' -priority ',&main::ProcessPriority
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   924
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   925
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   926
		if (&main::SmpSafe) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   927
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   928
				' -smpsafe'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   929
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   930
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   931
		if (&main::StackSize) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   932
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   933
				' -stack ',&main::StackSize
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   934
			);
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
 		if (&main::CodePagingTargetMode == UNPAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   938
 			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   939
 				' -codepaging unpaged'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   940
 			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   941
 		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   942
 		elsif (&main::CodePagingTargetMode == PAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   943
 			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   944
 				' -codepaging paged'
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
 		if (&main::DataPagingTargetMode == UNPAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   949
   			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   950
 				' -datapaging unpaged'
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
 		elsif (&main::DataPagingTargetMode == PAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   954
   			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   955
 				' -datapaging paged'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   956
   			);
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
		my $i=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   960
		foreach (@UidList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   961
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   962
				" -uid$i $_"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   963
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   964
			$i++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   965
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   966
		if(&main::VendorId) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   967
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   968
				' -vid ',&main::VendorId
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   969
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   970
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   971
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   972
			' -capability ',&main::Capability,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   973
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   974
		&main::Output("\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   975
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   976
			"\t-\$(ERASE) \"\$(EPOCBLDP$Bld)\\$Trg\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   977
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   978
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   979
	elsif ($BasicTrgType=~/^LIB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   980
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   981
			"\tcopy \"\$(EPOCBLDP$Bld)\\$BaseTrg.in\" \"\$(EPOCSTATLINK$Bld)\\$Trg\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   982
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   983
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   984
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   985
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   986
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   987
	);
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
	# TARGET *.IN
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   991
	#------------
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   992
	if (scalar @SrcList >150) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   993
		# deal with very long lists by splitting them into 150 file pieces, which allows
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   994
		# about 200 bytes per filename if the underlying max size is 32K
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   995
		#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   996
		my $counter1=150;	# i.e. trigger new variable immediately
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   997
		my $counter2=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   998
		my @objvarlist=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   999
		foreach (@SrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1000
			if ($counter1==150) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1001
				$counter1=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1002
				$counter2++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1003
				my $objvar = "OBJECTS$Bld$counter2";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1004
				push @objvarlist, " \$($objvar)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1005
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1006
					"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1007
					"$objvar="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1008
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1009
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1010
			my $BaseSrc = &main::Path_Split('Base', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1011
			my $Ext = &main::Path_Split('Ext', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1012
			$BaseSrc.='_' if (lc($Ext) eq '.cia');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1013
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1014
				" \\\n\t", &Generic_Quote("\$(EPOCBLDP$Bld)\\$BaseSrc.o")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1015
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1016
			$counter1++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1017
		}
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",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1020
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1021
			&Generic_Quote("\$(EPOCBLDP$Bld)\\$BaseTrg.in"), " : ", @objvarlist,"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1022
			"\tif exist \"\$\@\" del \"\$\@\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1023
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1024
		foreach (@objvarlist) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1025
			# Add the files to the list in groups
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1026
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1027
				"\t$Archive cr \$\@$_\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1028
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1029
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1030
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1031
			"\n\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1032
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1033
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1034
		# shorter lists remain unchanged
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1035
		#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1036
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1037
			"OBJECTS$Bld="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1038
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1039
		foreach (@SrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1040
			my $BaseSrc = &main::Path_Split('Base', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1041
			my $Ext = &main::Path_Split('Ext', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1042
			$BaseSrc.='_' if (lc($Ext) eq '.cia');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1043
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1044
				" \\\n\t", &Generic_Quote("\$(EPOCBLDP$Bld)\\$BaseSrc.o")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1045
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1046
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1047
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1048
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1049
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1050
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1051
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1052
			&Generic_Quote("\$(EPOCBLDP$Bld)\\$BaseTrg.in"), " : \$(OBJECTS$Bld)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1053
			"\tif exist \"\$\@\" del \"\$\@\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1054
			"\t$Archive cr \$\@ \$^\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1055
			"\n\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1056
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1057
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1058
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1059
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1060
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1061
sub PMStartSrcList {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1062
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1063
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1064
		"# SOURCES\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
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1068
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1069
sub PMBitMapBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1070
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1071
	&Generic_BitMapBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1072
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1073
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1074
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1075
sub PMResrcBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1076
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1077
	&Generic_ResrcBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1078
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1079
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1080
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1081
sub PMAifBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1082
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1083
	&Generic_AifBld;
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1087
sub PMStartSrc {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1088
	my $Src=&main::Src;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1089
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1090
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1091
		"# Source $Src\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1092
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1093
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1094
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1095
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1096
sub PMSrcDepend {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1097
	my @BldList=&main::BldList;	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1098
	my @DepList=&main::DepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1099
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1100
	my $ExtSrc=&main::ExtSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1101
	my $cia = (lc($ExtSrc) eq '.cia') ? "_" : "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1102
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1103
	return if (@DepList == 0);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1104
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1105
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1106
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1107
			&Generic_Quote("\$(EPOCBLDP$_)\\$BaseSrc$cia.lis"), " ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1108
			&Generic_Quote("\$(EPOCBLDP$_)\\$BaseSrc$cia.o"), " \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1109
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1110
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1111
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1112
		":"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1113
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1114
	foreach (@DepList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1115
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1116
		" \\\n\t", &Generic_Quote($_)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1117
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1118
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1119
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1120
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1121
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1122
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1123
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1124
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1125
sub PMSrcBldDepend {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1126
	my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1127
	my @DepList=&main::DepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1128
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1129
	my $ExtSrc=&main::ExtSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1130
	my $cia = (lc($ExtSrc) eq '.cia') ? "_" : "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1131
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1132
	return if (@DepList == 0);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1133
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1134
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1135
		&Generic_Quote("\$(EPOCBLDP$Bld)\\$BaseSrc$cia.lis"), " ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1136
		&Generic_Quote("\$(EPOCBLDP$Bld)\\$BaseSrc$cia.o"), " :",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1137
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1138
	foreach (@DepList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1139
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1140
			" \\\n\t", &Generic_Quote($_)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1141
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1142
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1143
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1144
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1145
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1146
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1147
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1148
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1149
sub PMEndSrcBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1150
	my $ABI=&main::ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1151
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1152
	my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1153
	my $Src=ucfirst lc &main::Src;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1154
	my $SrcPath=&main::SrcPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1155
	my $Ext = &main::Path_Split('Ext', $Src);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1156
	my $Cia = (lc($Ext) eq '.cia') ? 1 : 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1157
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1158
	my $RTWSrcPath=&main::Path_Chop(&main::Path_RltToWork($SrcPath));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1159
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1160
	# Use GCC trick to get assembler source files preprocessed with CPP
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1161
	$Src =~ s/\.s$/.S/i;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1162
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1163
	if ($Cia) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1164
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1165
			&Generic_Quote("\$(EPOCBLDP$Bld)\\$BaseSrc\_.o"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1166
			&Generic_Quote("$SrcPath$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1167
			"\techo $Src\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1168
			"\t\$(GCC$Bld) -x c++ -D__CIA__ -I \"$RTWSrcPath\" \$(INCDIR) -o \$\@ \"$RTWSrcPath\\$Src\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1169
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1170
	#		generate an assembly listing target too
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1171
			"LISTING$Bld$BaseSrc\_ : ", &Generic_Quote("\$(EPOCBLDP$Bld)\\$BaseSrc\_.lis"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1172
			"\t", &Generic_CopyAction("$SrcPath$BaseSrc\_.$ABI.lst"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1173
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1174
			&Generic_Quote("\$(EPOCBLDP$Bld)\\$BaseSrc\_.lis"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1175
			&Generic_Quote("$SrcPath$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1176
			"\t\$(GCC$Bld) -x c++ -D__CIA__ -Wa,-adln -I \"$RTWSrcPath\" \$(INCDIR) -o nul: \"$RTWSrcPath\\$Src\" > \$\@\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1177
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1178
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1179
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1180
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1181
			&Generic_Quote("\$(EPOCBLDP$Bld)\\$BaseSrc.o"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1182
			&Generic_Quote("$SrcPath$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1183
			"\techo $Src\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1184
			"\t\$(GCC$Bld) -I \"$RTWSrcPath\" \$(INCDIR) -o \$\@ \"$RTWSrcPath\\$Src\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1185
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1186
	#		generate an assembly listing target too
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1187
			"LISTING$Bld$BaseSrc : ", &Generic_Quote("\$(EPOCBLDP$Bld)\\$BaseSrc.lis"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1188
			"\t", &Generic_CopyAction("$SrcPath$BaseSrc.$ABI.lst"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1189
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1190
			&Generic_Quote("\$(EPOCBLDP$Bld)\\$BaseSrc.lis"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1191
			&Generic_Quote("$SrcPath$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1192
			"\t\$(GCC$Bld) -Wa,-adln -I \"$RTWSrcPath\" \$(INCDIR) -o nul: \"$RTWSrcPath\\$Src\" > \$\@\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1193
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1194
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1195
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1196
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1197
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1198
sub PMEndSrc {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1199
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1200
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1201
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1202
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1203
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1204
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1205
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1206
sub PMEndSrcList {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1207
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1208
	# Deal with accumulated MAKEDIRS etc.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1209
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1210
	&Generic_End;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1211
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1212
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1213
1;