sbsv1/abld/platform/cl_gccxml.pm
author Zheng Shen <zheng.shen@nokia.com>
Thu, 09 Sep 2010 19:09:10 +0800
changeset 633 a4eca1f021ac
parent 599 fa7a3cc6effd
permissions -rw-r--r--
ROMTools-13.1.0.2 Bug 3415 - SBS failing to build open C libraries
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
599
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     1
# Copyright (c) 2004-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
# Cl_gccxml;
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 Cl_gccxml;
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
@EXPORT=qw(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    23
	PMHelp_Mmp
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    24
	PMStartBldList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    25
	PMBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    26
	PMStartSrcList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    27
	PMStartSrc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    28
	PMSrcDepend
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    29
	PMSrcBldDepend
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    30
	PMEndSrcBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    31
	PMEndSrc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    32
	PMEndSrcList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    33
	PMBitMapBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    34
	PMResrcBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    36
);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    37
use cl_generic;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    38
use Genutl;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
use File::Path;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
use Cwd;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
use Pathutl;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    42
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    43
sub PMHelp_Mmp {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    44
	print "// No additional keywords for this platform\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47
	# takes an 'expression'  to evaluate with $_ bound to each of the
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    48
	# remaining args
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    49
	sub PrintList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    50
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    51
		my $expr = shift @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    52
		foreach (@_) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    53
		my $str = eval($expr);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    54
		&main::Output($str);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    55
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    56
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    57
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    58
my $epocroot = $ENV{EPOCROOT};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    59
$epocroot=~ s-\\$--;            # chop trailing \\
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    60
my $Makecmd;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    61
sub PMStartBldList($) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    62
	($Makecmd) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    63
	my $BasicTrgType=&main::BasicTrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    64
	my @BldList=&main::BldList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    65
	my @ChopSysIncPaths=&main::Path_Chop(&main::SysIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    66
	my @ChopUserIncPaths=&main::Path_Chop(&main::UserIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    67
	my $RelPath="$epocroot\\EPOC32\\RELEASE";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    68
	my @MacroList=&main::MacroList();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    69
	my $VariantFile=&main::VariantFile();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    70
	my $Trg=&main::Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    71
	my $DPath = &main::Path_RltToWork($epocroot);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    72
	my $DefFile = &main::DefFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    73
	my $EABIDefFile = &main::EABIDef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    74
	my $ExtCompileOption = &main::CompilerOption("GCCXML");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    75
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    76
	&Generic_Header(0,$Makecmd);	# define standard things using absolute paths
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    77
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    78
	$DefFile="" if(!(-e $DefFile));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    79
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    80
		"GXPTRGUDEB = $RelPath\\GCCXML\\UDEB\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    81
		"GXPTRGUREL = $RelPath\\GCCXML\\UREL\n\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    82
		"DEFFILE = $DefFile\n\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    83
        "EABIDEFFILE = $EABIDefFile\n\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    84
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    85
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    86
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    87
		"INCDIR  ="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    88
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    89
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    90
	foreach (@ChopUserIncPaths) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    91
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    92
			" -I \"$_\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    93
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    94
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    95
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    96
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    97
		" -I- "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    98
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    99
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   100
	foreach (@ChopSysIncPaths) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   101
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   102
			" -I \"$_\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   103
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   104
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   105
	if($VariantFile){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   106
	    &main::Output("\\\n  -include \"$VariantFile\"");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   107
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   108
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   109
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   110
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   111
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   112
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   113
	&main::Output( 		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   114
		"GCCFLAGS= -nostdinc -Wall -Wno-ctor-dtor-privacy -Wno-unknown-pragmas -UWIN32 -fshort-wchar -quiet -w $ExtCompileOption\n",  # -fsyntax-only
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   115
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   116
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   117
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   118
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   119
		"GCCDEFS = -D __EABI__ -D __SUPPORT_CPP_EXCEPTIONS__"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   120
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   121
	foreach(@MacroList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   122
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   123
			" -D$_"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   124
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   125
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   126
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   127
		" \$(USERDEFS)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   128
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   129
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   130
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   131
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   132
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   133
			"GCC$_ = gccxml_cc1plus -bi"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   134
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   135
		if (/REL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   136
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   137
				      ' -fomit-frame-pointer '
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   138
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   139
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   140
		elsif (/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   141
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   142
				' -g'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   143
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   144
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   145
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   146
			' $(GCCFLAGS)'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   147
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   148
		foreach (&main::MacroList($_)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   149
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   150
				" -D$_"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   151
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   152
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   153
                
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   154
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   155
			" \$(GCCDEFS)\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   156
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   157
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   158
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   159
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   160
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   161
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   162
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   163
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   164
			"LIBRARY:\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   165
			"\t\@echo Nothing to do\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   166
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   167
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   168
	# Resource building is done entirely via cl_generic.pm
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   169
	PrintList("\"\nRESOURCE\$_ : MAKEWORK\$_\"", @BldList)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   170
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   171
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   172
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   173
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   174
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   175
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   176
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   177
			"$_ :"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   178
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   179
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   180
		if ($BasicTrgType !~ /IMPLIB/io) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   181
			my $TrgBase = &main::Path_Split('base',$Trg);           
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   182
			&main::Output (
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   183
			" \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   184
			&Generic_Quote("\$(GXPTRG$_)\\$TrgBase$BasicTrgType.gxp")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   185
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   186
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   187
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   188
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   189
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   190
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   191
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   192
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   193
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   194
# DumpToFile
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   195
sub DumpMMPToFile
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   196
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   197
	my $rfiFileList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   198
	my @rfiFiles;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   199
	if(scalar @_) # if an argument has been passed then it is a reference to the list of .RFI files.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   200
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   201
		($rfiFileList) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   202
		@rfiFiles = @$rfiFileList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   203
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   204
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   205
	my $BldPath=&main::BldPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   206
	my $Target = &main::Trg; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   207
	my $TargetBase = &main::Path_Split('Base', $Target); 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   208
	my $Gxpurel="$epocroot\\epoc32\\release\\gccxml\\urel";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   209
	my $Gxpudeb="$epocroot\\epoc32\\release\\gccxml\\udeb";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   210
	unless (-d $BldPath) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   211
		mkpath([$BldPath]);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   212
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   213
	unless (-d $Gxpurel) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   214
		mkpath([$Gxpurel]);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   215
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   216
	unless (-d $Gxpudeb) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   217
		mkpath([$Gxpudeb]);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   218
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   219
    $BldPath = (&main::Path_StepDirs($BldPath))[-2];
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   220
	use File::Basename;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   221
    my $FileName = basename(&main::MmpFile());
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   222
    $FileName = $BldPath.$FileName.".xml";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   223
    open FILE,"> $FileName" or die "Cannot open mmp info dump file $FileName: $!";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   224
    print FILE "<?xml version=\"1.0\"?>\n<mmpInfo>\n"; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   225
   
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   226
    my $Path = &main::RelPath();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   227
    my $MmpFile = &main::MmpFile();  
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   228
    my $TrgType = &main::TrgType(); 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   229
    my $TrgPath = &main::TrgPath(); 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   230
    print FILE "\t<mmp path=\"$MmpFile\"/>\n"; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   231
	print FILE "\t<target name=\"$Target\" type=\"$TrgType\" ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   232
    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   233
	if(not $TrgPath eq '') 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   234
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   235
		print FILE "path=\"$TrgPath\""; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   236
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   237
	print FILE "/>\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   238
	# insert current working directory
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   239
	my $WorkPath = &main::Path_WorkPath();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   240
	print FILE "\t<cwd path=\"$WorkPath\"/>\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   241
    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   242
    my $ABI = &main::ABI; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   243
    print FILE "\t<abi type=\"$ABI\"/>\n"; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   244
    my $LinkAs = &main::LinkAs;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   245
    print FILE "\t<linkAs name=\"$LinkAs\"/>\n"; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   246
    my $LinkAsBase = &main::LinkAsBase;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   247
    print FILE "\t<linkAsBase name=\"$LinkAsBase\"/>\n"; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   248
    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   249
    # Uids
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   250
    my @UidList=&main::UidList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   251
    my $count = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   252
    print FILE "\t<uids";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   253
    foreach my $uid(@UidList)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   254
    {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   255
		print FILE " u$count=\"$uid\"" ;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   256
		$count++; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   257
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   258
    print FILE "/>\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   259
    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   260
    # Versioning 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   261
    my %Version = &main::Version; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   262
    print FILE "\t<version";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   263
    foreach my $var (sort keys %Version)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   264
    {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   265
        print FILE " $var=\"$Version{$var}\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   266
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   267
    print FILE "/>\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   268
    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   269
    # Capabilities
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   270
    my $Capability = &main::Capability;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   271
    print FILE "\t<capability id=\"$Capability\"/>\n"; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   272
    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   273
	# DefFile
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   274
	my $DefFile = &main::DefFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   275
	$DefFile="" if(!(-e $DefFile));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   276
	print FILE "\t<defFile path=\"$DefFile\" type=\"GCC\"/>\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   277
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   278
	# EABIDefFile
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   279
	my $EABIDefFile = &main::EABIDef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   280
	print FILE "\t<defFile path=\"$EABIDefFile\" type=\"EABI\"/>\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   281
        
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   282
    # Handle All types of libraries
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   283
    my $FirstLib = &main::FirstLib; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   284
    my @LibList = &main::LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   285
    my @ASSPLibList = &main::ASSPLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   286
    my @StatLibList = &main::StatLibList;;    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   287
    print FILE "\t<libs>\n"; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   288
    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   289
	#first
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   290
    print FILE "\t\t<lib name=\"$FirstLib\" type=\"First\"/>\n"; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   291
    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   292
    #  normal
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   293
    foreach my $lib (@LibList)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   294
    {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   295
        print FILE "\t\t<lib name=\"$lib\"/>\n"; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   296
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   297
    # ASSP Specific
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   298
    foreach my $lib (@ASSPLibList)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   299
    {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   300
        print FILE "\t\t<lib name=\"$lib\" type=\"ASSP\"/>\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   301
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   302
    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   303
    # Static Libraries
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   304
    foreach my $lib (@StatLibList)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   305
    {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   306
        print FILE "\t\t<lib name=\"$lib\" type=\"Static\"/>\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   307
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   308
    print FILE "\t</libs>\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   309
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   310
    # Resources
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   311
    print FILE "\t<resources>\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   312
    my $rfiFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   313
    foreach $rfiFile (@rfiFiles)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   314
    {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   315
	    print FILE "\t\t<resource name=\"$rfiFile\"/>\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   316
    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   317
    print FILE "\t</resources>\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   318
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   319
    close FILE;
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 PMBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   323
	my @ASSPLibList=&main::ASSPLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   324
	my @SrcList=&main::SrcList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   325
	my $BaseTrg=&main::BaseTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   326
	my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   327
	my $ChopBldPath=&main::Path_Chop(&main::BldPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   328
	my $EPOCIncPath=&main::EPOCIncPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   329
	my $BasicTrgType=&main::BasicTrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   330
	my $ChopRelPath=&main::Path_Chop(&main::RelPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   331
	my $RelPath=&main::RelPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   332
	my $Trg=&main::Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   333
	my $TrgType=&main::TrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   334
	my @UidList=&main::UidList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   335
	# DefFile
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   336
	my $DefFile = &main::DefFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   337
	# EABIDefFile
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   338
	my $EABIDefFile = &main::EABIDef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   339
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   340
	my $rfiList = GatherResourceInformation();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   341
	my @RfiFiles = @$rfiList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   342
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   343
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   344
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   345
	DumpMMPToFile(\@RfiFiles);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   346
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   347
	# REAL TARGETS
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   348
	#-------------
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   349
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   350
		"# REAL TARGET - BUILD VARIANT $Bld\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   351
		"\n"
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
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   355
		"WHAT$Bld : WHATGENERIC\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   356
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   357
		"CLEAN$Bld : CLEANBUILD$Bld CLEANRELEASE$Bld\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   358
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   359
		"CLEANBUILD$Bld : \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   360
		"\t\@perl -S ermdir.pl \"\$(EPOCBLD$Bld)\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   361
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   362
		"CLEANRELEASE$Bld : CLEANGENERIC\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   363
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   364
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   365
	my @releaseables;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   366
	&Generic_WhatCleanTargets($Bld, "WHAT$Bld", "CLEANRELEASE$Bld", @releaseables);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   367
	&Generic_MakeWorkDir("MAKEWORK$Bld",$ChopBldPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   368
	&Generic_MakeWorkDir("MAKEWORK$Bld",$ChopRelPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   369
	&Generic_Releaseables;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   370
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   371
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   372
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   373
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   374
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   375
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   376
	# XML Stuff
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   377
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   378
				&Generic_Quote("\$(GXPTRG$Bld)\\$BaseTrg$BasicTrgType.gxp"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   379
				&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseTrg$BasicTrgType.gxp"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   380
				"\n\tcopy \"\$(EPOCBLD$Bld)\\$BaseTrg$BasicTrgType.gxp\" \"\$@\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   381
	); 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   382
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   383
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   384
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   385
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   386
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   387
        
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   388
	# TARGET *.GXP
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   389
	#------------
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   390
	if (scalar @SrcList >150) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   391
		# deal with very long lists by splitting them into 150 file pieces, which allows
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   392
		# about 200 bytes per filename if the underlying max size is 32K
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   393
		#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   394
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   395
		my $counter1=150;	# i.e. trigger new variable immediately
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   396
		my $counter2=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   397
		my @objvarlist=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   398
		foreach (@SrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   399
			if ($counter1==150) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   400
				$counter1=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   401
				$counter2++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   402
				my $objvar = "OBJECTS$Bld$counter2";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   403
				push @objvarlist, " \$($objvar)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   404
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   405
					"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   406
					"$objvar="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   407
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   408
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   409
			my $BaseSrc = &main::Path_Split('Base', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   410
			my $Ext = &main::Path_Split('Ext', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   411
			$BaseSrc.='_' if (lc($Ext) eq '.cia');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   412
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   413
				" \\\n\t", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.xml")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   414
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   415
			$counter1++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   416
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   417
		use File::Basename;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   418
	    my $FileName = basename(&main::MmpFile()).".xml";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   419
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   420
			" \\\n\t\$(EPOCBLD)\\$FileName",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   421
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   422
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   423
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseTrg$BasicTrgType.gxp"), " : ", @objvarlist,"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   424
			"\tif exist \"\$\@\" del \"\$\@\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   425
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   426
		foreach (@objvarlist) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   427
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   428
				"\tzip -j \$\@$_\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   429
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   430
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   431
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   432
			"\tif exist \$(EABIDEFFILE) zip -j \$\@ \$(EABIDEFFILE)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   433
			"\n\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   434
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   435
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   436
		# shorter lists remain unchanged
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   437
		#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   438
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   439
			"OBJECTS$Bld="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   440
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   441
		use File::Basename;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   442
	    my $FileName = basename(&main::MmpFile()).".xml";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   443
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   444
		&main::Output("\$(EPOCBLD)\\$FileName");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   445
        foreach (@SrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   446
			my $BaseSource = &main::Path_Split('Base', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   447
			my $Ext = &main::Path_Split('Ext', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   448
			$BaseSource.='_' if (lc($Ext) eq '.cia');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   449
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   450
			" \\\n\t", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSource.xml")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   451
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   452
		}       
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   453
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   454
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   455
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   456
			"\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
		&main::Output("RESOURCEINFO$Bld=");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   460
		foreach (@RfiFiles)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   461
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   462
			&main::Output(" \\\n\t\$(EPOCBLD)\\$_");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   463
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   464
		&main::Output("\n\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   465
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   466
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   467
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   468
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseTrg$BasicTrgType.gxp"), " : \$(OBJECTS$Bld) \$(EABIDEFFILE) \$(RESOURCEINFO$Bld)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   469
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   470
			"\tif exist \"\$\@\" del \"\$\@\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   471
			"\tzip -j \$\@ \$^ \$(EABIDEFFILE) \$(RESOURCEINFO$Bld)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   472
			"\n\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   473
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   474
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   475
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   476
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   477
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   478
sub PMStartSrcList {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   479
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   480
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   481
		"# SOURCES\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   482
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   483
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   484
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   485
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   486
sub PMBitMapBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   487
	&Generic_BitMapBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   488
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   489
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   490
sub PMResrcBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   491
	&Generic_ResrcBld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   492
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   493
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   494
sub PMStartSrc {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   495
	my $Src=&main::Src;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   496
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   497
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   498
		"# Source $Src\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   499
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   500
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   501
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   502
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   503
sub PMSrcDepend {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   504
	my @BldList=&main::BldList;	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   505
	my @DepList=&main::DepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   506
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   507
	my $ExtSrc=&main::ExtSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   508
	my $cia = (lc($ExtSrc) eq '.cia') ? "_" : "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   509
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   510
	return if (@DepList == 0);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   511
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   512
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   513
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   514
			&Generic_Quote("\$(EPOCBLD$_)\\$BaseSrc$cia.lis"), " ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   515
			&Generic_Quote("\$(EPOCBLD$_)\\$BaseSrc$cia.xml"), " \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   516
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   517
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   518
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   519
		":"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   520
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   521
	foreach (@DepList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   522
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   523
		" \\\n\t", &Generic_Quote($_)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   524
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   525
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   526
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   527
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   528
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   529
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   530
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   531
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   532
sub PMSrcBldDepend {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   533
	my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   534
	my @DepList=&main::DepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   535
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   536
	my $ExtSrc=&main::ExtSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   537
	my $cia = (lc($ExtSrc) eq '.cia') ? "_" : "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   538
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   539
	return if (@DepList == 0);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   540
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   541
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   542
		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc$cia.lis"), " ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   543
		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc$cia.xml"), " :",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   544
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   545
	foreach (@DepList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   546
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   547
			" \\\n\t", &Generic_Quote($_)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   548
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   549
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   550
	&main::Output( 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   551
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   552
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   553
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   554
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   555
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   556
my %sources;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   557
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   558
sub PMEndSrcBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   559
	my $ABI=&main::ABI;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   560
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   561
	my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   562
	my $Src=ucfirst lc &main::Src;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   563
	my $SrcPath=&main::SrcPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   564
	my $Ext = &main::Path_Split('Ext', $Src);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   565
	my $Cia = (lc($Ext) eq '.cia') ? 1 : 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   566
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   567
	my $ChopSrcPath=&main::Path_Chop($SrcPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   568
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   569
	# add source path, source file and build type to hashmap. 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   570
    $sources{$SrcPath}{$Src}{$Bld}=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   571
   
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   572
	# Use GCC trick to get assembler source files preprocessed with CPP
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   573
	$Src =~ s/\.s$/.S/i;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   574
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   575
	if ($Cia) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   576
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   577
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.xml"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   578
			&Generic_Quote("$SrcPath$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   579
			"\t\$(GCC$Bld) -D__CIA__ -I \"$ChopSrcPath\" \$(INCDIR) -fxml=\$\@ -o nul \"$ChopSrcPath\\$Src\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   580
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   581
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   582
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   583
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   584
			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.xml"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   585
			&Generic_Quote("$SrcPath$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   586
			"\t\$(GCC$Bld) -I \"$ChopSrcPath\" \$(INCDIR) -fxml=\$\@ -o nul \"$ChopSrcPath\\$Src\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   587
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   588
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   589
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   590
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   591
	#Keep the staus of the dependency-generation-flag was enabled or disabled.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   592
	my $Deps_Stat = &main::Deps_GetNoDependencies();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   593
	if($Deps_Stat){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   594
		#If the no-dependency-generation-flag turned on, turn it off temporarily, so that we can get 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   595
		#the dependencies.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   596
		&main::Deps_SetNoDependenciesStatus(0);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   597
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   598
	# Code to print the log file includeheaders.txt
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   599
	my $IncFileName = "$epocroot\\epoc32\\release\\gccxml\\includeheaders.txt";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   600
	open INC_FILE,">> $IncFileName" or die "Cannot open file $IncFileName";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   601
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   602
	#Get the dependencies for the current source file.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   603
	my @DepList=&main::Deps_GenDependsL("$SrcPath$Src");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   604
	foreach(@DepList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   605
		print INC_FILE "$_\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   606
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   607
	close INC_FILE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   608
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   609
	#Set the dependency-generation-flag to its original state so that, it doesn't affect the other target 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   610
	#builds.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   611
	&main::Deps_SetNoDependenciesStatus($Deps_Stat);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   612
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   613
	# Code to print the existance of the file in logs
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   614
	my $neededfile="$epocroot\\epoc32\\release\\gccxml\\includeheaders.txt";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   615
	if (!-e $neededfile)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   616
	{ 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   617
		print "!!! File $epocroot\\epoc32\\release\\gccxml\\includeheaders.txt does not exist\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   618
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   619
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   620
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   621
sub PMEndSrc {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   622
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   623
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   624
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   625
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   626
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   627
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   628
sub PMEndSrcList {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   629
        my $BldPath=&main::BldPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   630
        my $Target = &main::Trg; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   631
        my $TargetBase = &main::Path_Split('Base', $Target);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   632
		use File::Basename;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   633
	    my $FileName = basename(&main::MmpFile());
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   634
	    $FileName = $BldPath.$FileName.".xml";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   635
        open FILE,">> $FileName" or die "Cannot open mmp info dump file $FileName: $!";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   636
		my $path;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   637
        foreach $path (keys %sources)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   638
        {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   639
            my %thing =  %{$sources{$path}}; # {"UREL"}; 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   640
            my $file;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   641
            foreach $file (keys %thing)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   642
            {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   643
                if( defined $thing{$file}{"UREL"})
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   644
                {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   645
                    if( defined  $thing{$file}{"UDEB"} )
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   646
                    {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   647
                        print FILE "\t<sourceFile name=\"$file\" path=\"$path\"/>\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   648
                    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   649
                    else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   650
                    {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   651
                        print FILE "\t<sourceFile name=\"$file\" path=\"$path\" type=\"UREL\"/>\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   652
                    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   653
                }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   654
                else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   655
                {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   656
                    if(defined $thing{$file}{"UDEB"})
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   657
                    {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   658
                        print FILE "\t<sourceFile name=\"$file\" path=\"$path\" type=\"UDEB\"/>\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   659
                    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   660
                    else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   661
                    {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   662
                        die "Should Never Get HERE!";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   663
                    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   664
                }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   665
                
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   666
            }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   667
        }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   668
        
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   669
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   670
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   671
        my $BldInfDir=&Path_WorkPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   672
        my $PrjBldDir=$E32env::Data{BldPath};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   673
        $PrjBldDir=~s-^(.*)\\-$1-o;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   674
        $PrjBldDir.=$BldInfDir;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   675
        $PrjBldDir=~m-(.*)\\-o; # remove backslash because some old versions of perl can't cope
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   676
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   677
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   678
        ### the export call is like this
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   679
        my $lCmd = "make -r -f \"${PrjBldDir}EXPORT.make\" WHAT";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   680
        my @lExportDump = split(/\n/,`$lCmd`);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   681
        foreach my $lLine (@lExportDump) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   682
            $lLine =~ s/"//g;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   683
            chomp($lLine);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   684
            if($lLine =~ /.*\.h/i) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   685
                print FILE "\t<export name=\"$lLine\"/>\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   686
            }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   687
        }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   688
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   689
		print FILE "</mmpInfo>\n\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   690
        close FILE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   691
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   692
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   693
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   694
		&Generic_End;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   695
}
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
sub GetRelDir
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   699
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   700
	my ($fileName) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   701
	$fileName = CleanPath($fileName); # make sure that /'s are use rather than \ or \\
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   702
	if($fileName!~m-\/-) # no directory, just a file name, so return ./
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   703
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   704
		return "./";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   705
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   706
	elsif($fileName=~m-^(.*\/)[^\/]+$-) # return directory
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   707
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   708
		return $1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   709
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   710
	else # don't know how could get here
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   711
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   712
		return "./";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   713
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   714
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   715
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   716
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   717
sub SearchMmpFile
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   718
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   719
	my @rfiFiles;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   720
	my @SystemIncludes = &main::SysIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   721
	my @UserIncludes = &main::UserIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   722
	my $ResourceStruct = &main::ResourceStructRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   723
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   724
	foreach my $ResourceStructure (@$ResourceStruct)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   725
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   726
		push @rfiFiles, AnalyseResourceFile($$ResourceStructure{Source}, \@SystemIncludes, \@UserIncludes);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   727
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   728
	return \@rfiFiles;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   729
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   730
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   731
sub AnalyseResourceFile
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   732
{ # when get to here $rssFile should be fully qualified relative to mmp file location (i.e. base: .../name.rss)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   733
	my ($rssFile, $systemIncludeList, $userIncludeList) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   734
	my @resourceRelatedFiles = ($rssFile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   735
	my $baseFile = 0; #flag to indicate whether this is the base file which the rfi file is named after
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   736
	my $rssItem;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   737
	my $containerFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   738
	foreach $rssItem (@resourceRelatedFiles) #@resourceRelatedFiles is added to during this foreach loop as included files are found
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   739
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   740
		$rssItem = CleanPath($rssItem);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   741
		if( ! ($baseFile) )
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   742
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   743
			$baseFile = 1; # set to non-zero so that setting up the rfi file is only done once
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   744
			if($rssItem =~m-\/-)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   745
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   746
				if($rssItem =~m-^\S*\/([^\/]+)$-) # just extracts file name
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   747
				{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   748
					$containerFile = $1 . ".rfi";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   749
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   750
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   751
			else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   752
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   753
				$containerFile = $rssItem . ".rfi";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   754
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   755
			open CONTAINER, ">$containerFile";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   756
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   757
		OutputHeader($rssItem);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   758
		my $resourceFiles = ReadFile($rssItem, \@resourceRelatedFiles, $systemIncludeList, $userIncludeList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   759
		@resourceRelatedFiles = @$resourceFiles;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   760
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   761
	close CONTAINER;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   762
	return $containerFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   763
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   764
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   765
sub CheckForInclude
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   766
{ # check whether the passed line from the resource type file is a #include line, if it is then store it to be added to the rfi file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   767
	my ($line, $dir, $resourceFiles, $systemIncludeList, $userIncludeList) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   768
	my @resourceFiles = @$resourceFiles;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   769
	if($line =~ /^\s*\#include\s+([\<\"])(\S+)([\>\"])(\s+\/\/.*)?/)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   770
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   771
		if( ($1 eq "\"") and ($3 eq "\"") )
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   772
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   773
			my $possibleAddition = SearchDirectories($2, "quoted", $dir, $systemIncludeList, $userIncludeList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   774
			if($possibleAddition ne "")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   775
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   776
				push @resourceFiles, $possibleAddition;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   777
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   778
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   779
		elsif( ($1 eq "\<") and ($3 eq "\>") )
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   780
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   781
			my $possibleAddition = SearchDirectories($2, "angle", $dir, $systemIncludeList, $userIncludeList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   782
			if($possibleAddition ne "")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   783
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   784
				push @resourceFiles, $possibleAddition;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   785
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   786
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   787
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   788
	return \@resourceFiles;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   789
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   790
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   791
sub ReadFile
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   792
{ # copy the passed file into the rfi file and check it for included files
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   793
	my ($fileName, $resourceFiles, $systemIncludeList, $userIncludeList) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   794
	my $dir = GetRelDir($fileName);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   795
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   796
	open RESOURCE, $fileName or die "Can't open file $fileName from " . cwd() . "\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   797
	my $line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   798
	foreach $line (<RESOURCE>)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   799
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   800
		print CONTAINER $line;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   801
		$resourceFiles = CheckForInclude($line, $dir, $resourceFiles, $systemIncludeList, $userIncludeList);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   802
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   803
	close RESOURCE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   804
	return $resourceFiles;
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
sub OutputHeader
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   808
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   809
	my ($fileName) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   810
	print CONTAINER "\n\n/* GXP ***********************\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   811
	if($fileName =~m-\/-)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   812
	{ # remove path as only want to store file name
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   813
		if($fileName =~m-^\S*\/([^\/]+)$-)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   814
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   815
			print CONTAINER " * $1\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   816
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   817
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   818
	else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   819
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   820
		print CONTAINER " * $fileName\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   821
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   822
	print CONTAINER " ****************************/\n\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   823
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   824
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   825
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   826
sub RecordSystemIncludes
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   827
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   828
	my ($line) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   829
	my @terms = split(/ /, $line);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   830
	my $term;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   831
	my @systemIncludes = ();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   832
	foreach $term (@terms)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   833
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   834
		if($term!~m/\/\//) # if term is not the start of a c++ style comment
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   835
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   836
			push @systemIncludes, $term;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   837
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   838
		else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   839
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   840
			last;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   841
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   842
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   843
	return \@systemIncludes;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   844
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   845
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   846
sub RecordUserIncludes
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   847
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   848
	my ($line) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   849
	my @terms = split(/ /, $line);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   850
	my $term;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   851
	my @userIncludes = ();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   852
	foreach $term (@terms)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   853
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   854
		if($term!~m/\/\//) # if term is not the start of a c++ style comment
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   855
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   856
			push @userIncludes, $term;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   857
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   858
		else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   859
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   860
			last;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   861
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   862
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   863
	return \@userIncludes;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   864
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   865
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   866
sub CleanPath # change \ and \\ in path to /
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   867
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   868
	my ($fileName) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   869
	$fileName =~ s-\\\\-\/-og;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   870
	$fileName =~ s-\\-\/-og;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   871
	return $fileName;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   872
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   873
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   874
sub RecordSourcePath
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   875
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   876
	my ($line) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   877
	my $sourcePath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   878
	if($line=~/^(\S+)/) # in case of comments at end of line
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   879
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   880
		$sourcePath = $1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   881
		$sourcePath = CleanPath($sourcePath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   882
		if($sourcePath !~ m/\/$/)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   883
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   884
			$sourcePath .= "\/";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   885
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   886
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   887
	return $sourcePath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   888
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   889
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   890
sub SearchDirectories
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   891
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   892
	my ($fileName, $includeType, $base, $systemIncludeList, $userIncludeList) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   893
	my @systemIncludes = @$systemIncludeList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   894
	my @userIncludes = @$userIncludeList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   895
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   896
	$fileName = CleanPath($fileName);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   897
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   898
	if(-e $base.$fileName)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   899
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   900
		return $base.$fileName;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   901
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   902
	if($includeType eq "quoted")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   903
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   904
		# search through the user includes and return dir + file name if found
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   905
		my $directory;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   906
		foreach $directory (@userIncludes)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   907
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   908
			my $qualifiedFileName = $directory . "/" . $fileName;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   909
			if(-e $qualifiedFileName)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   910
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   911
				return $qualifiedFileName;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   912
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   913
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   914
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   915
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   916
	# search through the system includes
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   917
	my $directory;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   918
	foreach $directory (@systemIncludes)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   919
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   920
		my $qualifiedFileName = $directory . "/" . $fileName;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   921
		if(-e $qualifiedFileName)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   922
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   923
			return $qualifiedFileName;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   924
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   925
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   926
	return "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   927
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   928
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   929
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   930
sub GatherResourceInformation
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   931
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   932
	my $BldPath=&main::BldPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   933
	unless (-d $BldPath) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   934
		mkpath([$BldPath]);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   935
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   936
	$BldPath = (&main::Path_StepDirs($BldPath))[-2];
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   937
	my $bldInfDirectory = cwd(); # store current directory so can return to it later
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   938
	my $MmpFile = &main::MmpFile();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   939
	$MmpFile = CleanPath($MmpFile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   940
	my $MmpFileDir = "./";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   941
	my $MmpFileName = $MmpFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   942
	if($MmpFile=~m-\/-)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   943
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   944
		if($MmpFile=~m-^(.*)\/([^\/]*)$-)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   945
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   946
			$MmpFileDir = $1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   947
			$MmpFileName = $2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   948
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   949
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   950
	chdir($MmpFileDir) or die "Error: Could not change to MMP file directory: $MmpFileDir\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   951
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   952
	my $rfiFileList = &SearchMmpFile; # analyse the mmp file for resource files
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   953
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   954
	my @RfiFiles = @$rfiFileList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   955
	foreach (@RfiFiles) # copy the rfi files to the BldPath and delete them from temporary locations
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   956
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   957
		system("copy \"$_\" \"$BldPath$_\"");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   958
		unlink $_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   959
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   960
	chdir($bldInfDirectory); # return to the orignial directory
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   961
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   962
	return \@RfiFiles; # return list of rfi files to be added to .mmp.xml file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   963
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   964
1;