sbsv1/abld/platform/ide_vc6.pm
author marvin shi <marvin.shi@nokia.com>
Wed, 17 Nov 2010 16:47:55 +0800
changeset 696 30aa553e9465
parent 599 fa7a3cc6effd
permissions -rw-r--r--
features: bsym for rofsbuild and log input support for rombuild
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
599
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     1
# Copyright (c) 1999-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
# Makmake-module for creating MAKMAKE MSVC6 IDE makefiles shared by windows platform modules
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    15
# 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    16
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    17
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    18
package Ide_vc6;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    19
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    20
# declare variables global for module
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    21
my $BaseAddressFlag;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    22
my @CppCall;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    23
my %IdeBlds=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    24
my %PrjHdrs=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    25
my @Win32LibList=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    26
my $Win32Resrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    27
my $Win32StdHeaders;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    28
my $MSVCVer;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    29
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    30
my $SupText='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    31
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    32
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    33
require Exporter;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    34
@ISA=qw(Exporter);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    36
@EXPORT=qw(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    37
	PMHelp_Mmp
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    38
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
	PMCheckPlatformL
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
	PMPlatProcessMmp
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    42
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    43
	PMStartBldList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    44
		PMBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
	PMEndBldList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
	PMStartSrcList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47
			PMResrcBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    48
			PMDoc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    49
			PMStartSrc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    50
			PMSrcDepend
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    51
	PMEndSrcList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    52
);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    53
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    54
use Winutl;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    55
use Pathutl;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    56
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    57
sub PMHelp_Mmp {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    58
# get the windows help from WINUTL
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    59
	&Winutl_Help_Mmp;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    60
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    61
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    62
sub PMCheckPlatformL {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    63
	if ((&main::Plat eq 'TOOLS') and (&main::BasicTrgType ne 'EXE') and (&main::BasicTrgType ne 'LIB')) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    64
		die "Can't specify anything but EXE or LIB targettypes for this platform\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    65
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    66
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    67
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    68
sub PMPlatProcessMmp (@) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    69
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    70
	# get WINUTL to do the windows mmp file processing
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    71
	&Winutl_DoMmp(\@_, $ENV{INCLUDE});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    72
	$BaseAddressFlag=&Winutl_BaseAddress;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    73
	$BaseAddressFlag=~s/^(.+$)$/ \/base:\"$1\"/o;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    74
	@Win32LibList=&Winutl_Win32LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    75
	my $MSVCVer = &Winutl_MSVCVer;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    76
	push @Win32LibList, "kernel32.lib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    77
	$Win32Resrc=&Winutl_Win32Resrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    78
	$Win32StdHeaders=&Winutl_Win32StdHeaders;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    79
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    80
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    81
sub PMStartBldList($) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    82
	my ($makecmd) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    83
	die "Cannot generate $makecmd makefiles\n" if ($makecmd ne "nmake");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    84
	my $BaseTrg=&main::BaseTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    85
	my @BldList=&main::BldList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    86
	my $BldPath=&main::BldPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    87
	my $ChopDataPath=&main::Path_Chop(&main::DataPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    88
	my $ChopTrgPath=&main::Path_Chop(&main::TrgPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    89
	my $DefFile=&main::DefFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    90
	my $BasicTrgType=&main::BasicTrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    91
	my $ExportLibrary=&main::ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    92
	my $LibPath=&main::LibPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    93
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    94
	my $MSVCVer = &Winutl_MSVCVer;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    95
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    96
	my $LinkPath=&main::LinkPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    97
	my $Plat=&main::Plat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    98
	my $RelPath=&main::RelPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    99
	my $Trg=&main::Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   100
	my $StatLinkPath=&main::StatLinkPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   101
	my $TrgType=&main::TrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   102
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   103
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   104
	# set up global IDE builds variable
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   105
	%IdeBlds= (
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   106
		UREL=> "$BaseTrg - Win32 Uni Release",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   107
		UDEB=> "$BaseTrg - Win32 Uni Debug",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   108
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   109
	if (&main::Plat eq 'TOOLS') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   110
		%IdeBlds= (
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   111
			REL=> "$BaseTrg - Win32 Release",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   112
			DEB=> "$BaseTrg - Win32 Debug",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   113
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   114
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   115
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   116
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   117
#	Start the supplementary makefile
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   118
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   119
	$SupText.=join('',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   120
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   121
#			need to set path here because MSDEV might be set up so that
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   122
#			it does not take account of the PATH environment variable
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   123
		"PATH=$ENV{PATH}\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   124
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   125
		"# EPOC DEFINITIONS\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   126
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   127
		"EPOCBLD = $BldPath #\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   128
		"EPOCTRG = $RelPath #\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   129
		"EPOCLIB = $LibPath #\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   130
		"EPOCLINK = $LinkPath #\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   131
		"EPOCSTATLINK = $StatLinkPath #\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   132
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   133
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   134
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   135
	if ($BasicTrgType eq 'DLL' || $TrgType eq 'EXEXP') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   136
		foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   137
			$SupText.=join('',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   138
				"EPOCBLD$_ = \$(EPOCBLD)$_\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   139
				"EPOCTRG$_ = \$(EPOCTRG)$_\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   140
				"EPOCLIB$_ = \$(EPOCLIB)UDEB\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   141
				"EPOCLINK$_ = \$(EPOCLINK)UDEB\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   142
				"EPOCSTATLINK$_ = \$(EPOCSTATLINK)$_\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   143
				"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   144
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   145
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   146
		$SupText.="\nTRGDIR = ";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   147
		if ($Plat!~/^WINC$/o && $ChopTrgPath) {	# target path not allowed under WINC
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   148
			$SupText.=$ChopTrgPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   149
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   150
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   151
			$SupText.=".\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   152
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   153
		$SupText.="\n\nDATADIR = $ChopDataPath\n\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   154
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   155
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   156
#		commands for creating the import library
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   157
		$SupText.="LIBRARY :";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   158
		if ($DefFile) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   159
			unless (&main::ExportUnfrozen) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   160
				if (-e $DefFile) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   161
					$SupText.=" \"\$(EPOCLIB)UDEB\\$ExportLibrary.lib\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   162
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   163
				else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   164
					$SupText.=join('',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   165
						"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   166
						"\t\@echo WARNING: Not attempting to create \"\$(EPOCLIB)UDEB\\$ExportLibrary.lib\".\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   167
						"\t\@echo When exports are frozen in \"$DefFile\", regenerate Makefile.\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   168
					);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   169
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   170
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   171
			else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   172
				$SupText.=join('',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   173
					"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   174
					"\t\@echo Not attempting to create \"\$(EPOCLIB)UDEB\\$ExportLibrary.lib\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   175
					"\t\@echo from frozen .DEF file, since EXPORTUNFROZEN specified.\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   176
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   177
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   178
			$SupText.=join('',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   179
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   180
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   181
				"# REAL TARGET - IMPORT LIBRARY\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   182
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   183
				"\"\$(EPOCLIB)UDEB\\$ExportLibrary.lib\" : \"$DefFile\" MAKEWORKLIBRARY\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   184
				"\tperl -S prepdef.pl \"$DefFile\" \"\$(EPOCBLD)\\$ExportLibrary.prep.def\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   185
				"\tlib.exe /nologo /machine:i386 /nodefaultlib /name:\"$Trg\" /def:\"\$(EPOCBLD)\\$ExportLibrary.prep.def\" /out:\"\$(EPOCLIB)UDEB\\$ExportLibrary.lib\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   186
				"\tdel \"\$(EPOCLIB)UDEB\\$ExportLibrary.exp\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   187
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   188
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   189
		$SupText.=join('',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   190
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   191
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   192
			"MAKEWORKLIBRARY : \"${LibPath}UDEB\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   193
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   194
			"\"${LibPath}UDEB\" :\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   195
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   196
		$SupText.="\t\@perl -S emkdir.pl \"${LibPath}UDEB\"\n\n\n";
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   200
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   201
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   202
		"# Microsoft Developer Studio Project File - Name=\"$BaseTrg\" - Package Owner=<4>\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   203
		"# Microsoft Developer Studio Generated Build File, Format Version 6.00\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   204
		"# ** DO NOT EDIT **\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   205
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   206
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   207
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   208
	if ($BasicTrgType=~/^DLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   209
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   210
			"# TARGTYPE \"Win32 (x86) Dynamic-Link Library\" 0x0102\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   211
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   212
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   213
	elsif ($BasicTrgType=~/^EXE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   214
		if (not &main::Plat=~/^(WINC|TOOLS)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   215
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   216
				"# TARGTYPE \"Win32 (x86) Application\" 0x0101\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   217
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   218
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   219
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   220
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   221
				"# TARGTYPE \"Win32 (x86) Console Application\" 0x0103\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   222
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   223
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   224
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   225
	elsif ($BasicTrgType=~/^(LIB)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   226
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   227
			"# TARGTYPE \"Win32 (x86) Static Library\" 0x0104\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   228
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   229
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   230
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   231
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   232
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   233
		"CFG=",$IdeBlds{$BldList[0]},"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   234
		"!MESSAGE This is not a valid makefile. To build this project using NMAKE,\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   235
		"!MESSAGE use the Export Makefile command and run\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   236
		"!MESSAGE \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   237
		"!MESSAGE NMAKE /f \"",$BaseTrg,".mak\".\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   238
		"!MESSAGE \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   239
		"!MESSAGE You can specify a configuration when running NMAKE\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   240
		"!MESSAGE by defining the macro CFG on the command line. For example:\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   241
		"!MESSAGE \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   242
		"!MESSAGE NMAKE /f \"",$BaseTrg,".mak\" CFG=\"".$IdeBlds{$BldList[0]}."\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   243
		"!MESSAGE \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   244
		"!MESSAGE Possible choices for configuration are:\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   245
		"!MESSAGE \n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   246
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   247
	&main::OutSetLength(79);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   248
	if ($BasicTrgType=~/^DLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   249
		foreach (reverse @BldList) { # reverse because VC6 takes last as the default
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   250
			&main::OutFormat(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   251
				"!MESSAGE \"",$IdeBlds{$_},"\" (based on \"Win32 (x86) Dynamic-Link Library\")"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   252
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   253
			&main::Output();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   254
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   255
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   256
	elsif ($BasicTrgType=~/^EXE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   257
		if (not &main::Plat=~/^(WINC|TOOLS)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   258
			foreach (reverse @BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   259
				&main::OutFormat(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   260
					"!MESSAGE \"",$IdeBlds{$_},"\" (based on \"Win32 (x86) Application\")"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   261
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   262
				&main::Output();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   263
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   264
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   265
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   266
			foreach (reverse @BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   267
				&main::OutFormat(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   268
					"!MESSAGE \"",$IdeBlds{$_},"\" (based on \"Win32 (x86) Console Application\")"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   269
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   270
				&main::Output();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   271
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   272
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   273
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   274
	elsif ($BasicTrgType=~/^(LIB)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   275
		foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   276
			&main::OutFormat(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   277
				"!MESSAGE \"",$IdeBlds{$_},"\" (based on \"Win32 (x86) Static Library\")"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   278
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   279
			&main::Output();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   280
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   281
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   282
	&main::OutSetLength();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   283
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   284
		"!MESSAGE \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   285
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   286
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   287
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   288
	# BEGIN THE PROJECT
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   289
	#------------------
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   290
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   291
		"# Begin Project\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   292
		"# PROP Scc_ProjName \"\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   293
		"# PROP Scc_LocalPath \"\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   294
		"CPP=cl.exe\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   295
		"MTL=midl.exe\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   296
		"RSC=rc.exe\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   297
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   298
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   299
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   300
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   301
sub PMBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   302
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   303
	my @BaseSrcList=&main::BaseSrcList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   304
	my $BaseTrg=&main::BaseTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   305
	my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   306
	my @BldList=&main::BldList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   307
	my $ChopBldPath=&main::Path_Chop(&main::BldPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   308
	my $ChopLinkPath=&main::Path_Chop(&main::LinkPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   309
	my $ChopRelPath=&main::Path_Chop(&main::RelPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   310
	my $ChopStatLinkPath=&main::Path_Chop(&main::StatLinkPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   311
	my @ChopSysIncPaths=&main::Path_Chop(&main::SysIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   312
	my @ChopUserIncPaths=&main::Path_Chop(&main::UserIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   313
	my $ExportLibrary=&main::ExportLibrary;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   314
	my $DefFile=&main::DefFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   315
	my $FirstLib=&main::FirstLib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   316
	my $BasicTrgType=&main::BasicTrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   317
	my @MacroList=&main::MacroList();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   318
	push @MacroList, "__SUPPORT_CPP_EXCEPTIONS__";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   319
    my $VariantFile=&main::VariantFile();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   320
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   321
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   322
	my @LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   323
	my $PathBaseDsp=&main::MakeFilePath.&main::BaseMak;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   324
	my @StatLibList=&main::StatLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   325
	my $Trg=&main::Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   326
	my $TrgPath=&main::TrgPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   327
	my $TrgType=&main::TrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   328
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   329
	my $newlib = main::NewLib(); # Check if newlib has been set in the MMP file.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   330
	my $NewLib = 'scppnwdl.lib'; # This is where operator new and operator delete
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   331
                                 # are defined for user side targets.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   332
	my $NewKernLib = 'scppnwdl_kern.lib'; # This is where operator new and operator delete
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   333
                                 	  # are defined for kernel side targets.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   334
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   335
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   336
	if ($Bld =~ /DEB/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   337
		@LibList=&main::DebugLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   338
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   339
		@LibList=&main::LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   340
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   341
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   342
	my $NotUseWin32LibsFlag="";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   343
	unless ($Win32StdHeaders or &main::Plat eq 'TOOLS') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   344
		$NotUseWin32LibsFlag=" /X"; # this flag suppresses searching of the standard directories for header files
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   345
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   346
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   347
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   348
	if ($Bld eq $BldList[0]) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   349
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   350
			"!IF  \"\$(CFG)\" == \"$IdeBlds{$Bld}\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   351
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   352
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   353
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   354
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   355
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   356
			"!ELSEIF  \"\$(CFG)\" == \"$IdeBlds{$Bld}\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   357
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   358
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   359
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   360
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   361
		"# PROP BASE Use_MFC 0\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   362
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   363
	if ($Bld=~/REL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   364
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   365
			"# PROP BASE Use_Debug_Libraries 0\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   366
			"# PROP BASE Output_Dir \".\\Win32_Un\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   367
			"# PROP BASE Intermediate_Dir \".\\Win32_Un\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   368
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   369
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   370
	elsif ($Bld=~/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   371
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   372
			"# PROP BASE Use_Debug_Libraries 1\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   373
			"# PROP BASE Output_Dir \".\\Win32_U0\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   374
			"# PROP BASE Intermediate_Dir \".\\Win32_U0\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   375
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   376
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   377
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   378
			"# PROP Use_MFC 0\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   379
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   380
	if ($Bld=~/REL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   381
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   382
			"# PROP Use_Debug_Libraries 0\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   383
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   384
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   385
	elsif ($Bld=~/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   386
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   387
			"# PROP Use_Debug_Libraries 1\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   388
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   389
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   390
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   391
		"# PROP Output_Dir \"$ChopRelPath\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   392
		"# PROP Intermediate_Dir \"$ChopBldPath\"\n",
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
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   396
		"# ADD CPP",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   397
		" /nologo",		# suppress "sign-on" banner message
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   398
		" /Zp4"	,		# packs structures on 4 byte boundaries
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   399
		" /GF"			# Pools strings and places them in read-only memory 
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
	$MSVCVer = &Winutl_MSVCVer;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   403
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   404
	if ($MSVCVer >= 7) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   405
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   406
			" /wd4996",			# C4996: 'xxxx' was declared deprecated
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   407
			" /wd4571"			# C4571: catch(...) blocks compiled with /EHs do not catch or re-throw Structured Exceptions
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   408
		);	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   409
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   410
		if (&main::Plat ne 'TOOLS') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   411
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   412
				" /EHsc",			# Exceptions on
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   413
				" /GR"				# RTTI on
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   414
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   415
			if ($MSVCVer >= 8) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   416
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   417
					" /GS-"			# Buffer checking off
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   418
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   419
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   420
		} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   421
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   422
				" /EHsc",			# Exceptions on
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   423
				" /GR",				# RTTI on
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   424
				" /GS"				# Buffer checking on
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   425
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   426
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   427
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   428
		if (&main::Plat ne 'TOOLS') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   429
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   430
					" /GX",				# Exceptions on
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   431
					" /GR"				# RTTI on
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   432
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   433
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   434
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   435
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   436
	if ($BasicTrgType=~/^EXE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   437
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   438
			' /MT'			# Creates a multi-threaded executable file, using libcmt.lib
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   439
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   440
		if ($Bld=~/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   441
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   442
				"d"			# i.e. /MTd, debug executable using debug version of libcmt
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   443
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   444
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   445
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   446
	elsif (($BasicTrgType=~/^(DLL|LIB)$/o) and (&main::Plat ne 'TOOLS')) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   447
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   448
			" /MD"			# Creates a multithreaded DLL, using MSVCRT.LIB
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   449
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   450
		if ($Bld=~/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   451
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   452
				"d"			# i.e. /MDd, debug executable using debug version of msvcrt
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
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   456
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   457
	if ($MSVCVer >= 8) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   458
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   459
			" /Zc:wchar_t-"				# Don't make wchar_t a built-in; breaks mangled names
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   460
		);		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   461
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   462
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   463
	if (($MSVCVer >= 7) || (&main::Plat ne 'TOOLS')) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   464
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   465
			" /W4"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   466
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   467
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   468
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   469
	if ($Bld=~/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   470
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   471
			" /Zi",		# Generates complete debugging information
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   472
			" /Od"		# Disables optimization
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   473
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   474
#		euser change to apply inlining on the _NAKED functions
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   475
		if ($BaseTrg=~/^EUSER$/oi) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   476
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   477
				' /Ob1'	# Specific control of expension of inline functions
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
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   481
	elsif ($Bld=~/REL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   482
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   483
			' /O1'				# Creates small code
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   484
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   485
		if ($MSVCVer >= 8) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   486
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   487
				' /fp:strict'		# Improves floating-point consistency
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   488
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   489
		} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   490
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   491
				' /Op'				# Improves floating-point consistency
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   492
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   493
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   494
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   495
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   496
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   497
		"$NotUseWin32LibsFlag"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   498
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   499
	my @incList=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   500
	my $candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   501
	INCLOOP: foreach $candidate (@ChopUserIncPaths,@ChopSysIncPaths) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   502
		my $accepted;	# remove duplicates
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   503
		foreach $accepted (@incList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   504
			if ($candidate eq $accepted) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   505
				next INCLOOP;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   506
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   507
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   508
		push @incList, $candidate;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   509
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   510
			" /I \"$candidate\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   511
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   512
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   513
	foreach (@MacroList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   514
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   515
			" /D \"$_\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   516
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   517
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   518
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   519
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   520
   if($VariantFile){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   521
        my $VariantFileFileName  = Path_Split('FILE',$VariantFile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   522
        &main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   523
              " /FI\"$VariantFileFileName\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   524
              );
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   525
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   526
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   527
	if ($Bld=~/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   528
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   529
			" /FR /Fd\"$ChopRelPath\\$TrgPath$BaseTrg.PDB\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   530
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   531
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   532
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   533
		" /c\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   534
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   535
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   536
	if ($BasicTrgType=~/^DLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   537
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   538
			"# ADD MTL /nologo"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   539
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   540
		if ($Bld=~/REL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   541
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   542
				" /mktyplib203 /D"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   543
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   544
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   545
		elsif ($Bld=~/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   546
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   547
				" /D \"_DEBUG\" /mktyplib203"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   548
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   549
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   550
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   551
			" /win32\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   552
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   553
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   554
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   555
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   556
		"# ADD BASE RSC /l 0x809\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   557
		"# ADD RSC /l 0x809 /d"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   558
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   559
	if ($Bld=~/REL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   560
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   561
			" \"NDEBUG\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   562
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   563
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   564
	elsif ($Bld=~/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   565
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   566
			" \"_DEBUG\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   567
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   568
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   569
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   570
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   571
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   572
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   573
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   574
		"BSC32=bscmake.exe\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   575
		"# ADD BSC32 /nologo\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   576
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   577
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   578
	if ($BasicTrgType=~/^(DLL|EXE)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   579
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   580
			"LINK32=link.exe\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   581
			"# ADD BASE LINK32 /machine:IX86\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   582
			"# ADD LINK32"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   583
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   584
		unless (&main::Plat eq 'TOOLS') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   585
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   586
				" \"$ChopStatLinkPath\\$FirstLib\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   587
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   588
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   589
			unless ($newlib) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   590
				if ( main::SystemTrg() ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   591
					# System targets are PDD, LDD, VAR, KEXT and KDLL.
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
						" \"$ChopStatLinkPath\\$NewKernLib\""
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
				else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   598
					&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   599
						" \"$ChopStatLinkPath\\$NewLib\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   600
					);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   601
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   602
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   603
			else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   604
				&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   605
					" \"$ChopStatLinkPath\\$newlib\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   606
				);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   607
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   608
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   609
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   610
	elsif ($BasicTrgType=~/^LIB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   611
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   612
			"LIB32=link.exe -lib\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   613
			"# ADD BASE LIB32 /machine:IX86\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   614
			"# ADD LIB32"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   615
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   616
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   617
	foreach (@Win32LibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   618
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   619
			" \"",lc $_,"\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   620
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   621
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   622
	foreach (@StatLibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   623
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   624
			" \"$ChopStatLinkPath\\",lc $_,"\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   625
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   626
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   627
	foreach (@LibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   628
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   629
			" \"$ChopLinkPath\\",lc $_,"\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   630
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   631
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   632
	if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   633
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   634
			" \"$ChopBldPath\\$ExportLibrary.exp\""
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(' /nologo');
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   638
	if ($BasicTrgType=~/^(DLL|EXE)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   639
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   640
			" /fixed:no $BaseAddressFlag"
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
	if (&main::HeapSize) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   644
		my %HeapSize=&main::HeapSize;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   645
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   646
			' /heap:',$HeapSize{Max},',',$HeapSize{Min}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   647
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   648
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   649
	if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   650
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   651
			' /noentry /dll'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   652
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   653
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   654
	elsif ($BasicTrgType=~/^EXE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   655
		unless (&main::Plat eq 'TOOLS') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   656
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   657
				' /entry:"?_E32Bootstrap@@YGXXZ"'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   658
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   659
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   660
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   661
	if (&main::Plat=~/^(WINC|TOOLS)$/o && $BasicTrgType=~/^EXE$/o) { # shouldn't really have WINC mentioned here
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   662
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   663
			' /subsystem:console'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   664
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   665
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   666
	else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   667
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   668
			' /subsystem:windows'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   669
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   670
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   671
	if ($BasicTrgType=~/^(DLL|EXE)$/o && $Bld=~/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   672
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   673
#			pdb needs specifying here to be the same as the default applied in command-line builds
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   674
			" /pdb:\"$ChopRelPath\\$TrgPath$BaseTrg.pdb\" /debug"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   675
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   676
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   677
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   678
		' /machine:IX86',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   679
		' /ignore:4089',		# LNK4089: all references to "dynamic-link library" discarded by /OPT:REF
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   680
		' /ignore:4005'			# LNK4005: no objects used from XXX
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   681
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   682
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   683
	if ($MSVCVer >= 7) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   684
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   685
			' /ignore:4210'	# LNK4210: .CRT section exists; there may be unhandled static initializers or terminators
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   686
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   687
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   688
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   689
	my $EntrySymbol='';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   690
	unless (&main::Plat eq 'TOOLS') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   691
		if ($BasicTrgType=~/^EXE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   692
			my $debug = '';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   693
			if ($Bld =~ /DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   694
				$debug .= 'd';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   695
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   696
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   697
				" /nodefaultlib:libcmt$debug.lib"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   698
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   699
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   700
		if ($BasicTrgType=~/^DLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   701
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   702
				" /include:\"__E32Dll\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   703
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   704
			$EntrySymbol='_E32Dll';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   705
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   706
		elsif ($BasicTrgType=~/^EXE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   707
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   708
				" /include:\"__E32Startup\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   709
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   710
			$EntrySymbol='_E32Startup';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   711
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   712
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   713
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   714
			' /ignore:4098'	# LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   715
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   716
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   717
	my $AbsentSubst = '';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   718
	if ($EntrySymbol) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   719
		$AbsentSubst = " -absent $EntrySymbol";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   720
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   721
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   722
		" /out:\"$ChopRelPath\\$TrgPath$Trg\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   723
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   724
	if ($MSVCVer <= 7) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   725
		if ($BasicTrgType=~/^(DLL|EXE)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   726
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   727
				' /WARN:3'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   728
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   729
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   730
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   731
	if ($BasicTrgType=~/^(DLL|EXE)$/o && $Bld=~/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   732
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   733
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   734
			"# SUBTRACT LINK32 /pdb:none"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   735
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   736
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   737
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   738
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   739
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   740
	if (&main::Plat eq 'TOOLS' and $BasicTrgType eq 'EXE') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   741
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   742
			"# Begin Special Build Tool\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   743
			"PostBuild_Cmds=copy \"$ChopRelPath\\$TrgPath$Trg\" \"",&main::EPOCToolsPath,"$Trg\" \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   744
			"# End Special Build Tool\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   745
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   746
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   747
	if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   748
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   749
			"# Begin Special Build Tool\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   750
			"SOURCE=\$(InputPath)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   751
			"PreLink_Cmds=echo Doing first-stage link by name\\\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   752
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   753
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   754
			"\tnmake -nologo -f \"${PathBaseDsp}.SUP.MAKE\" PRELINK$Bld\\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   755
			"\tif errorlevel 1 nmake -nologo -f \"${PathBaseDsp}.SUP.MAKE\" STOPLINK$Bld \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   756
			"PostBuild_Cmds=nmake -nologo -f \"${PathBaseDsp}.SUP.MAKE\" POSTBUILD$Bld\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   757
			"# End Special Build Tool\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   758
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   759
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   760
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   761
#		append to the supplementary makefile for each build
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   762
		$SupText.=join('',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   763
			"# BUILD - $Bld\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   764
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   765
			"LIBS="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   766
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   767
		foreach (@StatLibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   768
			$SupText.=" \\\n\t\"\$(EPOCSTATLINK$Bld)\\$_\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   769
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   770
		foreach (@LibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   771
			$SupText.=" \\\n\t\"\$(EPOCLINK$Bld)\\$_\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   772
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   773
		$SupText.="\n\nLINK_OBJS=";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   774
		foreach (@BaseSrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   775
			$SupText.=" \\\n\t\"\$(EPOCBLD$Bld)\\$_.obj\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   776
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   777
		if ($Win32Resrc) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   778
			$SupText.=" \\\n\t\"\$(EPOCBLD$Bld)\\".&main::Path_Split('Base',$Win32Resrc).".res\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   779
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   780
		$SupText.="\n\nSTAGE1_LINK_FLAGS=\"\$(EPOCSTATLINK$Bld)\\$FirstLib\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   781
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   782
		unless ($newlib) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   783
			if ( main::SystemTrg() ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   784
				# System targets are PDD, LDD, VAR, KEXT and KDLL.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   785
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   786
				$SupText.=" \"\$(EPOCSTATLINK$Bld)\\$NewKernLib\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   787
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   788
			else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   789
				$SupText.=" \"\$(EPOCSTATLINK$Bld)\\$NewLib\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   790
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   791
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   792
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   793
			$SupText.=" \"\$(EPOCSTATLINK$Bld)\\$newlib\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   794
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   795
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   796
		foreach (@Win32LibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   797
			$SupText.=' ';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   798
			$SupText.=lc $_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   799
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   800
		$SupText.=" \\\n \$(LIBS) /nologo$BaseAddressFlag /noentry /dll /subsystem:windows";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   801
		if ($Bld=~/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   802
			$SupText.=' /debug';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   803
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   804
		$SupText.=" \\\n /incremental:no /machine:IX86 /ignore:4089";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   805
		if ($BasicTrgType=~/^EXE$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   806
			my $debug = '';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   807
			if ($Bld =~ /DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   808
				$debug .= 'd';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   809
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   810
			$SupText .= " /nodefaultlib:libcmt$debug.lib";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   811
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   812
		if ($MSVCVer >= 7) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   813
			$SupText .=  " /ignore:4210";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   814
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   815
		if ($BasicTrgType=~/^DLL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   816
			$SupText.=" /include:\"__E32Dll\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   817
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   818
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   819
			$SupText.=" /include:\"__E32Startup\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   820
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   821
		if ($BasicTrgType=~/^(DLL)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   822
			$SupText.=" /implib:\"\$(EPOCBLD$Bld)\\$ExportLibrary.lib\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   823
		} elsif ($BasicTrgType=~/^(EXE)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   824
			$SupText.=" /implib:\"\$(EPOCBLD$Bld)\\$ExportLibrary.exe.lib\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   825
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   826
		$SupText.=join('',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   827
			' /ignore:4089',		# LNK4089: all references to "dynamic-link library" discarded by /OPT:REF
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   828
			' /ignore:4005'			# LNK4005: no objects used from XXX
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   829
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   830
		if ($MSVCVer >= 7) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   831
			$SupText.=" /ignore:4210";		# LNK4210: .CRT section exists; there may be unhandled static initializers or terminators
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   832
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   833
		$SupText.=" /out:\"\$(EPOCBLD$Bld)\\$Trg\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   834
		if ($MSVCVer < 7) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   835
			$SupText .= " /WARN:3";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   836
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   837
		$SupText.="\n\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   838
		$SupText.="PRELINK$Bld : \$(LINK_OBJS)";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   839
		if (-e $DefFile) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   840
			$SupText.=" \"$DefFile\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   841
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   842
		unless (&main::Plat eq 'TOOLS') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   843
			$SupText.=" \"\$(EPOCSTATLINK$Bld)\\$FirstLib\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   844
			
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   845
			unless ($newlib) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   846
				if ( main::SystemTrg() ) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   847
					# System targets are PDD, LDD, VAR, KEXT and KDLL.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   848
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   849
					$SupText.=" \"\$(EPOCSTATLINK$Bld)\\$NewKernLib\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   850
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   851
				else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   852
					$SupText.=" \"\$(EPOCSTATLINK$Bld)\\$NewLib\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   853
				}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   854
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   855
			else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   856
				$SupText.=" \"\$(EPOCSTATLINK$Bld)\\$newlib\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   857
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   858
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   859
		$SupText.=" \$(LIBS)\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   860
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   861
#		Link by name first time round for dlls
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   862
		$SupText.=join('',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   863
			"\tlink.exe \@<<\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   864
			"\t\t\$(STAGE1_LINK_FLAGS) \$(LINK_OBJS)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   865
			"<<\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   866
			"\tdel \"\$(EPOCBLD$Bld)\\$Trg\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   867
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   868
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   869
		if ($BasicTrgType=~/^(DLL)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   870
			$SupText.="\tdel \"\$(EPOCBLD$Bld)\\$ExportLibrary.exp\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   871
		} elsif ($BasicTrgType=~/^(EXE)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   872
			$SupText.="\tdel \"\$(EPOCBLD$Bld)\\$ExportLibrary.exe.exp\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   873
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   874
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   875
#		Generate an export info file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   876
		if ($BasicTrgType=~/^(DLL)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   877
			$SupText.=join('',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   878
				"\tdumpbin /exports /out:\"\$(EPOCBLD$Bld)\\$ExportLibrary.inf\" \"\$(EPOCBLD$Bld)\\$ExportLibrary.lib\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   879
				"\tdel \"\$(EPOCBLD$Bld)\\$ExportLibrary.lib\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   880
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   881
		} elsif ($BasicTrgType=~/^(EXE)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   882
			$SupText.=join('',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   883
				"\tdumpbin /exports /out:\"\$(EPOCBLD$Bld)\\$ExportLibrary.inf\" \"\$(EPOCBLD$Bld)\\$ExportLibrary.exe.lib\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   884
				"\tdel \"\$(EPOCBLD$Bld)\\$ExportLibrary.exe.lib\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   885
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   886
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   887
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   888
#		call makedef to reorder the export information
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   889
#		call perl on the script here so nmake will die if there are errors - this doesn't happen if calling perl in a batch file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   890
		$SupText.="\tperl -S makedef.pl $AbsentSubst -Inffile \"\$(EPOCBLD$Bld)\\$ExportLibrary.inf\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   891
		if (-e $DefFile) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   892
			$SupText.=" -Frzfile \"$DefFile\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   893
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   894
		# freeze ordinals, a maximum of 2, for polymorphic dlls
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   895
		my $Ordinal;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   896
		my $Num=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   897
		foreach $Ordinal (&main::Exports) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   898
#			replace "$" with "$$" so that NMAKE doesn't think there's a macro in the function name
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   899
			$Ordinal=~s-\$-\$\$-go;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   900
			$SupText.=" -$Num $Ordinal";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   901
			$Num++;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   902
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   903
		$SupText.=join('',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   904
			" \"\$(EPOCBLD)$ExportLibrary.def\" \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   905
			"\tdel \"\$(EPOCBLD$Bld)\\$ExportLibrary.inf\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   906
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   907
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   908
		# create the export object from the .DEF file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   909
		$SupText.="\tlib.exe  /nologo /machine:i386 /nodefaultlib /name:\"$Trg\" /def:\"\$(EPOCBLD)$ExportLibrary.def\" /out:\"\$(EPOCBLD$Bld)\\$ExportLibrary.lib\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   910
		if (&main::ExportUnfrozen) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   911
			$SupText.="\tcopy \"\$(EPOCBLD$Bld)\\$ExportLibrary.lib\" \"\$(EPOCLIB)UDEB\\$ExportLibrary.lib\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   912
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   913
		$SupText.=join('',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   914
			"\tdel \"\$(EPOCBLD$Bld)\\$ExportLibrary.lib\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   915
			"\t\@echo First-stage link successful\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   916
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   917
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   918
			"STOPLINK$Bld : DELEXPOBJ$Bld\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   919
			"\t\@echo Stopped the build by removing the export object,\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   920
			"\t\@echo if present, because the pre-link stage failed\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   921
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   922
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   923
			"POSTBUILD$Bld : DELEXPOBJ$Bld"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   924
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   925
		if ($DefFile and not &main::ExportUnfrozen) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   926
			$SupText.=" LIBRARY";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   927
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   928
		$SupText.=join('',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   929
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   930
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   931
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   932
			"DELEXPOBJ$Bld :\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   933
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   934
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   935
		if ($BasicTrgType=~/^(DLL)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   936
			$SupText.="\tif exist \"\$(EPOCBLD$Bld)\\$ExportLibrary.exp\" del \"\$(EPOCBLD$Bld)\\$ExportLibrary.exp\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   937
		} elsif ($BasicTrgType=~/^(EXE)$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   938
			$SupText.="\tif exist \"\$(EPOCBLD$Bld)\\$ExportLibrary.exe.exp\" del \"\$(EPOCBLD$Bld)\\$ExportLibrary.exe.exp\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   939
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   940
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   941
		$SupText.=join('',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   942
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   943
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   944
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   945
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   946
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   947
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   948
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   949
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   950
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   951
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   952
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   953
sub PMEndBldList {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   954
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   955
	# CLOSE THE !IF ... !ENDIF LOOP
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   956
	#------------------------------
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   957
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   958
		"!ENDIF \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   959
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   960
	);
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
sub PMStartSrcList {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   964
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   965
	my @BldList=&main::BldList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   966
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   967
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   968
		"# Begin Target\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   969
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   970
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   971
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   972
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   973
			"# Name \"".$IdeBlds{$_}."\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   974
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   975
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   976
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   977
		"# Begin Group \"Source Files\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   978
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   979
		"# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   980
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   981
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   982
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   983
sub PMResrcBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   984
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   985
	my $ResourceRef=&main::ResourceRef;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   986
	my $Resrc=ucfirst lc &main::Path_Split('File', $$ResourceRef{Source});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   987
	my $BaseResrc=&main::Path_Split('Base', $$ResourceRef{Source});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   988
	my $SrcPath=&main::Path_Split('Path', $$ResourceRef{Source});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   989
	my $TrgPath=&main::Path_Split('Path', $$ResourceRef{Trg});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   990
	my @LangList=($$ResourceRef{Lang});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   991
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   992
	my $inputpath="$SrcPath$Resrc";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   993
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   994
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   995
		"# Begin Source File\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   996
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   997
		"SOURCE=$inputpath\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   998
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   999
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1000
	my @BldList=&main::BldList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1001
	my $ChopBldPath=&main::Path_Chop(&main::BldPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1002
	my @ChopSysIncPaths=&main::Path_Chop(&main::SysIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1003
	my @ChopUserIncPaths=&main::Path_Chop(&main::UserIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1004
	my $DataPath=&main::DataPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1005
	my @DepList=&main::DepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1006
	my $PathBaseDsp=&main::MakeFilePath.&main::BaseMak;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1007
	my $PerlLibPath=&main::PerlLibPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1008
	my $RelPath=&main::RelPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1009
	my $ChopSrcPath=&main::Path_Chop($SrcPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1010
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1011
	my $ResrcHdr=join '', &main::EPOCIncPath(), $BaseResrc, '.RSG';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1012
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1013
	&main::OutFormat(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1014
		"USERDEP__$BaseResrc="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1015
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1016
	$SupText.="DEPEND=";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1017
	my $Dep;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1018
	foreach $Dep (@DepList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1019
		&main::OutFormat(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1020
			"\"$Dep\"\t"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1021
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1022
		$SupText.=" \\\n\t\"$Dep\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1023
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1024
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1025
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1026
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1027
	$SupText.="\n\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1028
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1029
	my $Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1030
	foreach $Bld (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1031
		my $ResrcTrgFullName="$RelPath$Bld\\$TrgPath$BaseResrc.r";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1032
		if ($Bld eq $BldList[0]) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1033
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1034
				'!IF'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1035
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1036
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1037
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1038
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1039
				'!ELSEIF'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1040
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1041
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1042
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1043
			"  \"\$(CFG)\" == \"$IdeBlds{$Bld}\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1044
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1045
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1046
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1047
			"# PROP Intermediate_Dir \"$ChopBldPath\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1048
			"# Begin Custom Build - Building resources from $Resrc\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1049
			"InputPath=$inputpath\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1050
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1051
			"BuildCmds= \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1052
			"\tnmake -nologo -f \"${PathBaseDsp}.SUP.MAKE\"\\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1053
			"  \"$ResrcTrgFullName\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1054
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1055
		$SupText.="\"$ResrcTrgFullName\" :";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1056
		my $Lang;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1057
		foreach $Lang (@LangList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1058
			if ($Lang eq 'SC') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1059
#				change to put dummy file in dependency list
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1060
				$SupText.=" \"$ResrcTrgFullName$Lang.dummy\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1061
				next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1062
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1063
			$SupText.=" \"$ResrcTrgFullName$Lang\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1064
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1065
		$SupText.="\n\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1066
		foreach $Lang (@LangList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1067
#			change to put dummy file in dependency list
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1068
			if ($Lang eq 'SC') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1069
				$SupText.="\"$ResrcTrgFullName$Lang.dummy\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1070
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1071
			else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1072
				$SupText.="\"$ResrcTrgFullName$Lang\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1073
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1074
			$SupText.=" : \"$SrcPath$Resrc\" \$(DEPEND)\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1075
			$SupText.="\tperl -S epocrc.pl -I \"$ChopSrcPath\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1076
			foreach (@ChopUserIncPaths) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1077
				$SupText.=" -I \"$_\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1078
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1079
			$SupText.=" -I-";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1080
			foreach (@ChopSysIncPaths) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1081
				$SupText.=" -I \"$_\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1082
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1083
			$SupText.=" -DLANGUAGE_$Lang -u \"$SrcPath$Resrc\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1084
			$SupText.=" -o\"$ResrcTrgFullName$Lang\" -h\"$SrcPath$BaseResrc.rs~\" -t\"\$(EPOCBLD$Bld)\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1085
# 			change because if a .RSC file is output then VC5 tries to link it to the main target as a Win32 resource file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1086
			if ($Lang eq 'SC') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1087
				$SupText.="\techo this is a dummy output file > \"$ResrcTrgFullName$Lang.dummy\"\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1088
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1089
			$SupText.=join('',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1090
				"\tperl -S ecopyfile.pl \"$SrcPath$BaseResrc.rs~\" \"$ResrcHdr\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1091
				"\tdel \"$SrcPath$BaseResrc.rs~\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1092
				"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1093
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1094
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1095
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1096
		foreach $Lang (@LangList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1097
#			change again to avoid VC5 linking the resource
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1098
			my $TmpLang=$Lang;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1099
			if ($TmpLang eq 'SC') {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1100
				$TmpLang.='.dummy';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1101
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1102
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1103
				"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1104
				"\"$ResrcTrgFullName$TmpLang\" : \$(SOURCE) \"\$(INTDIR)\"\\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1105
				" \"\$(OUTDIR)\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1106
				"   \$(BuildCmds)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1107
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1108
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1109
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1110
			"# End Custom Build\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1111
			"\n"
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
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1115
		"!ENDIF \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1116
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1117
		"# End Source File\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1118
	);
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
sub PMDoc {    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1122
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1123
	my $SrcPath=&main::SrcPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1124
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1125
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1126
		"# Begin Source File\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1127
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1128
		"SOURCE=",$SrcPath,ucfirst lc &main::Doc,"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1129
		"# PROP Exclude_From_Build 1\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1130
		"# End Source File\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1131
	);
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
sub PMStartSrc {    
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1135
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1136
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1137
		"# Begin Source File\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1138
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1139
		"SOURCE=",&main::SrcPath,ucfirst lc &main::Src,"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1140
		"# End Source File\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1141
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1142
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1143
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1144
sub PMSrcDepend {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1145
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1146
	# Generate user header list for this src, merge with list for all sources
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1147
	foreach (&main::DepList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1148
		$PrjHdrs{$_}='unusedval';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1149
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1150
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1151
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1152
sub PMEndSrcList {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1153
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1154
	my $BaseDsp=&main::BaseMak;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1155
	my $PathBaseDsp=&main::MakeFilePath.$BaseDsp;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1156
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1157
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1158
		"# End Group\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1159
		"# Begin Group \"Resource Files\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1160
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1161
		"# PROP Default_Filter \"ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1162
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1163
	if ($Win32Resrc) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1164
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1165
			"# Begin Source File\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1166
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1167
			"SOURCE=",ucfirst lc $Win32Resrc,"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1168
			"# End Source File\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1169
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1170
		# Generate user header list for this src, merge with list for all sources
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1171
		foreach (&main::Deps_GenDependsL($Win32Resrc)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1172
			$PrjHdrs{$_}='unusedval';
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1173
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1174
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1175
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1176
		"# End Group\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1177
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1178
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1179
	# Use the global %PrjHdrs Hash to produce user header listing
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1180
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1181
		"# Begin Group \"Header Files\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1182
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1183
		"# PROP Default_Filter \"h;hpp;hxx;hm;inl;fi;fd\"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1184
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1185
	foreach (keys %PrjHdrs) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1186
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1187
			"# Begin Source File\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1188
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1189
			"SOURCE=",&main::Path_Split('Path',$_),ucfirst lc &main::Path_Split('File',$_),"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1190
			"# End Source File\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1191
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1192
	}	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1193
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1194
		"# End Group\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1195
		"# End Target\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1196
		"# End Project\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1197
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1198
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1199
	&main::Path_DelFiles("$PathBaseDsp.MAK","$PathBaseDsp.MDP","$PathBaseDsp.NCB","$PathBaseDsp.OPT","$PathBaseDsp.PLG");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1200
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1201
#	Add target to supplementary makefile to recreate the workspace
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1202
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1203
#	This target is intended for use as a custom tool within the MSVC IDE, for regenerating
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1204
#	workspace once the .MMP file has been edited within the IDE.  To install the target as
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1205
#	a custom tool in the IDE, select Tools->Customise...->Tools, and choose a name for the
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1206
#	tool, e.g. "Recreate Workspace".  Next, type "nmake.exe" as the command and
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1207
#	"-nologo -f $(WkspDir)\$(WkspName).sup.make recreateworkspace" as the program arguments.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1208
#	Leave the "initial directory" field blank, and tick the "Close window on exiting" checkbox.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1209
#	Having edited the .MMP file for a project, select the new tool from the tools menu to
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1210
#	recreate the workspace.  If the commands have run correctly, you will be prompted to
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1211
#	reload the workspace.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1212
	$SupText.=join('',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1213
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1214
		"RECREATEWORKSPACE :\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1215
		'	cd ', &main::Path_Chop(&main::Path_WorkPath), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1216
		'	perl -S makmake.pl -D ', &main::MmpFile, ' ', &main::PlatName, "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1217
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1218
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1219
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1220
#	Create the supplementary makefile
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1221
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1222
	&main::CreateExtraFile(&main::MakeFilePath.&main::BaseMak.'.SUP.MAKE', $SupText);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1223
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1224
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1225
# create the .DSW file
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1226
	my $DswText=join(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1227
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1228
		"Microsoft Developer Studio Workspace File, Format Version 6.00",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1229
		'# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1230
		'',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1231
		'#'x79,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1232
		'',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1233
		"Project: \"$BaseDsp\"=.\\$BaseDsp.dsp - Package Owner=<4>",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1234
		'',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1235
		'Package=<5>',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1236
		'{{{',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1237
		'}}}',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1238
		'',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1239
		'Package=<4>',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1240
		'{{{',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1241
		'}}}',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1242
		'',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1243
		'#'x79,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1244
		'',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1245
		'Global:',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1246
		'',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1247
		'Package=<5>',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1248
		'{{{',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1249
		'}}}',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1250
		'',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1251
		'Package=<3>',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1252
		'{{{',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1253
		'}}}',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1254
		'',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1255
		'#'x79,
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1256
		''
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1257
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1258
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1259
	&main::CreateExtraFile("$PathBaseDsp.DSW",$DswText);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1260
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1261
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
  1262
1;