sbsv1/abld/makmake/makmake.pl
author Zheng Shen <zheng.shen@nokia.com>
Tue, 17 Aug 2010 15:31:16 +0800
changeset 626 ac03b93ca9c4
parent 599 fa7a3cc6effd
permissions -rw-r--r--
ROM Tools 12.3.4 + RCOMP 8.4.2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
599
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     1
# Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     2
# All rights reserved.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     3
# This component and the accompanying materials are made available
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     4
# under the terms of "Eclipse Public License v1.0"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     5
# which accompanies this distribution, and is available
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     7
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     8
# Initial Contributors:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     9
# Nokia Corporation - initial contribution.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    10
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    11
# Contributors:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    12
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    13
# Description:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    14
# all variables called *Path* are set up to end with a backslash
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    15
# all variables called *Path or *File are stored as absolute (file)paths within makmake
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    16
# all variables called UpPath* are stored as relative paths within makmake
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    17
# 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    18
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    19
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    20
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    21
use FindBin;		# for FindBin::Bin
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    22
use Getopt::Long;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    23
use Cwd;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    24
# modified start: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    25
use File::stat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    26
use Time::localtime;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    27
# modified end: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    28
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    29
my $PerlLibPath;    # fully qualified pathname of the directory containing our Perl modules
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    30
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    31
# Prototype to remove warning.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    32
sub AddStringTables();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    33
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    34
BEGIN {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
# check user has a version of perl that will cope
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    36
	require 5.005_03;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    37
# establish the path to the Perl libraries: currently the same directory as this script
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    38
	$PerlLibPath = $FindBin::Bin;	# X:/epoc32/tools
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
	$PerlLibPath =~ s/\//\\/g;	# X:\epoc32\tools
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
	$PerlLibPath .= "\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    42
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    43
use lib $PerlLibPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    44
use E32env;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
use E32Plat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
use E32Variant;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47
use Genutl;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    48
use Modload;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    49
use Pathutl;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    50
use Trgtype;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    51
use CheckSource;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    52
use featurevariantparser;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    53
use featurevariantmap;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    54
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    55
# THE MAIN PROGRAM SECTION
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    56
##########################
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    57
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    58
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    59
	Load_SetModulePath($PerlLibPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    60
	Plat_Init($PerlLibPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    61
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    62
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    63
my $MAKEFILE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    64
my $MMPFILE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    65
my %Options;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    66
my %Plat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    67
my %TruePlat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    68
my %BldMacros;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    69
my $PlatArg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    70
my @PlatOverrideList=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    71
my $EABIDef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    72
my $DebugSwitch=undef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    73
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    74
my $IsCompilerWrapperOption = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    75
my $IsProxyWrapperOption = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    76
my $FeatureVariantArg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    77
my %FeatureVariantInfo;
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
	# process the command line
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    81
	unless (GetOptions(\%Options, 'd', 'mmp', 'plat=s', 'v', 'arm', 'nd' , 'ithumb' , 'iarm' , 'debug', 'no_debug', 'logfc','wrap:s')) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    82
		exit 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    83
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    84
	#Update the variable to set the information of -wrap option
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    85
	if(exists($Options{wrap})) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    86
		if ($Options{wrap} eq "") {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    87
			# Set the Compiler wrapper option information i.e. '1'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    88
			$IsCompilerWrapperOption = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    89
		} elsif ($Options{wrap} eq "proxy") {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    90
			$IsProxyWrapperOption = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    91
		} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    92
			print "WARNING: Invalid value for option -wrap: $Options{wrap}\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    93
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    94
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    95
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    96
	$Options{makemakefile}='1' unless ($Options{mmp} || $Options{plat});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    97
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    98
	if ($Options{mmp} or $Options{plat}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    99
		eval { &Load_ModuleL('MAKHELP'); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   100
		die $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   101
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   102
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   103
	if ($Options{mmp}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   104
		&Help_Mmp;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   105
		exit;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   106
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   107
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   108
	if ($Options{plat}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   109
		eval { &Plat_GetL($Options{plat},\%Plat,\%BldMacros); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   110
		die $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   111
		eval { &Load_ModuleL($Plat{MakeMod}); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   112
		die $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   113
		&Help_Plat($Plat{Real},$Plat{CPU}, $Plat{DefFile}, \@{$Plat{MmpMacros}},\@{$Plat{Macros}});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   114
		exit;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   115
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   116
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   117
#	show help & exit if necessary
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   118
	if (@ARGV != 2) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   119
		&Usage();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   120
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   121
	if ($Options{v}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   122
		print "perl -S makmake.pl @ARGV\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   123
		&Load_SetVerbose;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   124
		&Path_SetVerbose;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   125
		&Plat_SetVerbose;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   126
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   127
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   128
	$PlatArg=uc pop @ARGV;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   129
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   130
	# Process build platform arguments where they differ from the "norm"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   131
	if ($PlatArg=~/^(\S+)\.(\S+)$/)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   132
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   133
		# Explicit feature variant platforms take the form <base platform>.<variant name>
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   134
		# e.g. armv5.variant1
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   135
		$PlatArg=$1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   136
		$FeatureVariantArg=$2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   137
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   138
	elsif ($PlatArg=~/^(\S+):(\S+)$/)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   139
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   140
		# IDE platforms can take the form cw_ide:<platform-1>+<platform-2>+<platform-n>
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   141
		# e.g. cw_ide:plat1+plat2+plat3
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   142
		# 			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   143
		$PlatArg=$1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   144
		@PlatOverrideList=split(/\+/,$2);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   145
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   146
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   147
	eval { &Plat_GetL($PlatArg,\%TruePlat,\%BldMacros); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   148
	die $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   149
	if (scalar @PlatOverrideList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   150
		$PlatArg=$PlatOverrideList[0];
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   151
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   152
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   153
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   154
	$MMPFILE=pop @ARGV;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   155
	die "ERROR: Can't specify MMP file on a different drive\n" if $MMPFILE=~/^\w:\\/o;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   156
	if ($MMPFILE!~/.MMP$/io) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   157
		$MMPFILE.='.MMP';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   158
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   159
	$MMPFILE=&Path_AbsToWork($MMPFILE);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   160
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   161
	eval { &Load_ModuleL('Mmp'); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   162
	die $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   163
	if ($Options{v}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   164
		&Mmp_SetVerbose;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   165
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   166
	if ($Options{d}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   167
		die "ERROR: $E32env::Data{EPOCPath} does not exist\n" if (!-d $E32env::Data{EPOCPath});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   168
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   169
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   170
	if ($Options{debug}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   171
		$DebugSwitch = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   172
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   173
	elsif($Options{no_debug}){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   174
		$DebugSwitch = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   175
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   176
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   177
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   178
my %LinkerOptions;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   179
my %WarningLevel;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   180
my $ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   181
my @AifStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   182
my $AllowDllData;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   183
my $CompressTarget;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   184
my $CompressTargetMode;   #NONE
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   185
my $ASSPExports;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   186
my @ASSPLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   187
my @BitMapStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   188
my $BuildAsARM=$Options{arm};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   189
my $CallDllEntryPoints;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   190
my $Capability;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   191
my @CapabilityFlags;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   192
my $DataLinkAddress;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   193
my @DebugLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   194
my %Def;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   195
my %DocHash;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   196
my $ExportUnfrozen;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   197
my $FirstLib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   198
my $FixedProcess;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   199
my %HeapSize;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   200
my @LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   201
my $LinkAs;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   202
my $LinkAsBase;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   203
my $ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   204
my $NoExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   205
my %MmpFlag;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   206
my @PlatTxt2D;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   207
my $ProcessPriority;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   208
my @RamTargets;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   209
my @ResourceStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   210
my @RomTargets;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   211
my $SmpSafe;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   212
my @SourceStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   213
my $StackSize;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   214
my @StatLibList;    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   215
my $StdCpp;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   216
my $NoStdCpp;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   217
my $NewLib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   218
my @SysIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   219
my @ResourceSysIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   220
my $ResourceVariantMacroHRHFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   221
my $Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   222
my %TrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   223
my @UidList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   224
my @UserIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   225
my $SrcDbg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   226
my %Path;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   227
my %Version;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   228
my $SecureId;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   229
my $VendorId;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   230
my $variantMacroHRHFile = Variant_GetMacroHRHFile();  # HRH file containing macros specific to a variant
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   231
my %ReplaceOptions;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   232
my $ARMFPU;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   233
my @StringTable;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   234
my @StringTableUserIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   235
my $CodePagingTargetMode;	# 0-N/A, 1-UNPAGED, 2-PAGED
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   236
my $DataPagingTargetMode;	# 0-N/A, 1-UNPAGED, 2-PAGED
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   237
my %CheckSourceUDEBIncludes;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   238
my %CheckSourceURELIncludes;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   239
my %CheckSourceMMPMetaData;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   240
my %CheckSourceMMPIncludes;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   241
my $IsWideCharMain=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   242
my $IsDebuggable; # 0-NONDEBUGGABLE, 1-DEBUGGABLE, 2-DEBUGGABLE_UDEBONLY
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   243
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   244
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   245
use constant NOTPAGED => 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   246
use constant UNPAGED => 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   247
use constant PAGED => 2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   248
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   249
use constant INFLATECOMPRESSIONMETHOD => 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   250
use constant BYTEPAIRCOMPRESSIONMETHOD => 2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   251
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   252
use constant NOTDEBUGGABLE => 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   253
use constant DEBUGGABLE =>  1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   254
use constant DEBUGGABLE_UDEBONLY => 2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   255
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   256
# If the platform does support feature variants but none are specified, then we assume the use of "DEFAULT" if it exists
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   257
# If default doesn't exist feature variantion is basically disabled?
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   258
$FeatureVariantArg = 'default' if (!$FeatureVariantArg && defined &PMSupportsFeatureVariants && featurevariantparser->DefaultExists());
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   259
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   260
# Preload the details of the variant requested if any - we need the HRH file for MMP file processing
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   261
if ($FeatureVariantArg)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   262
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   263
	# First check the feature variant is valid
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   264
	my @buildableFeatureVariants = featurevariantparser->GetBuildableFeatureVariants();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   265
	die "ERROR: \"$PlatArg.$FeatureVariantArg\" feature variant is either invalid or virtual.\n" if !(grep /^$FeatureVariantArg$/i, @buildableFeatureVariants);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   266
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   267
	# Now load the variant
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   268
	%FeatureVariantInfo = featurevariantparser->GetVariant($FeatureVariantArg);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   269
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   270
	# Change the HRH file to use
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   271
	$variantMacroHRHFile = $FeatureVariantInfo{VARIANT_HRH} if $FeatureVariantInfo{VARIANT_HRH};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   272
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   273
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   274
&SetVarsFromMmp($PlatArg);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   275
die $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   276
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   277
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   278
	# set up the makefile filepath - need to do this before loading the platform module
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   279
	# because UID source file will be added and set up in the makefile path under WINS
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   280
	if ($Options{d}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   281
		$MAKEFILE=join ('', $Path{Bld}, &Path_Split('Base',$MMPFILE), $TruePlat{Ext});
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
		$MAKEFILE=join "", &Path_WorkPath, &Path_Split('Base',$MMPFILE), $TruePlat{Ext};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   285
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   286
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   287
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   288
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   289
	# Generate an X86GCC def file from eabi def file in build dir if needed
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   290
	if (($PlatArg eq "X86GCC" || $PlatArg eq "X86GMP") && $Def{Base} && not -e &DefFile)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   291
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   292
		# Find the equivalent eabi def file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   293
		my $eabiDefFile = File::Spec->canonpath("$Def{Path}../eabi/$Def{Base}$Def{Ext}");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   294
		if (-e $eabiDefFile)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   295
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   296
			# Need to create MAKEFILE directory early in this case
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   297
			eval { &Path_MakePathL($MAKEFILE); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   298
			die $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   299
			# Change def file path to build path 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   300
			$Def{Path} = $Path{Bld};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   301
			&generateX86GCCDefFile($eabiDefFile, &DefFile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   302
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   303
		else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   304
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   305
			print "WARNING: Unable to find EABI def file at $eabiDefFile to generate X86GCC def file with\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   306
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   307
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   308
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   309
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   310
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   311
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   312
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   313
#	load the platform module
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   314
	eval { &Load_ModuleL($TruePlat{MakeMod}); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   315
	die $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   316
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   317
	unless (defined &PMHelp_Mmp) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   318
#		check this function is defined - all modules must have it - if not perhaps the
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   319
#		platform module has not loaded is compiler module successfully via "use"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   320
		die "ERROR: Module \"$Plat{MakeMod}\" not loaded successfully\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   321
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   322
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   323
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   324
	# Allow the platform to bow out if feature variants have been specified but it doesn't support them
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   325
	if ($FeatureVariantArg && !defined &PMSupportsFeatureVariants)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   326
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   327
		die "ERROR: The \"$PlatArg\" platform does not support feature variants.\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   328
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   329
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   330
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   331
	# allow the platform to bow out if it can't support some .MMP file specifications
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   332
	if (defined &PMCheckPlatformL) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   333
		eval { &PMCheckPlatformL(); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   334
		die $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   335
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   336
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   337
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   338
my @StdIncPaths=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   339
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   340
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   341
	# get the platform module to do it's mmpfile processing - WINS modules may set up an extra source file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   342
	# for UIDs here depending upon the targettype
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   343
	&PMPlatProcessMmp(@PlatTxt2D) if defined &PMPlatProcessMmp;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   344
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   345
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   346
%CheckSourceMMPMetaData = &Mmp_CheckSourceMMPMetaData();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   347
%CheckSourceMMPIncludes = &Mmp_CheckSourceMMPIncludes();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   348
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   349
# merge checksource processing from platform specific .mmp sections, if applicable
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   350
%CheckSourceMMPMetaData = (%CheckSourceMMPMetaData, &PMPlatCheckSource()) if defined &PMPlatCheckSource;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   351
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   352
@ResourceSysIncPaths = @SysIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   353
$ResourceVariantMacroHRHFile = $variantMacroHRHFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   354
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   355
AddStringTables();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   356
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   357
# Process feature variants if applicable
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   358
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   359
if ($FeatureVariantArg)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   360
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   361
	if ($Options{v})
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   362
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   363
		$featurevariantmap::verbose = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   364
		$featurevariantparser::verbose = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   365
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   366
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   367
	# Get the default variant details
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   368
	my %DefaultFeatureVariantInfo = $FeatureVariantInfo{NAME} =~ /^default$/i ? %FeatureVariantInfo : featurevariantparser->GetVariant("DEFAULT");	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   369
	die "ERROR: Feature variant \"$PlatArg.default\" is invalid.\n" if !$DefaultFeatureVariantInfo{VALID};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   370
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   371
	# The following IF statement decides whether to use the default variant and not use the hash in the filename 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   372
	# This prevents the generation of dll's/exe's for which variants are not needed (i.e they are invariant)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   373
	# It also avoids the time-consuming and redundant hash generation
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   374
	# A component is considered invariant if it's not a DLL or EXE or FEATUREVARIANT isn't present in the .mmp file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   375
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   376
# modified start: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   377
	if ($TrgType{Basic} =~ /^(EXEDLL|EXE|DLL|LIB)$/ && &Mmp_IsFeatureVariant)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   378
# modified end: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   379
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   380
		# Load the requested variant if it hasn't already been preloaded		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   381
		%FeatureVariantInfo = featurevariantparser->GetVariant($FeatureVariantArg) if !$FeatureVariantInfo{NAME} || $FeatureVariantInfo{NAME} ne $FeatureVariantArg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   382
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   383
	else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   384
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   385
		# Use the default variant
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   386
		%FeatureVariantInfo = %DefaultFeatureVariantInfo;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   387
		$FeatureVariantInfo{INVARIANT} = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   388
		$FeatureVariantInfo{NAME} = uc $FeatureVariantArg;
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
	die "ERROR: Feature variant \"$PlatArg.$FeatureVariantInfo{NAME}\" is invalid.\n" if !$FeatureVariantInfo{VALID};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   392
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   393
	my @featureVariantSysIncPaths = (@{$FeatureVariantInfo{BUILD_INCLUDES}},@SysIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   394
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   395
	# Further process paths and filenames so that they include a drive letter.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   396
	# We store this in a hash specifically for passing on to featurevariantmap->Hash
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   397
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   398
	my @processedIncludes = &Path_PrefixWithDrive(&Path_Chop(@UserIncPaths), &Path_Chop(@featureVariantSysIncPaths));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   399
	push @processedIncludes, &Path_Chop(&PMToolChainIncDir) if defined &PMToolChainIncDir && &PMToolChainIncDir;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   400
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   401
	my $processedPreInclude = "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   402
	if (defined &PMPrefixFile)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   403
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   404
		$processedPreInclude = &PMPrefixFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   405
		$processedPreInclude =~ s/\"//g;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   406
		$processedPreInclude = &Path_PrefixWithDrive($processedPreInclude);		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   407
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   408
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   409
	my %processedFeatureVariantInfo;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   410
	$processedFeatureVariantInfo{PREINCLUDE} = $processedPreInclude if $processedPreInclude;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   411
	$processedFeatureVariantInfo{BUILD_INCLUDES} = \@processedIncludes if @processedIncludes;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   412
	$processedFeatureVariantInfo{VALID} = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   413
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   414
	# Pass in the details of the macros tested in the MMP
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   415
	$processedFeatureVariantInfo{MMPTESTED} = &Mmp_TestedMacros();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   416
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   417
	my @pathedSrcList = ();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   418
	push @pathedSrcList, Path_PrefixWithDrive($$_{SrcPath}.$$_{CurFile}) foreach (@SourceStruct);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   419
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   420
	foreach my $bld (@{$Plat{Blds}})
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   421
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   422
# modified start: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   423
		my @reusedHash;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   424
# modified end: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   425
		if ($FeatureVariantInfo{INVARIANT})															# Invariant override
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   426
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   427
			$FeatureVariantInfo{$bld."_LABEL"} = "INVARIANT";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   428
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   429
		else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   430
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   431
# modified by SV start: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   432
			my $vmap = "$E32env::Data{RelPath}".lc($Plat{Real})."\\".lc($bld)."\\".Trg()."." . $FeatureVariantInfo{NAME}.".vmap";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   433
# modified by SV end: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   434
			$vmap = Path_PrefixWithDrive($vmap);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   435
			if(-e $vmap){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   436
				my @variantlist = featurevariantmap->GetVariantListFromVmap($vmap);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   437
				my @calls;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   438
				foreach(@variantlist)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   439
				{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   440
					my $target = "CHECKVMAP".uc($bld);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   441
					my $makefile = $MAKEFILE.".".$_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   442
					if(-e $makefile){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   443
						push @calls, "make -r -f \"$makefile\"  $target";
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
				foreach my $call (@calls)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   447
				{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   448
					print "call: $call" if $Options{v};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   449
					open PIPE, "$call |";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   450
					while(<PIPE>) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   451
						print $_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   452
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   453
					close PIPE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   454
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   455
				if(-e $vmap){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   456
					@reusedHash = featurevariantmap->CheckOldVmapFile($vmap, \%FeatureVariantInfo);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   457
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   458
			}
626
ac03b93ca9c4 ROM Tools 12.3.4 + RCOMP 8.4.2
Zheng Shen <zheng.shen@nokia.com>
parents: 599
diff changeset
   459
			if(@reusedHash)
599
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   460
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   461
				$FeatureVariantInfo{$bld."_LABEL"} = $reusedHash[0];
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   462
				$FeatureVariantInfo{$bld."_FEATURES"} = $reusedHash[1];
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   463
				next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   464
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   465
# modified end: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   466
			my @macros = (@{$Plat{Macros}}, @{$BldMacros{$bld}}, "__SUPPORT_CPP_EXCEPTIONS__");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   467
			push @macros, "__PRODUCT_INCLUDE__=\"".&Path_PrefixWithDrive($FeatureVariantInfo{VARIANT_HRH})."\"" if $FeatureVariantInfo{VARIANT_HRH};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   468
			$processedFeatureVariantInfo{MACROS} = \@macros;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   469
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   470
			print ("Feature variant hash processing: \"$FeatureVariantInfo{NAME} $bld\"\n") if $Options{v};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   471
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   472
			my @result = featurevariantmap->HashAndFeatures(\@pathedSrcList, \%processedFeatureVariantInfo);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   473
			$FeatureVariantInfo{$bld."_LABEL"} = $result[0];
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   474
			$FeatureVariantInfo{$bld."_FEATURES"} = $result[1];
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   475
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   476
			die "ERROR: Can't obtain hash for \"$PlatArg.$FeatureVariantInfo{NAME}\" feature variant.\n" if !$FeatureVariantInfo{$bld."_LABEL"};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   477
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   478
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   479
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   480
	# Customise standard content based on feature variant updates
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   481
	@SysIncPaths = @featureVariantSysIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   482
	$variantMacroHRHFile = $FeatureVariantInfo{VARIANT_HRH};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   483
	$MAKEFILE .= ".$FeatureVariantInfo{NAME}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   484
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   485
	# Resources are always processed in the context of the default variant's system include and variant files when
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   486
	# feature variants are in use
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   487
	@ResourceSysIncPaths = (@{$DefaultFeatureVariantInfo{BUILD_INCLUDES}},@ResourceSysIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   488
	$ResourceVariantMacroHRHFile = $DefaultFeatureVariantInfo{VARIANT_HRH};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   489
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   490
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   491
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   492
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   493
	# if verbose mode set, output some info
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   494
	#--------------------------------------
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   495
	if ($Options{v}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   496
		print  
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   497
			"Target: \"$Trg\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   498
			"TargetType: \"$TrgType{Name}\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   499
			"Libraries: \"@LibList\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   500
			"Debug Libraries: \"@DebugLibList\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   501
			"Static Libraries: \"@StatLibList\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   502
			"Uids: \"@UidList\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   503
			"BuildVariants: \"@{$Plat{Blds}}\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   504
			"TargetMakeFile: \"$MAKEFILE\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   505
			"UserIncludes: \"<Source Dir> @UserIncPaths\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   506
			"SystemIncludes: \"@SysIncPaths\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   507
		;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   508
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   509
	if (%FeatureVariantInfo)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   510
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   511
		print 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   512
			"Feature Variant Name: \"$FeatureVariantInfo{NAME}\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   513
			"Feature Variant SystemIncludes: \"@{$FeatureVariantInfo{BUILD_INCLUDES}}\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   514
			"Feature Variant HRH file: \"$FeatureVariantInfo{VARIANT_HRH}\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   515
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   516
		foreach my $bld (@{$Plat{Blds}})
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   517
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   518
			print "Feature Variant $bld Label: \"".$FeatureVariantInfo{$bld."_LABEL"}."\"\n";			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   519
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   520
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   521
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   522
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   523
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   524
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   525
# Special handling for non-default invariant makefiles without FEATUREVARIANT in the MMP file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   526
# In this situation the default variant makefle is just included into the variant makefile
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   527
# modified start: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   528
if ($TrgType{Basic} =~ /^(EXEDLL|EXE|DLL|LIB)$/ && %FeatureVariantInfo && $FeatureVariantInfo{INVARIANT})
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   529
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   530
	$MAKEFILE =~ s/([^.]*$)/DEFAULT/;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   531
# modified by SV start: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   532
		if( $FeatureVariantInfo{NAME} !~ /^default$/i)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   533
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   534
				print "not creating makefile for  : $FeatureVariantInfo{NAME}\n" if ($Options{v});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   535
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   536
# modified by SV end: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   537
	if(-e $MAKEFILE )
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   538
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   539
		my $mmp_time = -M $MMPFILE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   540
		my $makefile_time = -M $MAKEFILE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   541
		if( $makefile_time <= $mmp_time)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   542
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   543
			exit;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   544
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   545
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   546
	undef %FeatureVariantInfo;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   547
	%FeatureVariantInfo = featurevariantparser->GetVariant("default");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   548
	$FeatureVariantInfo{INVARIANT} = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   549
	$FeatureVariantInfo{UREL_LABEL} = 'INVARIANT';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   550
	$FeatureVariantInfo{UDEB_LABEL} = 'INVARIANT';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   551
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   552
# modified by SV start: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   553
	elsif(%FeatureVariantInfo)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   554
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   555
	my $variant_info = &Path_Chop($E32env::Data{BldPath}).$Path{BldInfPath}."\\FeatureVariantInfo\\".$Plat{Real}."\\".$Plat{Real}.".".$FeatureVariantInfo{NAME}.".".&Path_Split('Base', $MMPFILE).".info";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   556
	#if mmp file does not exists
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   557
	$variant_info = &Path_Chop($E32env::Data{BldPath}).$Path{BldInfPath}."\\FeatureVariantInfo\\".$Plat{Real}."\\".$Plat{Real}.".".$FeatureVariantInfo{NAME}.".info" if ! -e $MMPFILE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   558
# modified by SV end: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   559
	my $variant_key = "VARIANT_PLAT_NAME_".&Path_Split('Base', $MMPFILE);
626
ac03b93ca9c4 ROM Tools 12.3.4 + RCOMP 8.4.2
Zheng Shen <zheng.shen@nokia.com>
parents: 599
diff changeset
   560
	my $variant_info_new = $variant_info.".tmp";
599
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   561
	open VARIANTINFOR_NEW, ">$variant_info_new" or die "ERROR: Can't open or create file \"$variant_info_new\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   562
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   563
	# Open the variant infor file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   564
	open VARIANTINFOR, "<$variant_info" or die "ERROR: Can't open file \"$variant_info\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   565
	while(<VARIANTINFOR>)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   566
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   567
		if(/^$variant_key/)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   568
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   569
			print VARIANTINFOR_NEW $variant_key.":=".$FeatureVariantInfo{NAME}."\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   570
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   571
			else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   572
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   573
			print VARIANTINFOR_NEW $_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   574
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   575
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   576
	# Close and cleanup
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   577
	close VARIANTINFOR or die "ERROR: Can't close file \"$variant_info\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   578
	close VARIANTINFOR_NEW or die "ERROR: Can't close file \"$variant_info\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   579
	unlink $variant_info;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   580
	rename($variant_info_new, $variant_info);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   581
	if ($Options{v}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   582
		print "Successful Variant Infor File Creation\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   583
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   584
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   585
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   586
# modified end: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   587
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   588
my $CurAifRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   589
my $CurBaseObj;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   590
my $CurBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   591
my $CurBitMapRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   592
my @CurDepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   593
my $CurDoc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   594
my $CurResrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   595
my $CurResourceRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   596
my $CurSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   597
my $CurSrcPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   598
my $ResrcIsSys;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   599
# modified start: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   600
my %CurSrcSet;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   601
# modified end: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   602
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   603
# Set up library paths getting the backend module to help if it wants to
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   604
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   605
	&InitLinkPaths();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   606
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   607
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   608
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   609
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   610
	# LOOPING SECTION
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   611
	#----------------
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   612
	# Load the output module
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   613
	eval { &Load_ModuleL('OUTPUT'); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   614
	die $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   615
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   616
 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   617
	# Believe include first on the system list. 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   618
    my $VariantFile=&main::VariantFile();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   619
    if($VariantFile){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   620
        my $VariantFilePath = Path_Split('Path',$VariantFile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   621
        chop($VariantFilePath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   622
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   623
        push(@SysIncPaths, $VariantFilePath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   624
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   625
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   626
	my $ResourceVariantFile=&main::ResourceVariantFile();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   627
    if($ResourceVariantFile){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   628
        my $ResourceVariantFilePath = Path_Split('Path',$ResourceVariantFile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   629
        chop($ResourceVariantFilePath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   630
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   631
        push(@ResourceSysIncPaths, $ResourceVariantFilePath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   632
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   633
    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   634
    ## Add default system include info for TOOLS2
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   635
    if ($PlatArg eq 'TOOLS2') {    	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   636
    	push @SysIncPaths , "$E32env::Data{EPOCPath}include\\tools\\stlport";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   637
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   638
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   639
	# If the stdcpp keyword is used, or if the target type is STD* ...
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   640
	if ($StdCpp or $TrgType{Name} eq 'STDEXE' or $TrgType{Name} eq 'STDDLL' or $TrgType{Name} eq 'STDLIB') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   641
		push @SysIncPaths, $E32env::Data{EPOCPath}."include\\stdapis";
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
	&PMStartBldList($Plat{MakeCmd}) if defined &PMStartBldList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   645
	my $LoopBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   646
	foreach $LoopBld (@{$Plat{Blds}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   647
		$CurBld=$LoopBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   648
		&PMBld if defined &PMBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   649
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   650
	undef $CurBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   651
	undef $LoopBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   652
	&PMEndBldList if defined &PMEndBldList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   653
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   654
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   655
	# Load the Dependency Generator
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   656
	eval { &Load_ModuleL('MAKDEPS'); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   657
	die $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   658
	eval { &Deps_InitL($E32env::Data{EPOCIncPath},@StdIncPaths); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   659
	die $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   660
	if ($Options{v}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   661
		&Deps_SetVerbose;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   662
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   663
	if ($Plat{UsrHdrsOnly}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   664
		&Deps_SetUserHdrsOnly;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   665
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   666
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   667
	if ($Options{nd} || ($ENV{SYMBIANBUILD_DEPENDENCYOFF} && ($ENV{SYMBIANBUILD_DEPENDENCYOFF}==1))) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   668
		&Deps_SetNoDependencies
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   669
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   670
	&Deps_SetNoDependencies if(grep /boostlibrary/i, &Mmp_UserIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   671
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   672
	&Deps_SetUserIncPaths(@UserIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   673
	&Deps_SetSysIncPaths(@ResourceSysIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   674
	&Deps_SetPlatMacros(@{$Plat{Macros}});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   675
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   676
	my $prefixFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   677
	$prefixFile = &PMPrefixFile if defined &PMPrefixFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   678
	&Deps_SetPrefixFile($prefixFile) if $prefixFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   679
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   680
#	Start source list - bitmaps, resources, .AIF files, documents, sources.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   681
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   682
	# If feature variants are in use, dependency analysis may use a different overall variant file to that for "straight" source
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   683
	my $curDepOSVariantFile = &Deps_GetOSVariantFile();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   684
	&Deps_SetOSVariantFile($ResourceVariantFile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   685
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   686
	&PMStartSrcList if defined &PMStartSrcList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   687
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   688
#	start bitmaps
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   689
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   690
	if ($Options{v}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   691
		print "Starting bitmaps\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   692
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   693
	my $LoopBitMapRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   694
	foreach $LoopBitMapRef (@BitMapStruct) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   695
		$CurBitMapRef=$LoopBitMapRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   696
		if ($Options{v}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   697
			print "BitMap: \"$$CurBitMapRef{Trg}\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   698
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   699
		&PMBitMapBld if defined &PMBitMapBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   700
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   701
	undef $CurBitMapRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   702
	undef $LoopBitMapRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   703
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   704
#	end bitmaps
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   705
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   706
#	start resources
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   707
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   708
	if ($Options{v}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   709
		print "Starting resources\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   710
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   711
	my $LoopResourceRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   712
	foreach $LoopResourceRef (@ResourceStruct) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   713
		$CurResourceRef=$LoopResourceRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   714
		if ($Options{v}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   715
			print "Resource: \"$$CurResourceRef{Trg}\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   716
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   717
		eval { @CurDepList=&Deps_GenDependsL($$CurResourceRef{Source}, ("LANGUAGE_$$CurResourceRef{Lang}")); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   718
		die $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   719
		&PMResrcBld if defined &PMResrcBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   720
		undef @CurDepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   721
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   722
	undef $CurResourceRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   723
	undef $LoopResourceRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   724
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   725
#	end resources
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   726
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   727
#	start aifs
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   728
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   729
	if ($Options{v}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   730
		print "Starting aifs\n";
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
# Add tools-relative include path to sys includes, to allow for shared include\aiftool.rh
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   734
	use FindBin;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   735
	$FindBin::Bin =~ /:(.*)\//;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   736
	my $extraIncPath = $1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   737
	$extraIncPath =~ s/\//\\/g;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   738
	my @SavedResourceSysIncPaths = @ResourceSysIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   739
	push @ResourceSysIncPaths, "$extraIncPath\\INCLUDE";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   740
	&Deps_SetSysIncPaths(@ResourceSysIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   741
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   742
	my $LoopAifRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   743
	foreach $LoopAifRef (@AifStruct) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   744
		$CurAifRef=$LoopAifRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   745
		if ($Options{v}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   746
			print "Aif: \"$$CurAifRef{Trg}\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   747
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   748
		eval { @CurDepList=&Deps_GenDependsL("$$CurAifRef{Source}"); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   749
		die $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   750
		&PMAifBld if defined &PMAifBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   751
		undef @CurDepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   752
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   753
	undef $CurAifRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   754
	undef $LoopAifRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   755
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   756
	@ResourceSysIncPaths = @SavedResourceSysIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   757
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   758
#	end aifs
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   759
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   760
#	start sources
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   761
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   762
	if ($Options{v}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   763
		print "Starting sources\n";
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
	my $SrcRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   767
	&Deps_SetOSVariantFile($curDepOSVariantFile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   768
	&Deps_SetSysIncPaths(@SysIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   769
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   770
	foreach $SrcRef (@SourceStruct){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   771
		 $CurSrcPath=$$SrcRef{SrcPath};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   772
		 $CurSrc=$$SrcRef{CurFile};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   773
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   774
		 my @userIncludes = &Mmp_UserIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   775
		 @userIncludes = (@userIncludes, @StringTableUserIncPaths) if (@StringTableUserIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   776
		 unshift (@userIncludes, $CurSrcPath);		 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   777
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   778
		 if ($TruePlat{Ext} !~ /\.DSP|\.xml/i)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   779
		 	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   780
			foreach my $buildVariant (@{$Plat{Blds}})
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   781
				{		 		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   782
				my @macros = &MacroList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   783
				@macros = (@macros, @{$BldMacros{$buildVariant}});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   784
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   785
				my $checkSourceCommandStore;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   786
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   787
				if ($buildVariant =~ /rel$/i)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   788
					{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   789
					$checkSourceCommandStore = \%CheckSourceURELIncludes
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   790
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   791
				else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   792
					{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   793
					$checkSourceCommandStore = \%CheckSourceUDEBIncludes
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   794
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   795
				CheckSource_Includes($CurSrcPath.$CurSrc, %$checkSourceCommandStore, $VariantFile, @macros, @userIncludes, @SysIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   796
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   797
		 }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   798
		 if ($Options{v}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   799
			print "Sourcepath: \"$CurSrcPath\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   800
		 }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   801
		 &PMStartSrc if defined &PMStartSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   802
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   803
#			strict depend alt 1 start - call different module function if strict depend flag specified
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   804
			if (((not $MmpFlag{StrictDepend}) || (not defined &PMSrcBldDepend)) && defined &PMSrcDepend) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   805
				eval { @CurDepList=&Deps_GenDependsL($CurSrcPath.$CurSrc);};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   806
				die $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   807
# modified start: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   808
				foreach $srcFile (@CurDepList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   809
					if(not exists($CurSrcSet{$srcFile})){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   810
						my $srctmp = $srcFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   811
						$CurSrcSet{$srctmp} = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   812
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   813
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   814
# modified end: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   815
				&PMSrcDepend if defined &PMSrcDepend;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   816
				undef @CurDepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   817
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   818
							
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   819
#			strict depend alt 1 end
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   820
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   821
			my $LoopBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   822
			foreach $LoopBld (@{$Plat{Blds}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   823
				$CurBld=$LoopBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   824
				&PMStartSrcBld if defined &PMStartSrcBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   825
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   826
#				strict depend alt 2 start - call the module function that deals with dependencies generated for each build variant
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   827
				if ($MmpFlag{StrictDepend} && defined &PMSrcBldDepend) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   828
					eval { @CurDepList=Deps_GenDependsL($CurSrcPath.$CurSrc,@{$BldMacros{$CurBld}}); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   829
					die $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   830
					&PMSrcBldDepend if defined &PMSrcBldDepend;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   831
					undef @CurDepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   832
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   833
#				strict depend alt 2 end
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   834
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   835
				&PMEndSrcBld if defined &PMEndSrcBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   836
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   837
			undef $CurBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   838
			undef $LoopBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   839
			&PMEndSrc if defined &PMEndSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   840
# modified start: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   841
			my $cursrcfile = $CurSrcPath.$CurSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   842
			if(not exists($CurSrcSet{$cursrcfile})){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   843
				$CurSrcSet{$cursrcfile} = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   844
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   845
# modified end: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   846
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   847
		undef $CurSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   848
		undef $CurSrcPath;  
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   849
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   850
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   851
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   852
#	end sources
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   853
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   854
#	start documents
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   855
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   856
	if ($Options{v}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   857
		print "Starting documents\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   858
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   859
	my $LoopSrcPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   860
	foreach $LoopSrcPath (sort keys %DocHash) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   861
		$CurSrcPath=$LoopSrcPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   862
		if ($Options{v}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   863
			print "Sourcepath: \"$CurSrcPath\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   864
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   865
		my $LoopDoc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   866
		foreach $LoopDoc (sort @{$DocHash{$CurSrcPath}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   867
			$CurDoc=$LoopDoc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   868
			if ($Options{v}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   869
				print "Document: \"$CurDoc\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   870
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   871
			&PMDoc if defined &PMDoc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   872
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   873
		undef $CurDoc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   874
		undef $LoopDoc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   875
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   876
	undef $CurSrcPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   877
	undef $LoopSrcPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   878
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   879
#	end documents
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   880
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   881
#	rombuild
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   882
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   883
	my %SpecialRomFileTypes=(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   884
		KEXT=>'extension[MAGIC]',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   885
		LDD=>'device[MAGIC]',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   886
		PDD=>'device[MAGIC]',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   887
		VAR=>'variant[MAGIC]'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   888
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   889
	my %KHash1 = (
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   890
		kext=>1,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   891
		ldd=>1,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   892
		pdd=>1,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   893
		var=>1,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   894
		kdll=>1
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   895
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   896
	my %KHash2 = (
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   897
		primary=>1,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   898
		variant=>1,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   899
		extension=>1,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   900
		device=>1
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   901
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   902
	unless ($TrgType{Basic} =~ /^IMPLIB$/io or $TruePlat{Ext} =~ /\.DSP|\.xml/i) { # change to avoid rombuild target for IDE makefiles
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   903
		&Output("ROMFILE:\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   904
		unless ($Plat{OS} ne 'EPOC32' or $TrgType{Basic} eq 'LIB') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   905
			my $ref;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   906
			foreach $ref (@RomTargets) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   907
				my $ABIDir = '##MAIN##';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   908
				my $RomFileType='file';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   909
				if ($$ref{FileType}) {	# handle EKERN.EXE and EFILE.EXE with new ROMFILETYPE keyword instead
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   910
					$RomFileType=$$ref{FileType}; # or just do this bit as a custom build makefile
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   911
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   912
				elsif ($CallDllEntryPoints) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   913
					$RomFileType='dll';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   914
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   915
				elsif ($SpecialRomFileTypes{$TrgType{Name}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   916
					$RomFileType=$SpecialRomFileTypes{$TrgType{Name}};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   917
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   918
				my $RomPath="sys\\bin\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   919
				if ($$ref{Path}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   920
					$RomPath=$$ref{Path};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   921
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   922
				elsif ($TrgType{Path}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   923
					$RomPath=$TrgType{Path};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   924
					$RomPath=~s-z\\(.*)-$1-o;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   925
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   926
				my $RomFile=$LinkAsBase;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   927
				if ($$ref{File}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   928
					$RomFile=$$ref{File};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   929
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   930
				my $RomDecorations='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   931
				if ($DataLinkAddress) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   932
					$RomDecorations="reloc=$DataLinkAddress";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   933
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   934
				elsif ($FixedProcess) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   935
					$RomDecorations.='fixed';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   936
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   937
				
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   938
				$ABIDir = '##KMAIN##' if ($KHash1{lc $TrgType{Name}});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   939
				$ABIDir = '##KMAIN##' if ($KHash2{lc $RomFileType});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   940
				my $IbyTextFrom="$RomFileType=$E32env::Data{RelPath}$ABIDir\\##BUILD##\\$Trg";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   941
				my $IbyTextTo="$RomPath$RomFile";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   942
				my $Spaces= 60>length($IbyTextFrom) ? 60-length($IbyTextFrom) : 1; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   943
				&Output("\t\@echo ", $IbyTextFrom, ' 'x$Spaces, "$IbyTextTo $RomDecorations\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   944
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   945
			foreach $ref (@RamTargets) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   946
				my $ABIDir = '##MAIN##';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   947
				$ABIDir = '##KMAIN##' if ($KHash1{lc $TrgType{Name}});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   948
				my $RomFileType='data';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   949
				my $RomPath="sys\\bin\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   950
				if ($$ref{Path}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   951
					$RomPath=$$ref{Path};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   952
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   953
				my $RomFile=$Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   954
				if ($$ref{File}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   955
					$RomFile=$$ref{File};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   956
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   957
				my $RomDecorations='attrib=r';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   958
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   959
				my $IbyTextFrom="$RomFileType=$E32env::Data{RelPath}$ABIDir\\##BUILD##\\$Trg";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   960
				my $IbyTextTo="$RomPath$RomFile";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   961
				my $Spaces= 60>length($IbyTextFrom) ? 60-length($IbyTextFrom) : 1; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   962
				&Output("\t\@echo ", $IbyTextFrom, ' 'x$Spaces, "$IbyTextTo $RomDecorations\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   963
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   964
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   965
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   966
#	end rombuild
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   967
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   968
	&PMEndSrcList if defined &PMEndSrcList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   969
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   970
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   971
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   972
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   973
	# open the makefile and write all the text it requires to it if makmake has so far been successful
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   974
	#-------------------------------------------------------------------------------------------------
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   975
	eval { &Path_MakePathL($MAKEFILE); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   976
	die $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   977
	if ($Options{v}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   978
		print "Creating: \"$MAKEFILE\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   979
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   980
	open MAKEFILE,">$MAKEFILE" or die "ERROR: Can't open or create file \"$MAKEFILE\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   981
	print MAKEFILE &OutText or die "ERROR: Can't write output to file \"$MAKEFILE\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   982
	close MAKEFILE or die "ERROR: Can't close file \"$MAKEFILE\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   983
	if ($Options{v}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   984
		print "Successful MakeFile Creation\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   985
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   986
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   987
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   988
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   989
################ END OF MAIN PROGRAM SECTION #################
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   990
#------------------------------------------------------------#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   991
##############################################################
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   992
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   993
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   997
# SUBROUTINE SECTION
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   998
####################
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   999
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1000
sub FatalError (@) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1001
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1002
	print STDERR "MAKMAKE ERROR: @_\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1003
	exit 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1004
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1005
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1006
sub Usage () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1007
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1008
		eval { &Load_ModuleL('MAKHELP'); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1009
		die $@ if $@; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1010
		eval { &Help_Invocation; };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1011
		die $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1012
		exit;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1013
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1014
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1015
sub getEABIDef() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1016
	# Preprocess the mmp with ARMv5 platform settings so we can pick up 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1017
    # EABI specific def file entries etc. 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1018
    my ($platname)="ARMV5";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1019
    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1020
    # get platform info for armv5
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1021
    eval { &Plat_GetL($platname,\%Plat,\%BldMacros); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1022
	return $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1023
	&Mmp_Reset;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1024
	# process 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1025
    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1026
    # set package to ignore warnings about missing .def file. 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1027
    &Mmp_SetIgnoreMissingDef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1028
    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1029
    eval { &Mmp_ProcessL($E32env::Data{EPOCPath}, $MMPFILE, \%Plat, $FeatureVariantInfo{BUILD_INCLUDES}); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1030
	return $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1031
	my %EABIDef=%{&Mmp_Def};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1032
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1033
    # handle case that def file doesn't exist -> Simply set to ""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1034
    my $EABIDefFile = "$EABIDef{Path}$EABIDef{Base}$EABIDef{Ext}";;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1035
   	unless (-e "$EABIDefFile") {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1036
        $EABIDefFile = "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1037
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1038
    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1039
    return $EABIDefFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1040
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1041
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1042
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1043
sub SetVarsFromMmp ($) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1044
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1045
	my ($platname)=@_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1046
    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1047
	if($platname eq "GCCXML") {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1048
        $EABIDef = getEABIDef();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1049
    } 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1050
    else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1051
        $EABIDef = "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1052
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1053
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1054
	# MMP FILE PROCESSING - filter the mmp file content through the GCC preprecessor
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1055
	#-------------------------------------------------------------------------------
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1056
	eval { &Plat_GetL($platname,\%Plat,\%BldMacros); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1057
	return $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1058
	&Mmp_Reset;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1059
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1060
	if($platname eq "GCCXML" || $platname eq "X86GCC" || $platname eq "X86GMP") {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1061
	# set package to ignore warnings about missing .def file, this is necessary,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1062
	# as either EABI .def or GCC .def may not exist, and this shouldn't be reported
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1063
	# as a warning or error. Similarly for x86gcc def files - these are autogenerated.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1064
	&Mmp_SetIgnoreMissingDef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1065
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1066
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1067
	eval { &Mmp_ProcessL($E32env::Data{EPOCPath}, $MMPFILE, \%Plat, $FeatureVariantInfo{BUILD_INCLUDES}); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1068
	return $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1069
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1070
	%WarningLevel=&Mmp_WarningLevel;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1071
	%LinkerOptions=&Mmp_LinkerOptions;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1072
	$ABI=&Mmp_ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1073
	@AifStruct=@{&Mmp_AifStruct};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1074
	$AllowDllData=&Mmp_AllowDllData;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1075
	$CompressTarget=&Mmp_CompressTarget;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1076
	$CompressTargetMode=&Mmp_CompressTargetMode;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1077
	$ASSPExports=&Mmp_ASSPExports;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1078
	@ASSPLibList=&Mmp_ASSPLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1079
	@BitMapStruct=@{&Mmp_BitMapStruct};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1080
	$BuildAsARM=$BuildAsARM || &Mmp_BuildAsARM;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1081
	$CallDllEntryPoints=&Mmp_CallDllEntryPoints;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1082
	$Capability=&Mmp_Capability;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1083
	@CapabilityFlags=&Mmp_CapabilityFlags;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1084
	$DataLinkAddress=&Mmp_DataLinkAddress;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1085
	@DebugLibList=@{&Mmp_DebugLibList};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1086
	%Def=%{&Mmp_Def};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1087
	%DocHash=%{&Mmp_DocHash};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1088
	$ExportUnfrozen=&Mmp_ExportUnfrozen;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1089
	$FirstLib=&Mmp_FirstLib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1090
	$FixedProcess=&Mmp_FixedProcess;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1091
	%HeapSize=%{&Mmp_HeapSize};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1092
	@LibList=@{&Mmp_LibList};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1093
	$LinkAs=&Mmp_LinkAs;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1094
	$LinkAsBase=&Mmp_LinkAsBase;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1095
	$ExportLibrary=&Mmp_ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1096
	$NewLib = &Mmp_NewLib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1097
    $NoExportLibrary=&Mmp_NoExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1098
	%MmpFlag=%{&Mmp_MmpFlag};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1099
	@PlatTxt2D=&Mmp_PlatTxt2D;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1100
	$ProcessPriority=&Mmp_ProcessPriority;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1101
	@RamTargets=&Mmp_RamTargets;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1102
	@ResourceStruct=@{&Mmp_ResourceStruct};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1103
	@RomTargets=&Mmp_RomTargets;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1104
	$SmpSafe=&Mmp_SmpSafe;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1105
	@SourceStruct=@{&Mmp_SourceStruct};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1106
	$StackSize=&Mmp_StackSize;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1107
	@StatLibList=&Mmp_StatLibList;    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1108
	$StdCpp = &Mmp_StdCpp;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1109
	$NoStdCpp = &Mmp_NoStdCpp;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1110
	@SysIncPaths=&Mmp_SysIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1111
	$Trg=&Mmp_Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1112
	%TrgType=%{&Mmp_TrgType};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1113
	@UidList=&Mmp_UidList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1114
	@UserIncPaths=&Mmp_UserIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1115
	$SrcDbg=&Mmp_SrcDbg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1116
	%Version=&Mmp_Version;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1117
	$SecureId=&Mmp_SecureId;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1118
	$VendorId=&Mmp_VendorId;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1119
	%ReplaceOptions=&Mmp_Replace;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1120
	$ARMFPU=&Mmp_ARMFPU;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1121
	@StringTable=@{&Mmp_StringTable};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1122
	$CodePagingTargetMode=&Mmp_CodePagingTargetMode;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1123
	$DataPagingTargetMode=&Mmp_DataPagingTargetMode;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1124
	$IsWideCharMain=&Mmp_IsWideCharMain;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1125
	$IsDebuggable=&Mmp_IsDebuggable;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1126
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1127
#	finish defining any macros
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1128
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1129
	if ($Plat{CPU} eq 'MARM') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1130
#		apply the ABI source define - note that it is difficult to define a corresponding
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1131
#		.MMP define since we can't be sure what the ABI is until we've processed the .MMP file,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1132
#		though we could apply it for generic MARM builds only
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1133
		push @{$Plat{Macros}}, "__MARM_${ABI}__";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1134
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1135
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1136
	if ($TrgType{Basic}=~/^(DLL|EXE)$/o) { # this macro may soon be removed
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1137
		push @{$Plat{Macros}},'__'.$TrgType{Basic}.'__';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1138
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1139
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1140
#	add the macros defined in the .mmp file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1141
	push @{$Plat{Macros}}, &Mmp_Macros;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1142
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1143
# set up a hash containing the start paths for various things
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1144
	undef %Path;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1145
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1146
#	set up ASSP link path - this is the path where the target looks for ASSP-specific import libraries
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1147
        $Path{ASSPLink}="$E32env::Data{LinkPath}$Plat{ASSP}\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1148
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1149
#	set up build path
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1150
	my $BldInfPath=cwd;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1151
	$BldInfPath=~s-/-\\-go;						# separator from Perl 5.005_02+ is forward slash
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1152
	$BldInfPath=~s/^(.:)//o;					# remove drive letter
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1153
	$BldInfPath=~s-^(.*[^\\])$-$1\\-o;			# ensure workpath ends with a backslash
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1154
	$Path{BldInfPath} = $BldInfPath;			# Remember the path to bldinf
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1155
	$Path{Bld}=join('', &Path_Chop($E32env::Data{BldPath}), $BldInfPath, &Path_Split('Base',$MMPFILE), "\\$Plat{Real}\\");
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
sub generateX86GCCDefFile()
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1159
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1160
	my ($oldPath, $newPath) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1161
	print "Generating X86GCC deffile from $oldPath\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1162
	if (!open(OLDDEF, $oldPath))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1163
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1164
		print "Warning: Failed to open $oldPath for reading\n".
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1165
		return;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1166
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1167
	# Force creation of new def file even if one already exists
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1168
	if (!open(NEWDEF, ">$newPath"))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1169
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1170
		close OLDDEF;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1171
		print "Warning: Failed to open $newPath for writing\n".
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1172
		return;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1173
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1174
	while (<OLDDEF>)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1175
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1176
		chomp;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1177
		if (/^\s*_ZT(I|V)/ && !/\sABSENT/i)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1178
	    {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1179
		# Typeinfo that isn't already absent. Add the ABSENT keyword.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1180
		    my @frags = split /;/, $_, 2; # 1 or 2 parts depending on the presence of a comment
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1181
		    $frags[0] =~ s/\s*$/ ABSENT /;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1182
		    $_ = join ';', @frags;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1183
	    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1184
	    else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1185
	    {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1186
		# Try to substitute any va_list params with char* (Pc). Ignore if no match
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1187
		s/St9__va_list/Pc/g;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1188
	    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1189
		print NEWDEF "$_\n";	    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1190
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1191
	close OLDDEF;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1192
	close NEWDEF;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1193
	print "Successfully generated $newPath\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1194
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1195
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1196
sub InitLinkPaths() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1197
#	set up lib path - this is the path where the target puts it's import library
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1198
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1199
	my $ABI=&Mmp_ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1200
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1201
#	let the build target determine where it puts its import libray and where its links against its imports
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1202
	my $UnderlyingABI=$ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1203
	$UnderlyingABI=&PMUnderlyingABI($ABI) if defined &PMUnderlyingABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1204
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1205
	$Path{Lib}="$E32env::Data{LinkPath}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1206
	unless ($ASSPExports) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1207
		$Path{Lib}.= lc($UnderlyingABI)."\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1208
	} 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1209
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1210
		$Path{Lib}.= lc($Plat{ASSP})."\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1211
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1212
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1213
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1214
#	set up link path - this is the place where the target looks for ordinary libraries
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1215
	$Path{Link}="$E32env::Data{LinkPath}"."$UnderlyingABI\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1216
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1217
#	set up stat link path - this is where the target looks for static libraries
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1218
	$Path{StatLink}="$E32env::Data{LinkPath}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1219
	if ($Plat{StatLink}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1220
			$Path{StatLink}.=lc($Plat{StatLink})."\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1221
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1222
		unless ($Plat{OS} eq 'WINS') {	# WINC and WINS versions of EEXE are different
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1223
			$Path{StatLink}.=lc($ABI)."\\"; # ARM static libraries are currently always ASSP-independent
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1224
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1225
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1226
			$Path{StatLink}.=lc($Plat{ASSP})."\\"; # WINC static libraries are currently always ASSP-specific
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1227
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1228
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1229
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1230
#	set up release path
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1231
	$Path{Rel}="$E32env::Data{RelPath}".lc($Plat{Real})."\\";
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
sub CreateExtraFile ($$) { # takes abs path for source and text
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1236
# allows modules to create extrafiles
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1237
	my ($FILE,$Text)=@_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1238
	if ($Options{makemakefile}) {	# only create if making the makefile
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1239
		if ($Options{v}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1240
			print "Creating \"$FILE\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1241
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1242
		eval { &Path_MakePathL($FILE); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1243
		die $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1244
		open FILE, ">$FILE" or die "WARNING: Can't open or create \"$FILE\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1245
		print  FILE $Text or die "WARNING: Can't write text to \"$FILE\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1246
		close FILE or die "WARNING: Can't close \"$FILE\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1247
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1248
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1249
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1250
sub ABI () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1251
	$ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1252
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1253
sub AddSrc ($$) { # needs abs path for source
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1254
# allows modules to add a source file to the project and have it created if necessary
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1255
	my ($SRCFILE,$Text)=@_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1256
	my $SrcPath=&Path_Split('Path',$SRCFILE);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1257
	my $CurFile=&Path_Split('File',$SRCFILE);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1258
	my $BaseName=&Path_Split('Base',$SRCFILE);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1259
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1260
	if ((not -e $SRCFILE) || (-M $SRCFILE > -M $MMPFILE)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1261
		# only create the file if it's older than the .MMP file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1262
		CreateExtraFile($SRCFILE,$Text);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1263
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1264
	 my %CurSource;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1265
	 $CurSource{SrcPath}=$SrcPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1266
	 $CurSource{CurFile}=$CurFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1267
	 $CurSource{BaseTrg}=$BaseName;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1268
	 push @SourceStruct, \%CurSource;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1269
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1270
sub AddPlatMacros (@) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1271
# allows modules to add extra macros to the platform macro list
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1272
	push @{$Plat{Macros}},@_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1273
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1274
sub AifRef () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1275
	$CurAifRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1276
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1277
sub AifStructRef () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1278
	\@AifStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1279
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1280
sub AllowDllData () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1281
	$AllowDllData;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1282
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1283
sub CompressTarget () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1284
	$CompressTarget;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1285
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1286
sub CompressTargetMode () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1287
	$CompressTargetMode;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1288
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1289
sub BuildAsARM () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1290
	return 0 if $Options{ithumb};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1291
	return 1 if $Options{iarm};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1292
	$BuildAsARM;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1293
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1294
sub ASSPLibList () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1295
	@ASSPLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1296
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1297
sub ASSPLinkPath () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1298
#	this is the path where the target looks for ASSP-specific import libraries
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1299
	my $Path=$Path{ASSPLink};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1300
	if ($CurBld) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1301
		if ($Plat{OS} eq 'EPOC32') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1302
			$Path.="UREL\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1303
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1304
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1305
			$Path.="UDEB\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1306
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1307
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1308
	$Path;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1309
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1310
sub BaseMak () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1311
	&Path_Split('Base',$MAKEFILE);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1312
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1313
sub BaseResrc () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1314
	&Path_Split('Base',$CurResrc);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1315
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1316
sub BaseResrcList () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1317
	my @ResrcList=&ResrcList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1318
	my $Path;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1319
	foreach $Path (@ResrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1320
		$Path=&Path_Split('Base',$Path);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1321
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1322
	@ResrcList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1323
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1324
sub BaseSrc () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1325
	&Path_Split('Base',$CurSrc);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1326
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1327
sub ExtSrc () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1328
	&Path_Split('Ext',$CurSrc);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1329
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1330
sub BaseSrcList () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1331
	my @SrcList=&SrcList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1332
	my $Path;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1333
	foreach $Path (@SrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1334
		$Path=&Path_Split('Base',$Path);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1335
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1336
	@SrcList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1337
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1338
sub BaseSysResrcList () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1339
	my @SysResrcList=&SysResrcList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1340
	my $Path;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1341
	foreach $Path (@SysResrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1342
		$Path=&Path_Split('Base',$Path);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1343
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1344
	@SysResrcList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1345
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1346
sub BaseTrg () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1347
	&Path_Split('Base',$Trg);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1348
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1349
sub BitMapRef () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1350
	$CurBitMapRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1351
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1352
sub BitMapStructRef () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1353
	\@BitMapStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1354
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1355
sub Bld () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1356
	$CurBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1357
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1358
sub BldList () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1359
	@{$Plat{Blds}};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1360
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1361
sub BldPath () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1362
	my $Path=$Path{"Bld"};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1363
	if ($CurBld) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1364
		$Path.=$FeatureVariantInfo{$CurBld."_LABEL"}."\\" if (%FeatureVariantInfo && !$FeatureVariantInfo{INVARIANT} && $FeatureVariantInfo{$CurBld."_LABEL"});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1365
		$Path.="$CurBld\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1366
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1367
	$Path;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1368
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1369
sub CallDllEntryPoints () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1370
	$CallDllEntryPoints;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1371
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1372
sub Capability () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1373
	$Capability;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1374
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1375
sub CapabilityFlags () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1376
	@CapabilityFlags;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1377
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1378
sub DataLinkAddress () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1379
	$DataLinkAddress;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1380
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1381
sub DataPath () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1382
	$E32env::Data{DataPath};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1383
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1384
sub DebugLibList () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1385
	@DebugLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1386
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1387
sub DefFile () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1388
	"$Def{Path}$Def{Base}$Def{Ext}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1389
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1390
sub DefFileType () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1391
	$Plat{DefFile};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1392
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1393
sub DepList () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1394
	sort @CurDepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1395
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1396
sub Doc () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1397
	$CurDoc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1398
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1399
sub DocList () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1400
	if ($CurSrcPath) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1401
		return sort @{$DocHash{$CurSrcPath}};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1402
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1403
	my @DocList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1404
	my $Key;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1405
	foreach $Key (keys %DocHash) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1406
		push @DocList,@{$DocHash{$Key}};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1407
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1408
	sort @DocList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1409
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1410
sub EPOCPath () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1411
	$E32env::Data{EPOCPath};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1412
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1413
sub EPOCDataPath () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1414
	$E32env::Data{EPOCDataPath};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1415
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1416
sub EPOCIncPath () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1417
	$E32env::Data{EPOCIncPath};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1418
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1419
sub EPOCRelPath () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1420
	$E32env::Data{RelPath};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1421
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1422
sub EPOCSecurePlatform () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1423
	$E32env::Data{SecurePlatform};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1424
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1425
sub EPOCToolsPath () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1426
	$E32env::Data{EPOCToolsPath};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1427
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1428
sub Exports () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1429
	@{$TrgType{Exports}{$Plat{"DefFile"}}};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1430
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1431
sub ExportUnfrozen () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1432
	$ExportUnfrozen;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1433
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1434
sub FirstLib () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1435
	$FirstLib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1436
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1437
sub FixedProcess () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1438
	$FixedProcess;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1439
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1440
sub BasicTrgType () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1441
	$TrgType{Basic};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1442
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1443
sub HeapSize () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1444
	%HeapSize;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1445
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1446
sub LibList () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1447
	@LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1448
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1449
sub LibPath () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1450
#	this is the path where the target puts it's import library
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1451
	my $Path=$Path{Lib};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1452
	if ($CurBld) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1453
		if (($Plat{DefFile} eq 'EABI') || ($Plat{DefFile} eq 'x86gcc') || ($Plat{OS} eq 'TOOLS2')) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1454
			$Path.="lib\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1455
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1456
		elsif ($Plat{OS} eq 'EPOC32') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1457
			$Path.="urel\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1458
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1459
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1460
			$Path.="udeb\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1461
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1462
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1463
	$Path;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1464
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1465
sub LinkAs () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1466
	$LinkAs;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1467
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1468
sub LinkAsBase () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1469
	$LinkAsBase;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1470
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1471
sub ExportLibrary () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1472
	$ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1473
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1474
sub NoExportLibrary () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1475
	$NoExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1476
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1477
sub LinkPath () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1478
#	this is the place where the target looks for CPU-specific libraries
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1479
	my $Path=$Path{Link};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1480
	if ($CurBld) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1481
		if ($Plat{DefFile} eq 'EABI' || $Plat{DefFile} eq 'x86gcc') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1482
			$Path.="LIB\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1483
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1484
		elsif ($Plat{OS} eq 'EPOC32') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1485
			$Path.="UREL\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1486
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1487
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1488
			$Path.="UDEB\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1489
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1490
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1491
	$Path;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1492
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1493
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1494
sub MacroList ($) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1495
	if ($_[0]) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1496
	return @{$BldMacros{$_[0]}};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1497
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1498
	return @{$Plat{Macros}} unless $CurBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1499
	(@{$Plat{Macros}},@{$BldMacros{$CurBld}});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1500
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1501
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1502
# returns the file containing Variant specific Macros
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1503
sub VariantFile($)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1504
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1505
    return $variantMacroHRHFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1506
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1507
# returns the file containing Variant specific Macros, which may differ from the above if feature variants are used
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1508
sub ResourceVariantFile($)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1509
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1510
    return $ResourceVariantMacroHRHFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1511
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1512
sub MakeFilePath () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1513
	&Path_Split('Path',$MAKEFILE);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1514
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1515
sub MmpFile () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1516
	$MMPFILE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1517
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1518
sub PerlLibPath () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1519
	$PerlLibPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1520
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1521
sub Plat () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1522
	$Plat{Real};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1523
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1524
sub PlatABI () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1525
	$Plat{"ABI"};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1526
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1527
sub PlatCompiler () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1528
	$Plat{"Compiler"};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1529
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1530
sub PlatName () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1531
	$Plat{Name};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1532
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1533
sub PlatOS () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1534
	$Plat{OS};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1535
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1536
sub PlatOverrideList () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1537
	@PlatOverrideList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1538
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1539
sub ProcessPriority () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1540
	$ProcessPriority;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1541
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1542
sub RelPath () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1543
	my $Path=$Path{Rel};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1544
	if ($CurBld) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1545
		$Path .= lc($CurBld)."\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1546
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1547
	$Path;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1548
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1549
sub ResourceRef () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1550
	$CurResourceRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1551
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1552
sub ResourceStructRef () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1553
	\@ResourceStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1554
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1555
sub SetCurBld($) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1556
	$CurBld=$_[0];		# used by ide_cw.pm when handling additional platforms
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1557
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1558
sub	SetStdIncPaths (@) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1559
# allows module to set standard include paths
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1560
	@StdIncPaths=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1561
	my $Path;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1562
	foreach $Path (@_) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1563
		$Path=~s-^(.*[^\\])$-$1\\-o if defined($Path);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1564
		push @StdIncPaths, $Path;	# only place drive letters may appear, up to modules to handle
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1565
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1566
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1567
sub Src () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1568
	$CurSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1569
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1570
sub SourceStructRef () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1571
	\@SourceStruct;		#array of references to hashes of SOURCEPATH => (filename1, filename2, ...)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1572
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1573
sub SrcList () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1574
	my @SrcList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1575
    my $KeyRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1576
    foreach $KeyRef (@SourceStruct) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1577
            push @SrcList,$$KeyRef{CurFile};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1578
           } 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1579
	 @SrcList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1580
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1581
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1582
sub SmpSafe () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1583
	$SmpSafe;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1584
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1585
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1586
sub StackSize () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1587
	$StackSize;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1588
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1589
sub StatLibList () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1590
	@StatLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1591
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1592
sub StatLinkPath () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1593
	my $Path=$Path{StatLink};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1594
	if ($CurBld) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1595
		$Path.="$CurBld\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1596
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1597
	$Path;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1598
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1599
sub StdCpp () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1600
	$StdCpp;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1601
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1602
sub NoStdCpp () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1603
	$NoStdCpp;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1604
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1605
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1606
sub NewLib () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1607
	$NewLib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1608
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1609
sub SetStatLinkPath($) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1610
	($Path{StatLink}) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1611
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1612
sub SrcPath () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1613
	$CurSrcPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1614
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1615
sub SysIncPaths () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1616
	@SysIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1617
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1618
sub ResourceSysIncPaths () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1619
	return @ResourceSysIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1620
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1621
sub Trg (;$) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1622
	# The optional $bld argument permits (U)DEB and (U)REL distinction in situations where $CurBld isn't set/relevant
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1623
	my ($bld) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1624
	$bld = $CurBld if (!$bld);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1625
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1626
	return "" if !$Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1627
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1628
	my $localTrg = $Trg;	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1629
	my $vinfo = $FeatureVariantInfo{$bld."_LABEL"};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1630
	$localTrg =~ s/(\.[^\.]+)$/\.$vinfo$1/ if ($bld && %FeatureVariantInfo && !$FeatureVariantInfo{INVARIANT} && $vinfo);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1631
	return $localTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1632
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1633
sub TrgPath () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1634
	$TrgType{Path};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1635
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1636
sub TrgType () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1637
	$TrgType{Name};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1638
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1639
# this can probably go as its always 0 now
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1640
sub KernelTrg () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1641
	$TrgType{Kernel};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1642
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1643
sub SystemTrg () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1644
	$TrgType{System};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1645
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1646
sub UidList () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1647
	@UidList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1648
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1649
sub UserIncPaths () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1650
	@UserIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1651
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1652
sub SrcDbg () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1653
	$SrcDbg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1654
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1655
sub CompilerOption
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1656
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1657
	my $CompOption=$WarningLevel{$_[0]};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1658
	$CompOption="" if (!defined($CompOption)); 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1659
	$CompOption;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1660
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1661
sub LinkerOption
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1662
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1663
    my $lnkOption = $LinkerOptions{$_[0]};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1664
    $lnkOption="" if (!defined($lnkOption));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1665
    $lnkOption;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1666
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1667
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1668
sub PlatRec () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1669
	%Plat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1670
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1671
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1672
sub Version() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1673
	%Version;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1674
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1675
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1676
sub SecureId() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1677
	$SecureId;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1678
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1679
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1680
sub VendorId () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1681
	$VendorId;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1682
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1683
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1684
sub EABIDef () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1685
	$EABIDef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1686
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1687
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1688
sub ReplaceOptions () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1689
	my @ReplacementOptions = ();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1690
	if (defined($ReplaceOptions{$_[0]}))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1691
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1692
		@ReplacementOptions=@{$ReplaceOptions{$_[0]}};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1693
	}	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1694
	@ReplacementOptions;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1695
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1696
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1697
sub ARMFPU () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1698
	$ARMFPU;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1699
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1700
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1701
sub IsDebuggable () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1702
	$IsDebuggable;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1703
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1704
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1705
sub PlatTxt2D () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1706
	@PlatTxt2D;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1707
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1708
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1709
sub ToolChain () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1710
	my $ToolChain = $TruePlat{Toolchain};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1711
	$ToolChain ="" if(!defined ($TruePlat{Toolchain}) );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1712
	$ToolChain;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1713
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1714
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1715
sub StringTables () 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1716
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1717
	@StringTable;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1718
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1719
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1720
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1721
#This generates and adds the generated source of the stringtable to the source list so it's included in the binary.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1722
sub AddStringTables ()
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1723
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1724
	if(@StringTable)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1725
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1726
		foreach my $stringtable (@StringTable)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1727
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1728
			my %genSrcHash;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1729
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1730
			$genSrcHash{SrcPath} = $Path{Bld};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1731
			$genSrcHash{CurFile} = $stringtable->{BaseTrg}.".cpp";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1732
			$genSrcHash{BaseTrg} = $stringtable->{BaseTrg};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1733
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1734
			push(@SourceStruct, \%genSrcHash) if !$stringtable->{Hdronly};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1735
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1736
			# Execute it now.  This can probably be moved into the makefile by adding a suitable rule
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1737
			# to ensure the resource file is generated before the source tries to #include it.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1738
			my $stPath = $Path{Bld};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1739
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1740
			my $stCpp = $stringtable->{BaseTrg}.".cpp";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1741
			my $stHeader = lc($stringtable->{BaseTrg}).".h";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1742
			my $stFile = $stringtable->{STFile};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1743
			my $stOrigin = $stringtable->{STPath};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1744
			system("perl -S ecopyfile.pl $stOrigin$stFile $stPath$stFile");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1745
			system("perl -S stringtable.pl $stPath$stFile");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1746
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1747
			#If it's an exported header we'll need to export it.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1748
			if(defined $stringtable->{ExportPath}) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1749
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1750
				my $exportpath = $stringtable->{ExportPath};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1751
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1752
				system("perl -S ecopyfile.pl $stPath$stHeader $exportpath\\$stHeader");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1753
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1754
				push(@UserIncPaths, $exportpath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1755
				push(@StringTableUserIncPaths, $exportpath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1756
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1757
			#otherwise we just need the path of the generated header to be added 'userinclude'.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1758
			else 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1759
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1760
				push(@UserIncPaths, $Path{Bld});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1761
				push(@StringTableUserIncPaths, $Path{Bld});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1762
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1763
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1764
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1765
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1766
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1767
sub CheckSourceMMPMetaData () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1768
	%CheckSourceMMPMetaData;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1769
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1770
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1771
sub CheckSourceMMPIncludes () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1772
	%CheckSourceMMPIncludes;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1773
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1774
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1775
sub CheckSourceURELIncludes () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1776
	%CheckSourceURELIncludes;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1777
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1778
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1779
sub CheckSourceUDEBIncludes () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1780
	%CheckSourceUDEBIncludes;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1781
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1782
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1783
sub CodePagingTargetMode() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1784
	$CodePagingTargetMode;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1785
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1786
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1787
sub DataPagingTargetMode() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1788
	$DataPagingTargetMode;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1789
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1790
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1791
sub DebugSwitchUsed () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1792
	return 1 if (defined $DebugSwitch);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1793
	return 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1794
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1795
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1796
sub SymbolicDebugEnabled () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1797
	return $DebugSwitch;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1798
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1799
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1800
sub IsFunctionCallLogging() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1801
	$Options{logfc};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1802
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1803
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1804
sub IsWideCharMain() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1805
	return $IsWideCharMain;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1806
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1807
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1808
sub MmpMacros(){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1809
	my @mmpMacros=&Mmp_Macros;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1810
	return @mmpMacros;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1811
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1812
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1813
sub FeatureVariantInfo()
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1814
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1815
	return %FeatureVariantInfo;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1816
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1817
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1818
sub FeatureVariantVMapFile()
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1819
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1820
	return "" if !%FeatureVariantInfo || defined $FeatureVariantInfo{INVARIANT};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1821
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1822
	my $target = RelPath().Trg();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1823
	$target =~ s/\.$FeatureVariantInfo{$CurBld."_LABEL"}//;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1824
# modified by SV start: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1825
	my $vmap = $target. "." . $FeatureVariantInfo{NAME}.".vmap";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1826
# modified by SV end: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1827
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1828
	eval { &Path_MakePathL($vmap); };	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1829
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1830
	if (featurevariantmap->Save($target, $FeatureVariantInfo{$CurBld."_LABEL"}, $FeatureVariantInfo{NAME}, $FeatureVariantInfo{$CurBld."_FEATURES"}, &Mmp_IsFeatureVariant ? [ 'FEATUREVARIANT' ] : undef))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1831
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1832
		die "ERROR: Couldn't create feature variant map file \"$vmap\".\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1833
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1834
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1835
	return $vmap;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1836
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1837
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1838
sub FeatureVariantBaseTrg()
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1839
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1840
	# In some situations, for example .sym files, we need a feature variant tagged name
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1841
	# based on the normal BaseTrg i.e. root target name but minus extension.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1842
	my $localBaseTrg = BaseTrg();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1843
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1844
	if (%FeatureVariantInfo && !defined $FeatureVariantInfo{INVARIANT})
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1845
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1846
		$localBaseTrg .= ".".$FeatureVariantInfo{$CurBld."_LABEL"};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1847
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1848
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1849
	return $localBaseTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1850
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1851
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1852
sub CommandFile()
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1853
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1854
	my $plat = Plat();	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1855
	$plat .= ".$FeatureVariantInfo{NAME}" if %FeatureVariantInfo;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1856
	return MakeFilePath().BaseTrg().".$plat.".Bld().".objects.via";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1857
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1858
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1859
#Compiler wrapper option support
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1860
sub CompilerWrapperOption()
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1861
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1862
  # Return 1 if compiler wrapper option option(-wrap) is specified else return 0	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1863
  $IsCompilerWrapperOption;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1864
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1865
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1866
#Proxy wrapper option support
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1867
sub ProxyWrapperOption()
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1868
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1869
  # Return 1 if compiler wrapper option option(-wrap) is specified else return 0	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1870
  $IsProxyWrapperOption;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1871
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1872
# modified start: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1873
sub getSrcSet()
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1874
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1875
	return \%CurSrcSet;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1876
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1877
# modified end: makefile improvement 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1878
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1879
#1 = STDCPP support is available
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1880
#others = STDCPP support is not available
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1881
my $stdcppsupport;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1882
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1883
#STDCPP support check (SYMBIAN_OE_LIBSTDCPP)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1884
#return non-zero means STDCPP support is available,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1885
#otherwise it's not available
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1886
sub StdCppSupport()
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1887
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1888
	return $stdcppsupport if (defined $stdcppsupport);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1889
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1890
	my @hrhMacros = &Variant_GetMacroList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1891
	if (grep /^\s*SYMBIAN_OE_LIBSTDCPP\s*$/, @hrhMacros)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1892
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1893
		$stdcppsupport = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1894
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1895
	else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1896
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1897
	    $stdcppsupport = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1898
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1899
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1900
	return $stdcppsupport;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1901
}