sbsv1/abld/makmake/mmp.pm
author jascui
Wed, 17 Nov 2010 13:45:48 +0800
changeset 689 b70d8ea6cf75
parent 599 fa7a3cc6effd
permissions -rw-r--r--
Updating release text and product version
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
# Processes an mmp file and sets up subroutines to return the data
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    15
# 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    16
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    17
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    18
package Mmp;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    19
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    20
require Exporter;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    21
@ISA=qw(Exporter);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    22
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    23
@EXPORT=qw(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    24
	Mmp_SetVerbose
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    25
	Mmp_ProcessL
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    26
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    27
	Mmp_ABI
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    28
	Mmp_AifStruct
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    29
	Mmp_AllowDllData
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    30
	Mmp_CompressTarget
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    31
	Mmp_ASSPExports
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    32
	Mmp_ASSPLibList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    33
	Mmp_BuildAsARM
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    34
	Mmp_BitMapStruct 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
	Mmp_CallDllEntryPoints
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    36
	Mmp_Capability
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    37
	Mmp_CapabilityFlags
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    38
	Mmp_DataLinkAddress
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
	Mmp_DebugLibList 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
	Mmp_Def
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
	Mmp_DocHash
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    42
	Mmp_ExportUnfrozen
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    43
	Mmp_FirstLib
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    44
	Mmp_FixedProcess
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
	Mmp_HeapSize
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
	Mmp_LibList 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47
	Mmp_LinkAs
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    48
	Mmp_LinkAsBase
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    49
	Mmp_ExportLibrary
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    50
	Mmp_NewLib
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    51
	Mmp_NoExportLibrary
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    52
	Mmp_Macros
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    53
	Mmp_MmpFlag
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    54
	Mmp_PlatTxt2D
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    55
	Mmp_ProcessPriority
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    56
	Mmp_ResourceStruct 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    57
	Mmp_SmpSafe
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    58
	Mmp_RamTargets
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    59
	Mmp_RomTargets
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    60
	Mmp_SourceStruct 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    61
	Mmp_StackSize
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    62
	Mmp_StatLibList 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    63
	Mmp_SysIncPaths
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    64
	Mmp_Trg
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    65
	Mmp_TrgType
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    66
	Mmp_UidList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    67
	Mmp_UserIncPaths
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    68
	Mmp_SrcDbg
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    69
	Mmp_StdCpp
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    70
	Mmp_NoStdCpp
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    71
	Mmp_WarningLevel
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    72
	Mmp_LinkerOptions
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    73
	Mmp_Reset
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    74
	Mmp_Uids
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    75
	Mmp_Version
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    76
	Mmp_SecureId
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    77
	Mmp_VendorId
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    78
	Mmp_Replace
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    79
	Mmp_ARMFPU	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    80
	Mmp_SetIgnoreMissingDef 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    81
	Mmp_StringTable
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    82
	Mmp_CompressTargetMode
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    83
	Mmp_CodePagingTargetMode
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    84
	Mmp_DataPagingTargetMode
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    85
	Mmp_CheckSourceMMPMetaData
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    86
	Mmp_CheckSourceMMPIncludes
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    87
	Mmp_IsWideCharMain
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    88
	Mmp_IsDebuggable
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    89
	Mmp_IsFeatureVariant
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    90
	Mmp_TestedMacros
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    91
);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    92
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    93
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    94
use Genutl;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    95
use Prepfile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    96
use Pathutl;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    97
use Trgtype;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    98
use CheckSource;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    99
use Cwd;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   100
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   101
my %ProcessPriorityNames = (
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   102
	LOW=>'Low',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   103
	BACKGROUND=>'Background',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   104
	FOREGROUND=>'Foreground',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   105
	HIGH=>'High',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   106
	WINDOWSERVER=>'WindowServer',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   107
	FILESERVER=>'FileServer',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   108
	REALTIMESERVER=>'RealTimeServer',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   109
	SUPERVISOR=>'SuperVisor'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   110
);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   111
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   112
my %CapabilityNames;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   113
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   114
my %Mode;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   115
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   116
my $ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   117
my @AifStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   118
my $AllowDllData=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   119
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   120
use constant COMPRESS => 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   121
use constant NOCOMPRESS => 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   122
my $CompressTarget=COMPRESS;	# compress the target binary (negative logic)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   123
use constant NOCOMPRESSIONMETHOD => 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   124
use constant INFLATECOMPRESSIONMETHOD => 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   125
use constant BYTEPAIRCOMPRESSIONMETHOD => 2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   126
my $CompressTargetMethod=NOCOMPRESSIONMETHOD;   #NONE
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   127
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   128
my $ASSPABISwitch=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   129
my $ASSPExports=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   130
my @ASSPLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   131
my @BitMapStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   132
my $BuildAsARM=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   133
my $CallDllEntryPoints=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   134
my $Capability;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   135
my @CapabilityFlags=(0,0);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   136
my %CurSource;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   137
my $DataLinkAddress='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   138
my @DebugLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   139
my %Def;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   140
$Def{Path}='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   141
$Def{Base}='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   142
$Def{Ext}='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   143
my %DocHash;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   144
my $ExportUnfrozen=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   145
my $FirstLib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   146
my $FixedProcess=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   147
my %HeapSize;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   148
my @LangList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   149
my @LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   150
my $LinkAs;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   151
my $LinkAsBase;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   152
my $ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   153
my $NoExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   154
my @Macros;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   155
my %MmpFlag;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   156
my $NewLib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   157
my @PlatTxt2D;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   158
my $ProcessPriority='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   159
my @ResourceStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   160
my @RamTargets;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   161
my @RomTargets=({}); # include default
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   162
my $SmpSafe = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   163
my @SourceStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   164
my $StackSize='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   165
my @StatLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   166
my $StdCpp = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   167
my $NoStdCpp = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   168
my @SysIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   169
my $Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   170
my %TrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   171
my @UidList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   172
my @UserIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   173
my $SrcDbg=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   174
my %Compiler;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   175
my %LinkerOptions;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   176
my %Version;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   177
my $SecureId;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   178
my $VendorId;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   179
my %Replace;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   180
my $ARMFPU;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   181
my $IgnoreMissingDef=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   182
my @StringTableStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   183
my $CodePagingTargetMode;	# 0-N/A, 1-UNPAGED, 2-PAGED
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   184
my $DataPagingTargetMode;	# 0-N/A, 1-UNPAGED, 2-PAGED
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   185
my $WideCharMain=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   186
my $IsDebuggable;	# 0-NON_DEBUGGABLE, 1-DEBUGGABLE,2-DEBUGGABLE_UDEBONLY
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   187
my $FeatureVariant=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   188
use constant NOTPAGED => 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   189
use constant UNPAGED => 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   190
use constant PAGED => 2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   191
use constant NON_DEBUGGABLE => 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   192
use constant DEBUGGABLE => 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   193
use constant DEBUGGABLE_UDEBONLY => 2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   194
my %CheckSourceMMPMetaData;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   195
my %CheckSourceMMPIncludes;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   196
my %mmptestedMacrosHash;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   197
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   198
# List of deprecated 2nd UIDs. These are checked in a Secure Platform
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   199
my %deprecatedUIDs=
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   200
    (
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   201
    "0x10005e32" => "Unmigrated FEP detected from use of UID 0x10005e32 ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   202
    "0x10004cc1" => "Unmigrated Application Initaliser (CEikLibrary deriver) detected from use of UID 0x10004cc1 ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   203
    "0x10003a30" => "Unmigrated Conarc plugin detected from use of UID 0x10003a30",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   204
    "0x10003a19" => "Unmigrated Recogniser detected from use of UID 0x10003a19",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   205
    "0x10003a37" => "Unmigrated Recogniser detected from use of UID 0x10003a37",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   206
    "0x10003a34" => "Unmigrated CTL detected from use of UID 0x10003a34"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   207
    );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   208
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   209
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   210
sub Mmp_Reset() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   211
	undef $ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   212
	undef @AifStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   213
	$AllowDllData=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   214
	$CompressTarget=COMPRESS;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   215
    $CompressTargetMethod=NOCOMPRESSIONMETHOD;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   216
	$ASSPABISwitch=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   217
	$ASSPExports=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   218
	$BuildAsARM=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   219
	undef @ASSPLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   220
	undef @BitMapStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   221
	$CallDllEntryPoints=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   222
	undef $Capability;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   223
	@CapabilityFlags=(0,0);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   224
	undef $VendorId;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   225
	$DataLinkAddress='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   226
	undef @DebugLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   227
	undef %Def;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   228
	$Def{Path}='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   229
	$Def{Base}='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   230
	$Def{Ext}='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   231
	undef %DocHash;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   232
	$ExportUnfrozen=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   233
	undef $FirstLib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   234
	$FixedProcess=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   235
	undef %HeapSize;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   236
	undef @LangList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   237
	undef @LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   238
	undef $LinkAs;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   239
	undef $LinkAsBase;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   240
	undef $ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   241
	undef @Macros;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   242
	undef %MmpFlag;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   243
	undef $NewLib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   244
	undef @PlatTxt2D;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   245
	$ProcessPriority='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   246
	undef @ResourceStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   247
	undef @RamTargets;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   248
	@RomTargets=({}); # include default
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   249
	undef @SourceStruct;   
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   250
	$StackSize='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   251
	undef @StatLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   252
	$SmpSafe = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   253
	$StdCpp = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   254
	$NoStdCpp = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   255
	undef @SysIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   256
	undef $Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   257
	undef %TrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   258
	undef @UidList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   259
	undef @UserIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   260
	$SrcDbg=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   261
	undef %Compiler;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   262
	undef %LinkerOptions;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   263
    undef %Version;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   264
    $IgnoreMissingDef=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   265
    undef $ARMFPU;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   266
	undef @StringTableStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   267
	$CodePagingTargetMode=0;	# default N/A
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   268
	$DataPagingTargetMode=0;	# default N/A
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   269
	$IsDebuggable=0; # Default = 0 (Not debuggable)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   270
	undef %mmptestedMacrosHash;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   271
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   272
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   273
BEGIN {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   274
	$Mode{'Verbose'}=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   275
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   276
	%CapabilityNames = (
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   277
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   278
		TCB =>					(1<<0),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   279
		COMMDD =>				(1<<1),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   280
		POWERMGMT =>			(1<<2),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   281
		MULTIMEDIADD =>			(1<<3),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   282
		READDEVICEDATA =>		(1<<4),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   283
		WRITEDEVICEDATA =>		(1<<5),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   284
		DRM =>					(1<<6),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   285
		TRUSTEDUI =>			(1<<7),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   286
		PROTSERV =>				(1<<8),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   287
		DISKADMIN =>			(1<<9),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   288
		NETWORKCONTROL =>		(1<<10),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   289
		ALLFILES =>				(1<<11),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   290
		SWEVENT =>				(1<<12),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   291
		NETWORKSERVICES =>		(1<<13),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   292
		LOCALSERVICES =>		(1<<14),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   293
		READUSERDATA =>			(1<<15),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   294
		WRITEUSERDATA =>		(1<<16),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   295
		LOCATION =>				(1<<17),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   296
		SURROUNDINGSDD =>		(1<<18),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   297
		USERENVIRONMENT =>		(1<<19),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   298
#old capability names have zero value
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   299
		ROOT =>				0,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   300
		MEDIADD =>			0,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   301
		READSYSTEMDATA =>	0,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   302
		WRITESYSTEMDATA =>	0,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   303
		SOUNDDD =>			0,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   304
		UIDD =>				0,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   305
		KILLANYPROCESS =>	0,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   306
		DEVMAN =>			0,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   307
		PHONENETWORK =>		0,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   308
		LOCALNETWORK =>		0
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   309
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   310
	my $all=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   311
	foreach (keys %CapabilityNames)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   312
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   313
		$all = $all | $CapabilityNames{$_};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   314
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   315
	$CapabilityNames{"ALL"} = $all;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   316
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   317
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   318
sub Mmp_SetVerbose () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   319
	$Mode{'Verbose'}=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   320
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   321
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   322
sub Mmp_SetIgnoreMissingDef() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   323
    $IgnoreMissingDef = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   324
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   325
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   326
sub Mmp_ProcessL ($$$$) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   327
	my ($EPOCPath, $MMPFILE, $Plat_ref, $BuildIncList)=@_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   328
	my $emulator = $$Plat_ref{OS} ne 'EPOC32';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   329
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   330
	if ($Mode{Verbose}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   331
		&Prepfile_SetVerbose;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   332
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   333
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   334
	# Generate macro usage information and add variant build includes
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   335
	my $options = '-dU';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   336
	foreach ( @$BuildIncList )
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   337
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   338
		$options .= ' -I ' . &Path_PrefixWithDriveAndQuote($_);
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
#	preprocess the project description file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   342
	my @Mmp2D;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   343
	Prepfile_SetCmdOptions($options);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   344
	eval { &Prepfile_ProcessL(\@Mmp2D, $MMPFILE, &main::VariantFile(), @{$$Plat_ref{MmpMacros}}); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   345
	Prepfile_SetCmdOptions('');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   346
	die $@ if $@;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   347
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   348
	my @checkSourceMacros;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   349
	foreach (@{$$Plat_ref{MmpMacros}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   350
		$_=uc $_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   351
		push @checkSourceMacros, " $_=_____$_";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   352
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   353
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   354
	my $current = cwd;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   355
	$current =~ s/\//\\/g;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   356
	$current =~ s/^[a-zA-Z]://;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   357
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   358
	# Mimic what the current parsing routine does in terms of include paths and .mmp files
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   359
	my @checkSourceUserIncludePaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   360
	push @checkSourceUserIncludePaths, "$ENV{EPOCROOT}epoc32\\include";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   361
	push @checkSourceUserIncludePaths, "\.";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   362
	push @checkSourceUserIncludePaths, $current;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   363
	my @checkSourceSystemIncludePaths = ();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   364
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   365
	CheckSource_Includes($MMPFILE, %CheckSourceMMPIncludes, &main::VariantFile(), @checkSourceMacros, @checkSourceUserIncludePaths, @checkSourceSystemIncludePaths, $CheckSource_NoUserSystemDistinction);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   366
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   367
	my $NoStrictDef=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   368
	my $TrgPath='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   369
	my $TrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   370
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   371
	my $MmpPath=&Path_Split('Path', $MMPFILE);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   372
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   373
	my @MmpDie=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   374
	my @MmpWarn=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   375
	my @MmpDiagnostic=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   376
	my @MmpMigrationNote=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   377
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   378
	my (%CheckAif, %CheckASSPLib, %CheckDoc, %CheckLang, %CheckLib, %CheckMacro, %CheckResrc, %CheckSrc, %CheckStatLib, %CheckSysInc, %CheckSysResrc, %CheckUserInc);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   379
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   380
	my ($CheckDef);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   381
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   382
	my ($CheckRamTargets, $CheckRomTargets);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   383
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   384
	my ($OtherPlatSwitch, $PlatTxtSwitch);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   385
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   386
	my (%CurBitMap, $CurBitMapSrcPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   387
	$CurBitMapSrcPath=$MmpPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   388
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   389
	my (%CurResource, %ResourceCheckLang);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   390
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   391
	my %CurStringTable;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   392
	my ($CurSrcPath, $MmpMacro, $Line);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   393
	$CurSrcPath=$MmpPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   394
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   395
#	include the .MMP file as a document
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   396
	@{$DocHash{$MmpPath}}=(&Path_Split('File', $MMPFILE));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   397
	$CheckDoc{$MMPFILE}='zero - specified by default';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   398
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   399
# process the data structure
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   400
	my $CurFile=$MMPFILE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   401
	LINE: foreach $Line (@Mmp2D) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   402
		my $LineNum=shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   403
		$_=shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   404
		if ($LineNum eq '#') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   405
			$CurFile=$_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   406
			next LINE;
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
		# Get details of tested macros affecting the MMP file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   410
		# We get this from -dU preprocessor option
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   411
		if (/^#define$/ && "@$Line" =~ /^(\w+(?:\([^\)]*\))?)(?:\s(\S.*?))?\s*$/)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   412
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   413
			# Record macro details for defined tested macro
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   414
			$mmptestedMacrosHash{$1} = $2 ? "\'$2\'" : 'defined';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   415
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   416
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   417
		elsif (/^#undef$/)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   418
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   419
			# Record macro details for undefined tested macro
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   420
			$mmptestedMacrosHash{"@$Line"} = 'undefined';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   421
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   422
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   423
				
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   424
		$CurFile = &Path_Norm ($CurFile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   425
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   426
		$_=uc $_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   427
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   428
		my $mainElement = $_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   429
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   430
		if ($PlatTxtSwitch) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   431
			if (/^END$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   432
				$PlatTxtSwitch=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   433
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   434
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   435
			push @PlatTxt2D, [ "$CurFile($LineNum)", $_, @$Line ];
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   436
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   437
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   438
		if ($OtherPlatSwitch) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   439
			if (/^END$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   440
				$OtherPlatSwitch=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   441
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   442
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   443
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   444
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   445
		# ----------- handle body of START BITMAP ... END -------------
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   446
		if (%CurBitMap) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   447
			if (/^SOURCE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   448
				unless (@$Line>1) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   449
					push @MmpDie, "$CurFile($LineNum) : Not enough arguments for Bitmap keyword SOURCE\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   450
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   451
				my $cldepth = shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   452
				my @ClDepths = split(/,/, $cldepth);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   453
				foreach (@ClDepths) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   454
					$_ = lc $_; # bmconv can't handle upper-case 'C's
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   455
					unless (/^c?\d\d?a?$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   456
						push @MmpDie, "$CurFile($LineNum) : BITMAP color depth \"$_\" - unexpected format\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   457
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   458
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   459
				@ClDepths = (@ClDepths) x @$Line;	# make a sufficiently long list of color depths
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   460
				foreach (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   461
					CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, "BITMAP SOURCE", $_, $LineNum, $CheckSource_PhysicalCheck, $CurBitMapSrcPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   462
					$_ = &Path_Norm($_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   463
					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   464
					$_=lc $_;	# bmconv generates a header with case-sensitive enums
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   465
					my $bitmap = "$CurBitMapSrcPath$_";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   466
					push @{$CurBitMap{Source}}, { # sources must be kept in order
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   467
						Src=>$bitmap,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   468
						ClDepth=>shift @ClDepths	# take next color depth from the list
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   469
					};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   470
					unless (-e $bitmap) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   471
						push @MmpWarn, "$CurFile($LineNum) : BITMAP source \"$CurBitMapSrcPath$_\" not found\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   472
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   473
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   474
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   475
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   476
			if (/^END$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   477
				$CurBitMapSrcPath=$MmpPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   478
				my %BitMap=%CurBitMap;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   479
				undef %CurBitMap;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   480
				push @BitMapStruct, \%BitMap;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   481
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   482
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   483
			if (/^SOURCEPATH$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   484
				unless ($CurBitMapSrcPath=shift @$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   485
					push @MmpDie, "$CurFile($LineNum) : No path specified with Bitmap keyword SOURCEPATH\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   486
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   487
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   488
				CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, "BITMAP SOURCEPATH", $CurBitMapSrcPath, $LineNum, $CheckSource_PhysicalCheck);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   489
				$CurBitMapSrcPath = &Path_Norm($CurBitMapSrcPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   490
				
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   491
				$CurBitMapSrcPath=~s-^(.*[^\\])$-$1\\-o;   # ensure path ends with a backslash
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   492
				$CurBitMapSrcPath=&Path_MakeAbs($CurFile,$CurBitMapSrcPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   493
				if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   494
					push @MmpWarn, "$CurFile($LineNum) : Too many arguments for Bitmap keyword SOURCEPATH\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   495
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   496
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   497
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   498
			if (/^HEADER$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   499
				if ($CurBitMap{Hdr}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   500
					push @MmpWarn, "$CurFile($LineNum) : Bitmap HEADER already specified at line $CurBitMap{Hdr}\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   501
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   502
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   503
				$CurBitMap{Hdr}="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   504
				if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   505
					push @MmpWarn, "$CurFile($LineNum) : Bitmap keyword HEADER takes no arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   506
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   507
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   508
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   509
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   510
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   511
			if (/^TARGETPATH$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   512
				if ($CurBitMap{TrgPath}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   513
					push @MmpWarn, "$CurFile($LineNum) : Bitmap TARGETPATH already specified\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   514
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   515
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   516
				unless ($CurBitMap{TrgPath}=shift @$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   517
					push @MmpDie, "$CurFile($LineNum) : No path specified with Bitmap keyword TARGETPATH\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   518
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   519
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   520
				CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, "BITMAP TARGETPATH", $CurBitMap{TrgPath}, $LineNum);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   521
				$CurBitMap{TrgPath} = &Path_Norm($CurBitMap{TrgPath});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   522
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   523
				$CurBitMap{TrgPath}=~s-^\\(.*)$-$1-o;        # remove leading backslash, if any
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   524
				$CurBitMap{TrgPath}=~s-^(.*[^\\])$-$1\\-o;   # ensure path ends with a backslash
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   525
				$CurBitMap{TrgPath}="z\\$CurBitMap{TrgPath}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   526
				if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   527
					push @MmpWarn, "$CurFile($LineNum) : Too many arguments for Bitmap keyword TARGETPATH\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   528
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   529
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   530
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   531
			push @MmpWarn, "$CurFile($LineNum) : Unrecognised Bitmap Keyword \"$_\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   532
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   533
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   534
		# ----------- handle body of START RESOURCE ... END -------------
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   535
		if (%CurResource) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   536
			if (/^END$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   537
				$CurResource{SrcPath}=$CurSrcPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   538
				my %Resource=%CurResource;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   539
				undef %CurResource;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   540
				push @ResourceStruct, \%Resource;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   541
				undef %ResourceCheckLang;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   542
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   543
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   544
			if (/^HEADER$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   545
				if ($CurResource{Hdr}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   546
					push @MmpWarn, "$CurFile($LineNum) : Resource HEADER already specified at line $CurResource{Hdr}\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   547
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   548
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   549
				elsif ($CurResource{Hdronly}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   550
					push @MmpWarn, "$CurFile($LineNum) : Resource HEADERONLY already specified at line $CurResource{Hdr}\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   551
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   552
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   553
				$CurResource{Hdr}="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   554
				if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   555
					push @MmpWarn, "$CurFile($LineNum) : Resource keyword HEADER takes no arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   556
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   557
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   558
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   559
			if (/^HEADERONLY$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   560
				if ($CurResource{Hdronly}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   561
					push @MmpWarn, "$CurFile($LineNum) : Resource HEADERONLY already specified at line $CurResource{Hdr}\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   562
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   563
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   564
				elsif ($CurResource{Hdr}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   565
					push @MmpWarn, "$CurFile($LineNum) : Resource HEADER already specified at line $CurResource{Hdr}\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   566
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   567
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   568
				$CurResource{Hdronly}="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   569
				if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   570
					push @MmpWarn, "$CurFile($LineNum) : Resource keyword HEADERONLY takes no arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   571
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   572
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   573
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   574
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   575
			if (/^LANG$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   576
				if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   577
					my $Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   578
					foreach $Candidate (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   579
						if ($ResourceCheckLang{$Candidate}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   580
							push @MmpWarn, "$CurFile($LineNum) : Duplicate Language \"$Candidate\" at line $ResourceCheckLang{$Candidate}\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   581
							next; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   582
						}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   583
						push @{$CurResource{Lang}}, $Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   584
						$ResourceCheckLang{$Candidate}="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   585
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   586
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   587
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   588
				push @MmpWarn, "$CurFile($LineNum) : No Languages specified for keyword LANG\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   589
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   590
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   591
			if (/^TARGET$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   592
				if ($CurResource{BaseTrg}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   593
					push @MmpWarn, "$CurFile($LineNum) : Resource TARGET already specified\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   594
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   595
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   596
			    my $src=shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   597
			    CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, "RESOURCE TARGET", $src, $LineNum);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   598
			    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   599
			    $src = &Path_Norm($src);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   600
				$CurResource{BaseTrg}=&Path_Split('Base',$src);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   601
				unless ($CurResource{BaseTrg}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   602
					push @MmpDie, "$CurFile($LineNum) : No name specified with Resource keyword TARGET\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   603
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   604
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   605
				if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   606
					push @MmpWarn, "$CurFile($LineNum) : Too many arguments for Resource keyword TARGET\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   607
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   608
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   609
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   610
			if (/^TARGETPATH$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   611
				if ($CurResource{TrgPath}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   612
					push @MmpWarn, "$CurFile($LineNum) : Resource TARGETPATH already specified\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   613
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   614
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   615
				unless ($CurResource{TrgPath}=shift @$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   616
					push @MmpDie, "$CurFile($LineNum) : No path specified with Resource keyword TARGETPATH\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   617
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   618
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   619
				CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, "RESOURCE TARGETPATH", $CurResource{TrgPath}, $LineNum);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   620
				$CurResource{TrgPath} = &Path_Norm($CurResource{TrgPath});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   621
				
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   622
				$CurResource{TrgPath}=~s-^\\(.*)$-$1-o;        # remove leading backslash, if any
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   623
				$CurResource{TrgPath}=~s-^(.*[^\\])$-$1\\-o;   # ensure path ends with a backslash
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   624
				$CurResource{TrgPath}="z\\$CurResource{TrgPath}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   625
				if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   626
					push @MmpWarn, "$CurFile($LineNum) : Too many arguments for Resource keyword TARGETPATH\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   627
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   628
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   629
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   630
			if (/^UID$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   631
				if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   632
					if (scalar @$Line>2) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   633
						push @MmpWarn, "$CurFile($LineNum) : Can't specify more than 2 Uids\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   634
						next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   635
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   636
					foreach (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   637
						$_=&Genutl_AnyToHex($_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   638
						if (defined $_) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   639
							push @{$CurResource{Uids}}, $_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   640
							next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   641
						}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   642
						push @MmpDie, "$CurFile($LineNum) : Uid doesn't fit expected number format\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   643
						next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   644
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   645
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   646
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   647
				push @MmpWarn, "$CurFile($LineNum) : No Uids specified for Resource keyword UID\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   648
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   649
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   650
			if (/^DEPENDS$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   651
				# Note that DEPENDS lines are tolerated, but ignored - these are only relevant to build systems
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   652
				# other than ABLD
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   653
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   654
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   655
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   656
			push @MmpWarn, "$CurFile($LineNum) : Unrecognised Resource Keyword \"$_\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   657
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   658
		if (/^WCHARENTRYPOINT$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   659
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   660
				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   661
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   662
			if ($TrgType=~/^STDEXE$/io) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   663
				$WideCharMain=1;	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   664
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   665
			else{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   666
				push @MmpWarn, "$CurFile($LineNum) : WCHARENTRYPOINT is supported only for Target Type STDEXE\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   667
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   668
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   669
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   670
		# ----------- handle body of START STRINGTABLE ... END -------------
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   671
		if(%CurStringTable)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   672
		{	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   673
			if (/^END$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   674
				my %stringtable = %CurStringTable;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   675
				push @StringTableStruct, \%stringtable;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   676
				undef %CurStringTable;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   677
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   678
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   679
			if (/^EXPORTPATH/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   680
				if (scalar @$Line != 1) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   681
					push @MmpDie, "$CurFile($LineNum) : Wrong number of arguments for EXPORTPATH\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   682
				} 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   683
				if(defined $CurStringTable{ExportPath})	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   684
					push @MmpDie, "$CurFile($LineNum) : Redefinition of EXPORTPATH\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   685
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   686
				else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   687
				    my $src=shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   688
					$CurStringTable{ExportPath} = $src;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   689
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   690
					CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, "STRINGTABLE EXPORTPATH", $CurStringTable{ExportPath}, $LineNum);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   691
					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   692
					$CurStringTable{ExportPath} = &Path_Norm($CurStringTable{ExportPath});					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   693
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   694
					$CurStringTable{ExportPath} =~ s/\\$//o;   # ensure path doesn't end with a backslash (cl_generic.pm will add one)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   695
					$CurStringTable{ExportPath} = &Path_MakeEAbs($EPOCPath,$CurFile,$CurStringTable{ExportPath});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   696
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   697
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   698
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   699
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   700
			if (/^HEADERONLY$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   701
				if ($CurStringTable{Hdronly}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   702
					push @MmpWarn, "$CurFile($LineNum) : Stringtable HEADERONLY already specified\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   703
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   704
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   705
				$CurStringTable{Hdronly}="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   706
				if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   707
					push @MmpWarn, "$CurFile($LineNum) : Stringtable keyword HEADERONLY takes no arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   708
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   709
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   710
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   711
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   712
		# ----------- handle top-level MMP file -------------------	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   713
		if (/^START$/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   714
			unless ($_=uc shift @$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   715
				push @MmpWarn, "$CurFile($LineNum) : No Argument specified for START block\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   716
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   717
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   718
			foreach $MmpMacro (@{$$Plat_ref{MmpMacros}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   719
				if ($_ eq $MmpMacro) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   720
					$PlatTxtSwitch="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   721
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   722
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   723
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   724
			if ($_ eq 'BITMAP') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   725
				unless ($CurBitMap{Trg}=shift @$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   726
					push @MmpWarn, "$CurFile($LineNum) : No Bitmap Target specified\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   727
					$CurBitMap{Trg}='NoTargetSpecified';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   728
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   729
				if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   730
					push @MmpWarn, "$CurFile($LineNum) : Too many arguments for START BITMAP clause\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
				CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, "START BITMAP", $CurBitMap{Trg}, $LineNum);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   734
				$CurBitMap{Trg} = &Path_Norm($CurBitMap{Trg});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   735
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   736
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   737
			if ($_ eq 'RESOURCE') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   738
				if (scalar @$Line != 1) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   739
					push @MmpWarn, "$CurFile($LineNum) : Wrong number of arguments for START RESOURCE clause\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   740
				} 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   741
				else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   742
				    my $src=shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   743
					CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, "START RESOURCE", $src, $LineNum, $CheckSource_PhysicalCheck, $CurSrcPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   744
					$src = &Path_Norm($src);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   745
				    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   746
					$CurResource{Source}="$CurSrcPath$src";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   747
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   748
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   749
				
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   750
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   751
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   752
			if ($_ eq 'STRINGTABLE') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   753
				if (scalar @$Line != 1) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   754
					push @MmpWarn, "$CurFile($LineNum) : Wrong number of arguments for START STRINGTABLE clause\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   755
				} 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   756
				else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   757
				    my $Candidate = shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   758
				    CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, "START STRINGTABLE", $Candidate, $LineNum, $CheckSource_PhysicalCheck, $CurSrcPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   759
					$Candidate = &Path_Norm($Candidate);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   760
				    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   761
					$Candidate =~ s/^\\//;	# remove leading \, if any	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   762
					$CurStringTable{BaseTrg}=&Path_Split('Base',$Candidate);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   763
					my $path=&Path_Split('Path',$Candidate);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   764
					if($path){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   765
					  $CurStringTable{STPath}=&Path_MakeAbs($CurSrcPath,&Path_Split('Path',$Candidate));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   766
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   767
					else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   768
					  $CurStringTable{STPath}=$CurSrcPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   769
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   770
					$CurStringTable{STFile}=&Path_Split('File',$Candidate);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   771
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   772
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   773
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   774
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   775
			$OtherPlatSwitch="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   776
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   777
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   778
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   779
		if (/^AIF$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   780
			my ($trg, $dir, $file, $clDepth, @bitmaps)=@$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   781
			unless ($file) { # bitmaps aren't essential
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   782
				push @MmpDie, "$CurFile($LineNum) : Not enough arguments for keyword AIF\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   783
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   784
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   785
			my %Data;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   786
			$Data{Trg} = $trg;	# Defect: may include directory
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   787
			$dir=~s-^(.*[^\\])$-$1\\-o;   # ensure path ends with a backslash
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   788
			$Data{Source}=&Path_MakeAbs($CurFile, "$dir$file");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   789
			unless (-e "$Data{Source}") {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   790
				push @MmpWarn, "$CurFile($LineNum) : AIF source \"$Data{Source}\" not found\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   791
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   792
			if ($CheckAif{$Data{Trg}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   793
				push @MmpDie, "$CurFile($LineNum) : Duplicate Aif \"$Data{Trg}\" at line $CheckAif{$Data{Trg}}\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   794
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   795
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   796
			$CheckAif{$Data{Trg}}="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   797
			push @AifStruct, \%Data;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   798
			next LINE unless (@bitmaps);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   799
			# handle bitmaps
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   800
			my @ClDepths = split(/,/, $clDepth);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   801
			foreach (@ClDepths) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   802
				$_ = lc $_; # bmconv can't handle upper-case 'C's
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   803
				unless (/^c?\d\d?$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   804
					push @MmpDie, "$CurFile($LineNum) : AIF color depth \"$_\" - unexpected format\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   805
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   806
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   807
			@ClDepths = (@ClDepths) x @bitmaps;	# make a sufficiently long list of color depths
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   808
			foreach $file (@bitmaps) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   809
				if ($file !~ /^\\/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   810
					$file = &Path_MakeAbs($CurFile, "$dir$file");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   811
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   812
				push @{$Data{BitMaps}}, { # sources must be kept in order
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   813
					Src=>$file,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   814
					ClDepth=>shift @ClDepths	# take next color depth from the list
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   815
				};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   816
				unless (-e $file) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   817
					push @MmpWarn, "$CurFile($LineNum) : AIF source \"$file\" not found\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   818
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   819
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   820
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   821
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   822
		if (/^ASSPABI$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   823
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   824
				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   825
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   826
			$ASSPABISwitch=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   827
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   828
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   829
		if (/^ASSPEXPORTS$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   830
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   831
				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   832
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   833
			$ASSPExports=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   834
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   835
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   836
		if (/^ASSPLIBRARY$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   837
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   838
				my $Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   839
				foreach $Candidate (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   840
					CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, $mainElement, $Candidate, $LineNum);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   841
					$Candidate = &Path_Norm($Candidate);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   842
					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   843
					unless ($emulator or &Genutl_ParseVersionedName(\$Candidate)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   844
						push @MmpWarn, "$CurFile($LineNum) : Bad version in ASSPLIBRARY\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   845
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   846
					if ($CheckASSPLib{$Candidate}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   847
						push @MmpWarn, "$CurFile($LineNum) : Duplicate Library \"$Candidate\" at line $CheckASSPLib{$Candidate}\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   848
						next; 
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
					push @ASSPLibList, $Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   852
					$CheckASSPLib{$Candidate}="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   853
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   854
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   855
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   856
			push @MmpWarn, "$CurFile($LineNum) : No Libraries specified for keyword ASSPLIBRARY\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   857
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   858
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   859
		if (/^CAPABILITY$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   860
			if (defined($Capability)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   861
				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine CAPABILITY\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   862
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   863
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   864
			if (scalar @$Line == 0) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   865
				push @MmpWarn, "$CurFile($LineNum) : Wrong number of arguments for CAPABILITY\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   866
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   867
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   868
			foreach my $capname (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   869
				my $invert = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   870
				if ($capname =~ /^-(\w*)/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   871
					$invert = 0xffffffff;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   872
					$capname = $1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   873
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   874
				my $capFlag = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   875
				if (defined($CapabilityNames{uc $capname})) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   876
					$capFlag = $CapabilityNames{uc $capname};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   877
					if (not $capFlag) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   878
						push @MmpDiagnostic, "$CurFile($LineNum) : Use of old capability name, \"$capname\" ignored\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   879
						next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   880
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   881
					if ("ALL" eq uc $capname and $invert) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   882
						push @MmpWarn, "Capability '-ALL' not allowed";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   883
						next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   884
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   885
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   886
				elsif ("NONE" eq uc $capname) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   887
					if($invert) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   888
						push @MmpWarn, "Capability '-NONE' not allowed";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   889
						next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   890
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   891
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   892
				else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   893
					push @MmpWarn, "$CurFile($LineNum) : Unknown capability \"$capname\" ignored\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   894
					next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   895
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   896
				# append name to capability string
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   897
				if (defined($Capability) and not $invert) { $Capability .= "+"; }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   898
				if($invert) { $Capability .= "-"; }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   899
				$Capability .= $capname;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   900
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   901
				# add capability mask to flags
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   902
				$CapabilityFlags[0] = $CapabilityFlags[0] ^ $invert;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   903
				$CapabilityFlags[0] = $CapabilityFlags[0] | $capFlag;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   904
				$CapabilityFlags[0] = $CapabilityFlags[0] ^ $invert;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   905
				$CapabilityFlags[1] = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   906
				next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   907
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   908
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   909
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   910
		if (/^DEBUGLIBRARY$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   911
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   912
				my $Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   913
				foreach $Candidate (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   914
					CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, $mainElement, $Candidate, $LineNum);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   915
					$Candidate = &Path_Norm($Candidate);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   916
					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   917
					unless ($emulator or &Genutl_ParseVersionedName(\$Candidate)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   918
						push @MmpWarn, "$CurFile($LineNum) : Bad version in DEBUGLIBRARY\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   919
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   920
					if ($CheckLib{$Candidate}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   921
						push @MmpWarn, "$CurFile($LineNum) : Duplicate Library \"$Candidate\" at line $CheckLib{$Candidate}\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   922
						next; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   923
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   924
					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   925
					push @DebugLibList, $Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   926
					$CheckLib{$Candidate}="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   927
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   928
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   929
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   930
			push @MmpWarn, "$CurFile($LineNum) : No Libraries specified for keyword DEBUGLIBRARY\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   931
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   932
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   933
		if (/^DEFFILE$/o)  {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   934
			if ($CheckDef) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   935
				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine DEFFILE\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   936
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   937
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   938
			$CheckDef=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   939
			unless ($_=shift @$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   940
				push @MmpWarn, "$CurFile($LineNum) : No file specified for keyword DEFFILE\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   941
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   942
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   943
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   944
			$Def{CheckSource_MMPEntry} = $_;		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   945
			$Def{CheckSource_LineNumber} = $LineNum;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   946
			$Def{CheckSource_MMPFile} = $CurFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   947
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   948
			$_ = &Path_Norm($_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   949
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   950
			$Def{Base}=&Path_Split('Base',$_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   951
			$Def{Ext}=&Path_Split('Ext',$_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   952
			$Def{Path}=&Path_Split('Path',$_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   953
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   954
			if ($Def{Path}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   955
				$Def{Path}=&Path_MakeEAbs($EPOCPath,$CurFile,$Def{Path});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   956
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   957
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   958
			if ($Def{Base} =~ /\{|\}/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   959
				push @MmpDie, "$CurFile($LineNum) : Bad DEFFILE name\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   960
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   961
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   962
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   963
		if (/^DOCUMENT$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   964
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   965
				my $Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   966
				foreach $Candidate (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   967
					CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, $mainElement, $Candidate, $LineNum, $CheckSource_PhysicalCheck, $CurSrcPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   968
					$Candidate = &Path_Norm($Candidate);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   969
					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   970
					if ($CheckDoc{"$CurSrcPath$Candidate"}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   971
						push @MmpWarn, "$CurFile($LineNum) : Duplicate Document \"$CurSrcPath$Candidate\" at line ", $CheckDoc{"$CurSrcPath$Candidate"}, "\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   972
						next; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   973
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   974
					unless (-e "$CurSrcPath$Candidate") {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   975
						push @MmpWarn, "$CurFile($LineNum) : DOCUMENT \"$CurSrcPath$Candidate\" not found\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   976
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   977
					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   978
					push @{$DocHash{$CurSrcPath}}, $Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   979
					$CheckDoc{"$CurSrcPath$Candidate"}="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   980
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   981
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   982
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   983
			push @MmpWarn, "$CurFile($LineNum) : No Files specified for keyword DOCUMENT\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   984
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   985
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   986
		if (/^EPOCALLOWDLLDATA$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   987
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   988
				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   989
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   990
			$AllowDllData=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   991
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   992
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   993
		if (/^ALWAYS_BUILD_AS_ARM$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   994
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   995
				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   996
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   997
			$BuildAsARM=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   998
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   999
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1000
		if (/^EPOCCALLDLLENTRYPOINTS$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1001
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1002
				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1003
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1004
			$CallDllEntryPoints=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1005
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1006
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1007
		if (/^EPOCDATALINKADDRESS$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1008
			if (@$Line) { 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1009
				my $temp=&main::Genutl_AnyToHex(shift @$Line);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1010
				if (defined $temp) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1011
					$DataLinkAddress=$temp;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1012
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1013
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1014
				push @MmpDie, "$CurFile($LineNum) : Data link address doesn't fit expected number format\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1015
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1016
			push @MmpWarn, "$CurFile($LineNum) : No data link address specified for keyword $_\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1017
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1018
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1019
		if (/^EPOCFIXEDPROCESS$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1020
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1021
				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1022
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1023
			$FixedProcess=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1024
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1025
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1026
		if (/^EPOCHEAPSIZE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1027
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1028
				my $tempMin=&main::Genutl_AnyToHex(shift @$Line);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1029
				if (defined $tempMin) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1030
					if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1031
						my $tempMax=&main::Genutl_AnyToHex(shift @$Line);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1032
						if (defined $tempMax) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1033
							$HeapSize{Min}=$tempMin;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1034
							$HeapSize{Max}=$tempMax;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1035
							next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1036
						}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1037
						push @MmpDie, "$CurFile($LineNum) : maximum heap size doesn't fit expected number format\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1038
						next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1039
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1040
					push @MmpDie, "$CurFile($LineNum) : No maximum heap size specified for keyword $_\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1041
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1042
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1043
				push @MmpDie, "$CurFile($LineNum) : minimum heap size doesn't fit expected number format\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1044
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1045
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1046
			push @MmpWarn, "$CurFile($LineNum) : No minimum heap size specified for keyword $_\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1047
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1048
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1049
		if (/^EPOCPROCESSPRIORITY$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1050
			if ($ProcessPriority) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1051
				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine EPOCPROCESSPRIORITY\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1052
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1053
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1054
			if ($ProcessPriority=shift @$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1055
				if (defined($ProcessPriorityNames{uc $ProcessPriority})) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1056
					$ProcessPriority = $ProcessPriorityNames{uc $ProcessPriority}; # canonical form
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1057
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1058
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1059
				push @MmpDie, "$CurFile($LineNum) : ProcessPriority \"$ProcessPriority\" not supported\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1060
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1061
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1062
			push @MmpWarn, "$CurFile($LineNum) : No Priority specified for keyword EPOCPROCESSPRIORITY\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1063
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1064
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1065
		if (/^EPOCSTACKSIZE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1066
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1067
				my $temp=&main::Genutl_AnyToHex(shift @$Line);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1068
				if (defined $temp) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1069
					$StackSize=$temp;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1070
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1071
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1072
				push @MmpDie, "$CurFile($LineNum) : Stack size doesn't fit expected number format\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1073
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1074
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1075
			push @MmpWarn, "$CurFile($LineNum) : No stack size specified for keyword STACKSIZE\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1076
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1077
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1078
		if (/^COMPRESSTARGET$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1079
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1080
				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1081
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1082
			$CompressTarget=COMPRESS;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1083
            $CompressTargetMethod=NOCOMPRESSIONMETHOD; # means 'use default'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1084
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1085
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1086
		if (/^NOCOMPRESSTARGET$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1087
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1088
				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1089
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1090
			$CompressTarget=NOCOMPRESS;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1091
            $CompressTargetMethod=NOCOMPRESSIONMETHOD;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1092
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1093
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1094
        if (/^INFLATECOMPRESSTARGET$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1095
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1096
				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1097
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1098
            $CompressTarget=COMPRESS;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1099
			$CompressTargetMethod=INFLATECOMPRESSIONMETHOD;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1100
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1101
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1102
		if (/^BYTEPAIRCOMPRESSTARGET$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1103
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1104
				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1105
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1106
            $CompressTarget=COMPRESS;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1107
			$CompressTargetMethod=BYTEPAIRCOMPRESSIONMETHOD;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1108
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1109
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1110
		if (/^EXPORTUNFROZEN$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1111
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1112
				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1113
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1114
			$ExportUnfrozen=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1115
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1116
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1117
		if (/^FIRSTLIB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1118
			if ($FirstLib) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1119
				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine FIRSTLIB\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1120
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1121
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1122
			if ($FirstLib=shift @$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1123
				CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, $mainElement, $FirstLib, $LineNum);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1124
				$FirstLib = &Path_Norm($FirstLib);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1125
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1126
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1127
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1128
			push @MmpWarn, "$CurFile($LineNum) : Nothing specified for keyword FIRSTLIB\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1129
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1130
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1131
		if (/^LANG$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1132
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1133
				my $Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1134
				foreach $Candidate (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1135
					if ($CheckLang{$Candidate}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1136
						push @MmpWarn, "$CurFile($LineNum) : Duplicate Language \"$Candidate\" at line $CheckLang{$Candidate}\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1137
						next; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1138
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1139
					push @LangList, $Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1140
					$CheckLang{$Candidate}="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1141
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1142
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1143
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1144
			push @MmpWarn, "$CurFile($LineNum) : No Languages specified for keyword LANG\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1145
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1146
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1147
		if (/^LIBRARY$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1148
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1149
				my $Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1150
				foreach $Candidate (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1151
					CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, $mainElement, $Candidate, $LineNum);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1152
					$Candidate = &Path_Norm($Candidate);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1153
					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1154
					unless ($emulator or &Genutl_ParseVersionedName(\$Candidate)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1155
						push @MmpWarn, "$CurFile($LineNum) : Bad version in LIBRARY\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1156
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1157
					if ($CheckLib{$Candidate}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1158
						push @MmpWarn, "$CurFile($LineNum) : Duplicate Library \"$Candidate\" at line $CheckLib{$Candidate}\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1159
						next; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1160
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1161
					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1162
					push @LibList, $Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1163
					push @DebugLibList, $Candidate;	    # appears in both
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1164
					$CheckLib{$Candidate}="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1165
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1166
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1167
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1168
			push @MmpWarn, "$CurFile($LineNum) : No Libraries specified for keyword LIBRARY\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1169
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1170
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1171
		if (/^LINKAS$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1172
			if ($LinkAs) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1173
				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine LINKAS\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1174
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1175
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1176
			if ($LinkAs=shift @$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1177
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1178
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1179
			push @MmpWarn, "$CurFile($LineNum) : No name specified for keyword LINKAS\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1180
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1181
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1182
		if (/^EXPORTLIBRARY$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1183
			if ($NoExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1184
				push @MmpDie, "$CurFile($LineNum) : Can't specify both EXPORTLIBRARY and NOEXPORTLIBRARY\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1185
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1186
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1187
			if ($ExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1188
				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine EXPORTLIBRARY\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1189
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1190
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1191
			if ($ExportLibrary=shift @$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1192
				CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, $mainElement, $ExportLibrary, $LineNum);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1193
				$ExportLibrary = &Path_Norm($ExportLibrary);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1194
				$ExportLibrary=&Path_Split('Base',$ExportLibrary);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1195
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1196
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1197
			push @MmpWarn, "$CurFile($LineNum) : No name specified for keyword EXPORTLIBRARY\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1198
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1199
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1200
		if (/^NOEXPORTLIBRARY$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1201
			if ($ExportLibrary) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1202
				push @MmpDie, "$CurFile($LineNum) : Can't specify both EXPORTLIBRARY and NOEXPORTLIBRARY\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1203
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1204
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1205
			$NoExportLibrary = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1206
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1207
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1208
		if (/^NEWLIB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1209
			if ($NewLib) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1210
				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine NEWLIB\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1211
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1212
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1213
			if ($NewLib = shift @$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1214
				CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, $mainElement, $NewLib, $LineNum);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1215
				$NewLib = &Path_Norm($NewLib);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1216
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1217
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1218
			push @MmpWarn, "$CurFile($LineNum) : No library specified for keyword NEWLIB\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1219
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1220
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1221
		if (/^MACRO$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1222
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1223
				my $Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1224
				foreach $Candidate (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1225
					if ($CheckMacro{$Candidate}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1226
						push @MmpWarn, "$CurFile($LineNum) : Duplicate Macro \"$Candidate\" at line $CheckMacro{$Candidate}\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1227
						next; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1228
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1229
					push @Macros, $Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1230
					$CheckMacro{$Candidate}="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1231
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1232
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1233
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1234
			next LINE; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1235
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1236
		if (/^NOSTRICTDEF$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1237
			if ($NoStrictDef) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1238
				push @MmpWarn, "$CurFile($LineNum) : NOSTRICTDEF already set\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1239
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1240
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1241
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1242
				push @MmpWarn, "$CurFile($LineNum) : Keyword NOSTRICTDEF takes no arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1243
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1244
			$NoStrictDef=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1245
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1246
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1247
		if (/^RAMTARGET$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1248
			if ($CheckRamTargets) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1249
				push @MmpWarn, "$CurFile($LineNum) : RAM targets already specified at line $CheckRamTargets\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1250
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1251
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1252
			$CheckRamTargets="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1253
			unless (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1254
				push @MmpWarn, "$CurFile($LineNum) : No targets specified for keyword RAMTARGET\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1255
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1256
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1257
			if ($$Line[0] eq '+') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1258
				my %Data=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1259
				push @RamTargets, \%Data;	# include default
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1260
				shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1261
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1262
			my $Elem;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1263
			foreach $Elem (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1264
				my %Data=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1265
				$Data{File}=&Path_Split('File',$Elem);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1266
				$Data{Path}=&Path_Split('Path',$Elem);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1267
				push @RamTargets, \%Data;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1268
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1269
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1270
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1271
		if (/^RESOURCE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1272
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1273
				my $Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1274
				foreach $Candidate (@$Line) {			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1275
					CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, $mainElement, $Candidate, $LineNum, $CheckSource_PhysicalCheck, $CurSrcPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1276
					$Candidate = &Path_Norm($Candidate);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1277
					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1278
					if ($CheckResrc{$Candidate}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1279
						push @MmpDie, "$CurFile($LineNum) : Duplicate Resource $Candidate at line $CheckResrc{$Candidate}\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1280
						next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1281
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1282
					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1283
					$CheckResrc{$Candidate}="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1284
					my $source="$CurSrcPath$Candidate";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1285
					unless (-e $source) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1286
						push @MmpWarn, "$CurFile($LineNum) : RESOURCE source \"$source\" not found\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1287
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1288
					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1289
					$CurResource{BaseTrg}=&Path_Split('Base',$Candidate);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1290
					$CurResource{Source}=$source;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1291
					$CurResource{Hdr}="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1292
					# $CurResource{TrgPath} will be filled in at the end;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1293
					my %Resource=%CurResource;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1294
					undef %CurResource;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1295
					push @ResourceStruct, \%Resource;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1296
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1297
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1298
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1299
			push @MmpWarn, "$CurFile($LineNum) : No Resources specified for keyword RESOURCE\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1300
			next LINE; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1301
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1302
		if (/^ROMTARGET$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1303
			if ($CheckRomTargets) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1304
				push @MmpWarn, "$CurFile($LineNum) : ROM targets already specified at line $CheckRomTargets\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1305
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1306
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1307
			$CheckRomTargets="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1308
			unless (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1309
				@RomTargets=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1310
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1311
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1312
			if ($$Line[0] eq '+') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1313
				shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1314
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1315
			else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1316
				@RomTargets=(); # remove default
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1317
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1318
			my $Elem;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1319
			foreach $Elem (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1320
				my %Data=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1321
				$Data{File}=&Path_Split('File',$Elem);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1322
				$Data{Path}=&Path_Split('Path',$Elem);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1323
				push @RomTargets, \%Data;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1324
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1325
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1326
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1327
		if (/^SMPSAFE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1328
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1329
				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1330
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1331
			$SmpSafe = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1332
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1333
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1334
		if (/^SOURCE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1335
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1336
				my $Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1337
				foreach $Candidate (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1338
					CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, $mainElement, $Candidate, $LineNum, $CheckSource_PhysicalCheck, $CurSrcPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1339
					$Candidate = &Path_Norm($Candidate);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1340
					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1341
					$Candidate =~ s/^\\//;	# remove leading \, if any	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1342
					$CurSource{BaseTrg}=&Path_Split('Base',$Candidate);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1343
					my $path=&Path_Split('Path',$Candidate);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1344
					if($path){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1345
					  $CurSource{SrcPath}=&Path_MakeAbs($CurSrcPath,&Path_Split('Path',$Candidate));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1346
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1347
					else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1348
					  $CurSource{SrcPath}=$CurSrcPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1349
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1350
					$CurSource{CurFile}=&Path_Split('File',$Candidate);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1351
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1352
					my %Source=%CurSource;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1353
					undef %CurSource;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1354
					push @SourceStruct, \%Source;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1355
					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1356
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1357
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1358
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1359
			push @MmpWarn, "$CurFile($LineNum) : No Sources specified for keyword SOURCE\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1360
			next LINE; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1361
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1362
		if (/^SOURCEPATH$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1363
			if ($CurSrcPath=shift @$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1364
				CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, $mainElement, $CurSrcPath, $LineNum, $CheckSource_PhysicalCheck);				
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1365
				$CurSrcPath = &Path_Norm($CurSrcPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1366
				
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1367
				$CurSrcPath=~s-^(.*[^\\])$-$1\\-o;	# in case no terminating backslash
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1368
				$CurSrcPath=&Path_MakeEAbs($EPOCPath,$CurFile,$CurSrcPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1369
				if (-d &Path_Chop($CurSrcPath)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1370
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1371
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1372
				push @MmpWarn, "$CurFile($LineNum) : SOURCEPATH \"$CurSrcPath\" not found\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1373
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1374
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1375
			push @MmpDie, "$CurFile($LineNum) : No Source Path specified for keyword SOURCEPATH\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1376
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1377
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1378
		if (/^STATICLIBRARY$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1379
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1380
				my $Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1381
				foreach $Candidate (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1382
					CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, $mainElement, $Candidate, $LineNum);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1383
					$Candidate = &Path_Norm($Candidate);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1384
					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1385
					if ($CheckStatLib{$Candidate}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1386
						push @MmpWarn, "$CurFile($LineNum) : Duplicate Library \"$Candidate\" at line $CheckStatLib{$Candidate}\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1387
						next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1388
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1389
					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1390
					push @StatLibList, $Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1391
					$CheckStatLib{$Candidate}="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1392
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1393
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1394
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1395
			push @MmpWarn, "$CurFile($LineNum) : No Libraries specified for keyword STATICLIBRARY\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1396
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1397
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1398
		if (/^STDCPP$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1399
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1400
				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1401
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1402
			$StdCpp=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1403
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1404
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1405
  		if (/^NOSTDCPP$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1406
  			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1407
  				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1408
  			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1409
  			$NoStdCpp=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1410
  			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1411
  		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1412
		if (/^STRICTDEPEND$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1413
			if ($MmpFlag{StrictDepend}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1414
				push @MmpWarn, "$CurFile($LineNum) : STRICTDEPEND already set\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1415
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1416
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1417
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1418
				push @MmpWarn, "$CurFile($LineNum) : Keyword STRICTDEPEND takes no arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1419
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1420
			$MmpFlag{StrictDepend}=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1421
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1422
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1423
		if (/^SYSTEMINCLUDE$/o){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1424
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1425
				my $Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1426
				foreach $Candidate (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1427
					CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, $mainElement, $Candidate, $LineNum, $CheckSource_PhysicalCheck);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1428
					$Candidate = &Path_Norm($Candidate);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1429
					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1430
					$Candidate=~s-^(.*[^\\])$-$1\\-o;   # ensure path ends with a backslash
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1431
					$Candidate=&Path_MakeEAbs($EPOCPath,$CurFile,$Candidate);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1432
					if ($CheckSysInc{$Candidate}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1433
						next; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1434
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1435
					push @SysIncPaths,$Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1436
					$CheckSysInc{$Candidate}="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1437
					if (-d &Path_Chop($Candidate)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1438
						next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1439
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1440
					push @MmpWarn, "$CurFile($LineNum) : SYSTEMINCLUDE path \"$Candidate\" not found\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1441
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1442
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1443
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1444
			push @MmpWarn, "$CurFile($LineNum) : No Paths specified for keyword SYSTEMINCLUDE\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1445
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1446
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1447
		if (/^SYSTEMRESOURCE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1448
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1449
				my $Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1450
				foreach $Candidate (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1451
					CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, $mainElement, $Candidate, $LineNum, $CheckSource_PhysicalCheck, $CurSrcPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1452
					$Candidate = &Path_Norm($Candidate);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1453
					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1454
					if ($CheckSysResrc{$Candidate}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1455
						push @MmpDie, "$CurFile($LineNum) : Duplicate Resource \"$Candidate\" at line $CheckSysResrc{$Candidate}\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1456
						next; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1457
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1458
					$CheckSysResrc{$Candidate}="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1459
					my $source="$CurSrcPath$Candidate";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1460
					unless (-e $source) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1461
						push @MmpWarn, "$CurFile($LineNum) : SYSTEMRESOURCE source \"$source\" not found\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1462
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1463
					$CurResource{BaseTrg}=&Path_Split('Base',$Candidate);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1464
					$CurResource{Source}=$source;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1465
					$CurResource{Hdr}="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1466
					$CurResource{TrgPath}="z\\system\\data\\";	# needs to match e32env.pm
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1467
					my %Resource=%CurResource;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1468
					undef %CurResource;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1469
					push @ResourceStruct, \%Resource;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1470
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1471
				if (&main::EPOCSecurePlatform()) {    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1472
					push @MmpMigrationNote, "Obsolete SYSTEMRESOURCE keyword specified in \"$MMPFILE\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1473
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1474
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1475
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1476
			push @MmpWarn, "$CurFile($LineNum) : No Resources specified for keyword SYSTEMRESOURCE\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1477
			next LINE; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1478
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1479
		if (/^TARGET$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1480
			if ($Trg) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1481
				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine TARGET\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1482
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1483
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1484
			if ($Trg=shift @$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1485
				CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, $mainElement, $Trg, $LineNum);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1486
				$Trg = &Path_Norm($Trg);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1487
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1488
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1489
			push @MmpWarn, "$CurFile($LineNum) : No Target specified for keyword TARGET\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1490
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1491
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1492
		if (/^TARGETPATH$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1493
			if ($TrgPath) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1494
				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine TARGETPATH\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1495
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1496
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1497
			unless ($TrgPath=shift @$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1498
				push @MmpWarn, "$CurFile($LineNum) : No Path specified for keyword TARGETPATH\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1499
				next LINE;
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
			CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, $mainElement, $TrgPath, $LineNum);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1503
			$TrgPath = &Path_Norm($TrgPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1504
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1505
			$TrgPath=~s-^\\(.*)$-$1-o;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1506
			$TrgPath=~s-^(.*[^\\])$-$1\\-o;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1507
			$TrgPath="z\\$TrgPath";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1508
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1509
				push @MmpWarn, "$CurFile($LineNum) : Too many arguments for keyword TARGETPATH\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1510
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1511
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1512
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1513
		if (/^TARGETTYPE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1514
			if ($TrgType) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1515
				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine TARGETTYPE\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1516
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1517
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1518
			unless ($TrgType=shift @$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1519
				push @MmpWarn, "$CurFile($LineNum) : No Type specified for keyword TARGETTYPE\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1520
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1521
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1522
			eval { &Trg_GetL($TrgType, \%TrgType); };
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1523
			if ($@) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1524
				push @MmpDie, "$CurFile($LineNum) : $@";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1525
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1526
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1527
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1528
		if (/^UID$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1529
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1530
				foreach (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1531
					if ($#UidList>=1) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1532
						push @MmpWarn, "$CurFile($LineNum) : Can't specify more than 2 Uids\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1533
						next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1534
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1535
					$_=&Genutl_AnyToHex($_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1536
					if (defined $_) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1537
						push @UidList, $_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1538
						next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1539
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1540
					push @MmpDie, "$CurFile($LineNum) : Uid doesn't fit expected number format\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1541
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1542
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1543
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1544
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1545
			push @MmpWarn, "$CurFile($LineNum) : No Uids specified for keyword UID\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1546
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1547
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1548
		if (/^SECUREID$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1549
			if ($SecureId) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1550
				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine SECUREID\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1551
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1552
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1553
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1554
				$SecureId = &Genutl_AnyToHex(shift @$Line);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1555
				if (!defined $SecureId) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1556
					push @MmpDie, "$CurFile($LineNum) : SECUREID doesn't fit expected number format\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1557
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1558
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1559
				if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1560
					push @MmpWarn, "$CurFile($LineNum) : Too many arguments for keyword SECUREID\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1561
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1562
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1563
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1564
			push @MmpWarn, "$CurFile($LineNum) : Missing argument for keyword SECUREID\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1565
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1566
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1567
		if (/^VENDORID$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1568
			if (defined($VendorId)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1569
				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine VENDORID\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1570
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1571
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1572
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1573
				$VendorId = &Genutl_AnyToHex(shift @$Line);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1574
				if (!defined $VendorId) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1575
					push @MmpDie, "$CurFile($LineNum) : VENDORID doesn't fit expected number format\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1576
					next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1577
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1578
				if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1579
					push @MmpWarn, "$CurFile($LineNum) : Too many arguments for keyword VENDORID\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1580
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1581
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1582
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1583
			push @MmpWarn, "$CurFile($LineNum) : Missing argument for keyword VENDORID\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1584
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1585
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1586
		if (/^USERINCLUDE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1587
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1588
				my $Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1589
				foreach $Candidate (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1590
					CheckSource_MetaData(%CheckSourceMMPMetaData, $CurFile, $mainElement, $Candidate, $LineNum, $CheckSource_PhysicalCheck);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1591
					$Candidate = &Path_Norm($Candidate);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1592
					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1593
					$Candidate=~s-^(.*[^\\])$-$1\\-o;   # ensure path ends with a backslash
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1594
					$Candidate=&Path_MakeEAbs($EPOCPath,$CurFile,$Candidate);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1595
					if ($CheckUserInc{$Candidate}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1596
						next; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1597
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1598
					push @UserIncPaths,$Candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1599
					$CheckUserInc{$Candidate}="$CurFile($LineNum)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1600
					if (-d &Path_Chop($Candidate)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1601
						next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1602
					}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1603
					push @MmpWarn, "$CurFile($LineNum) : USERINCLUDE path \"$Candidate\" not found\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1604
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1605
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1606
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1607
			push @MmpWarn, "$CurFile($LineNum) : No Paths specified for keyword USERINCLUDE\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1608
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1609
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1610
		if (/^SRCDBG$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1611
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1612
				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1613
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1614
			$SrcDbg=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1615
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1616
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1617
		if (/^VERSION$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1618
			if (%Version) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1619
				push @MmpDie, "$CurFile($LineNum) : Attempt to redefine VERSION\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1620
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1621
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1622
			unless (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1623
				push @MmpDie, "$CurFile($LineNum) : Missing argument to VERSION\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1624
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1625
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1626
			%Version = &Genutl_StringToVersion(shift @$Line);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1627
			if (!%Version) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1628
				push @MmpDie, "$CurFile($LineNum) : Bad VERSION number\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1629
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1630
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1631
			if (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1632
				if ((lc $$Line[0]) eq 'explicit') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1633
					$Version{explicit} = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1634
					shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1635
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1636
				if (scalar(@$Line)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1637
					push @MmpDie, "$CurFile($LineNum) : Garbage after VERSION number\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1638
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1639
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1640
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1641
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1642
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1643
		if (/^OPTION$/oi ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1644
			if (@$Line >= 2) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1645
				my $compilerkey= uc shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1646
				if (!defined($Compiler{$compilerkey})) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1647
					# first use of "OPTION xxx"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1648
					$Compiler{$compilerkey}=shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1649
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1650
				# concatenate extra stuff
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1651
				while (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1652
					$Compiler{$compilerkey}.=" ".shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1653
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1654
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1655
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1656
			push @MmpWarn, "$CurFile($LineNum) : Keyword OPTION requires at least two arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1657
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1658
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1659
		if (/^LINKEROPTION$/oi ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1660
			if (@$Line >= 2) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1661
			        # first parameter is the compiler
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1662
				my $compilerkey= uc shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1663
				if (!defined($Compiler{$compilerkey})) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1664
					# first use of "LINKEROPTION xxx"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1665
					$LinkerOptions{$compilerkey}=shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1666
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1667
				# concatenate extra stuff
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1668
				while (@$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1669
					$LinkerOptions{$compilerkey}.=" ".shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1670
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1671
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1672
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1673
			push @MmpWarn, "$CurFile($LineNum) : Keyword LINKEROPTION requires at least two arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1674
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1675
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1676
		if (/^OPTION_Replace$/oi ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1677
			if (@$Line >= 2) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1678
				my $compilerkey= uc shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1679
				my $repOptions= shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1680
				while (@$Line) 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1681
				{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1682
					$repOptions.= " ".shift @$Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1683
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1684
				$repOptions =~ s/=\s*/=/g;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1685
				push @{$Replace{$compilerkey}},$repOptions;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1686
				
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1687
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1688
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1689
			push @MmpWarn, "$CurFile($LineNum) : Keyword OPTION_Replace requires at least two arguments\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1690
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1691
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1692
		if (/^ARMFPU$/oi) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1693
			if ($ARMFPU) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1694
				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine ARMFPU\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1695
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1696
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1697
			if ($ARMFPU=shift @$Line) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1698
				if (($ARMFPU !~ /^SOFTVFP$/oi) && ($ARMFPU !~ /^VFPV2$/oi)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1699
					push @MmpWarn, "$CurFile($LineNum) : ARMFPU can only specify SOFTVFP or VFPV2 as an argument\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1700
					undef $ARMFPU;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1701
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1702
				next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1703
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1704
			push @MmpWarn, "$CurFile($LineNum) : ARMFPU must specify either SOFTVFP or VFPV2 as an argument\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1705
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1706
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1707
		if( /^PAGED$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1708
			#revert "PAGED" keyword from code and data paged to code paged only
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1709
			#if ($CodePagingTargetMode == PAGED or $DataPagingTargetMode == PAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1710
			if ($CodePagingTargetMode == PAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1711
				push @MmpWarn, "$CurFile($LineNum) : duplicate paging setting\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1712
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1713
			#revert "PAGED" keyword from code and data paged to code paged only
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1714
			#if ($CodePagingTargetMode == UNPAGED or $DataPagingTargetMode == UNPAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1715
			if ($CodePagingTargetMode == UNPAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1716
				push @MmpWarn, "$CurFile($LineNum) : conflict paging setting\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1717
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1718
			$CodePagingTargetMode = PAGED;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1719
			#revert "PAGED" keyword from code and data paged to code paged only
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1720
			#$DataPagingTargetMode = PAGED;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1721
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1722
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1723
		if( /^UNPAGED$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1724
			if ($CodePagingTargetMode == UNPAGED or $DataPagingTargetMode == UNPAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1725
				push @MmpWarn, "$CurFile($LineNum) : duplicate paging setting\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1726
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1727
			if ($CodePagingTargetMode == PAGED or $DataPagingTargetMode == PAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1728
				push @MmpWarn, "$CurFile($LineNum) : conflict paging setting\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1729
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1730
			$CodePagingTargetMode = UNPAGED;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1731
			$DataPagingTargetMode = UNPAGED;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1732
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1733
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1734
		if( /^PAGEDCODE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1735
			if ($CodePagingTargetMode == PAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1736
				push @MmpWarn, "$CurFile($LineNum) : duplicate paging setting\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1737
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1738
			if ($CodePagingTargetMode == UNPAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1739
				push @MmpWarn, "$CurFile($LineNum) : conflict paging setting\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1740
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1741
			$CodePagingTargetMode = PAGED;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1742
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1743
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1744
		if( /^UNPAGEDCODE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1745
			if ($CodePagingTargetMode == UNPAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1746
				push @MmpWarn, "$CurFile($LineNum) : duplicate paging setting\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1747
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1748
			if ($CodePagingTargetMode == PAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1749
				push @MmpWarn, "$CurFile($LineNum) : conflict paging setting\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1750
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1751
			$CodePagingTargetMode = UNPAGED;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1752
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1753
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1754
		if( /^PAGEDDATA$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1755
			if ($DataPagingTargetMode == PAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1756
				push @MmpWarn, "$CurFile($LineNum) : duplicate paging setting\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1757
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1758
			if ($DataPagingTargetMode == UNPAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1759
				push @MmpWarn, "$CurFile($LineNum) : conflict paging setting\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1760
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1761
			$DataPagingTargetMode = PAGED;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1762
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1763
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1764
		if( /^UNPAGEDDATA$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1765
			if ($DataPagingTargetMode == UNPAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1766
				push @MmpWarn, "$CurFile($LineNum) : duplicate paging setting\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1767
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1768
			if ($DataPagingTargetMode == PAGED) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1769
				push @MmpWarn, "$CurFile($LineNum) : conflict paging setting\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1770
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1771
			$DataPagingTargetMode = UNPAGED;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1772
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1773
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1774
		if( /^DEBUGGABLE_UDEBONLY$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1775
			$IsDebuggable = DEBUGGABLE_UDEBONLY;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1776
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1777
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1778
		if( /^DEBUGGABLE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1779
			if ($IsDebuggable != DEBUGGABLE_UDEBONLY)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1780
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1781
				$IsDebuggable = DEBUGGABLE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1782
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1783
			next LINE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1784
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1785
		if( /^FEATUREVARIANT$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1786
			push @MmpDie, "$CurFile($LineNum) : FEATUREVARIANT specified multiple times" if ($FeatureVariant);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1787
			$FeatureVariant = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1788
			next LINE;
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
		push @MmpWarn, "$CurFile($LineNum) : Unrecognised Keyword \"$_\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1792
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1793
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1794
	undef $Line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1795
	undef $MmpMacro;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1796
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1797
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1798
	# test the mmp contents
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1799
	#----------------------
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1800
	if ($PlatTxtSwitch || $OtherPlatSwitch)	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1801
		push @MmpDie, $PlatTxtSwitch ? $PlatTxtSwitch : $OtherPlatSwitch, ": Unterminated START ... END block\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1802
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1803
	undef $PlatTxtSwitch;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1804
	undef $OtherPlatSwitch;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1805
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1806
	# Check the consistency of the mmp file contents
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1807
	unless ($Trg) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1808
		unless($TrgType=~/^NONE$/io){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1809
			push @MmpDie, "ERROR: No Target specified\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1810
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1811
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1812
	unless ($TrgType) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1813
		push @MmpDie, "ERROR: No TargetType specified\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1814
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1815
  	if( $StdCpp && $NoStdCpp ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1816
  		push @MmpWarn, "WARNING: Keyword statement STDCPP not permitted with keyword NOSTDCPP.\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1817
  		push @MmpWarn, "WARNING: Keyword statements STDCPP and NOSTDCPP ignored.\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1818
  		$StdCpp = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1819
  		$NoStdCpp = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1820
  	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1821
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1822
	if (($TrgType =~ /^LIB$/io) && (scalar(@DebugLibList) || scalar(@LibList) || scalar(@StatLibList))) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1823
		push @MmpWarn, "WARNING: Library statements (DEBUGLIBRARY, LIBRARY or STATICLIBRARY) not permitted with TARGETTYPE LIB.";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1824
		push @MmpWarn, "WARNING: Library statements (DEBUGLIBRARY, LIBRARY or STATICLIBRARY) ignored.\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1825
		undef @DebugLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1826
		undef @LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1827
		undef @StatLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1828
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1829
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1830
	if ($TrgType =~ /^LIB$/io && $NewLib) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1831
		push @MmpWarn, "WARNING: Library statement NEWLIB not permitted with TARGETTYPE LIB.";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1832
		push @MmpWarn, "WARNING: Library statement NEWLIB ignored.\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1833
		undef @DebugLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1834
		undef @LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1835
		undef @StatLibList;
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
	if ($TrgType =~ /^STD(EXE|DLL)$/io && $NewLib) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1839
		push @MmpWarn, "WARNING: Library statement NEWLIB not permitted with TARGETTYPE STD*.";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1840
		push @MmpWarn, "WARNING: Library statement NEWLIB ignored.\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1841
		undef @DebugLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1842
		undef @LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1843
		undef @StatLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1844
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1845
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1846
	if (($TrgType=~/^IMPLIB$/io) || ($TrgType=~/^NONE$/io)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1847
		push @MmpDie, "ERROR: SOURCE not permitted with TARGETTYPE $TrgType\n" if (@SourceStruct);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1848
	} elsif (!@SourceStruct) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1849
		push @MmpDie, "ERROR: No Sources specified\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1850
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1851
	if ($TrgType{NeedUID3} && $#UidList<1) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1852
		push @MmpWarn, "WARNING: No Uid3 specified in \"$MMPFILE\" for TargetType \"$TrgType\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1853
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1854
	if ($Trg && $Trg=~/\{|\}/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1855
		push @MmpDie, "ERROR: Bad TARGET name specified\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1856
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1857
	if ($ExportLibrary and $ExportLibrary=~/\{|\}/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1858
		push @MmpDie, "ERROR: Bad EXPORTLIBRARY name specified\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1859
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1860
	if ($LinkAs and $LinkAs=~/\{|\}/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1861
		push @MmpDie, "ERROR: Bad LINKAS name specified\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1862
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1863
	# Make sure a valid compression method has been chosen if target is going to be paged
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1864
	if ($CodePagingTargetMode == PAGED && $CompressTarget == COMPRESS) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1865
		if ($CompressTargetMethod == INFLATECOMPRESSIONMETHOD) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1866
			push @MmpWarn, "Incompatible keywords! The INFLATECOMPRESSTARGET is not allowed with PAGED!\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1867
			push @MmpWarn, "Changing compression method to BYTEPAIRCOMPRESSTARGET\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1868
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1869
		$CompressTargetMethod = BYTEPAIRCOMPRESSIONMETHOD;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1870
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1871
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1872
  # Ensure 2nd UID is not deprecated
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1873
  if (&main::EPOCSecurePlatform() && $TrgType{Basic} eq "DLL")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1874
    {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1875
    $deprecatedUIDs{"0x100039ce"} = "Unmigrated dll style application detected from use of UID 0x100039ce";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1876
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1877
  
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1878
  # Do not need UIDs for a resource only (i.e. TARGETTYPE is "none") mmp file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1879
  if  ((!$TrgType=~/^NONE$/io) && &main::EPOCSecurePlatform() && defined($deprecatedUIDs{$UidList[0]}))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1880
    {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1881
    push @MmpMigrationNote, "$deprecatedUIDs{$UidList[0]}\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1882
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1883
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1884
#	PUT IN SOME DEFAULTS
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1885
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1886
	if ($TrgPath eq '') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1887
		# set up default path from $TrgType 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1888
		$TrgPath = $TrgType{Path};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1889
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1890
	my $ResourceTrgPath = $TrgType{ResourcePath};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1891
	if ($ResourceTrgPath eq '') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1892
		$ResourceTrgPath = $TrgPath;	# default to TrgPath, as before
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1893
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1894
	unless (%Version) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1895
	    if ($$Plat_ref{DefFile} =~ /^\s*EABI\s*/i ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1896
			$Version{major} = 10;	# Start major versions at 10 for EABI to allow coexistence with GCC98r2 ABI
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1897
		} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1898
			$Version{major} = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1899
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1900
		$Version{minor} = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1901
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1902
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1903
	# check for languages
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1904
	@LangList=('SC') unless @LangList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1905
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1906
  if (&main::EPOCSecurePlatform() && !defined($Capability) &&
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1907
    (($TrgType{Basic} eq "DLL") || (uc($TrgType) eq "EXEXP")))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1908
    {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1909
    push @MmpMigrationNote, "No Capabilities set in \"$MMPFILE\" for TargetType: $TrgType\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1910
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1911
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1912
	# Supply default capability mask if not set explicitly, and convert to hex string
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1913
	$Capability = "none" unless (defined($Capability));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1914
	$CapabilityFlags[0] = 0 unless (defined($CapabilityFlags[0]));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1915
        $CapabilityFlags[1] = 0 unless (defined($CapabilityFlags[1]));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1916
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1917
        $CapabilityFlags[0] = sprintf("0x%08x", $CapabilityFlags[0]);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1918
        $CapabilityFlags[1] = sprintf("0x%08x", $CapabilityFlags[1]);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1919
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1920
#	ensure all bitmaps have targetpaths and check for duplicate bitmaps
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1921
	my %BitMapCheck;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1922
	my $BitMapRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1923
	foreach $BitMapRef (@BitMapStruct) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1924
		unless ($$BitMapRef{TrgPath}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1925
			$$BitMapRef{TrgPath}=$ResourceTrgPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1926
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1927
		if ($BitMapCheck{"$$BitMapRef{TrgPath}$$BitMapRef{Trg}"}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1928
			push @MmpDie, "ERROR: Duplicate bitmap target \"$$BitMapRef{TrgPath}$$BitMapRef{Trg}\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1929
			next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1930
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1931
		$BitMapCheck{"$$BitMapRef{TrgPath}$$BitMapRef{Trg}"}=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1932
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1933
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1934
#	ensure all resources have targetpaths, expand language list and check for duplicates
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1935
	my %ResourceCheck;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1936
	my $ResourceRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1937
	my @PerLanguageResourceStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1938
	foreach $ResourceRef (@ResourceStruct) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1939
					
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1940
		unless ($$ResourceRef{BaseTrg}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1941
			$$ResourceRef{BaseTrg}=&Path_Split('Base',$$ResourceRef{Source});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1942
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1943
		unless ($$ResourceRef{TrgPath}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1944
			$$ResourceRef{TrgPath}=$ResourceTrgPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1945
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1946
		unless ($$ResourceRef{Lang}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1947
			@{$$ResourceRef{Lang}}=@LangList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1948
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1949
		# generate one instance per language.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1950
		my @list = @{$$ResourceRef{Lang}};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1951
		my $base = "$$ResourceRef{TrgPath}$$ResourceRef{BaseTrg}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1952
		foreach my $lang (@list) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1953
			my %newResourceRef = %{$ResourceRef};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1954
			$newResourceRef{Lang} = $lang;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1955
			$newResourceRef{Trg} = $base.lc("\.R$lang");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1956
			push @PerLanguageResourceStruct, \%newResourceRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1957
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1958
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1959
	@ResourceStruct = @PerLanguageResourceStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1960
	undef @PerLanguageResourceStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1961
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1962
	foreach $ResourceRef (@ResourceStruct) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1963
		if ($ResourceCheck{"$$ResourceRef{TrgPath}$$ResourceRef{Trg}"}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1964
			push @MmpDie, "ERROR: Duplicate Resource target \"$$ResourceRef{TrgPath}$$ResourceRef{Trg}\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1965
			next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1966
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1967
		$ResourceCheck{"$$ResourceRef{TrgPath}$$ResourceRef{Trg}"}=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1968
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1969
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1970
	my $Plat=&main::Plat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1971
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1972
	if (@MmpDie || @MmpWarn || @MmpDiagnostic || @MmpMigrationNote) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1973
		warn "\nMMPFILE \"$MMPFILE\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1974
		if (@MmpDiagnostic) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1975
			warn
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1976
				"DIAGNOSTIC MESSAGE(S)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1977
				@MmpDiagnostic,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1978
				"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1979
			;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1980
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1981
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1982
		foreach my $printedWarning (@MmpWarn)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1983
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1984
			print "WARNING: $printedWarning\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1985
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1986
		foreach my $printedError (@MmpDie)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1987
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1988
			print "FATAL ERROR: $printedError\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1989
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1990
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1991
		foreach my $printedMigrationNote (@MmpMigrationNote)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1992
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1993
			print "MIGRATION_NOTE: $printedMigrationNote\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1994
			}		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1995
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1996
		if (@MmpDie)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1997
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1998
			die;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1999
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2000
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2001
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2002
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2003
#	COMPLETE THE UID LIST
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2004
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2005
	while ($#UidList<1) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2006
		push @UidList, '0x00000000';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2007
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2008
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2009
	# check the second UID, or set it
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2010
	if ($TrgType{UID2}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2011
		if ($UidList[0]=~/^0x00000000$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2012
			# put in second uid for known targetypes without them
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2013
			$UidList[0]=$TrgType{UID2};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2014
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2015
		elsif ($UidList[0] ne $TrgType{UID2}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2016
			# text comparison is OK here because UIDs have both been through AnyToHex function
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2017
			if ($UidList[0] ne '0x01111111') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2018
				# issue warning (but not if UID == 0x01111111 (to allow test code to deliberately set incorrect UID)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2019
				warn(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2020
					"WARNING: Second Uid is $UidList[0], but\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2021
					" expected value for Target Type $TrgType is $TrgType{UID2}\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2022
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2023
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2024
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2025
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2026
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2027
#	Put in the first UID in the list
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2028
	if ($TrgType{Basic}=~/^DLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2029
		unshift @UidList, '0x10000079';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2030
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2031
	elsif ($TrgType{Basic}=~/^(EXE)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2032
		unshift @UidList, '0x1000007a';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2033
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2034
	elsif ($TrgType{Basic}=~/^(EXEDLL)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2035
# EXE on EPOC32, DLL on Emulator
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2036
# NOTE: On EKA1 EXEDLL used EXE UID1 on emulator
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2037
# On EKA2 this is unacceptable
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2038
		if (!$emulator) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2039
			unshift @UidList, '0x1000007a';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2040
		} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2041
			unshift @UidList, '0x10000079';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2042
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2043
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2044
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2045
		unshift @UidList, '0x00000000';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2046
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2047
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2048
# If no SID specified use UID3
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2049
	$SecureId = $UidList[2] unless(defined $SecureId);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2050
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2051
#	SORT OUT TARGET TYPE DATA STRUCTURE
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2052
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2053
	# set the target path
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2054
	if ($TrgPath) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2055
		$TrgType{Path}=$TrgPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2056
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2057
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2058
#	put in the $Linkas default
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2059
	if (!$LinkAs and $TrgType=~/^IMPLIB$/io) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2060
		$LinkAs = $Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2061
		$LinkAs =~ s/\.lib$/\.dll/i;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2062
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2063
		$LinkAs = $Trg unless $LinkAs;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2064
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2065
	$LinkAsBase = $LinkAs;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2066
	unless ($emulator) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2067
		$LinkAs = &DecorateWithVersion($LinkAs, %Version);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2068
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2069
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2070
# If explicit version add to target
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2071
	if ($Version{explicit} && !$emulator) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2072
		$Trg = &DecorateWithVersion($Trg, %Version);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2073
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2074
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2075
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2076
#	Reconcile any EXEDLL targettypes - must be done after first UIDs put in the list
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2077
#	and after the $LinkAs keyword has been defined/defaulted
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2078
	if ($TrgType{Basic} eq 'EXEDLL') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2079
		$TrgType{Basic} = $emulator ? 'DLL' : 'EXE';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2080
		$Trg=&Path_Split('Base',$Trg).'.EXE';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2081
		$LinkAsBase=&Path_Split('Base',$LinkAsBase).'.EXE';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2082
		$LinkAs=&Path_Split('Base',$LinkAs).'.EXE';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2083
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2084
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2085
#	put in the $ExportLibrary default
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2086
	$ExportLibrary=&Path_Split('Base',$Trg) unless $ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2087
	unless ($emulator) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2088
		$ExportLibrary = &DecorateWithVersion($ExportLibrary, %Version);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2089
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2090
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2091
#	Get the EPOC entrypoint static library
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2092
	unless ($FirstLib) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2093
		unless ($TrgType{FirstLib}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2094
			$FirstLib="E$TrgType{Basic}.LIB";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2095
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2096
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2097
			$FirstLib=$TrgType{FirstLib};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2098
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2099
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2100
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2101
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2102
#	 WORK OUT THE ASSP IMPLICATIONS
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2103
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2104
#	Nullify ASSP-specific API things for WINS/WINC since the API should always be
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2105
#	the same for WINC as for WINS,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2106
	if ($emulator) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2107
		$ASSPABISwitch=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2108
		$ASSPExports=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2109
		unshift @LibList, @ASSPLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2110
		unshift @DebugLibList, @ASSPLibList;	# keep DebugLibList in sync with LibList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2111
		@ASSPLibList=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2112
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2113
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2114
#		Force ASSPABISwitch for known kernel components or if ASSPEXPORTS or ASSPLIBRARY specified in .MMP file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2115
		if ($TrgType{Kernel} or $ASSPExports or @ASSPLibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2116
			$ASSPABISwitch=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2117
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2118
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2119
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2120
#	Switch the ABI if necessary
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2121
	unless ($ASSPABISwitch) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2122
#		apply the standard ABI
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2123
		$ABI=$$Plat_ref{ABI};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2124
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2125
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2126
#		kernel-specific stuff
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2127
#		check that the platform is not generic
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2128
		if ($$Plat_ref{Generic}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2129
			die "ERROR: Can't apply ASSPABI, ASSPEXPORTS or ASSPLIBRARY for generic platform \"$$Plat_ref{Name}\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2130
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2131
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2132
#		apply the ASSP-specific ABI
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2133
		$ABI=$$Plat_ref{ASSPABI};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2134
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2135
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2136
#	COMPLETE THE .DEF FILE STRUCTURE
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2137
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2138
	# apply the default .DEF filename, and
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2139
	# check as far as possible that the project is frozen
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2140
	if (($TrgType{NeedDeffile} or $CheckDef)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2141
		unless ($Def{Path} and $Def{Path} !~ /\\\~\\$/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2142
			my $augment;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2143
			if ($ASSPExports) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2144
			    if ($$Plat_ref{DefFile} =~ /^\s*EABI\s*/i ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2145
					$augment = $$Plat_ref{ASSP};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2146
			    } else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2147
					$augment = "B$$Plat_ref{ASSP}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2148
			    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2149
			} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2150
			    if ($$Plat_ref{DefFile} =~ /^\s*EABI\s*/i ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2151
					$augment = lc($$Plat_ref{DefFile});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2152
			    } else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2153
					$augment = lc("B$$Plat_ref{DefFile}");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2154
			    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2155
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2156
			if ($Def{Path} =~ /\\\~\\$/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2157
				$Def{Path} =~ s/\\\~\\$/\\$augment\\/;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2158
			} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2159
				$Def{Path}=&Path_Strip(&Path_Split('Path',$MMPFILE)."..\\$augment\\");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2160
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2161
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2162
		unless ($Def{Base}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2163
			$Def{Base} = &Path_Split('Base',$LinkAsBase);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2164
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2165
		unless ($Def{Ext}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2166
			$Def{Ext}='.def';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2167
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2168
#		now that we've dumped narrow, treat the 'u' basename suffix as part of the frozen
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2169
#		.DEF file basename.  Once we've dumped the suffix we won't have to store the extension
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2170
#		separately either
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2171
		if (!$emulator && $Version{explicit}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2172
			$Def{Base} .= &Genutl_VersionToFileAugment(%Version);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2173
		} elsif (!$NoStrictDef) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2174
			$Def{Base}.='u';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2175
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2176
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2177
		if ($Def{CheckSource_MMPEntry})
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2178
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2179
			my $type = "DEFFILE";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2180
			$type .= " (NOSTRICTDEF)" if ($NoStrictDef);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2181
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2182
			# for GCCXML and X86GCC, ignore check source errors for missing .def file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2183
			my $checkdef = (($IgnoreMissingDef) && ($Def{Path} =~ /[\\\/]bmarm[\\\/]/ || $$Plat_ref{Name} eq "X86GCC" || $$Plat_ref{Name} eq "X86GMP")) ? 0 : 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2184
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2185
			if( $checkdef ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2186
			  CheckSource_MetaData(%CheckSourceMMPMetaData, $Def{CheckSource_MMPFile}, $type, $Def{CheckSource_MMPEntry}, $Def{CheckSource_LineNumber}, $CheckSource_PhysicalCheck, $Def{Path});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2187
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2188
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2189
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2190
#		check deffile exists,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2191
        unless (-e "$Def{Path}$Def{Base}$Def{Ext}") {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2192
            if($IgnoreMissingDef == 0) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2193
                warn "WARNING: Frozen .def file $Def{Path}$Def{Base}$Def{Ext} not found - project not frozen\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2194
            }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2195
     	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2196
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2197
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2198
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2199
sub Mmp_ABI () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2200
	$ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2201
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2202
sub Mmp_AifStruct () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2203
	\@AifStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2204
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2205
sub Mmp_AllowDllData () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2206
	$AllowDllData;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2207
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2208
sub Mmp_CompressTarget () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2209
	$CompressTarget;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2210
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2211
sub Mmp_CompressTargetMode () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2212
	$CompressTargetMethod;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2213
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2214
sub Mmp_ASSPExports () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2215
	$ASSPExports;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2216
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2217
sub Mmp_ASSPLibList () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2218
	@ASSPLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2219
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2220
sub Mmp_BitMapStruct () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2221
	\@BitMapStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2222
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2223
sub Mmp_BuildAsARM () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2224
	$BuildAsARM;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2225
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2226
sub Mmp_CallDllEntryPoints () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2227
	$CallDllEntryPoints;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2228
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2229
sub Mmp_Capability () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2230
	$Capability;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2231
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2232
sub Mmp_CapabilityFlags () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2233
	@CapabilityFlags;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2234
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2235
sub Mmp_DataLinkAddress () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2236
	$DataLinkAddress;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2237
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2238
sub Mmp_DebugLibList () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2239
	\@DebugLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2240
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2241
sub Mmp_Def () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2242
	\%Def;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2243
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2244
sub Mmp_DocHash () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2245
	\%DocHash;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2246
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2247
sub Mmp_ExportUnfrozen () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2248
	$ExportUnfrozen;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2249
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2250
sub Mmp_FirstLib () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2251
	$FirstLib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2252
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2253
sub Mmp_FixedProcess () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2254
	$FixedProcess;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2255
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2256
sub Mmp_HeapSize () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2257
	\%HeapSize;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2258
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2259
sub Mmp_LibList () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2260
	\@LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2261
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2262
sub Mmp_LinkAs () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2263
	$LinkAs;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2264
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2265
sub Mmp_LinkAsBase () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2266
	$LinkAsBase;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2267
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2268
sub Mmp_ExportLibrary () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2269
	$ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2270
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2271
sub Mmp_NoExportLibrary () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2272
	$NoExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2273
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2274
sub Mmp_NewLib () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2275
	$NewLib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2276
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2277
sub Mmp_Macros () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2278
	@Macros;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2279
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2280
sub Mmp_MmpFlag () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2281
	\%MmpFlag;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2282
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2283
sub	Mmp_PlatTxt2D () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2284
	@PlatTxt2D;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2285
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2286
sub Mmp_ProcessPriority () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2287
	$ProcessPriority;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2288
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2289
sub Mmp_RamTargets () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2290
	@RamTargets;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2291
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2292
sub Mmp_ResourceStruct () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2293
	\@ResourceStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2294
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2295
sub Mmp_RomTargets () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2296
	@RomTargets;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2297
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2298
sub Mmp_SourceStruct () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2299
	\@SourceStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2300
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2301
sub Mmp_StackSize () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2302
	$StackSize;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2303
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2304
sub Mmp_StatLibList () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2305
	@StatLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2306
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2307
sub Mmp_StdCpp () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2308
	$StdCpp;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2309
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2310
sub Mmp_NoStdCpp () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2311
	$NoStdCpp;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2312
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2313
sub Mmp_SysIncPaths () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2314
	@SysIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2315
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2316
sub Mmp_Trg () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2317
	$Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2318
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2319
sub Mmp_TrgType () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2320
	\%TrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2321
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2322
sub Mmp_UidList () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2323
	@UidList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2324
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2325
sub Mmp_UserIncPaths () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2326
	@UserIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2327
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2328
sub Mmp_SrcDbg () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2329
	$SrcDbg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2330
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2331
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2332
sub Mmp_WarningLevel() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2333
     %Compiler; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2334
} 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2335
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2336
sub Mmp_LinkerOptions() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2337
    %LinkerOptions
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2338
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2339
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2340
sub Mmp_Version() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2341
	%Version;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2342
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2343
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2344
sub Mmp_SecureId() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2345
	$SecureId;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2346
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2347
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2348
sub Mmp_VendorId () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2349
	$VendorId;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2350
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2351
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2352
sub DecorateWithVersion($$) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2353
	my ($name, %ver) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2354
	my $base = &Path_Split('Base', $name);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2355
	my $ext = &Path_Split('Ext', $name);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2356
	unless ($base =~ /\{(\d|a|b|c|d|e|f){8}\}$/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2357
		$base .= &Genutl_VersionToFileAugment(%Version);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2358
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2359
	return "$base$ext";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2360
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2361
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2362
sub Mmp_Replace() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2363
	%Replace;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2364
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2365
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2366
sub Mmp_SmpSafe() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2367
	$SmpSafe;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2368
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2369
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2370
sub Mmp_StringTable() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2371
	\@StringTableStruct;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2372
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2373
sub Mmp_ARMFPU() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2374
	$ARMFPU;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2375
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2376
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2377
sub Mmp_CheckSourceMMPMetaData() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2378
	%CheckSourceMMPMetaData;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2379
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2380
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2381
sub Mmp_CheckSourceMMPIncludes() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2382
	%CheckSourceMMPIncludes;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2383
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2384
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2385
sub Mmp_CodePagingTargetMode() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2386
	$CodePagingTargetMode;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2387
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2388
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2389
sub Mmp_DataPagingTargetMode() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2390
	$DataPagingTargetMode;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2391
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2392
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2393
sub Mmp_IsWideCharMain() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2394
	$WideCharMain;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2395
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2396
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2397
sub Mmp_IsDebuggable() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2398
	$IsDebuggable;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2399
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2400
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2401
sub Mmp_IsFeatureVariant() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2402
	$FeatureVariant;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2403
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2404
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2405
# Return the macros tested in the MMP file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2406
sub Mmp_TestedMacros() {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2407
	return \%mmptestedMacrosHash;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2408
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2409
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  2410
1;