sbsv1/abld/platform/cl_codewarrior.pm
author Bob Rosenberg <bob.rosenberg@nokia.com>
Mon, 06 Sep 2010 09:57:24 +0100
changeset 639 0e65f93be3cb
parent 599 fa7a3cc6effd
permissions -rw-r--r--
Joinsysdef schema calculation handles missing files. rootsystef generation does not modify embedded metatdata.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
599
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     1
# Copyright (c) 2001-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_codewarrior;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    18
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    19
# declare variables global for module
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    20
my @Win32LibList=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    21
my $Win32StdHeaders;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    22
my $BaseAddressFlag;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    23
my $Win32Resrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    24
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    25
my $MWCC;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    26
my $MWLD;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    27
my $MWIncludePath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    28
my $MWIncludeVar;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    29
my $CWVersion;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    30
my $CWVersionReadable;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    31
my $CWBuildNum;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    32
my $CWRuntimeLibs="";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    33
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    34
require Exporter;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
@ISA=qw(Exporter);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    36
@EXPORT=qw(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    37
	PMHelp_Mmp
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    38
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
	PMCheckPlatformL
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
	PMPlatProcessMmp
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    42
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    43
	PMPlatCheckSource
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    44
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
	PMStartBldList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
		PMBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47
	PMStartSrcList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    48
		PMBitMapBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    49
		PMResrcBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    50
		PMAifBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    51
		PMStartSrc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    52
		PMSrcDepend
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    53
			PMSrcBldDepend
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    54
			PMEndSrcBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    55
		PMEndSrc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    56
	PMEndSrcList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    57
);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    58
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    59
use Winutl;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    60
use cl_generic;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    61
use E32Variant;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    62
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    63
my $NamedSymLkup = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    64
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    65
my $stdcpp_tag_file = 'tag_coff';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    66
my $stdcpp_tag_path = '$(EPOCROOT)epoc32\tools\tag';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    67
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    68
sub RoundUp1k($) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    69
	# Accept C hexadecimal number (0xNNN).  Convert argument to Kb
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    70
	# rounded up to the next 1kb boundary.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    71
	use integer;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    72
	return (hex($_[0]) + 1023) / 1024;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    73
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    74
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    75
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    76
sub PMHelp_Mmp {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    77
	&Winutl_Help_Mmp;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    78
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    79
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    80
sub SysTrg () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    81
	return 1 if &main::SystemTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    82
	my $ExportLibrary=&main::ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    83
	return 1 if ($ExportLibrary =~ /EKERN/i);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    84
	my $Trg=&main::Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    85
	return 1 if ($Trg =~ /KSRT/i);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    86
	return 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    87
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    88
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    89
sub PMCheckPlatformL {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    90
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    91
	my $IsProxyWrapperOption=&main::ProxyWrapperOption();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    92
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    93
	# check version of CodeWarrior for Symbian OS
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    94
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    95
	if (defined($ENV{MWCSym2Includes})) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    96
		$MWCC = "mwccsym2.exe";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    97
		$MWLD = "mwldsym2.exe";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    98
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    99
	if (!defined($MWCC) && defined($ENV{MWSym2Libraries})) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   100
		$MWCC = "mwccsym2.exe";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   101
		$MWLD = "mwldsym2.exe";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   102
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   103
	if (!defined($MWCC) && defined($ENV{CWFolder})) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   104
		$MWCC = "mwcc.exe";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   105
		$MWLD = "mwld.exe";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   106
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   107
	if (!defined($MWCC)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   108
		die "ERROR: Unable to identify a valid CodeWarrior for Symbian OS installation\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   109
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   110
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   111
	# determine default include path
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   112
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   113
	$MWIncludeVar = 'MWCIncludes';	# default, even if it doesn't exist
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   114
	$MWIncludePath = '';			# default is empty
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   115
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   116
	foreach my $var ('MWCSym2Includes','MWCWinx86Includes','MWCIncludes') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   117
		if (defined($ENV{$var})) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   118
			$MWIncludePath = $ENV{$var};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   119
			$MWIncludeVar = $var;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   120
			last;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   121
		}
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
	open PIPE, "$MWCC |", or &main::FatalError( "Failed to find version information for $MWCC \n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   125
	while (<PIPE>) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   126
		if($_ =~ /Version\s+(\d+)\.(\d+)\.(\d+)\s+build\s+(\d+)/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   127
			my $MajorVer = $1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   128
			my $MinorVer = $2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   129
			my $PatchNum = $3;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   130
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   131
			$CWBuildNum = $4;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   132
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   133
            $CWVersionReadable = "$1.$2.$3 build $4";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   134
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   135
#			The CW compiler documentation says that the compiler version is a 2-byte value as
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   136
#			0xMnpp (the corresponding CW's pre-defined macro is __MWERKS__), where,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   137
#				M is the major version number (which means it is accomodated in the first 4 bits, 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   138
#				n is the minor version number (which means it is accomodated in the next 4 bits, 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   139
#				pp is the patch number (which means it is accomodated in the next 8 bits.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   140
#			Here, an integer is formed from these 3 values to uniquely identify the compiler version.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   141
			$CWVersion = ($MajorVer << 12) + ($MinorVer << 8) + $PatchNum;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   142
			last;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   143
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   144
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   145
	close PIPE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   146
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   147
	if ($IsProxyWrapperOption){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   148
		$MWCC = "$ENV{ABLD_COMPWRAP} " . $MWCC;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   149
		$MWLD = "$ENV{ABLD_COMPWRAP} " . $MWLD;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   150
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   151
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   152
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   153
sub PMPlatProcessMmp (@) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   154
	&Winutl_DoMmp(\@_, $MWIncludePath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   155
	$BaseAddressFlag=&Winutl_BaseAddress;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   156
	if ($BaseAddressFlag ne "") {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   157
		$BaseAddressFlag=" -imagebase \"$BaseAddressFlag\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   158
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   159
	@Win32LibList=&Winutl_Win32LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   160
	$Win32Resrc=&Winutl_Win32Resrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   161
	$Win32StdHeaders=&Winutl_Win32StdHeaders;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   162
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   163
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   164
sub PMPlatCheckSource () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   165
	&Winutl_CheckSourceMMPMetaData ();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   166
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   167
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   168
sub PMStartBldList($) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   169
	my ($makecmd) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   170
	my $AifStructRef=&main::AifStructRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   171
	my $BaseTrg=&main::BaseTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   172
	my $BitMapStructRef=&main::BitMapStructRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   173
	my @BldList=&main::BldList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   174
	my @ChopSysIncPaths=&main::Path_Chop(&main::SysIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   175
	my @ChopUserIncPaths=&main::Path_Chop(&main::UserIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   176
	my $ExportLibrary=&main::ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   177
	my $NoExportLibrary=&main::NoExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   178
	my $DefFile=&main::DefFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   179
	my $BasicTrgType=&main::BasicTrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   180
	my $LibPath=&main::LibPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   181
	my @MacroList=&main::MacroList();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   182
	push @MacroList, "__SUPPORT_CPP_EXCEPTIONS__";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   183
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   184
	push @MacroList, "__SYMBIAN_STDCPP_SUPPORT__" if StdCppTarget();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   185
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   186
    my $VariantFile=&main::VariantFile();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   187
	my $ResourceStructRef=&main::ResourceStructRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   188
	my $Plat=&main::Plat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   189
	my $Trg=&main::Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   190
	my $TrgType=&main::TrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   191
	my $WarningLevel=&main::CompilerOption("CW");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   192
	my $LinkAs=&main::LinkAs;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   193
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   194
	Generic_Header(0,$makecmd);	# define standard things using absolute paths
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   195
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   196
	my $TrgDir="";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   197
	my $AifTrgDir="";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   198
	if (&Generic_Definition("TRGDIR") ne "") {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   199
		$TrgDir="\$(TRGDIR)\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   200
		$AifTrgDir=$TrgDir;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   201
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   202
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   203
# Handle migration of binaries to secure location
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   204
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   205
	&Winutl_AdjustTargetPath(\$TrgDir);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   206
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   207
# Change - mwwinrc.exe uses MWWinx86Includes or MWCIncludes, but some installations
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   208
# fail to install either. Set MWCIncludes from the chosen variable as part
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   209
# of the Makefile.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   210
	if (!defined($ENV{MWCIncludes}) && $MWIncludeVar ne 'MWCIncludes') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   211
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   212
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   213
			"MWCIncludes:=\$($MWIncludeVar)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   214
			"export MWCIncludes\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   215
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   216
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   217
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   218
	if( ($CWVersion == 0x3205 && $CWBuildNum == 465)){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   219
		if($TrgType =~ /^(STDDLL|STDEXE|STDLIB)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   220
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   221
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   222
				"MWSym2LibraryFiles:=msl_all_mse_symbian_d.lib;gdi32.lib;user32.lib;kernel32.lib;\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   223
				"export MWSym2LibraryFiles\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   224
				"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   225
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   226
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   227
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   228
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   229
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   230
				"MWSym2LibraryFiles:=msl_all_static_mse_symbian_d.lib;gdi32.lib;user32.lib;kernel32.lib;\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   231
				"export MWSym2LibraryFiles\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   232
				"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   233
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   234
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   235
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   236
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   237
	if($WarningLevel =~ /\-cwd\s\s*include/){	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   238
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   239
			"# EPOC DEFINITIONS\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   240
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   241
			"INCDIR  = -cwd include -i-"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   242
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   243
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   244
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   245
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   246
			"# EPOC DEFINITIONS\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   247
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   248
			"INCDIR  = -cwd source -i-"
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
	foreach (@ChopUserIncPaths,@ChopSysIncPaths) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   252
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   253
			" \\\n -i \"$_\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   254
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   255
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   256
	use Pathutl;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   257
	if($VariantFile){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   258
	    my $variantFilePath = Path_Split('Path',$VariantFile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   259
	    $VariantFile  = Path_Split('FILE',$VariantFile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   260
	    # workaround for codewarrior defect:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   261
	    # codewarrior at the moment doesn't accept an absolute path with the
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   262
	    # the -include option unless it contains a drive letter, this is solved
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   263
	    # by including the directory and the file separately
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   264
	    &main::Output("\\\n -i \"$variantFilePath \" -include \"$VariantFile\"");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   265
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   266
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   267
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   268
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   269
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   270
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   271
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   272
		"CWFLAGS ="		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   273
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   274
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   275
	# 'wchar_t' should be treated as default datatype for OE targets because when wchar_t option is turned off, 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   276
	# using 'wchar_t' defaults to the unsigned short int and wrong functionality. 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   277
	if ( $TrgType =~ /^(STDEXE|STDDLL|STDLIB)$/io || StdCppTarget() ) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   278
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   279
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   280
			" -wchar_t on"
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
	else 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   284
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   285
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   286
			" -wchar_t off"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   287
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   288
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   289
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   290
	&main::Output(		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   291
		" -align 4",		# long alignment
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   292
		" -warnings on",	# selection of warnings
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   293
		" -w nohidevirtual",	# turn off "hides inherited virtual function" warning
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   294
		   ",nounusedexpr",	# turn off "expression has no side effect" warning
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   295
		" -msgstyle gcc",	# use GCC-style message format
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   296
		# " -strict on",		# strict ANSI/ISO C++ checking
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   297
		" -enum int",		# use int for enumeration types
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   298
		" -str pool",		# pool strings into a single data object
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   299
		" -exc ms",			# SEH C++ exception implementation
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   300
		" -trigraphs on",		# Enable recognition of C-style trigraphs, e.g. '??/' -> '\'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   301
		" $WarningLevel"		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   302
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   303
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   304
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   305
	if ($Win32StdHeaders or &main::Plat eq 'TOOLS') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   306
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   307
			" -stdinc"		# insist because mwccsym2 has -nostdinc as the default(?)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   308
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   309
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   310
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   311
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   312
			" -nostdinc"	# insist because mwcc has -stdinc as the default.
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
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   316
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   317
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   318
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   319
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   320
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   321
		"CWDEFS  = "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   322
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   323
	foreach(@MacroList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   324
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   325
			" -d \"$_\""
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
		" \$(USERDEFS)\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
			"CW$_ = $MWCC"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   336
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   337
		if (/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   338
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   339
				' -g -O0'   # debug information, no optimisation
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   340
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   341
#			euser change to apply inlining on the _NAKED functions
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   342
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   343
#			stdexe/stddll change so that the inline functions dont 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   344
#			get exported (in debug build) causing a different export list for debug and release builds
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   345
			if ($BaseTrg!~/^EUSER$/oi && $TrgType !~ /^(STDEXE|STDDLL)$/io) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   346
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   347
					' -inline off'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   348
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   349
			}	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   350
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   351
		elsif (/REL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   352
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   353
				' -O4,s'	# highest level of optimisation, optimise for space
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   354
			);
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
		if( ($CWVersion == 0x3205 && $CWBuildNum >= 465) || $CWVersion > 0x3205){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   358
			if ($TrgType =~ /^(STDEXE|STDDLL|STDLIB)$/io) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   359
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   360
					' -runtime dllmulti'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   361
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   362
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   363
			else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   364
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   365
					' -runtime staticmulti'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   366
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   367
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   368
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   369
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   370
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   371
			' $(CWFLAGS)'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   372
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   373
		foreach (&main::MacroList($_)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   374
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   375
				" -d $_"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   376
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   377
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   378
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   379
			" \$(CWDEFS) \$(INCDIR)\n"
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
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   383
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   384
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   385
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   386
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   387
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   388
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   389
			"$_ :"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   390
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   391
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   392
		if ($BasicTrgType !~ /IMPLIB/io) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   393
			&main::Output (
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   394
				" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   395
				"\t", &Generic_Quote("\$(EPOCTRG$_)\\$TrgDir$Trg")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   396
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   397
			if (&Winutl_CopyForStaticLinkage) {
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", &Generic_Quote("\$(EPOCTRG$_)\\$Trg")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   401
				);
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
#		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
   406
		if ($DefFile and not &main::ExportUnfrozen) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   407
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   408
				" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   409
				"\tLIBRARY\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
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   416
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   417
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   418
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   419
		my $makework="MAKEWORK$_";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   420
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   421
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   422
			"RESOURCE$_ : $makework"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   423
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   424
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   425
		my $BitMapRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   426
		foreach $BitMapRef (@$BitMapStructRef) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   427
			my $file="\$(EPOCTRG$_)\\$$BitMapRef{TrgPath}$$BitMapRef{Trg}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   428
			&Generic_MakeWorkFile($makework,$file);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   429
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   430
				" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   431
				"\t", &Generic_Quote($file)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   432
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   433
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   434
		undef $BitMapRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   435
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   436
		my $ResourceRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   437
		foreach $ResourceRef (@$ResourceStructRef) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   438
			if(! defined $$ResourceRef{Hdronly}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   439
				my $file="\$(EPOCTRG$_)\\$$ResourceRef{Trg}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   440
				&Generic_MakeWorkFile($makework,$file);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   441
				&main::Output(	# must come before main target because source for target will depend on the
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   442
				" \\\n",		# *.rsg file in $EPOCIncPath
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   443
				"\t", &Generic_Quote("$file")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   444
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   445
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   446
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   447
		undef $ResourceRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   448
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   449
		my $AifRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   450
		foreach $AifRef (@$AifStructRef) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   451
			my $file="\$(EPOCTRG$_)\\$AifTrgDir$$AifRef{Trg}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   452
			&Generic_MakeWorkFile($makework,$file);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   453
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   454
				" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   455
				"\t", &Generic_Quote($file)
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
		undef $AifRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   459
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   460
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   461
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   462
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   463
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   464
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   465
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   466
		"\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
		"# REAL TARGET - LIBRARY\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   472
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   473
		"LIBRARY : MAKEWORKLIBRARY"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   474
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   475
	if ($BasicTrgType=~/^LIB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   476
#		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
   477
		foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   478
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   479
				" $_"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   480
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   481
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   482
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   483
	elsif ($DefFile and !$NoExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   484
		unless (&main::ExportUnfrozen) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   485
			if (-e $DefFile) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   486
				my $LibLinkAs = ($BasicTrgType=~/^IMPLIB$/io) ? $LinkAs : $Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   487
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   488
					" ", &Generic_Quote("\$(EPOCLIB)\\UDEB\\$ExportLibrary.lib"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   489
					"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   490
					&Generic_Quote("\$(EPOCLIB)\\UDEB\\$ExportLibrary.lib"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   491
					&Generic_Quote($DefFile), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   492
					"\tperl -S prepdef.pl ",&Generic_Quote($DefFile)," \"\$(EPOCBLD)\\$ExportLibrary.prep.def\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   493
					"\t$MWLD \"\$(EPOCBLD)\\$ExportLibrary.prep.def\" -importlib -o \$\@",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   494
					" -addcommand \"out:$LibLinkAs\" -warnings off",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   495
					"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   496
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   497
			} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   498
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   499
					"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   500
					"\t\@echo WARNING: Not attempting to create \"\$(EPOCLIB)\\UDEB\\$ExportLibrary.lib\".\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   501
					"\t\@echo When exports are frozen in \"$DefFile\", regenerate Makefile.\n"
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
		} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   505
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   506
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   507
				"\t\@echo Not attempting to create \"\$(EPOCLIB)\\UDEB\\$ExportLibrary.lib\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   508
				"\t\@echo from frozen .DEF file, since EXPORTUNFROZEN specified.\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   509
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   510
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   511
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   512
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   513
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   514
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   515
		"FREEZE :\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   516
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   517
	if ($DefFile and $BasicTrgType!~/^IMPLIB$/io) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   518
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   519
#			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
   520
			"\tperl -S efreeze.pl \$(EFREEZE_ALLOW_REMOVE) \"$DefFile\" \"\$(EPOCBLD)\\$ExportLibrary.def\" \n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   521
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   522
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   523
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   524
		&main::Output( "\tperl -e \"print \\\"warning: freeze could not be supported or \\
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   525
		         you need to declare an explicitly specified def file using the keyword \\
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   526
			 DEFFILE in the MMP file!\\n\\\"\""); 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   527
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   528
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   529
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   530
		"CLEANLIBRARY :\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   531
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   532
	if ($DefFile and !$NoExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   533
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   534
			"\t-\$(ERASE) \"\$(EPOCLIB)\\UDEB\\$ExportLibrary.lib\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   535
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   536
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   537
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   538
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   539
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   540
	&Generic_MakeWorkDir('MAKEWORKLIBRARY',"${LibPath}UDEB");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   541
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   542
	&Generic_Releaseables;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   543
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   544
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   545
my $uidfile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   546
sub PMBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   547
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   548
	my $AifStructRef=&main::AifStructRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   549
	my @SrcList=&main::SrcList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   550
	my $BaseTrg=&main::BaseTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   551
	my $BitMapStructRef=&main::BitMapStructRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   552
	my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   553
	my $ChopBldPath=&main::Path_Chop(&main::BldPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   554
	my $ExportLibrary=&main::ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   555
	my $NoExportLibrary=&main::NoExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   556
	my $DefFile=&main::DefFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   557
	my $EPOCIncPath=&main::EPOCIncPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   558
	my $BasicTrgType=&main::BasicTrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   559
	my @LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   560
	my $RelPath=&main::RelPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   561
	my $ResourceStructRef=&main::ResourceStructRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   562
	my @StatLibList=&main::StatLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   563
	my $Trg=&main::Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   564
	my $TrgPath=&main::TrgPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   565
	my $TrgType=&main::TrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   566
	# Get the information regarding supporting Compiler Wrapper Option
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   567
	my $IsCompilerWrapperOption=&main::CompilerWrapperOption();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   568
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   569
	$NamedSymLkup = 1 if($TrgType =~ /^(STDDLL|STDEXE)$/o);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   570
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   571
	$uidfile = "$BaseTrg.UID";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   572
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   573
	if ($Bld =~ /DEB/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   574
		@LibList=&main::DebugLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   575
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   576
		@LibList=&main::LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   577
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   578
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   579
	# OE Glue Code
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   580
	my @oe_exe_libs=("libcrt0.lib");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   581
	my @oe_exe_libs_wchar=("libwcrt0.lib");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   582
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   583
	# OE Import Libraries
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   584
	my @oe_import_libs=("euser.lib"); 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   585
 	if(not (grep /^libc.lib$/i, @LibList)){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   586
 			push @oe_import_libs, "libc.lib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   587
 	}	   	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   588
	   	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   589
   # Handle migration of binaries to secure location
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   590
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   591
	my $BLDTRGPATH = "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   592
	my $AIFBLDTRGPATH = "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   593
	if ($TrgPath) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   594
		$BLDTRGPATH = "\$(TRGDIR)\\";	    # handles TARGETPATH
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   595
		$AIFBLDTRGPATH = $BLDTRGPATH;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   596
		&Winutl_AdjustTargetPath(\$BLDTRGPATH);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   597
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   598
	$BLDTRGPATH = "\$(EPOCTRG$Bld)\\".$BLDTRGPATH;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   599
	$AIFBLDTRGPATH = "\$(EPOCTRG$Bld)\\".$AIFBLDTRGPATH;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   600
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   601
	# REAL TARGETS
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   602
	#-------------
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   603
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   604
		"# REAL TARGET - BUILD VARIANT $Bld\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   605
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   606
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   607
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   608
#	releasables
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   609
	my @releaseables;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   610
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   611
	unless (&main::Plat() eq 'TOOLS') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   612
		if ($TrgType !~ /^IMPLIB$/io) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   613
			if ($TrgType !~ /^NONE/io) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   614
				push @releaseables, "$BLDTRGPATH$Trg";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   615
				if ($Bld=~/REL$/o && $BasicTrgType!~/^LIB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   616
					push @releaseables,"$BLDTRGPATH$Trg.map";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   617
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   618
				if (&Winutl_CopyForStaticLinkage) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   619
					push @releaseables, "\$(EPOCTRG$Bld)\\$Trg";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   620
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   621
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   622
			my $BitMapRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   623
			foreach $BitMapRef (@$BitMapStructRef) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   624
				push @releaseables, "\$(EPOCTRG$Bld)\\$$BitMapRef{TrgPath}$$BitMapRef{Trg}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   625
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   626
			my $ResourceRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   627
			foreach $ResourceRef (@$ResourceStructRef) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   628
				if(! defined $$ResourceRef{Hdronly}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   629
					push @releaseables,"\$(EPOCTRG$Bld)\\$$ResourceRef{Trg}";
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
			my $AifRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   633
			foreach $AifRef (@$AifStructRef) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   634
				push @releaseables, "$AIFBLDTRGPATH$$AifRef{Trg}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   635
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   636
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   637
		if (-e $DefFile and !$NoExportLibrary) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   638
			push @releaseables, "\$(EPOCLIB$Bld)\\$ExportLibrary.lib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   639
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   640
		if ($Bld=~/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   641
			# debugging support files?
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
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   645
		if ($BasicTrgType !~ /^IMPLIB$/io) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   646
			my $toolspath=&main::EPOCToolsPath();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   647
			push @releaseables, "$toolspath$Trg";
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   651
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   652
	my $firstlib = "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   653
	my $newlib = "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   654
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   655
	if ( $BasicTrgType =~ /^(EXE|DLL)$/o && main::Plat() ne 'TOOLS' ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   656
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   657
		$firstlib = main::FirstLib();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   658
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   659
		unless ( StdCppTarget() || ! main::StdCppSupport()) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   660
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   661
			$newlib = main::NewLib(); # Check if has been set in the MMP file.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   662
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   663
			unless ($newlib) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   664
				if ( main::SystemTrg() ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   665
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   666
					$newlib = 'scppnwdl_kern.lib';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   667
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   668
				else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   669
					$newlib = 'scppnwdl.lib';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   670
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   671
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   672
		}
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   676
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   677
		"WHAT$Bld : WHATGENERIC\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   678
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   679
		"CLEAN$Bld : CLEANBUILD$Bld CLEANRELEASE$Bld\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   680
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   681
		"CLEANBUILD$Bld : \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   682
		"\t\@perl -S ermdir.pl \"\$(EPOCBLD$Bld)\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   683
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   684
		"CLEANRELEASE$Bld : CLEANGENERIC\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   685
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   686
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   687
	&Generic_WhatCleanTargets($Bld, "WHAT$Bld", "CLEANRELEASE$Bld", @releaseables);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   688
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   689
	my $adjustedTargetPath=$TrgPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   690
	&Winutl_AdjustTargetPath(\$adjustedTargetPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   691
	&Generic_MakeWorkDir("MAKEWORK$Bld", &main::BldPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   692
	&Generic_MakeWorkDir("MAKEWORK$Bld", "$RelPath$adjustedTargetPath");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   693
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   694
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   695
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   696
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   697
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   698
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   699
	return if ($BasicTrgType=~/^IMPLIB$/io);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   700
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   701
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   702
		"LISTING$Bld : MAKEWORK$Bld"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   703
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   704
	foreach (@SrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   705
		my $BaseSrc = &main::Path_Split('Base', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   706
		my $Ext = &main::Path_Split('Ext', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   707
		$BaseSrc.='_' if (lc($Ext) eq '.cia');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   708
		$BaseSrc =~ s/\.UID/_UID_/i if ($BaseSrc eq $uidfile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   709
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   710
   		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   711
			" \\\n\tLISTING$Bld$BaseSrc"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   712
   		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   713
   	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   714
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   715
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   716
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   717
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   718
	#Compiler wrapper support starts
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   719
	if($IsCompilerWrapperOption)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   720
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   721
	 	my $Platcmpwrap=&main::Plat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   722
	 	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   723
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   724
			"COMPWRAP$Bld : OUTPUT_NAME = ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   725
			"$Platcmpwrap\_$Bld",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   726
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   727
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   728
	 	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   729
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   730
			"COMPWRAP$Bld : MAKEWORK$Bld"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   731
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   732
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   733
		foreach (@SrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   734
			my $BaseSrc = &main::Path_Split('Base', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   735
			my $Ext = &main::Path_Split('Ext', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   736
			$BaseSrc.='_' if (lc($Ext) eq '.cia');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   737
			$BaseSrc =~ s/\.UID/_UID_/i if ($BaseSrc eq $uidfile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   738
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   739
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   740
				" \\\n\tCOMPWRAP$Bld$BaseSrc"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   741
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   742
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   743
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   744
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   745
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   746
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   747
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   748
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   749
	#--Compiler wrapper support ends
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   750
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   751
	# Flag that tells whether to run checklib.exe on static libraries.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   752
	my $run_checklib = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   753
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   754
	if (@StatLibList && $BasicTrgType =~ /^(EXE|DLL)$/o && !main::SystemTrg() && main::StdCppSupport()) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   755
		# There are user-added static libraries. They should be checked for
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   756
		# consistent use of operator new.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   757
		$run_checklib = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   758
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   759
		#Create a make variable for the libraries.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   760
		main::Output("\nUSER_ADDED_ARCHIVES_$Bld=");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   761
		for (@StatLibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   762
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   763
				" \\\n\t", &Generic_Quote("\$(EPOCSTATLINK$Bld)\\$_")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   764
			);
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
		main::Output("\n\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   768
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   769
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   770
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   771
		"LIBS$Bld="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   772
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   773
	foreach (@StatLibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   774
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   775
			" \\\n\t", &Generic_Quote("\$(EPOCSTATLINK$Bld)\\$_")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   776
		);
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
	#OE Glue Code
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   780
	if ($TrgType=~/^STDEXE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   781
		if (&main::IsWideCharMain()) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   782
			foreach (@oe_exe_libs_wchar) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   783
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   784
					" \\\n\t", &Generic_Quote("\$(EPOCSTATLINK$Bld)\\$_")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   785
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   786
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   787
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   788
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   789
			foreach (@oe_exe_libs) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   790
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   791
					" \\\n\t", &Generic_Quote("\$(EPOCSTATLINK$Bld)\\$_")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   792
				);
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
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   796
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   797
	foreach (@LibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   798
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   799
			" \\\n\t", &Generic_Quote("\$(EPOCLINK$Bld)\\$_")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   800
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   801
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   802
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   803
	#OE Import Libraries
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   804
	if ($TrgType =~ /^STDEXE$/o || $TrgType =~ /^STDDLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   805
		foreach (@oe_import_libs) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   806
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   807
			" \\\n\t", &Generic_Quote("\$(EPOCLINK$Bld)\\$_")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   808
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   809
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   810
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   811
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   812
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   813
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   814
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   815
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   816
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   817
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   818
		"LINK_OBJS$Bld="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   819
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   820
	my $have_uidfile = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   821
	foreach (@SrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   822
		my $BaseSrc = &main::Path_Split('Base', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   823
		my $Ext = &main::Path_Split('Ext', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   824
		if ($BaseSrc eq $uidfile) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   825
			$have_uidfile = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   826
			next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   827
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   828
		$BaseSrc.='_' if (lc($Ext) eq '.cia');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   829
   		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   830
			" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   831
			"\t", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   832
   		);
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
	my $add_stdcpp_tag = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   836
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   837
	if ($BasicTrgType=~/^LIB$/o && StdCppTarget() ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   838
		$add_stdcpp_tag = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   839
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   840
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   841
	if ($add_stdcpp_tag) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   842
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   843
			" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   844
			"\t", &Generic_Quote("$stdcpp_tag_path\\$stdcpp_tag_file")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   845
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   846
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   847
	if ($Win32Resrc) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   848
		my $resbase=&main::Path_Split('Base',$Win32Resrc);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   849
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   850
			" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   851
			"\t", &Generic_Quote("\$(EPOCBLD$Bld)\\$resbase.res")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   852
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   853
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   854
	if ($have_uidfile) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   855
		# ensure that the uid file is at the end of the list, as it's implicit in
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   856
		# CodeWarrior IDE projects.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   857
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   858
			" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   859
			"\t", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseTrg"."_UID_.o")
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
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   863
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   864
		"\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
	&main::OutFormat(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   868
		"COMMON_LINK_FLAGS$Bld=",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   869
		' -msgstyle gcc',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   870
		' -stdlib'		# use default runtime library for compiler help functions
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   871
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   872
	if ($MWLD =~ /mwcc.exe/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   873
		&main::OutFormat(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   874
			' -warnings on'	# on by default in mwccsym2.exe
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   875
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   876
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   877
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   878
	main::OutFormat(" \"\$(EPOCSTATLINK$Bld)\\$firstlib\" ") if $firstlib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   879
	main::OutFormat(" \"\$(EPOCSTATLINK$Bld)\\$newlib\" ")   if $newlib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   880
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   881
	foreach my $lib (@Win32LibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   882
		 my $win32lib = $lib;    # take a copy, to avoid updating contents of Win32LibList!
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   883
		$win32lib = "-l$win32lib" unless ($win32lib =~ /\\/);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   884
		&main::OutFormat(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   885
			" ",lc $win32lib
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   886
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   887
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   888
	if ($BasicTrgType=~/^DLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   889
		&main::OutFormat(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   890
			"$BaseAddressFlag",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   891
			' -main __Win32DllMain@12',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   892
			' -shared'
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
	elsif ($TrgType=~/^EXEXP$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   896
		&main::OutFormat(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   897
			"$BaseAddressFlag",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   898
			' -noentry',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   899
			' -shared'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   900
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   901
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   902
	elsif ($BasicTrgType=~/^EXE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   903
		unless (&main::Plat eq 'TOOLS') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   904
			&main::OutFormat(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   905
				' -m "?_E32Bootstrap@@YGXXZ"'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   906
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   907
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   908
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   909
	if (&main::Plat=~/^(WINC|TOOLS)$/o && $BasicTrgType=~/^EXE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   910
		&main::OutFormat(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   911
			' -subsystem console'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   912
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   913
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   914
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   915
		&main::OutFormat(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   916
			' -subsystem windows'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   917
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   918
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   919
	if (&main::HeapSize) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   920
		my %HeapSize=&main::HeapSize;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   921
		&main::OutFormat(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   922
			' -heapreserve=',RoundUp1k($HeapSize{Max}),' -heapcommit=',RoundUp1k($HeapSize{Min})
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   923
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   924
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   925
	if ($BasicTrgType=~/^(DLL|EXE)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   926
		if ($Bld=~/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   927
			&main::OutFormat(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   928
				' -g'
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
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   932
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   933
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   934
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   935
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   936
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   937
	if($TrgType =~/^(STDEXE|STDDLL|STDLIB)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   938
		if(! (( $CWVersion == 0x3205 && $CWBuildNum >= 465 ) || $CWVersion > 0x3205 ) ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   939
			&main::FatalError("TargetType $TrgType requires CodeWarrior version `3.2.5 build 465' or later but you have $CWVersionReadable.");
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   943
	my $EntrySymbol='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   944
	if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/o || $NamedSymLkup) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   945
		my $Include="";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   946
		if ($BasicTrgType=~/^DLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   947
			$Include="-m __E32Dll";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   948
			$EntrySymbol='__E32Dll';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   949
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   950
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   951
			$Include="-m __E32Startup";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   952
			$EntrySymbol='__E32Startup';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   953
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   954
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   955
			"STAGE1_LINK_FLAGS$Bld= \$(COMMON_LINK_FLAGS$Bld) \$(LIBS$Bld) \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   956
			" -o \"\$(EPOCBLD$Bld)\\$Trg\"");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   957
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   958
		if ($NamedSymLkup) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   959
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   960
			" -export all",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   961
			" -map \"\$(EPOCBLD$Bld)\\$Trg.map\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   962
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   963
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   964
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   965
			&main::Output(' -export dllexport');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   966
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   967
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   968
		if($CWRuntimeLibs ne "") {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   969
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   970
				" -l$CWRuntimeLibs "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   971
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   972
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   973
		if($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   974
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   975
				" $Include",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   976
				' -nocompactimportlib', 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   977
				" -implib \"\$(EPOCBLD$Bld)\\$ExportLibrary.lib\"",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   978
				" -addcommand \"out:$Trg\" -warnings off",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   979
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   980
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   981
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   982
		else{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   983
#		Dont generate import libs for an Exe
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   984
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   985
				" $Include",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   986
				" -addcommand \"out:$Trg\" -warnings off",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   987
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   988
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   989
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   990
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   991
	my $AbsentSubst = '';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   992
	if ($EntrySymbol) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   993
		$AbsentSubst = " -absent $EntrySymbol";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   994
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   995
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   996
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   997
		"LINK_FLAGS$Bld= \$(COMMON_LINK_FLAGS$Bld) \$(LIBS$Bld) \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   998
		" -o \"$BLDTRGPATH$Trg\" ", &main::LinkerOption("CW") 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   999
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1000
	if($CWRuntimeLibs ne "") {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1001
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1002
				" -l$CWRuntimeLibs "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1003
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1004
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1005
	if ($Bld=~/REL$/o && $BasicTrgType!~/^LIB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1006
		# Generate map file for release build executables
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1007
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1008
			" -map \"$BLDTRGPATH$Trg.map\"", 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1009
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1010
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1011
	if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1012
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1013
			" -f \"\$(EPOCBLD)\\$ExportLibrary.def\"",	# use generated .DEF file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1014
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1015
		if (&main::ExportUnfrozen) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1016
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1017
				" -implib \"\$(EPOCLIB)\\UDEB\\$ExportLibrary.lib\"",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1018
				" -addcommand \"out:$Trg\" -warnings off"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1019
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1020
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1021
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1022
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1023
				' -noimplib'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1024
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1025
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1026
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1027
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1028
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1029
			' -noimplib'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1030
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1031
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1032
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1033
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1034
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1035
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1036
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1037
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1038
		&Generic_Quote("$BLDTRGPATH$Trg"), " : \$(LINK_OBJS$Bld) "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1039
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1040
	if (-e $DefFile) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1041
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1042
			&Generic_Quote($DefFile)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1043
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1044
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1045
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1046
	main::Output(" ", Generic_Quote("\$(EPOCSTATLINK$Bld)\\$firstlib") ) if $firstlib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1047
	main::Output(" ", Generic_Quote("\$(EPOCSTATLINK$Bld)\\$newlib") )   if $newlib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1048
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1049
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1050
		" \$(LIBS$Bld)\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1051
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1052
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1053
	my $checklib = "checklib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1054
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1055
	if ( StdCppTarget() ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1056
		$checklib .= " stdc++ --coff";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1057
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1058
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1059
		$checklib .= " symc++ --coff";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1060
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1061
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1062
	&main::Output( "\t$checklib ","\$(USER_ADDED_ARCHIVES_$Bld)\n" ) if ($run_checklib);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1063
#	Link by name first time round for dlls
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1064
	if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1065
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1066
			"\t$MWLD \$(STAGE1_LINK_FLAGS$Bld) -l \$(EPOCBLD$Bld) -search \$(notdir \$(LINK_OBJS$Bld))\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1067
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1068
		if(!$NamedSymLkup){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1069
#		Dont delete the binary as we need to extract symbol/dependency info
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1070
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1071
			"\t\$(ERASE) \"\$(EPOCBLD$Bld)\\$Trg\"\n",
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
#		Generate an export info file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1076
		my $show_options = "names,verbose";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1077
		$show_options = "names,unmangled,verbose" if ($MWLD =~ /mwldsym2.exe/);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1078
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1079
			"\t$MWLD -S -show only,$show_options -o \"\$(EPOCBLD$Bld)\\$ExportLibrary.inf\" \"\$(EPOCBLD$Bld)\\$ExportLibrary.lib\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1080
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1081
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1082
#		call makedef to reorder the export information
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1083
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1084
#			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
  1085
			"\tperl -S makedef.pl $AbsentSubst -Inffile \"\$(EPOCBLD$Bld)\\$ExportLibrary.inf\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1086
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1087
		if (SysTrg()) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1088
    			&main::Output( "\t\t-SystemTargetType \\\n" );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1089
	    	}		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1090
		if (-e $DefFile) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1091
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1092
				" -Frzfile \"$DefFile\""
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
		my $Export;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1096
		my $Ordinal=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1097
		foreach $Export (&main::Exports) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1098
#				replace "$" with "$$" so that NMAKE doesn't think there's a macro in the function name
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1099
			$Export=~s-\$-\$\$-go;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1100
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1101
				" -$Ordinal $Export"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1102
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1103
			$Ordinal++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1104
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1105
		&main::Output(" -sym_name_lkup") if($NamedSymLkup);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1106
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1107
		&main::Output(" -export_entrypoint_E32Dll") if ($TrgType =~ /^STDDLL$/i);  # Workaround: To export entry point _E32DLL for target type STDDLL
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1108
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1109
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1110
			" \"\$(EPOCBLD)\\$ExportLibrary.def\" \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1111
			"\t\$(ERASE) \"\$(EPOCBLD$Bld)\\$ExportLibrary.inf\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1112
			"\t\$(ERASE) \"\$(EPOCBLD$Bld)\\$ExportLibrary.lib\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1113
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1114
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1115
	elsif($NamedSymLkup) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1116
#	2-stage linking required for all those targets that enable symbol lookup
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1117
		&main::Output( "\t$checklib ","\$(USER_ADDED_ARCHIVES_$Bld)\n" ) if ($run_checklib);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1118
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1119
			"\t$MWLD \$(STAGE1_LINK_FLAGS$Bld) -l \$(EPOCBLD$Bld) -search \$(notdir \$(LINK_OBJS$Bld))\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1120
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1121
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1122
	my $gen_src_file = "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1123
	if($NamedSymLkup){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1124
#		pick the symbols and the dependencies.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1125
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1126
			"\t$MWLD -S -show only,names,verbose -o \"\$(EPOCBLD$Bld)\\$ExportLibrary.sym\" \"\$(EPOCBLD$Bld)\\$Trg\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1127
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1128
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1129
#		Generate the source file with symbol and dependency information in the named data segment.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1130
		$gen_src_file = "${BaseTrg}_SYM_";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1131
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1132
		if($BasicTrgType=~/^EXE$/o){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1133
#		For an EXE, generate the symbols as well as the dependencies
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1134
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1135
				"\tperl -S sym_lkup_util.pl -o \"\$(EPOCBLD$Bld)\\$gen_src_file.cpp\" -sym \"\$(EPOCBLD$Bld)\\$ExportLibrary.sym\" -map \"\$(EPOCBLD$Bld)\\$Trg.map\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1136
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1137
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1138
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1139
#		For DLLs, generate only the dependencies.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1140
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1141
				"\tperl -S sym_lkup_util.pl -o \"\$(EPOCBLD$Bld)\\$gen_src_file.cpp\" -sym \"\$(EPOCBLD$Bld)\\$ExportLibrary.sym\" --ignore_export_dir\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1142
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1143
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1144
		main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1145
			"\t\$(CW$Bld) -c \"\$(EPOCBLD$Bld)\\$gen_src_file.cpp\" -o \"\$(EPOCBLD$Bld)\\$gen_src_file.o\"\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
#	Perform the final link step
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1150
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1151
		"\t$MWLD "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1152
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1153
	if ($BasicTrgType=~/^LIB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1154
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1155
			"-library "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1156
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1157
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1158
		&main::Output( "-l $stdcpp_tag_path ") if ($add_stdcpp_tag);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1159
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1160
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1161
	if($NamedSymLkup){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1162
#	Final linking and cleanup
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1163
		main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1164
		"\$(LINK_FLAGS$Bld) -l \$(EPOCBLD$Bld) -search \$(notdir \$(LINK_OBJS$Bld))",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1165
		" \"\$(EPOCBLD$Bld)\\$gen_src_file.o\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1166
		"\t\$(ERASE) \"\$(EPOCBLD$Bld)\\$gen_src_file.cpp\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1167
		"\t\$(ERASE) \"\$(EPOCBLD$Bld)\\$gen_src_file.o\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1168
		"\t\$(ERASE) \"\$(EPOCBLD$Bld)\\$ExportLibrary.sym\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1169
		"\t\$(ERASE) \"\$(EPOCBLD$Bld)\\$Trg.map\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1170
		"\t\$(ERASE) \"\$(EPOCBLD$Bld)\\$Trg\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1171
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1172
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1173
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1174
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1175
			"\$(LINK_FLAGS$Bld) -l \$(EPOCBLD$Bld) -search \$(notdir \$(LINK_OBJS$Bld))\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1176
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1177
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1178
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1179
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1180
	if (&main::Plat eq 'TOOLS') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1181
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1182
			"\tcopy \"BLDTRGPATH$Trg\" \"",&main::EPOCToolsPath,"$Trg\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1183
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1184
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1185
	if (&Winutl_CopyForStaticLinkage) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1186
		&Generic_MakeWorkDir("MAKEWORK$Bld", "\$(EPOCTRG$Bld)");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1187
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1188
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1189
			&Generic_Quote("\$(EPOCTRG$Bld)\\$Trg"), " : ", 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1190
			&Generic_Quote("$BLDTRGPATH$Trg"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1191
			"\t", &Generic_CopyAction(),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1192
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1193
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1194
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1195
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1196
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1197
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1198
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1199
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1200
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1201
sub PMStartSrcList {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1202
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1203
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1204
		"# SOURCES\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1205
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1206
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1207
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1208
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1209
sub PMBitMapBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1210
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1211
	&Generic_BitMapBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1212
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1213
	# Need to copy generic resource into emulated Z drive
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1214
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1215
	my $BitMapRef=&main::BitMapRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1216
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1217
	my $ChopTrgPath="";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1218
	if ($$BitMapRef{TrgPath}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1219
		$ChopTrgPath.="\\$$BitMapRef{TrgPath}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1220
		chop $ChopTrgPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1221
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1222
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1223
	my @BldList=&main::BldList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1224
	my $Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1225
	foreach $Bld (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1226
		my $path="\$(EPOCTRG$Bld)$ChopTrgPath";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1227
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1228
			&Generic_Quote("$path\\$$BitMapRef{Trg}"), " : ", 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1229
			&Generic_Quote("$$BitMapRef{GenericTrg}"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1230
			"\t", &Generic_CopyAction(),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1231
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1232
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1233
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1234
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1235
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1236
sub PMResrcBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1237
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1238
	&Generic_ResrcBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1239
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1240
	# Need to copy generic resource into emulated Z drive
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1241
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1242
	my $ResourceRef=&main::ResourceRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1243
	my @BldList=&main::BldList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1244
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1245
	foreach my $Bld (@BldList) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1246
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1247
		if(! defined $$ResourceRef{Hdronly})
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1248
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1249
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1250
				&Generic_Quote("\$(EPOCTRG$Bld)\\$$ResourceRef{Trg}"), " : ", 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1251
				&Generic_Quote("$$ResourceRef{GenericTrg}"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1252
				"\t", &Generic_CopyAction(),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1253
				"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1254
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1255
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1256
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1257
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1258
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1259
sub PMAifBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1260
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1261
	&Generic_AifBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1262
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1263
	# Need to copy generic resource into emulated Z drive
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1264
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1265
	my $AifRef=&main::AifRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1266
	my $TrgDir="";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1267
	if (&Generic_Definition("TRGDIR") ne "") {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1268
		$TrgDir="\\\$(TRGDIR)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1269
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1270
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1271
	my @BldList=&main::BldList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1272
	my $Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1273
	foreach $Bld (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1274
		my $path="\$(EPOCTRG$Bld)$TrgDir";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1275
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1276
			&Generic_Quote("$path\\$$AifRef{Trg}"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1277
			&Generic_Quote("$$AifRef{GenericTrg}"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1278
			"\t", &Generic_CopyAction(),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1279
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1280
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1281
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1282
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1283
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1284
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1285
sub PMStartSrc {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1286
	my $Src=&main::Src;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1287
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1288
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1289
		"# Source $Src\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1290
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1291
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1292
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1293
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1294
sub PMSrcDepend {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1295
	my @BldList=&main::BldList;	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1296
	my @DepList=&main::DepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1297
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1298
	$BaseSrc =~ s/\.UID/_UID_/i if ($BaseSrc eq $uidfile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1299
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1300
	return if (@DepList == 0);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1301
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1302
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1303
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1304
			&Generic_Quote("\$(EPOCBLD$_)\\$BaseSrc.o"), " \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1305
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1306
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1307
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1308
		":"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1309
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1310
	foreach (@DepList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1311
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1312
		" \\\n\t", &Generic_Quote($_)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1313
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1314
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1315
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1316
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1317
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1318
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1319
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1320
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1321
sub PMSrcBldDepend {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1322
	my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1323
	my @DepList=&main::DepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1324
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1325
	$BaseSrc =~ s/\.UID/_UID_/i if ($BaseSrc eq $uidfile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1326
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1327
	return if (@DepList == 0);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1328
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1329
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1330
		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o"), " :",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1331
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1332
	foreach (@DepList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1333
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1334
			" \\\n\t", &Generic_Quote($_)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1335
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1336
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1337
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1338
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1339
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1340
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1341
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1342
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1343
sub PMEndSrcBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1344
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1345
	$BaseSrc =~ s/\.UID/_UID_/i if ($BaseSrc eq $uidfile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1346
	my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1347
	my $Plat=&main::Plat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1348
	my $Src=&main::Src;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1349
	my $SrcPath=&main::SrcPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1350
	my $Ext=&main::ExtSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1351
	my $Cia = (lc($Ext) eq '.cia') ? 1 : 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1352
	my $TrgType=&main::TrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1353
	# Get the information regarding supporting Compiler Wrapper Option
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1354
	my $IsCompilerWrapperOption=&main::CompilerWrapperOption();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1355
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1356
	if ($Cia) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1357
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1358
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.o"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1359
			&Generic_Quote("$SrcPath$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1360
			"\techo $Src\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1361
			"\t\$(CW$Bld) -lang c++ -o \"\$\@\" -c \"$SrcPath$Src\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1362
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1363
#			assembler listing target - uses implicit rule to do disassembly
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1364
			"LISTING$Bld$BaseSrc\_ : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.lis"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1365
			"\t", &Generic_CopyAction("$SrcPath$BaseSrc\_.$Plat.lst"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1366
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1367
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1368
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1369
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1370
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1371
			&Generic_Quote("$SrcPath$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1372
			"\techo $Src\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1373
			"\t\$(CW$Bld) -o \"\$\@\" -c \"$SrcPath$Src\" "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1374
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1375
		# When building for OE target type and source file is of C++ type, 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1376
 		# then pass macro "__wchar_t_defined" to indicate that datatype "wchar_t" is enabled.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1377
 		if ( StdCppTarget() || $TrgType =~ /^(STDEXE|STDDLL|STDLIB)$/io ) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1378
 		{			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1379
 			if (lc($Ext) =~ /^(.cpp|.cc|.cxx|.c\+\+)$/)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1380
 			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1381
 				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1382
 					" -d \"__wchar_t_defined\" "					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1383
 				);			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1384
 			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1385
 		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1386
 		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1387
   			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1388
 			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1389
 		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1390
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1391
#			assembler listing target - uses implicit rule to do disassembly
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1392
			"LISTING$Bld$BaseSrc : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1393
			"\t", &Generic_CopyAction("$SrcPath$BaseSrc.$Plat.lst"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1394
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1395
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1396
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1397
		# Output files if Compiler Wrapper Option is specified
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1398
		if($IsCompilerWrapperOption)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1399
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1400
			my $Platcmpwrap=&main::Plat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1401
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1402
				"COMPWRAP$Bld$BaseSrc : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1403
				&Generic_Quote("$SrcPath$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1404
				"\techo Analysing $Src\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1405
				"\t\$(COMPWRAP) \$(CW$Bld) -o \"\$\@\" -c \"$SrcPath$Src\" ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1406
				"\n\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1407
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1408
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1409
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1410
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1411
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1412
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1413
sub PMEndSrc {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1414
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1415
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1416
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1417
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1418
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1419
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1420
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1421
sub PMEndSrcList {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1422
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1423
	my $show_options = "source";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1424
	$show_options = "source,unmangled,comments" if ($MWLD =~ /mwldsym2.exe/);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1425
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1426
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1427
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1428
		"# Implicit rule for generating .lis files\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1429
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1430
		".SUFFIXES : .lis .o\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1431
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1432
		".o.lis:\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1433
		"\t$MWLD -S -show $show_options \$< -o \$\@\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1434
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1435
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1436
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1437
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1438
	if ($Win32Resrc) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1439
		my @BldList=&main::BldList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1440
		my @DepList=&main::Deps_GenDependsL($Win32Resrc);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1441
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1442
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1443
			"# Win32 Resource $Win32Resrc\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1444
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1445
			"DEPEND="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1446
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1447
		foreach (@DepList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1448
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1449
				" \\\n\t", &Generic_Quote($_)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1450
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1451
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1452
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1453
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1454
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1455
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1456
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1457
		my $Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1458
		my $resbase=&main::Path_Split('Base',$Win32Resrc);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1459
		my $respath=&main::Path_Chop(&main::Path_Split('Path',$Win32Resrc));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1460
		foreach $Bld (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1461
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1462
				&Generic_Quote("\$(EPOCBLD$Bld)\\$resbase.res"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1463
				&Generic_Quote($Win32Resrc), " \$(DEPEND)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1464
				"\tmwwinrc -o \$\@ \"$Win32Resrc\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1465
				"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1466
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1467
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1468
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1469
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1470
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1471
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1472
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1473
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1474
	# Deal with accumulated MAKEDIRS etc.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1475
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1476
	&Generic_End;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1477
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1478
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1479
sub StdCppTarget() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1480
    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1481
    # STDCPP is supported
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1482
    return 0 if (! main::StdCppSupport());
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1483
    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1484
	if ( main::NoStdCpp()) { # MMP keyword NOSTDCPP set
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1485
		return 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1486
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1487
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1488
	if ( main::StdCpp() ) { # MMP keyword STDCPP set.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1489
		return 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1490
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1491
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1492
		return ( main::TrgType() =~ /^(STDEXE|STDDLL|STDLIB)$/io );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1493
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1494
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1495
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1496
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1497
1;