sbsv1/abld/platform/cl_generic.pm
author jjkang
Wed, 30 Jun 2010 11:35:58 +0800
changeset 607 378360dbbdba
parent 599 fa7a3cc6effd
permissions -rw-r--r--
Merge missed changeset 11 (raptor v2.14 and helium 10.0)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
599
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     1
# Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     2
# All rights reserved.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     3
# This component and the accompanying materials are made available
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     4
# under the terms of "Eclipse Public License v1.0"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     5
# which accompanies this distribution, and is available
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     7
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     8
# Initial Contributors:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     9
# Nokia Corporation - initial contribution.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    10
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    11
# Contributors:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    12
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    13
# Description:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    14
# this package contains generic routines to handle bits of makefiles which are
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    15
# common to all of the platforms. Currently it deals with AIF, MBM amd RSC files.
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    19
package cl_generic;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    20
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    21
require Exporter;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    22
@ISA=qw(Exporter);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    23
@EXPORT=qw(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    24
	Generic_Define
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    25
	Generic_Definition
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    26
	Generic_MakeWorkDir
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    27
	Generic_MakeWorkFile
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    28
	Generic_Quote
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    29
	Generic_Header
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    30
	Generic_Releaseables
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    31
	Generic_BitMapBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    32
	Generic_ResrcBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    33
	Generic_AifBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    34
	Generic_End
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
	Generic_CopyAction
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    36
	Generic_WhatCleanTargets
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    37
	Generic_WhatTargets
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    38
	Generic_CleanTargets
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
use File::Basename;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    42
use lockit_info;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    43
use CheckSource;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    44
use E32Variant;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
my $SavedBldPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47
my $MakefileType=0;	# 0=NMAKE, 1=MAKE
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    48
my %CheckSourceResourceIncludes;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    49
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    50
sub Generic_Header ($$;$) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    51
	my ($UseRltPaths, $makefileType, $supportAbsPathConversion) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    52
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    53
	$MakefileType=($makefileType eq "nmake")? 0:1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    54
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    55
	my $LibSubDir="UDEB";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    56
	if (&main::PlatOS eq 'EPOC32') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    57
		$LibSubDir="UREL";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    58
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    59
	elsif (&main::PlatOS eq 'TOOLS2') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    60
		$LibSubDir="LIB";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    61
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    62
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    63
	my $BldPath=&main::BldPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    64
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    65
	if ( LocalBuildPathExists() ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    66
		$BldPath = ConvertToLocalBuild($BldPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    67
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    68
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    69
	# Get the information regarding supporting Compiler Wrapper option
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    70
	my $IsCompilerWrapperOption=&main::CompilerWrapperOption();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    71
	my $RelPath=&main::RelPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    72
	my $LibPath=&main::LibPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    73
	my $LinkPath=&main::LinkPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    74
	my $StatLinkPath=&main::StatLinkPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    75
	my $ASSPLinkPath=&main::ASSPLinkPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    76
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    77
	$SavedBldPath=&main::Path_Chop($BldPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    78
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    79
	if ($UseRltPaths) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    80
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    81
		if ( ! LocalBuildPathExists() ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    82
			# Local build does not exists so keep relative path.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    83
			$BldPath     =&main::Path_RltToWork($BldPath);
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
		$RelPath     =&main::Path_RltToWork($RelPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    87
		$LibPath     =&main::Path_RltToWork($LibPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    88
		$LinkPath    =&main::Path_RltToWork($LinkPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    89
		$StatLinkPath=&main::Path_RltToWork($StatLinkPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    90
		$ASSPLinkPath=&main::Path_RltToWork($ASSPLinkPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    91
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    92
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    93
	$BldPath=&main::Path_Chop($BldPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    94
	$RelPath=&main::Path_Chop($RelPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    95
	$LibPath=&main::Path_Chop($LibPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    96
	$LinkPath=&main::Path_Chop($LinkPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    97
	$StatLinkPath=&main::Path_Chop($StatLinkPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    98
	$ASSPLinkPath=&main::Path_Chop($ASSPLinkPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    99
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   100
	my $EPOCDataPath=&main::Path_Chop(&main::EPOCDataPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   101
	my $EPOCIncPath=&main::Path_Chop(&main::EPOCIncPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   102
	my $DataPath=&main::Path_Chop(&main::DataPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   103
	my $TrgPath=&main::Path_Chop(&main::TrgPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   104
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   105
	my $erasedefn = "\@erase";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   106
	$erasedefn = "\@erase 2>>nul" if ($ENV{OS} eq "Windows_NT");
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
		'# CWD ',             &main::Path_WorkPath, "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   111
		'# MMPFile ',         &main::MmpFile,       "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   112
		'# Target ',          &main::Trg,           "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   113
		'# TargetType ',      &main::TrgType,       "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   114
		'# BasicTargetType ', &main::BasicTrgType,  "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   115
		'# MakefileType ', ($MakefileType==1)? "GNU":"NMAKE", "\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
	my @BldList=&main::BldList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   119
	my %featureVariantInfo = &main::FeatureVariantInfo;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   120
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   121
	if (%featureVariantInfo)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   122
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   123
		&main::Output("# FeatureVariantName ", $featureVariantInfo{NAME}, "\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   124
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   125
		foreach (@BldList)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   126
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   127
			&main::Output("# FeatureVariant".$_."Label ", $featureVariantInfo{$_."_LABEL"}, "\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   128
			}
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
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   132
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   133
		"ERASE = $erasedefn\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   134
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   135
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   136
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   137
	# Include function to perform optional DOS to Unix slash conversion
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   138
	# on absolute paths if requested from backend.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   139
	if ($supportAbsPathConversion) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   140
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   141
			"ifeq \"\$(UNIX_SLASH_FOR_CC_ABS_PATHS)\" \"1\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   142
			"define absolutePaths\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   143
			"\$(subst \\,\/,\$1)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   144
			"endef\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   145
			"else\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   146
			"define absolutePaths\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   147
			"\$1\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   148
			"endef\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   149
			"endif\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   150
			"\n"
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
		"# EPOC DEFINITIONS\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   156
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   157
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   158
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   159
	Generic_Define("EPOCBLD",  $BldPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   160
	if (defined $ENV{PBUILDPID}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   161
		my $BldPathP = $BldPath . '$(PBUILDPID)';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   162
		Generic_Define("EPOCBLDP", $BldPathP);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   163
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   164
		Generic_Define("EPOCBLDP", $BldPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   165
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   166
	Generic_Define("EPOCTRG",  $RelPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   167
	Generic_Define("EPOCLIB",  $LibPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   168
	Generic_Define("EPOCLINK", $LinkPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   169
	Generic_Define("EPOCSTATLINK", $StatLinkPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   170
	Generic_Define("EPOCBSFSTATLINK", $RelPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   171
	Generic_Define("EPOCASSPLINK", $ASSPLinkPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   172
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   173
	Generic_Define("EPOCDATA", $EPOCDataPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   174
	Generic_Define("EPOCINC",  $EPOCIncPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   175
	Generic_Define("TRGDIR",   $TrgPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   176
	Generic_Define("DATADIR",  $DataPath);
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
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   180
		&main::Output("\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   181
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   182
		my $bldOffset = "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   183
		$bldOffset .= $featureVariantInfo{$_."_LABEL"}."\\" if (%featureVariantInfo && !$featureVariantInfo{INVARIANT});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   184
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   185
		Generic_Define("EPOCBLD$_", "\$(EPOCBLD)\\".$bldOffset.lc($_));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   186
		if (defined $ENV{PBUILDPID}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   187
			Generic_Define("EPOCBLDP$_", "\$(EPOCBLDP)\\".$bldOffset.lc($_));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   188
		} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   189
			Generic_Define("EPOCBLDP$_", "\$(EPOCBLD)\\".$bldOffset.lc($_));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   190
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   191
		Generic_Define("EPOCTRG$_", "\$(EPOCTRG)\\".lc($_));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   192
		Generic_Define("EPOCLIB$_", "\$(EPOCLIB)\\".lc($LibSubDir));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   193
		Generic_Define("EPOCLINK$_", "\$(EPOCLINK)\\".lc($LibSubDir));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   194
		Generic_Define("EPOCSTATLINK$_", "\$(EPOCSTATLINK)\\".lc($_));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   195
		Generic_Define("EPOCBSFSTATLINK$_","\$(EPOCBSFSTATLINK)\\".lc($_));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   196
		Generic_Define("EPOCASSPLINK$_", "\$(EPOCASSPLINK)\\".lc($LibSubDir));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   197
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   198
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   199
	# Compiler Wrapper option support 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   200
	# Generate the information Compiler Wrapper options in second level make file.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   201
	if($IsCompilerWrapperOption)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   202
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   203
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   204
			"\n\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   205
			"#COMPILER WRAPPER OPTION DEFINITIONS\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   206
			"COMPWRAP = ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   207
			"$ENV{ABLD_COMPWRAP}", # Extract the tool name from environment variable
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   208
			"\n\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   209
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   210
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   211
	# Compiler Wrapper option
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   212
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   213
	my $gccxml;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   214
	if (&main::Plat =~ /gccxml/i){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   215
		$gccxml = &main::Plat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   216
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   217
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   218
	my $edg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   219
	if (&main::Plat =~ /edg/i){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   220
		$edg = &main::Plat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   221
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   222
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   223
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   224
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   225
		"# EPOC PSEUDOTARGETS\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   226
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   227
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   228
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   229
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   230
		if(!$edg){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   231
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   232
				"$_ : MAKEWORK$_ RESOURCE$_\n\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   233
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   234
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   235
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   236
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   237
				"$_ : MAKEWORK$_ \n\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   238
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   239
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   240
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   241
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   242
	&main::Output(	# ALL comes after DEB: because first target in makefile is the default
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   243
		"ALL :"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   244
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   245
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   246
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   247
			" $_"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   248
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   249
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   250
	# # Compiler Wrapper option support 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   251
	if($IsCompilerWrapperOption)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   252
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   253
		&main::Output(	# ALL comes after DEB: because first target in makefile is the default
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   254
			"\n\nCOMPWRAPALL : COMPWRAPUREL COMPWRAPUDEB"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   255
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   256
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   257
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   258
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   259
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   260
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   261
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   262
		"CLEAN CLEANALL : CLEANBUILD CLEANRELEASE CLEANLIBRARY\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   263
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   264
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   265
	my $pseudoTarget;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   266
	foreach $pseudoTarget ("WHAT", "RESOURCE", "CLEANBUILD", "CLEANRELEASE", 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   267
				"MAKEWORK", "LISTING")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   268
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   269
		if(($gccxml && $pseudoTarget eq "RESOURCE") ||
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   270
		!($gccxml || $edg)){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   271
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   272
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   273
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   274
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   275
				"$pseudoTarget $pseudoTarget","ALL :"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   276
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   277
			foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   278
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   279
					" $pseudoTarget$_"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   280
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   281
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   282
		}	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   283
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   284
	if($gccxml){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   285
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   286
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   287
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   288
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   289
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   290
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   291
	if(!($gccxml || $edg)){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   292
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   293
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   294
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   295
			"MAKEWORK : MAKEWORKLIBRARY\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   296
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   297
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   298
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   299
	if(!$edg){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   300
		foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   301
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   302
				"RESOURCE$_ "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   303
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   304
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   305
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   306
			": GENERIC_RESOURCE\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   307
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   308
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   309
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   310
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   311
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   312
# Quote name if necessary, according to the type of Makefile
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   313
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   314
sub Generic_Quote ($) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   315
	my ($name)=@_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   316
	if ($MakefileType==1) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   317
		# GNU make wants backslash before each space
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   318
		$name =~ s/ /\\ /go;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   319
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   320
		# NMAKE prefers quotes around all filenames
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   321
		$name = "\"$name\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   322
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   323
	return $name;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   324
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   325
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   326
# Generic file copying action, which uses built-in variables quoted appropriately
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   327
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   328
# GNU make variables may contain spaces, but perl.exe will be executed directly
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   329
# and so doesn't need any quotes.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   330
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   331
sub Generic_CopyAction($) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   332
	my ($target) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   333
	my $source = '$?';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   334
	$target = '$@' if (!defined $target);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   335
	return "perl -S ecopyfile.pl $source $target\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   336
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   337
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   338
# Record necessary directories, for eventual emkdir.pl rules
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   339
# Also need to record related defines, to eliminate duplicates
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   340
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   341
my %DirDefines;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   342
sub expandDefines ($) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   343
	my ($value)=@_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   344
	while ($value =~ /^(.*?)\$\((\w+)\)(.*)$/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   345
		last if ($2 eq 'PBUILDPID');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   346
		$value="$1$DirDefines{$2}$3";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   347
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   348
	return $value;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   349
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   350
sub Generic_Define ($$;$) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   351
	my ($name, $value, $trailer)=@_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   352
	$trailer="" if (! defined $trailer);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   353
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   354
		"$name = $value$trailer\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   355
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   356
	$DirDefines{$name}=expandDefines($value);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   357
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   358
sub Generic_Definition ($) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   359
	return $DirDefines{$_[0]};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   360
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   361
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   362
my %MkDirs;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   363
sub Generic_MkDir ($) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   364
	my $dir=&main::Path_Chop(&expandDefines($_[0]));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   365
	$dir = lc $dir;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   366
	$dir =~ s/\$\(pbuildpid\)/\$\(PBUILDPID\)/g;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   367
	$MkDirs{$dir}=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   368
	return $dir;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   369
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   370
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   371
# Accumulate MAKEWORK targets and lists of directories,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   372
# automatically filling in the rest of the details.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   373
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   374
my %MakeWork;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   375
sub Generic_MakeWorkDir($$) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   376
	my ($work, $dir) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   377
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   378
	if ( LocalBuildPathExists() ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   379
		$dir = ConvertToLocalBuild($dir);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   380
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   381
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   382
	my $workhash;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   383
	if (defined $MakeWork{$work}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   384
		$workhash=$MakeWork{$work};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   385
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   386
		my %newhash;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   387
		$workhash=\%newhash;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   388
		$MakeWork{$work}=$workhash;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   389
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   390
	my $normdir=lc &main::Path_Chop(&expandDefines($dir));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   391
	$normdir =~ s/\$\(pbuildpid\)/\$\(PBUILDPID\)/g;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   392
	$$workhash{$normdir} ||= &Generic_MkDir($dir);
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
sub Generic_MakeWorkFile($$) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   396
	my ($work, $file) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   397
	my $dir=&main::Path_Split('Path',&expandDefines($file));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   398
	&Generic_MakeWorkDir($work,$dir);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   399
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   400
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   401
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   402
sub Generic_WhatTargets($$@)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   403
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   404
	my ($prefix, $whattarget, @files)=@_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   405
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   406
	if ((scalar @files) == 0) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   407
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   408
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   409
			"\n$whattarget :\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   410
			"\t\@rem none\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   411
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   412
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   413
# emit list of releasables in batches to avoid overflowing the 2048 character 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   414
# batch file line limit doing echo or erase...
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   415
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   416
		my $count=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   417
		my $length=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   418
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   419
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   420
			"${prefix}_RELEASEABLES$count="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   421
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   422
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   423
		my $File;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   424
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   425
		foreach $File (sort @files) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   426
			my $name = &Generic_Quote($File);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   427
			my $namelen = length($name)+3;	# for space, newline and tab
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   428
			if ($length+$namelen > 1700) {	# very conservative limit
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   429
				$count++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   430
				$length=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   431
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   432
					"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   433
					"${prefix}_RELEASEABLES$count="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   434
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   435
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   436
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   437
				" \\\n\t", $name
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   438
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   439
			$length += $namelen;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   440
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   441
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   442
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   443
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   444
			"$whattarget:\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   445
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   446
		my $filecount=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   447
		while ($filecount<=$count) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   448
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   449
				"\t\@echo \$(${prefix}_RELEASEABLES$filecount)\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   450
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   451
			$filecount++;
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   455
	&main::Output(
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
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   460
sub Generic_CleanTargets($$@) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   461
	my ($prefix, $cleantarget, @files)=@_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   462
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   463
	if ((scalar @files) == 0) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   464
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   465
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   466
			"\n$cleantarget :\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   467
			"\t\@rem none\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   468
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   469
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   470
# emit list of releasables in batches to avoid overflowing the 2048 character 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   471
# batch file line limit doing echo or erase...
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   472
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   473
		my $count=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   474
		my $length=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   475
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   476
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   477
			"${prefix}_CLEANTARGETS$count="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   478
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   479
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   480
		my $File;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   481
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   482
		foreach $File (sort @files) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   483
			my $name = &Generic_Quote($File);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   484
			my $namelen = length($name)+3;	# for space, newline and tab
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   485
			if ($length+$namelen > 1700) {	# very conservative limit
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   486
				$count++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   487
				$length=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   488
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   489
					"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   490
					"${prefix}_CLEANTARGETS$count="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   491
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   492
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   493
			if (!main::NoExportLibrary || ($name !~ /.dso$/i && $name !~ /.lib$/i))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   494
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   495
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   496
					" \\\n\t", $name
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   497
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   498
				$length += $namelen;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   499
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   500
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   501
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   502
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   503
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   504
			"$cleantarget:\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   505
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   506
		my $filecount=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   507
		while ($filecount<=$count) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   508
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   509
				"\t-\$(ERASE) \$(${prefix}_CLEANTARGETS$filecount)\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   510
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   511
			$filecount++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   512
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   513
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   514
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   515
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   516
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   517
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   518
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   519
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   520
sub Generic_WhatCleanTargets($$$@) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   521
	my ($prefix, $whattarget, $cleantarget, @files)=@_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   522
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   523
	if ((scalar @files) == 0) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   524
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   525
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   526
			"\n$whattarget $cleantarget :\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   527
			"\t\@rem none\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   528
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   529
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   530
# emit list of releasables in batches to avoid overflowing the 2048 character 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   531
# batch file line limit doing echo or erase...
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   532
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   533
		my $count=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   534
		my $length=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   535
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   536
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   537
			"${prefix}_RELEASEABLES$count="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   538
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   539
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   540
		my $File;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   541
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   542
		foreach $File (sort @files) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   543
			my $name = &Generic_Quote($File);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   544
			my $namelen = length($name)+3;	# for space, newline and tab
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   545
			if ($length+$namelen > 1700) {	# very conservative limit
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   546
				$count++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   547
				$length=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   548
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   549
					"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   550
					"${prefix}_RELEASEABLES$count="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   551
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   552
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   553
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   554
				" \\\n\t", $name
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   555
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   556
			$length += $namelen;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   557
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   558
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   559
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   560
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   561
			"$whattarget:\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   562
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   563
		my $filecount=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   564
		while ($filecount<=$count) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   565
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   566
				"\t\@echo \$(${prefix}_RELEASEABLES$filecount)\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   567
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   568
			$filecount++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   569
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   570
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   571
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   572
			"$cleantarget:\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   573
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   574
		$filecount=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   575
		while ($filecount<=$count) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   576
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   577
				"\t-\$(ERASE) \$(${prefix}_RELEASEABLES$filecount)\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   578
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   579
			$filecount++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   580
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   581
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   582
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   583
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   584
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   585
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   586
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   587
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   588
# accumulated list of generic releasables
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   589
my %Files;	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   590
sub Generic_End {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   591
	&Generic_WhatCleanTargets("GENERIC","WHATGENERIC","CLEANGENERIC", keys %Files);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   592
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   593
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   594
		"# Rules to create all necessary directories\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   595
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   596
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   597
	foreach (sort keys %MakeWork) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   598
		my $workhash = $MakeWork{$_};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   599
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   600
			"\n$_ :",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   601
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   602
		foreach (sort keys %$workhash) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   603
			my $withcase=$$workhash{$_};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   604
			if ($withcase =~ /\$\(PBUILDPID\)\\/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   605
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   606
					" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   607
					"\t\$(if \$(PBUILDPID),", &Generic_Quote($withcase), ")"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   608
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   609
			} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   610
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   611
					" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   612
					"\t", &Generic_Quote($withcase)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   613
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   614
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   615
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   616
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   617
			"\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
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   621
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   622
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   623
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   624
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   625
	my $dir;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   626
	foreach $dir (sort keys %MkDirs) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   627
		if ($dir =~ /\$\(PBUILDPID\)\\/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   628
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   629
				"\$(if \$(PBUILDPID),", &Generic_Quote($dir),") \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   630
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   631
		} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   632
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   633
				&Generic_Quote($dir)," \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   634
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   635
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   636
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   637
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   638
		":\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   639
		"\tperl -S emkdir.pl \$\@\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   640
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   641
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   642
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   643
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   644
		"CHECKSOURCE :\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   645
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   646
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   647
	&main::Output (CheckSource_MakefileOutput(&main::CheckSourceMMPIncludes));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   648
	&main::Output (CheckSource_MakefileOutput(%CheckSourceResourceIncludes));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   649
	&main::Output (CheckSource_MakefileOutput(&main::CheckSourceMMPMetaData));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   650
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   651
	my $cs_targetprefix = "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   652
	$cs_targetprefix = "U" unless (&main::Plat =~ /tools/i);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   653
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   654
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   655
		"\nCHECKSOURCE".$cs_targetprefix."REL :\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   656
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   657
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   658
	&main::Output (CheckSource_MakefileOutput(&main::CheckSourceURELIncludes));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   659
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   660
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   661
		"\nCHECKSOURCE".$cs_targetprefix."DEB :\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   662
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   663
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   664
	&main::Output (CheckSource_MakefileOutput(&main::CheckSourceUDEBIncludes));
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
sub Generic_Releaseables {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   669
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   670
	my $ResrcPath=&main::TrgPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   671
	my $dir;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   672
	my $EPOCIncPath=&main::EPOCIncPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   673
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   674
	&Generic_MakeWorkDir('GENERIC_MAKEWORK',$SavedBldPath);	    # used for temp directory in epocrc.pl
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   675
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   676
	my $AifStructRef=&main::AifStructRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   677
	my $AifRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   678
	foreach $AifRef (@$AifStructRef) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   679
# regression change - workaround lack of AIF directory
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   680
		$$AifRef{TrgFile}=&main::Path_Split('File',$$AifRef{Trg});  # record for later
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   681
		my $path=&main::Path_Split('Path',"$ResrcPath$$AifRef{Trg}");  
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   682
		my $file="\$(EPOCDATA)\\$ResrcPath$$AifRef{Trg}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   683
		my $xip="_xip";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   684
		my $base=&main::Path_Split('Base',"$file");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   685
		my $root=&main::Path_Split('Path',"$file");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   686
		my $ext=&main::Path_Split('Ext',"$file");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   687
		my $file_xip="$root"."$base$xip$ext";	# since XIP AIF format is generated
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   688
		if ($path eq "") {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   689
			# no target path for the AIF file, so not a releasable
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   690
			$file="$SavedBldPath\\$$AifRef{Trg}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   691
		} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   692
			$Files{$file}=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   693
			$Files{$file_xip}=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   694
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   695
		$$AifRef{GenericTrg}=$file;	    # record for later
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   696
		&Generic_MakeWorkFile('GENERIC_MAKEWORK',$file);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   697
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   698
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   699
	my $BitMapStructRef=&main::BitMapStructRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   700
	my $BitMapRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   701
	foreach $BitMapRef (@$BitMapStructRef) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   702
		my $path=$$BitMapRef{TrgPath};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   703
		my $file="\$(EPOCDATA)\\$path$$BitMapRef{Trg}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   704
		$$BitMapRef{GenericTrg}=$file;	    # record for later
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   705
		$Files{$file}=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   706
		&Generic_MakeWorkFile('GENERIC_MAKEWORK',$file);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   707
		if ($$BitMapRef{Hdr}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   708
			my $mbg=&main::Path_Split('Base', $$BitMapRef{Trg});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   709
			$mbg="\$(EPOCINC)\\$mbg.mbg";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   710
			&Generic_MakeWorkDir('GENERIC_MAKEWORK',$EPOCIncPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   711
			$Files{$mbg}=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   712
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   713
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   714
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   715
	my $ResourceStructRef=&main::ResourceStructRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   716
	my $ResourceRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   717
	foreach $ResourceRef (@$ResourceStructRef) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   718
		if(defined $$ResourceRef{Hdronly})
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   719
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   720
				my $rsg="\$(EPOCINC)\\$$ResourceRef{BaseTrg}.rsg";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   721
				$$ResourceRef{GenericTrg}=$rsg;	# record for later
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   722
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   723
				&Generic_MakeWorkDir('GENERIC_MAKEWORK',$EPOCIncPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   724
				$Files{$rsg}=1;			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   725
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   726
		else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   727
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   728
				my $file="\$(EPOCDATA)\\$$ResourceRef{Trg}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   729
				$$ResourceRef{GenericTrg}=$file;	# record for later
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   730
				$Files{$file}=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   731
				&Generic_MakeWorkFile('GENERIC_MAKEWORK',$file);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   732
				if ($$ResourceRef{Hdr}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   733
					my $rsg="\$(EPOCINC)\\$$ResourceRef{BaseTrg}.rsg";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   734
					&Generic_MakeWorkDir('GENERIC_MAKEWORK',$EPOCIncPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   735
					$Files{$rsg}=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   736
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   737
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   738
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   739
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   740
# Do StringTable 'export'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   741
	my @stringTables = &main::StringTables();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   742
	foreach my $stringtable (@stringTables)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   743
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   744
		if(defined $stringtable->{ExportPath})
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   745
		{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   746
			$Files{$stringtable->{ExportPath}."\\".$stringtable->{BaseTrg}.".h"} = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   747
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   748
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   749
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   750
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   751
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   752
		"GENERIC_RESOURCE : GENERIC_MAKEWORK\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   753
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   754
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   755
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   756
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   757
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   758
sub Generic_BitMapBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   759
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   760
	my $BitMapRef=&main::BitMapRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   761
	my $quotedTrg=&Generic_Quote($$BitMapRef{GenericTrg});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   762
	my $WorkPath = &main::Path_Chop(&main::Path_WorkPath); ## required for Lockit
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   763
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   764
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   765
		"# BitMap $$BitMapRef{Trg}\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   766
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   767
		"GENERIC_RESOURCE : $quotedTrg\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   768
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   769
		"$quotedTrg :"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   770
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   771
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   772
#	must lower-case header here since bmconv generates a header with case-sensitive enums accordingly
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   773
	my $BitMapHdr=join('', &main::EPOCIncPath, &main::Path_Split('Base', $$BitMapRef{Trg}), '.mbg');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   774
	my $TmpBitMapHdr=join('', &main::BldPath, &main::Path_Split('Base', $$BitMapRef{Trg}), '.mbg');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   775
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   776
	my $SrcRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   777
	foreach $SrcRef (@{$$BitMapRef{Source}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   778
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   779
		if (defined $ENV{ABLD_TOOLSMOD_COMPATIBILITY_MODE} &&  ($ENV{ABLD_TOOLSMOD_COMPATIBILITY_MODE} eq 'alpha')) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   780
			%Files = &Lockit_Releasables($WorkPath, $$BitMapRef{Trg}, \%Files, basename($$SrcRef{Src}),"","");		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   781
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   782
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   783
			%Files = &Lockit_Releasables($WorkPath, $$BitMapRef{Trg}, \%Files, basename($$SrcRef{Src}));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   784
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   785
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   786
			" \\\n  ", &Generic_Quote($$SrcRef{Src})
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   787
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   788
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   789
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   790
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   791
		"\tperl -S epocmbm.pl -h\"$TmpBitMapHdr\"",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   792
		"\t-o\"$$BitMapRef{GenericTrg}\"",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   793
		"\t-l\"\\$$BitMapRef{TrgPath}:$WorkPath\"",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   794
		"\\\n\t\t"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   795
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   796
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   797
		" -b\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   798
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   799
	foreach $SrcRef (@{$$BitMapRef{Source}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   800
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   801
			"\\\n\t\t/$$SrcRef{ClDepth}$$SrcRef{Src}"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   802
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   803
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   804
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   805
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   806
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   807
		"\" \\\n\t\t"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   808
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   809
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   810
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   811
		" -l\"\\$$BitMapRef{TrgPath}:$WorkPath\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   812
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   813
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   814
	if ($$BitMapRef{Hdr}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   815
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   816
			"\tperl -S ecopyfile.pl \"$TmpBitMapHdr\" \"$BitMapHdr\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   817
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   818
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   819
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   820
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   821
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   822
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   823
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   824
sub Generic_ResrcBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   825
	my $ResourceRef=&main::ResourceRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   826
	my $WorkPath = &main::Path_Chop(&main::Path_WorkPath); # required for Lockit
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   827
	my @RcompMacro=&main::MmpMacros;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   828
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   829
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   830
		"# Resource $$ResourceRef{Trg}\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   831
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   832
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   833
	my @DepList=&main::DepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   834
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   835
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   836
		"DEPEND="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   837
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   838
	foreach (@DepList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   839
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   840
			" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   841
			"\t", &Generic_Quote($_)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   842
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   843
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   844
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   845
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   846
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   847
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   848
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   849
	my $BaseResrc= $$ResourceRef{BaseTrg};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   850
	my $SrcPath=&main::Path_Split('Path', $$ResourceRef{Source});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   851
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   852
	my $AbsSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   853
	my $AbsSrcPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   854
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   855
	my $ResrcHdr=join '', &main::EPOCIncPath(), $BaseResrc, '.rsg';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   856
	my $AbsResrcHdr;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   857
	my $PlatName=&main::PlatName;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   858
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   859
	my @ChopAbsSysIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   860
	my @ChopAbsUserIncPaths;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   861
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   862
	@ChopAbsSysIncPaths=&main::Path_Chop(&main::Path_AbsToWork(&main::ResourceSysIncPaths));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   863
	@ChopAbsUserIncPaths=&main::Path_Chop(&main::Path_AbsToWork(&main::UserIncPaths));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   864
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   865
	$AbsSrc=&main::Path_AbsToWork($$ResourceRef{Source});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   866
	$AbsSrcPath=&main::Path_AbsToWork($SrcPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   867
	$AbsResrcHdr=&main::Path_AbsToWork($ResrcHdr);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   868
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   869
	my $ChopAbsSrcPath=&main::Path_Chop($AbsSrcPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   870
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   871
	my $EPOCDataDir = &main::Path_Chop($$ResourceRef{TrgPath});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   872
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   873
	my $RscOption= "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   874
	my $HeaderOption = "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   875
	my $HeaderCopyCmd = "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   876
    if (defined $ENV{ABLD_TOOLSMOD_COMPATIBILITY_MODE} &&  ($ENV{ABLD_TOOLSMOD_COMPATIBILITY_MODE} eq 'alpha'))  {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   877
	if ($$ResourceRef{Hdr} || $$ResourceRef{Hdronly}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   878
		$HeaderOption = " -h\"$SavedBldPath\\$BaseResrc$$ResourceRef{Lang}.rsg\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   879
		$HeaderCopyCmd = "\tperl -S ecopyfile.pl \"$SavedBldPath\\$BaseResrc$$ResourceRef{Lang}.rsg\" \"$ResrcHdr\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   880
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   881
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   882
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   883
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   884
	if ($$ResourceRef{Hdr} || $$ResourceRef{Hdronly}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   885
		$HeaderOption = " -h\"$SavedBldPath\\$BaseResrc.rsg\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   886
		$HeaderCopyCmd = "\tperl -S ecopyfile.pl \"$SavedBldPath\\$BaseResrc.rsg\" \"$ResrcHdr\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   887
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   888
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   889
	if (! $$ResourceRef{Hdronly}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   890
		$RscOption = " -o\$\@ ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   891
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   892
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   893
	my $Uidsref=$$ResourceRef{Uids};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   894
	my @Uids=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   895
	@Uids = @{$Uidsref} if (defined($Uidsref));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   896
	my $Uidsarg="";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   897
	if ($#Uids>0) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   898
		$Uidsarg="-uid2 $Uids[0] -uid3 $Uids[1]";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   899
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   900
	elsif ($#Uids==0) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   901
		$Uidsarg="-uid2 $Uids[0] ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   902
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   903
	if (defined $ENV{ABLD_TOOLSMOD_COMPATIBILITY_MODE} &&  ($ENV{ABLD_TOOLSMOD_COMPATIBILITY_MODE} eq 'alpha'))  {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   904
		%Files = &Lockit_Releasables($WorkPath, $$ResourceRef{Source}, \%Files, "", $$ResourceRef{Lang}) unless $$ResourceRef{Hdronly};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   905
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   906
	else {			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   907
		%Files = &Lockit_Releasables($WorkPath,$$ResourceRef{Source}, \%Files, "") unless $$ResourceRef{Hdronly};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   908
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   909
	my $quotedTrg=&Generic_Quote($$ResourceRef{GenericTrg});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   910
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   911
		"GENERIC_RESOURCE : $quotedTrg\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   912
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   913
		"$quotedTrg : ", &Generic_Quote($AbsSrc), " \$(DEPEND)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   914
		"\tperl -S epocrc.pl -m045,046,047 -I \"$ChopAbsSrcPath\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   915
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   916
	foreach (@ChopAbsUserIncPaths) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   917
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   918
			" -I \"$_\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   919
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   920
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   921
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   922
		" -I-"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   923
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   924
	foreach (@ChopAbsSysIncPaths) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   925
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   926
			" -I \"$_\""
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
	foreach(@RcompMacro) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   930
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   931
			" -D$_ "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   932
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   933
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   934
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   935
		" -DLANGUAGE_$$ResourceRef{Lang} -u \"$AbsSrc\" ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   936
		" $Uidsarg ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   937
		"$RscOption $HeaderOption -t\"$SavedBldPath\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   938
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   939
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   940
	if (!$$ResourceRef{Hdronly}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   941
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   942
			" -l\"$EPOCDataDir:$WorkPath\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   943
		);				
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   944
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   945
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   946
	if (&main::ResourceVariantFile()) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   947
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   948
			" -preinclude\"".&main::ResourceVariantFile()."\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   949
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   950
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   951
	if (defined $ENV{ABLD_TOOLSMOD_COMPATIBILITY_MODE} &&  ($ENV{ABLD_TOOLSMOD_COMPATIBILITY_MODE} eq 'alpha')) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   952
		if ((lc $$ResourceRef{Lang}) eq "sc") {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   953
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   954
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   955
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   956
				$HeaderCopyCmd,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   957
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   958
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   959
		&main::Output(		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   960
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   961
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   962
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   963
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   964
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   965
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   966
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   967
			$HeaderCopyCmd,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   968
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   969
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   970
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   971
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   972
	my @macros;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   973
	push @macros, "LANGUAGE_$$ResourceRef{Lang}", "_UNICODE";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   974
	my @userIncludes = &main::Path_Chop(&main::Path_AbsToWork(&main::UserIncPaths));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   975
	unshift (@userIncludes, $AbsSrcPath);	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   976
	my @systemIncludes = &main::Path_Chop(&main::Path_AbsToWork(&main::ResourceSysIncPaths));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   977
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   978
	CheckSource_Includes($AbsSrc, %CheckSourceResourceIncludes, &Variant_GetMacroHRHFile(), @macros, @userIncludes, @systemIncludes);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   979
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   980
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   981
sub Generic_AifBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   982
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   983
	my $AifRef=&main::AifRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   984
	my $ResrcPath=&main::TrgPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   985
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   986
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   987
		"# Aif $$AifRef{Trg}\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   988
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   989
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   990
	my @DepList=&main::DepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   991
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   992
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   993
		"DEPEND="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   994
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   995
	foreach (@DepList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   996
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   997
			" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   998
			"\t", &Generic_Quote($_)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   999
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1000
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1001
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1002
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1003
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1004
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1005
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1006
	my @ChopRTWSysIncPaths=&main::Path_Chop(&main::Path_RltToWork(&main::ResourceSysIncPaths));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1007
	my @ChopRTWUserIncPaths=&main::Path_Chop(&main::Path_RltToWork(&main::UserIncPaths));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1008
	my $BaseResrc=&main::Path_Split('Base',$$AifRef{Source});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1009
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1010
	my $WorkPath = &main::Path_Chop(&main::Path_WorkPath); # required for Lockit
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1011
	my $quotedTrg=&Generic_Quote($$AifRef{GenericTrg});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1012
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1013
		"GENERIC_RESOURCE : $quotedTrg\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1014
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1015
		"$quotedTrg : ", &Generic_Quote("$$AifRef{Source}"), " \$(DEPEND)"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1016
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1017
	if (defined $ENV{ABLD_TOOLSMOD_COMPATIBILITY_MODE} &&  ($ENV{ABLD_TOOLSMOD_COMPATIBILITY_MODE} eq 'alpha')) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1018
	%Files = &Lockit_Releasables($WorkPath, $$AifRef{TrgFile}, \%Files, "", "");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1019
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1020
	else 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1021
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1022
	%Files = &Lockit_Releasables($WorkPath, $$AifRef{TrgFile}, \%Files, "");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1023
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1024
	my $bitmapArg = "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1025
	if ($$AifRef{BitMaps}) { # bitmaps aren't essential
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1026
		$bitmapArg = "\\\n\t\t-b\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1027
		foreach my $BitMapRef (@{$$AifRef{BitMaps}}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1028
			my $BitMap = &main::Path_Split('File', $$BitMapRef{Src});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1029
			if (defined $ENV{ABLD_TOOLSMOD_COMPATIBILITY_MODE} &&  ($ENV{ABLD_TOOLSMOD_COMPATIBILITY_MODE} eq 'alpha')) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1030
			%Files = &Lockit_Releasables($WorkPath, $$AifRef{TrgFile}, \%Files, $BitMap, "");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1031
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1032
			else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1033
			{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1034
			%Files = &Lockit_Releasables($WorkPath, $$AifRef{TrgFile}, \%Files, $BitMap);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1035
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1036
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1037
				" ", &Generic_Quote("$$BitMapRef{Src}")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1038
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1039
			$bitmapArg .= "\\\n\t\t/$$BitMapRef{ClDepth}$$BitMapRef{Src}";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1040
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1041
		$bitmapArg .= "\" ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1042
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1043
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1044
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1045
		"\tperl -S epocaif.pl -o\$\@ ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1046
		"\"$$AifRef{Source}\" ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1047
		"\\\n\t\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1048
		"-t\"$SavedBldPath\" ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1049
		" -l\"\$(TRGDIR):$WorkPath\"",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1050
		$bitmapArg,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1051
		"\\\n\t\t"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1052
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1053
	foreach (@ChopRTWUserIncPaths) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1054
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1055
			" -I \"$_\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1056
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1057
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1058
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1059
		" -I-"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1060
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1061
	foreach (@ChopRTWSysIncPaths) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1062
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1063
			" -I \"$_\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1064
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1065
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1066
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1067
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1068
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1069
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1070
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1071
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1072
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1073
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1074
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1075
# Check to see that LOCAL_BUILD_PATH exists.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1076
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1077
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1078
sub LocalBuildPathExists() 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1079
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1080
	if ( defined( $ENV{LOCAL_BUILD_PATH} ) ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1081
		return 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1082
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1083
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1084
		return 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1085
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1086
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1087
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1088
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1089
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1090
# Take the build path and ensure that it is now local. 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1091
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1092
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1093
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1094
sub ConvertToLocalBuild($)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1095
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1096
	my ($BldPath)=@_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1097
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1098
	my $sub_replacement = $ENV{"LOCAL_BUILD_PATH"};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1099
	if ( !ValidBuildPath($sub_replacement) ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1100
		&FatalError(" Invalid Local Build Path : LOCAL_BUILD_PATH = \"$BldPath\"  must be in format drive:dir_name1 " );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1101
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1102
	else
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1103
	{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1104
		# Replace the \epoc32\build with local setting
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1105
		my $epocroot=$ENV{"EPOCROOT"};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1106
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1107
		my $sub_match = "\Q${epocroot}\EEPOC32\\\\BUILD";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1108
		$BldPath =~ s/${sub_match}/${sub_replacement}/;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1109
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1110
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1111
	return $BldPath
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1112
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1113
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1114
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1115
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1116
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1117
# Checks that the path is at least of the form drive:path_name
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1118
# If no drive: then the makefiles will be produced but not work. 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1119
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1120
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1121
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1122
sub ValidBuildPath($)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1123
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1124
	my ($BldPath)=@_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1125
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1126
	if ( $BldPath =~/^[a-zA-z]{1}:{1}.*$/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1127
		# Must have at least d:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1128
		return 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1129
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1130
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1131
		return 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1132
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1133
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1134
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1135
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1136
1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1137