sbsv1/abld/platform/cl_vscw.pm
changeset 607 378360dbbdba
parent 599 fa7a3cc6effd
equal deleted inserted replaced
591:22486c9c7b15 607:378360dbbdba
       
     1 # Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 # All rights reserved.
       
     3 # This component and the accompanying materials are made available
       
     4 # under the terms of "Eclipse Public License v1.0"
       
     5 # which accompanies this distribution, and is available
       
     6 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 #
       
     8 # Initial Contributors:
       
     9 # Nokia Corporation - initial contribution.
       
    10 #
       
    11 # Contributors:
       
    12 #
       
    13 # Description:
       
    14 #
       
    15 
       
    16 
       
    17 package Cl_vscw;
       
    18 
       
    19 # declare variables global for module
       
    20 
       
    21 my @Win32LibList=();
       
    22 my $Win32StdHeaders;
       
    23 my $BaseAddressFlag;
       
    24 my $Win32Resrc;
       
    25 
       
    26 my $MWCC;
       
    27 my $MWLD;
       
    28 my $MWIncludePath;
       
    29 my $MWIncludeVar;
       
    30 
       
    31 # declare variables global for VS6
       
    32 my %IdeBlds=();
       
    33 my %PrjHdrs=();
       
    34 my $DspText='';
       
    35 my $VcprojText='';
       
    36 my $PlatName=&main::PlatName;
       
    37 my $guid='';
       
    38 
       
    39 require Exporter;
       
    40 @ISA=qw(Exporter);
       
    41 @EXPORT=qw(
       
    42 	PMHelp_Mmp
       
    43 
       
    44 	PMCheckPlatformL
       
    45 
       
    46 	PMPlatProcessMmp
       
    47 	
       
    48 	PMStartBldList
       
    49 		PMBld
       
    50 	PMStartSrcList
       
    51 		PMBitMapBld
       
    52 		PMResrcBld
       
    53 		PMAifBld
       
    54 		PMDoc
       
    55 		PMStartSrc
       
    56 		PMSrcDepend
       
    57 			PMSrcBldDepend
       
    58 			PMEndSrcBld
       
    59 		PMEndSrc
       
    60 	PMEndSrcList
       
    61 );
       
    62 
       
    63 use Winutl;
       
    64 use cl_generic;
       
    65 use E32Variant;
       
    66 use lockit_info;
       
    67 
       
    68 sub RoundUp1k($) {
       
    69 	# Accept C hexadecimal number (0xNNN).  Convert argument to Kb
       
    70 	# rounded up to the next 1kb boundary.
       
    71 	use integer;
       
    72 	return (hex($_[0]) + 1023) / 1024;
       
    73 }
       
    74 
       
    75 
       
    76 sub PMHelp_Mmp {
       
    77 	&Winutl_Help_Mmp;
       
    78 }
       
    79 
       
    80 sub SysTrg () {
       
    81 	return 1 if &main::SystemTrg;
       
    82 	my $ExportLibrary=&main::ExportLibrary;
       
    83 	return 1 if ($ExportLibrary =~ /EKERN/i);
       
    84 	my $Trg=&main::Trg;
       
    85 	return 1 if ($Trg =~ /KSRT/i);
       
    86 	return 0;
       
    87 }
       
    88 
       
    89 sub PMCheckPlatformL {
       
    90 
       
    91 	# check version of CodeWarrior for Symbian OS
       
    92 	
       
    93 	if (defined($ENV{MWCSym2Includes})) {
       
    94 		$MWCC = "mwccsym2.exe";
       
    95 		$MWLD = "mwldsym2.exe";
       
    96 	}
       
    97 	if (!defined($MWCC) && defined($ENV{MWSym2Libraries})) {
       
    98 		$MWCC = "mwccsym2.exe";
       
    99 		$MWLD = "mwldsym2.exe";
       
   100 	}
       
   101 	if (!defined($MWCC) && defined($ENV{CWFolder})) {
       
   102 		$MWCC = "mwcc.exe";
       
   103 		$MWLD = "mwld.exe";
       
   104 	}
       
   105 	if (!defined($MWCC)) {
       
   106 		die "ERROR: Unable to identify a valid CodeWarrior for Symbian OS installation\n";
       
   107 	}
       
   108 	
       
   109 	# determine default include path
       
   110 	
       
   111 	$MWIncludeVar = 'MWCIncludes';	# default, even if it doesn't exist
       
   112 	$MWIncludePath = '';			# default is empty
       
   113 	
       
   114 	foreach my $var ('MWCSym2Includes','MWCWinx86Includes','MWCIncludes') {
       
   115 		if (defined($ENV{$var})) {
       
   116 			$MWIncludePath = $ENV{$var};
       
   117 			$MWIncludeVar = $var;
       
   118 			last;
       
   119 		}
       
   120 	}
       
   121 }
       
   122 
       
   123 sub PMPlatProcessMmp (@) {
       
   124 	&Winutl_DoMmp(\@_, $MWIncludePath);
       
   125 	$BaseAddressFlag=&Winutl_BaseAddress;
       
   126 	if ($BaseAddressFlag ne "") {
       
   127 		$BaseAddressFlag=" -imagebase \"$BaseAddressFlag\"";
       
   128 	}
       
   129 	@Win32LibList=&Winutl_Win32LibList;
       
   130 	$Win32Resrc=&Winutl_Win32Resrc;
       
   131 	$Win32StdHeaders=&Winutl_Win32StdHeaders;
       
   132 }
       
   133 
       
   134 sub PMStartBldList($) {
       
   135 	my ($makecmd) = @_;
       
   136 	my $AifStructRef=&main::AifStructRef;
       
   137 	my $BaseTrg=&main::BaseTrg;
       
   138 	my $BitMapStructRef=&main::BitMapStructRef;
       
   139 	my @BldList=&main::BldList;
       
   140 	my @ChopSysIncPaths=&main::Path_Chop(&main::SysIncPaths);
       
   141 	my @ChopUserIncPaths=&main::Path_Chop(&main::UserIncPaths);
       
   142 	my $ExportLibrary=&main::ExportLibrary;
       
   143 	my $NoExportLibrary=&main::NoExportLibrary;
       
   144 	my $DefFile=&main::DefFile;
       
   145 	my $BasicTrgType=&main::BasicTrgType;
       
   146 	my $LibPath=&main::LibPath;
       
   147 	my @MacroList=&main::MacroList();
       
   148 	push @MacroList, "__SUPPORT_CPP_EXCEPTIONS__";
       
   149 	my $VariantFile=&main::VariantFile();
       
   150 	my $ResourceStructRef=&main::ResourceStructRef;
       
   151 	my $Plat=&main::Plat;
       
   152 	my $Trg=&main::Trg;
       
   153 	my $TrgType=&main::TrgType;
       
   154 	my $WarningLevel=&main::CompilerOption("CW");
       
   155 	my $LinkAs=&main::LinkAs;
       
   156 
       
   157 	&main::Output(
       
   158 			"PATH=$ENV{EPOCROOT}epoc32\\tools\\;$ENV{PATH}",
       
   159 			"\n",
       
   160 			"Path=\$(PATH)",
       
   161 			"\n"
       
   162 			);
       
   163 
       
   164 # Get the drive letter to call the Lada compiler to call it with absolute path
       
   165 	&main::Output(
       
   166 			"COMPILER_PATH=\"$ENV{EPOCROOT}epoc32\\tools\\nokia_compiler\\Symbian_Tools\\Command_Line_Tools\\\"",
       
   167 			"\n"
       
   168 	);
       
   169 
       
   170 	Generic_Header(0,$makecmd);	# define standard things using absolute paths
       
   171 
       
   172 	my $TrgDir="";
       
   173 	my $AifTrgDir="";
       
   174 	if (&Generic_Definition("TRGDIR") ne "") {
       
   175 		$TrgDir="\$(TRGDIR)\\";
       
   176 		$AifTrgDir=$TrgDir;
       
   177 	}
       
   178 
       
   179 # Handle migration of binaries to secure location
       
   180 
       
   181 	&Winutl_AdjustTargetPath(\$TrgDir);
       
   182 	
       
   183 # Change - mwwinrc.exe uses MWWinx86Includes or MWCIncludes, but some installations
       
   184 # fail to install either. Set MWCIncludes from the chosen variable as part
       
   185 # of the Makefile.
       
   186 	if (!defined($ENV{MWCIncludes}) && $MWIncludeVar ne 'MWCIncludes') {
       
   187 		&main::Output(
       
   188 			"\n",
       
   189 			"MWCIncludes:=\$($MWIncludeVar)\n",
       
   190 			"export MWCIncludes\n",
       
   191 			"\n"
       
   192 		);
       
   193 	}
       
   194 
       
   195 	my $CompilerLibPath="$ENV{EPOCROOT}epoc32\\tools\\nokia_compiler\\Symbian_Support\\Runtime\\Runtime_x86\\Runtime_Win32\\Libs;$ENV{EPOCROOT}epoc32\\tools\\nokia_compiler\\Symbian_Support\\Win32-x86 Support\\Libraries\\Win32 SDK";
       
   196 	&main::Output(
       
   197 			"\n",
       
   198 		"MWLibraries:=\+$CompilerLibPath\n",
       
   199 		"export MWLibraries\n",
       
   200 		"\n"
       
   201 		);
       
   202 	&main::Output(
       
   203 			"\n",
       
   204 		"MWLibraryFiles:=gdi32.lib;user32.lib;kernel32.lib;\n",
       
   205 		"export MWLibraryFiles\n",
       
   206 		"\n"
       
   207 		);
       
   208 	
       
   209 	&main::Output(
       
   210 		"# EPOC DEFINITIONS\n",
       
   211 		"\n",
       
   212 		"INCDIR  = -cwd source -i-"
       
   213 	);
       
   214 	foreach (@ChopUserIncPaths,@ChopSysIncPaths) {
       
   215 		&main::Output(
       
   216 			" \\\n -i \"$_\""
       
   217 		);
       
   218 	}
       
   219 	use Pathutl;
       
   220 	if($VariantFile){
       
   221 	    my $variantFilePath = Path_Split('Path',$VariantFile);
       
   222 	    $VariantFile  = Path_Split('FILE',$VariantFile);
       
   223 	    # workaround for codewarrior defect:
       
   224 	    # codewarrior at the moment doesn't accept an absolute path with the
       
   225 	    # the -include option unless it contains a drive letter, this is solved
       
   226 	    # by including the directory and the file separately
       
   227 	    &main::Output("\\\n -i \"$variantFilePath \" -include \"$VariantFile\"");
       
   228 	}
       
   229 	&main::Output(
       
   230 		"\n",
       
   231 		"\n"
       
   232 	);
       
   233 
       
   234 	&main::Output(
       
   235 		"CWFLAGS =",
       
   236 		" -wchar_t off",	# do not treat wchar_t as a predefined type
       
   237 		" -align 4",		# long alignment
       
   238 		" -warnings on",	# selection of warnings
       
   239 		" -w nohidevirtual",	# turn off "hides inherited virtual function" warning
       
   240 		   ",nounusedexpr",	# turn off "expression has no side effect" warning
       
   241 		" -enum int",		# use int for enumeration types
       
   242 		" -str pool",		# pool strings into a single data object
       
   243 		" -exc ms",			# SEH C++ exception implementation
       
   244 		" $WarningLevel"		
       
   245 	
       
   246 	);
       
   247 	if ($Win32StdHeaders or &main::Plat eq 'TOOLS') {
       
   248 		&main::Output(
       
   249 			" -stdinc"		# insist because mwccsym2 has -nostdinc as the default(?)
       
   250 		);
       
   251 	}
       
   252 	else {
       
   253 		&main::Output(
       
   254 			" -nostdinc"	# insist because mwcc has -stdinc as the default.
       
   255 		);
       
   256 	}
       
   257 	&main::Output(
       
   258 		"\n",
       
   259 		"\n"
       
   260 	);
       
   261 
       
   262 	&main::Output(
       
   263 		"CWDEFS  = "
       
   264 	);
       
   265 	foreach(@MacroList) {
       
   266 		&main::Output(
       
   267 			" -d \"$_\""
       
   268 		);
       
   269 	}
       
   270 	&main::Output(
       
   271 		" \$(USERDEFS)\n",
       
   272 		"\n"
       
   273 	);
       
   274 
       
   275 	foreach (@BldList) {
       
   276 		&main::Output(
       
   277 			"CW$_ = perl -S err_formatter.pl \$(COMPILER_PATH)$MWCC -msgstyle parseable "
       
   278 		);
       
   279 		if (/DEB$/o) {
       
   280 
       
   281 			if($PlatName eq "VS6") {
       
   282 				&main::Output(
       
   283 					' -sym codeview'
       
   284 				);
       
   285 			}
       
   286 			else
       
   287 			{
       
   288 				&main::Output(
       
   289 					' -sym codeview_new'
       
   290 				);
       
   291 			}
       
   292 
       
   293 
       
   294 #			euser change to apply inlining on the _NAKED functions
       
   295 			if ($BaseTrg!~/^EUSER$/oi) {
       
   296 				&main::Output(
       
   297 					' -inline off'
       
   298 				);
       
   299 			}	
       
   300 		}
       
   301 		elsif (/REL$/o) {
       
   302 			&main::Output(
       
   303 				' -O4,s'	# highest level of optimisation, optimise for space
       
   304 			);
       
   305 		}
       
   306 		&main::Output(
       
   307 			' $(CWFLAGS)'
       
   308 		);
       
   309 		foreach (&main::MacroList($_)) {
       
   310 			&main::Output(
       
   311 				" -d $_"
       
   312 			);
       
   313 		}
       
   314 		&main::Output(
       
   315 			" \$(CWDEFS) \$(INCDIR)\n"
       
   316 		);
       
   317 	}
       
   318 	&main::Output(
       
   319 		"\n",
       
   320 		"\n"
       
   321 	);
       
   322 	
       
   323 	foreach (@BldList) {
       
   324 		&main::Output(
       
   325 			"$_ :"
       
   326 		);
       
   327 
       
   328 		if ($BasicTrgType !~ /IMPLIB/io) {
       
   329 			&main::Output (
       
   330 				" \\\n",
       
   331 				"\t", &Generic_Quote("\$(EPOCTRG$_)\\$TrgDir$Trg")
       
   332 			);
       
   333 			if (&Winutl_CopyForStaticLinkage) {
       
   334 				&main::Output(
       
   335 					" \\\n",
       
   336 					"\t", &Generic_Quote("\$(EPOCTRG$_)\\$Trg")
       
   337 				);
       
   338 			}
       
   339 		}
       
   340 
       
   341 #		lib has to come after the main target so that a .DEF file will be generated if the project is not frozen
       
   342 		if ($DefFile and not &main::ExportUnfrozen) {
       
   343 			&main::Output(
       
   344 				" \\\n",
       
   345 				"\tLIBRARY\n"
       
   346 			);
       
   347 		}
       
   348 		&main::Output(
       
   349 			"\n",
       
   350 			"\n"
       
   351 		);
       
   352 	}
       
   353 
       
   354 	foreach (@BldList) {
       
   355 		my $makework="MAKEWORK$_";
       
   356 		&main::Output(
       
   357 			"\n",
       
   358 			"RESOURCE$_ : $makework"
       
   359 		);
       
   360 
       
   361 		my $BitMapRef;
       
   362 		foreach $BitMapRef (@$BitMapStructRef) {
       
   363 			my $file="\$(EPOCTRG$_)\\$$BitMapRef{TrgPath}$$BitMapRef{Trg}";
       
   364 			&Generic_MakeWorkFile($makework,$file);
       
   365 			&main::Output(
       
   366 				" \\\n",
       
   367 				"\t", &Generic_Quote($file)
       
   368 			);
       
   369 		}
       
   370 		undef $BitMapRef;
       
   371 
       
   372 		my $ResourceRef;
       
   373 		foreach $ResourceRef (@$ResourceStructRef) {
       
   374 			my $file="\$(EPOCTRG$_)\\$$ResourceRef{Trg}";
       
   375 			&Generic_MakeWorkFile($makework,$file);
       
   376 			&main::Output(	# must come before main target because source for target will depend on the
       
   377 			" \\\n",		# *.rsg file in $EPOCIncPath
       
   378 			"\t", &Generic_Quote("$file")
       
   379 			);
       
   380 		}
       
   381 		undef $ResourceRef;
       
   382 
       
   383 		my $AifRef;
       
   384 		foreach $AifRef (@$AifStructRef) {
       
   385 			my $file="\$(EPOCTRG$_)\\$AifTrgDir$$AifRef{Trg}";
       
   386 			&Generic_MakeWorkFile($makework,$file);
       
   387 			&main::Output(
       
   388 				" \\\n",
       
   389 				"\t", &Generic_Quote($file)
       
   390 			);
       
   391 		}
       
   392 		undef $AifRef;
       
   393 
       
   394 		&main::Output(
       
   395 			"\n"
       
   396 		);
       
   397 	}
       
   398 	&main::Output(
       
   399 		"\n",
       
   400 		"\n",
       
   401 	);
       
   402 
       
   403 	&main::Output(
       
   404 		"\n",
       
   405 		"# REAL TARGET - LIBRARY\n",
       
   406 		"\n",
       
   407 		"LIBRARY : MAKEWORKLIBRARY"
       
   408 	);
       
   409 	if ($BasicTrgType=~/^LIB$/o) {
       
   410 #		code to ensure that the static libraries for all builds are built at the library stage
       
   411 		foreach (@BldList) {
       
   412 			&main::Output(
       
   413 				" $_"
       
   414 			);
       
   415 		}
       
   416 	}
       
   417 	elsif ($DefFile and !$NoExportLibrary) {
       
   418 		unless (&main::ExportUnfrozen) {
       
   419 			if (-e $DefFile) { # effectively "if project frozen ..."
       
   420 				my $LibLinkAs = ($BasicTrgType=~/^IMPLIB$/io) ? $LinkAs : $Trg;
       
   421 				&main::Output(
       
   422 					" ", &Generic_Quote("\$(EPOCLIB)\\UDEB\\$ExportLibrary.lib"), "\n",
       
   423 					"\n",
       
   424 					&Generic_Quote("\$(EPOCLIB)\\UDEB\\$ExportLibrary.lib"), " : ",
       
   425 					&Generic_Quote($DefFile), "\n",
       
   426 					"\tperl -S prepdef.pl ",&Generic_Quote($DefFile)," \"\$(EPOCBLD)\\$ExportLibrary.prep.def\"\n",
       
   427 					"\t\$(COMPILER_PATH)$MWLD -msgstyle gcc \"\$(EPOCBLD)\\$ExportLibrary.prep.def\" -importlib -o \$\@",
       
   428 					" -addcommand \"out:$LibLinkAs\" -warnings off",
       
   429 					"\n"
       
   430 				);
       
   431 			} else {
       
   432 				&main::Output(
       
   433 					"\n",
       
   434 					"\t\@echo WARNING: Not attempting to create \"\$(EPOCLIB)\\UDEB\\$ExportLibrary.lib\".\n",
       
   435 					"\t\@echo When exports are frozen in \"$DefFile\", regenerate Makefile.\n"
       
   436 				);
       
   437 			}
       
   438 		} else {
       
   439 			&main::Output(
       
   440 				"\n",
       
   441 				"\t\@echo Not attempting to create \"\$(EPOCLIB)\\UDEB\\$ExportLibrary.lib\"\n",
       
   442 				"\t\@echo from frozen .DEF file, since EXPORTUNFROZEN specified.\n"
       
   443 			);
       
   444 		}
       
   445 	}
       
   446 	&main::Output(
       
   447 		"\n",
       
   448 		"\n",
       
   449 		"FREEZE :\n"
       
   450 	);
       
   451 	if ($DefFile and $BasicTrgType!~/^IMPLIB$/io) {
       
   452 		&main::Output(
       
   453 #			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
       
   454 			"\tperl -S efreeze.pl \$(EFREEZE_ALLOW_REMOVE) \"$DefFile\" \"\$(EPOCBLD)\\$ExportLibrary.def\" \n"
       
   455 		);
       
   456 	}
       
   457 	&main::Output(
       
   458 		"\n",
       
   459 		"CLEANLIBRARY :\n"
       
   460 	);
       
   461 	if ($DefFile and !$NoExportLibrary) {
       
   462 		&main::Output(
       
   463 			"\t-\$(ERASE) \"\$(EPOCLIB)\\UDEB\\$ExportLibrary.lib\"\n"
       
   464 		);
       
   465 	}
       
   466 	&main::Output(
       
   467 		"\n"
       
   468 	);
       
   469 	&Generic_MakeWorkDir('MAKEWORKLIBRARY',"${LibPath}UDEB");
       
   470 
       
   471 	&Generic_Releaseables;
       
   472 
       
   473 	if($PlatName eq "VS6") {
       
   474 		VS6StartBldList();
       
   475 	}
       
   476 	elsif($PlatName eq "VS2003") 
       
   477 	{
       
   478 		VS2003StartBldList();
       
   479 	}
       
   480 
       
   481 }
       
   482 
       
   483 sub VS6StartBldList(){
       
   484 	my $BaseTrg=&main::BaseTrg;
       
   485 	my @BldList=&main::BldList;
       
   486 	my $Plat=&main::Plat;
       
   487 
       
   488 	# set up global IDE builds variable
       
   489 	%IdeBlds= (
       
   490 		UREL=> "$BaseTrg - Win32 Release",
       
   491 		UDEB=> "$BaseTrg - Win32 Debug",
       
   492 	);
       
   493 	if (&main::Plat eq 'TOOLS') {
       
   494 		%IdeBlds= (
       
   495 			REL=> "$BaseTrg - Win32 Release",
       
   496 			DEB=> "$BaseTrg - Win32 Debug",
       
   497 		);
       
   498 	}
       
   499 	
       
   500 
       
   501 	$DspText=join('',
       
   502 		"# Microsoft Developer Studio Project File - Name=\"$BaseTrg\" - Package Owner=<4>\n",
       
   503 		"# Microsoft Developer Studio Generated Build File, Format Version 6.00\n",
       
   504 		"# ** DO NOT EDIT **\n",
       
   505 		"\n"
       
   506 	);
       
   507 
       
   508 	$DspText.=join('',
       
   509 		"# TARGTYPE \"Win32 (x86) External Target\" 0x0106\n",
       
   510 		"\n",
       
   511 		"CFG=",$IdeBlds{$BldList[0]},"\n",
       
   512 		"!MESSAGE This is not a valid makefile. To build this project using NMAKE,\n",
       
   513 		"!MESSAGE use the Export Makefile command and run\n",
       
   514 		"!MESSAGE \n",
       
   515 		"!MESSAGE NMAKE /f \"",$BaseTrg,".mak\".\n",
       
   516 		"!MESSAGE \n",
       
   517 		"!MESSAGE You can specify a configuration when running NMAKE\n",
       
   518 		"!MESSAGE by defining the macro CFG on the command line. For example:\n",
       
   519 		"!MESSAGE \n",
       
   520 		"!MESSAGE NMAKE /f \"",$BaseTrg,".mak\" CFG=\"".$IdeBlds{$BldList[0]}."\"\n",
       
   521 		"!MESSAGE \n",
       
   522 		"!MESSAGE Possible choices for configuration are:\n",
       
   523 		"!MESSAGE \n"
       
   524 	);
       
   525 	
       
   526 	foreach (reverse @BldList) {
       
   527 		$DspText.=join('',
       
   528 			"!MESSAGE \"",$IdeBlds{$_},"\" (based on \"Win32 (x86) External Target\")"
       
   529 		);
       
   530 		$DspText.="\n";
       
   531 	}
       
   532 
       
   533 	$DspText.=join('',
       
   534 		"!MESSAGE \n",
       
   535 		"\n"
       
   536 	);
       
   537 
       
   538 	# BEGIN THE PROJECT
       
   539 	#------------------
       
   540 	$DspText.=join('',
       
   541 		"# Begin Project\n",
       
   542 		"# PROP AllowPerConfigDependencies 0\n",
       
   543 		"# PROP Scc_ProjName \"\"\n",
       
   544 		"# PROP Scc_LocalPath \"\"\n",
       
   545 		"\n"
       
   546 	);
       
   547 
       
   548 }
       
   549 
       
   550 sub VS2003StartBldList(){
       
   551 	my $BaseTrg=&main::BaseTrg;
       
   552 	my @BldList=&main::BldList;
       
   553 	my $Plat=&main::Plat;
       
   554 
       
   555 	$guid = `uuidgen.exe`;
       
   556 	$guid =~ s/\n//g;
       
   557 	$guid = uc $guid;
       
   558 # set up global IDE builds variable
       
   559 	%IdeBlds= (
       
   560 		UREL=> "Release|Win32",
       
   561 		UDEB=> "Debug|Win32",
       
   562 	);
       
   563 	if ($Plat eq 'TOOLS') {
       
   564 		%IdeBlds= (
       
   565 			REL=> "Release|Win32",
       
   566 			DEB=> "Debug|Win32",
       
   567 		);
       
   568 	}
       
   569 	
       
   570 
       
   571 	$VcprojText=join('',
       
   572 		"<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n",
       
   573 		"<VisualStudioProject\n",
       
   574 		"\tProjectType=\"Visual C++\"\n",
       
   575 		"\tVersion=\"7.10\"\n",
       
   576 		"\tName=\"$BaseTrg\"\n",
       
   577 		"\tProjectGUID=\"{$guid}\"\n",
       
   578 		"\tSccProjectName=\"\"\n",
       
   579 		"\tSccLocalPath=\"\"\n",
       
   580 		"\tKeyword=\"MakeFileProj\">\n",
       
   581 		"\t<Platforms>\n",
       
   582 		"\t\t<Platform\n",
       
   583 		"\t\t\tName=\"Win32\"/>\n",
       
   584 		"\t</Platforms>\n",
       
   585 		"\t<Configurations>\n",
       
   586 		"\n"
       
   587 	);
       
   588 
       
   589 }
       
   590 
       
   591 my $uidfile;
       
   592 sub PMBld {
       
   593 
       
   594 	my $AifStructRef=&main::AifStructRef;
       
   595 	my @SrcList=&main::SrcList;
       
   596 	my $BaseTrg=&main::BaseTrg;
       
   597 	my $BitMapStructRef=&main::BitMapStructRef;
       
   598 	my $Bld=&main::Bld;
       
   599 	my $ChopBldPath=&main::Path_Chop(&main::BldPath);
       
   600 	my $ExportLibrary=&main::ExportLibrary;
       
   601 	my $NoExportLibrary=&main::NoExportLibrary;
       
   602 	my $DefFile=&main::DefFile;
       
   603 	my $EPOCIncPath=&main::EPOCIncPath;
       
   604 	my $FirstLib=&main::FirstLib;
       
   605 	my $BasicTrgType=&main::BasicTrgType;
       
   606 	my @LibList;
       
   607 	my $RelPath=&main::RelPath;
       
   608 	my $ResourceStructRef=&main::ResourceStructRef;
       
   609 	my @StatLibList=&main::StatLibList;
       
   610 	my $Trg=&main::Trg;
       
   611 	my $TrgPath=&main::TrgPath;
       
   612 	my $TrgType=&main::TrgType;
       
   613 
       
   614 	$uidfile = "$BaseTrg.UID";
       
   615 
       
   616 	if ($Bld =~ /DEB/) {
       
   617 		@LibList=&main::DebugLibList;
       
   618 	} else {
       
   619 		@LibList=&main::LibList;
       
   620 	}
       
   621  	
       
   622 # Handle migration of binaries to secure location
       
   623 
       
   624 	my $BLDTRGPATH = "";
       
   625 	my $AIFBLDTRGPATH = "";
       
   626 	if ($TrgPath) {
       
   627 		$BLDTRGPATH = "\$(TRGDIR)\\";	    # handles TARGETPATH
       
   628 		$AIFBLDTRGPATH = $BLDTRGPATH;
       
   629 		&Winutl_AdjustTargetPath(\$BLDTRGPATH);
       
   630 	}
       
   631 	$BLDTRGPATH = "\$(EPOCTRG$Bld)\\".$BLDTRGPATH;
       
   632 	$AIFBLDTRGPATH = "\$(EPOCTRG$Bld)\\".$AIFBLDTRGPATH;
       
   633 
       
   634 	# REAL TARGETS
       
   635 	#-------------
       
   636 	&main::Output(
       
   637 		"# REAL TARGET - BUILD VARIANT $Bld\n",
       
   638 		"\n"
       
   639 	);
       
   640 
       
   641 #	releasables
       
   642 	my @releaseables;
       
   643 	
       
   644 	unless (&main::Plat() eq 'TOOLS') {
       
   645 		if ($BasicTrgType !~ /^IMPLIB$/io) {
       
   646 			push @releaseables, "$BLDTRGPATH$Trg";
       
   647 			if ($Bld=~/REL$/o && $BasicTrgType!~/^LIB$/o) {
       
   648 				push @releaseables,"$BLDTRGPATH$Trg.map";
       
   649 			}
       
   650 			if (&Winutl_CopyForStaticLinkage) {
       
   651 				push @releaseables, "\$(EPOCTRG$Bld)\\$Trg";
       
   652 			}
       
   653 			my $BitMapRef;
       
   654 			foreach $BitMapRef (@$BitMapStructRef) {
       
   655 				push @releaseables, "\$(EPOCTRG$Bld)\\$$BitMapRef{TrgPath}$$BitMapRef{Trg}";
       
   656 			}
       
   657 			my $ResourceRef;
       
   658 			foreach $ResourceRef (@$ResourceStructRef) {
       
   659 				push @releaseables,"\$(EPOCTRG$Bld)\\$$ResourceRef{Trg}";
       
   660 			}
       
   661 			my $AifRef;
       
   662 			foreach $AifRef (@$AifStructRef) {
       
   663 				push @releaseables, "$AIFBLDTRGPATH$$AifRef{Trg}";
       
   664 			}
       
   665 		}
       
   666 		if (-e $DefFile and !$NoExportLibrary) { # effectively "if project frozen ..."
       
   667 			push @releaseables, "\$(EPOCLIB$Bld)\\$ExportLibrary.lib";
       
   668 		}
       
   669 		if ($Bld=~/DEB$/o) {
       
   670 			# debugging support files?
       
   671 		}
       
   672 	}
       
   673 	else {
       
   674 		if ($BasicTrgType !~ /^IMPLIB$/io) {
       
   675 			my $toolspath=&main::EPOCToolsPath();
       
   676 			push @releaseables, "$toolspath$Trg";
       
   677 		}
       
   678 	}
       
   679 
       
   680 	&main::Output(
       
   681 		"WHAT$Bld : WHATGENERIC\n",
       
   682 		"\n",
       
   683 		"CLEAN$Bld : CLEANBUILD$Bld CLEANRELEASE$Bld\n",
       
   684 		"\n",
       
   685 		"CLEANBUILD$Bld : \n",
       
   686 		"\t\@perl -S ermdir.pl \"\$(EPOCBLD$Bld)\"\n",
       
   687 		"\n",
       
   688 		"CLEANRELEASE$Bld : CLEANGENERIC\n",
       
   689 		"\n"
       
   690 	);
       
   691 	&Generic_WhatCleanTargets($Bld, "WHAT$Bld", "CLEANRELEASE$Bld", @releaseables);
       
   692 
       
   693   my $adjustedTargetPath=$TrgPath;
       
   694   &Winutl_AdjustTargetPath(\$adjustedTargetPath);
       
   695   &Generic_MakeWorkDir("MAKEWORK$Bld", &main::BldPath);
       
   696   &Generic_MakeWorkDir("MAKEWORK$Bld", "$RelPath$adjustedTargetPath");
       
   697 
       
   698 	&main::Output(
       
   699 		"\n",
       
   700 		"\n"
       
   701 	);
       
   702 
       
   703 	return if ($BasicTrgType=~/^IMPLIB$/io);
       
   704 
       
   705 	&main::Output(
       
   706 		"LISTING$Bld : MAKEWORK$Bld"
       
   707 	);
       
   708 	foreach (@SrcList) {
       
   709 		my $BaseSrc = &main::Path_Split('Base', $_);
       
   710 		my $Ext = &main::Path_Split('Ext', $_);
       
   711 		$BaseSrc.='_' if (lc($Ext) eq '.cia');
       
   712 		$BaseSrc =~ s/\.UID/_UID_/i if ($BaseSrc eq $uidfile);
       
   713 		
       
   714    		&main::Output(
       
   715 			" \\\n\tLISTING$Bld$BaseSrc"
       
   716    		);
       
   717    	}
       
   718 	&main::Output(
       
   719 		"\n",
       
   720 		"\n"
       
   721 	);
       
   722 
       
   723 	&main::Output(
       
   724 		"LIBS$Bld="
       
   725 	);
       
   726 	foreach (@StatLibList) {
       
   727 		&main::Output(
       
   728 			" \\\n\t", &Generic_Quote("\$(EPOCSTATLINK$Bld)\\$_")
       
   729 		);
       
   730 	}
       
   731 	foreach (@LibList) {
       
   732 		&main::Output(
       
   733 			" \\\n\t", &Generic_Quote("\$(EPOCLINK$Bld)\\$_")
       
   734 		);
       
   735 	}
       
   736 	&main::Output(
       
   737 		"\n",
       
   738 		"\n"
       
   739 	);
       
   740 
       
   741 	&main::Output(
       
   742 		"LINK_OBJS$Bld="
       
   743 	);
       
   744 	my $have_uidfile = 0;
       
   745 	foreach (@SrcList) {
       
   746 		my $BaseSrc = &main::Path_Split('Base', $_);
       
   747 		my $Ext = &main::Path_Split('Ext', $_);
       
   748 		if ($BaseSrc eq $uidfile) {
       
   749 			$have_uidfile = 1;
       
   750 			next;
       
   751 		}
       
   752 		$BaseSrc.='_' if (lc($Ext) eq '.cia');
       
   753    		&main::Output(
       
   754 			" \\\n",
       
   755 			"\t", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o")
       
   756    		);
       
   757    	}
       
   758 	if ($Win32Resrc) {
       
   759 		my $resbase=&main::Path_Split('Base',$Win32Resrc);
       
   760 		&main::Output(
       
   761 			" \\\n",
       
   762 			"\t", &Generic_Quote("\$(EPOCBLD$Bld)\\$resbase.res")
       
   763 		);
       
   764 	}
       
   765 	if ($have_uidfile) {
       
   766 		# ensure that the uid file is at the end of the list, as it's implicit in
       
   767 		# CodeWarrior IDE projects.
       
   768 		&main::Output(
       
   769 			" \\\n",
       
   770 			"\t", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseTrg"."_UID_.o")
       
   771 		);
       
   772 	}
       
   773 	&main::Output(
       
   774 		"\n",
       
   775 		"\n"
       
   776 	);
       
   777 
       
   778 	&main::OutFormat(
       
   779 		"COMMON_LINK_FLAGS$Bld=",
       
   780 		' -stdlib'		# use default runtime library for compiler help functions
       
   781 	);
       
   782 	if ($MWLD eq "mwcc.exe") {
       
   783 		&main::OutFormat(
       
   784 			' -warnings on'	# on by default in mwccsym2.exe
       
   785 		);
       
   786 	}
       
   787 	if ($BasicTrgType=~/^(EXE|DLL)$/o) {
       
   788 		unless (&main::Plat eq 'TOOLS') {
       
   789 			&main::OutFormat(
       
   790 				" \"\$(EPOCSTATLINK$Bld)\\$FirstLib\""
       
   791 			);
       
   792 		}
       
   793 	}
       
   794 	foreach my $lib (@Win32LibList) {
       
   795 		 my $win32lib = $lib;    # take a copy, to avoid updating contents of Win32LibList!
       
   796 		$win32lib = "-l$win32lib" unless ($win32lib =~ /\\/);
       
   797 		&main::OutFormat(
       
   798 			" ",lc $win32lib
       
   799 		);
       
   800 	}
       
   801 	if ($BasicTrgType=~/^DLL$/o) {
       
   802 		&main::OutFormat(
       
   803 			"$BaseAddressFlag",
       
   804 			' -noentry',
       
   805 			' -shared'
       
   806 		);
       
   807 	}
       
   808 	elsif ($TrgType=~/^EXEXP$/o) {
       
   809 		&main::OutFormat(
       
   810 			"$BaseAddressFlag",
       
   811 			' -noentry',
       
   812 			' -shared'
       
   813 		);
       
   814 	}
       
   815 	elsif ($BasicTrgType=~/^EXE$/o) {
       
   816 		unless (&main::Plat eq 'TOOLS') {
       
   817 			&main::OutFormat(
       
   818 				' -m "?_E32Bootstrap@@YGXXZ"'
       
   819 			);
       
   820 		}
       
   821 	}
       
   822 	if (&main::Plat=~/^(WINC|TOOLS)$/o && $BasicTrgType=~/^EXE$/o) {
       
   823 		&main::OutFormat(
       
   824 			' -subsystem console'
       
   825 		);
       
   826 	}
       
   827 	else {
       
   828 		&main::OutFormat(
       
   829 			' -subsystem windows'
       
   830 		);
       
   831 	}
       
   832 	if (&main::HeapSize) {
       
   833 		my %HeapSize=&main::HeapSize;
       
   834 		&main::OutFormat(
       
   835 			' -heapreserve=',RoundUp1k($HeapSize{Max}),' -heapcommit=',RoundUp1k($HeapSize{Min})
       
   836 		);
       
   837 	}
       
   838 	if ($BasicTrgType=~/^(DLL|EXE)$/o) {
       
   839 		if ($Bld=~/DEB$/o) {
       
   840 			if($PlatName eq "VS6")
       
   841 			{
       
   842 				&main::OutFormat(
       
   843 					' -sym codeview'
       
   844 				);
       
   845 			}
       
   846 			else
       
   847 			{
       
   848 				&main::OutFormat(
       
   849 					' -sym codeview_new'
       
   850 				);
       
   851 			}
       
   852 			#mention the debug version of the runtime library
       
   853 			&main::OutFormat(
       
   854 				' -lMSL_All_MSE_Symbian_D.lib'
       
   855 				);
       
   856 		}
       
   857 		else
       
   858 		{
       
   859 			#mention the release version of the runtime library
       
   860 			&main::OutFormat(
       
   861 				' -lMSL_All_MSE_Symbian.lib'
       
   862 				);
       
   863 		}
       
   864 	}
       
   865 	&main::Output(
       
   866 		"\n",
       
   867 		"\n"
       
   868 	);
       
   869 
       
   870 	my $EntrySymbol='';
       
   871 	if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/o) {
       
   872 		my $Include="";
       
   873 		if ($BasicTrgType=~/^DLL$/o) {
       
   874 			$Include="-m __E32Dll";
       
   875 			$EntrySymbol='__E32Dll';
       
   876 		}
       
   877 		else {
       
   878 			$Include="-m __E32Startup";
       
   879 			$EntrySymbol='__E32Startup';
       
   880 		}
       
   881 		&main::Output(
       
   882 			"STAGE1_LINK_FLAGS$Bld= \$(COMMON_LINK_FLAGS$Bld) \$(LIBS$Bld) \\\n\t",
       
   883 			" -o \"\$(EPOCBLD$Bld)\\$Trg\"", 
       
   884 			' -export dllexport',
       
   885 			" $Include",
       
   886 			' -nocompactimportlib', 
       
   887 			" -implib \"\$(EPOCBLD$Bld)\\$ExportLibrary.lib\"",
       
   888 			" -addcommand \"out:$Trg\" -warnings off",
       
   889 			"\n",
       
   890 		);
       
   891 	}
       
   892 	my $AbsentSubst = '';
       
   893 	if ($EntrySymbol) {
       
   894 		$AbsentSubst = " -absent $EntrySymbol";
       
   895 	}
       
   896 
       
   897 	&main::Output(
       
   898 		"LINK_FLAGS$Bld= \$(COMMON_LINK_FLAGS$Bld) \$(LIBS$Bld) \\\n\t",
       
   899 		" -o \"$BLDTRGPATH$Trg\"" 
       
   900 	);
       
   901 	if ($Bld=~/REL$/o && $BasicTrgType!~/^LIB$/o) {
       
   902 		# Generate map file for release build executables
       
   903 		&main::Output(
       
   904 			" -map \"$BLDTRGPATH$Trg.map\"", 
       
   905 		);
       
   906 	}
       
   907 	if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/o) {
       
   908 		&main::Output(
       
   909 			" -f \"\$(EPOCBLD)\\$ExportLibrary.def\"",	# use generated .DEF file
       
   910 		);
       
   911 		if (&main::ExportUnfrozen) {
       
   912 			&main::Output(
       
   913 				" -implib \"\$(EPOCLIB)\\UDEB\\$ExportLibrary.lib\"",
       
   914 				" -addcommand \"out:$Trg\" -warnings off"
       
   915 			);
       
   916 		}
       
   917 		else {
       
   918 			&main::Output(
       
   919 				' -noimplib'
       
   920 			);
       
   921 		}
       
   922 	}
       
   923 	else {
       
   924 		&main::Output(
       
   925 			' -noimplib'
       
   926 		);
       
   927 	}
       
   928 	&main::Output(
       
   929 		"\n",
       
   930 		"\n"
       
   931 	);
       
   932 
       
   933 	&main::Output(
       
   934 		&Generic_Quote("$BLDTRGPATH$Trg"), " : \$(LINK_OBJS$Bld) "
       
   935 	);
       
   936 	if (-e $DefFile) { # effectively "if project frozen ..."
       
   937 		&main::Output(
       
   938 			&Generic_Quote($DefFile)
       
   939 		);
       
   940 	}
       
   941 	if ($BasicTrgType=~/^(DLL|EXE)$/o) {
       
   942 		unless (&main::Plat eq 'TOOLS') {
       
   943 			&main::Output(
       
   944 				" ", &Generic_Quote("\$(EPOCSTATLINK$Bld)\\$FirstLib")
       
   945 			);
       
   946 		}
       
   947 	}
       
   948 	&main::Output(
       
   949 		" \$(LIBS$Bld)\n"
       
   950 	);
       
   951 
       
   952 
       
   953 #	Link by name first time round for dlls
       
   954 	if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/o) {
       
   955 		&main::Output(
       
   956 			"\t\$(COMPILER_PATH)$MWLD -msgstyle gcc \$(STAGE1_LINK_FLAGS$Bld) -l \$(EPOCBLD$Bld) -search \$(notdir \$(LINK_OBJS$Bld))\n",
       
   957 			"\t\$(ERASE) \"\$(EPOCBLD$Bld)\\$Trg\"\n",
       
   958 		);
       
   959 
       
   960 #		Generate an export info file
       
   961 		my $show_options = "names,verbose";
       
   962 		$show_options = "names,unmangled,verbose" if ($MWLD eq "mwldsym2.exe");
       
   963 		&main::Output(
       
   964 			"\t\$(COMPILER_PATH)$MWLD -msgstyle gcc -S -show only,$show_options -o \"\$(EPOCBLD$Bld)\\$ExportLibrary.inf\" \"\$(EPOCBLD$Bld)\\$ExportLibrary.lib\"\n"
       
   965 		);
       
   966 
       
   967 #		call makedef to reorder the export information
       
   968 		&main::Output(
       
   969 #			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
       
   970 			"\tperl -S makedef.pl $AbsentSubst -Inffile \"\$(EPOCBLD$Bld)\\$ExportLibrary.inf\""
       
   971 		);
       
   972 		if (SysTrg()) {
       
   973     			&main::Output( "\t\t-SystemTargetType \\\n" );
       
   974 	    	}		
       
   975 		if (-e $DefFile) { # effectively "if project frozen ..."
       
   976 			&main::Output(
       
   977 				" -Frzfile \"$DefFile\""
       
   978 			);
       
   979 		}
       
   980 		my $Export;
       
   981 		my $Ordinal=1;
       
   982 		foreach $Export (&main::Exports) {
       
   983 #				replace "$" with "$$" so that NMAKE doesn't think there's a macro in the function name
       
   984 			$Export=~s-\$-\$\$-go;
       
   985 			&main::Output(
       
   986 				" -$Ordinal $Export"
       
   987 			);
       
   988 			$Ordinal++;
       
   989 		}
       
   990 		&main::Output(
       
   991 			" \"\$(EPOCBLD)\\$ExportLibrary.def\" \n",
       
   992 			"\t\$(ERASE) \"\$(EPOCBLD$Bld)\\$ExportLibrary.inf\"\n",
       
   993 			"\t\$(ERASE) \"\$(EPOCBLD$Bld)\\$ExportLibrary.lib\"\n"
       
   994 		);
       
   995 	}
       
   996 
       
   997 #	Perform the final link step
       
   998 	&main::Output(
       
   999 		"\t\$(COMPILER_PATH)$MWLD -msgstyle gcc "
       
  1000 	);
       
  1001 	if ($BasicTrgType=~/^LIB$/o) {
       
  1002 		&main::Output(
       
  1003 			"-library "
       
  1004 		);
       
  1005 	}
       
  1006 	&main::Output(
       
  1007 		"\$(LINK_FLAGS$Bld) -l \$(EPOCBLD$Bld) -search \$(notdir \$(LINK_OBJS$Bld))\n",
       
  1008 	);
       
  1009 
       
  1010 	if (&main::Plat eq 'TOOLS') {
       
  1011 		&main::Output(
       
  1012 			"\tcopy \"BLDTRGPATH$Trg\" \"",&main::EPOCToolsPath,"$Trg\"\n"
       
  1013 		);
       
  1014 	}
       
  1015 	if (&Winutl_CopyForStaticLinkage) {
       
  1016 		&Generic_MakeWorkDir("MAKEWORK$Bld", "\$(EPOCTRG$Bld)");
       
  1017 		&main::Output(
       
  1018 			"\n",
       
  1019 			&Generic_Quote("\$(EPOCTRG$Bld)\\$Trg"), " : ", 
       
  1020 			&Generic_Quote("$BLDTRGPATH$Trg"), "\n",
       
  1021 			"\t", &Generic_CopyAction(),
       
  1022 		);
       
  1023 	}
       
  1024 
       
  1025 	&main::Output(
       
  1026 		"\n",
       
  1027 		"\n"
       
  1028 	);
       
  1029 
       
  1030 	if($PlatName eq "VS6") {
       
  1031 		VS6Bld();
       
  1032 	}
       
  1033 	else
       
  1034 	{
       
  1035 		VS2003Bld();
       
  1036 	}
       
  1037 }
       
  1038 
       
  1039 sub VS6Bld(){
       
  1040 
       
  1041 	my $BaseTrg=&main::BaseTrg;
       
  1042 	my $Bld=&main::Bld;
       
  1043 	my @BldList=&main::BldList;
       
  1044 	my $ChopBldPath=&main::Path_Chop(&main::BldPath);
       
  1045 	my $ChopRelPath=&main::Path_Chop(&main::RelPath);
       
  1046 	my $Trg=&main::Trg;
       
  1047 
       
  1048 
       
  1049 	if ($Bld eq $BldList[0]) {
       
  1050 		$DspText.=join('',
       
  1051 			"!IF  \"\$(CFG)\" == \"$IdeBlds{$Bld}\"\n",
       
  1052 			"\n"
       
  1053 		);
       
  1054 	}
       
  1055 	else {
       
  1056 		$DspText.=join('',
       
  1057 			"!ELSEIF  \"\$(CFG)\" == \"$IdeBlds{$Bld}\"\n",
       
  1058 			"\n"
       
  1059 		);
       
  1060 	}
       
  1061 	$DspText.=join('',
       
  1062 		"# PROP BASE Use_MFC 0\n"
       
  1063 	);
       
  1064 	if ($Bld=~/REL$/o) {
       
  1065 		$DspText.=join('',
       
  1066 			"# PROP BASE Use_Debug_Libraries 0\n",
       
  1067 			"# PROP BASE Output_Dir \".\\Release\"\n",
       
  1068 			"# PROP BASE Intermediate_Dir \".\\Release\"\n"
       
  1069 		);
       
  1070 	}
       
  1071 	elsif ($Bld=~/DEB$/o) {
       
  1072 		$DspText.=join('',
       
  1073 			"# PROP BASE Use_Debug_Libraries 1\n",
       
  1074 			"# PROP BASE Output_Dir \".\\Debug\"\n",
       
  1075 			"# PROP BASE Intermediate_Dir \".\\Debug\"\n"
       
  1076 		);
       
  1077 	}
       
  1078 
       
  1079 	$DspText.=join('',
       
  1080 		"# PROP BASE Cmd_Line \"NMAKE /f ",$BaseTrg,".mak \"\n",
       
  1081 		"# PROP BASE Rebuild_Opt \"/a\"\n",
       
  1082 		"# PROP BASE Target_File \"",$Trg,"\"\n",
       
  1083 		"# PROP BASE Bsc_Name \"",$BaseTrg,".bsc\"\n",
       
  1084 		"# PROP BASE Target_Dir \"\"\n"
       
  1085 	);
       
  1086 
       
  1087 	$DspText.=join('',
       
  1088 			"# PROP Use_MFC\n"
       
  1089 	);
       
  1090 	if ($Bld=~/REL$/o) {
       
  1091 		$DspText.=join('',
       
  1092 			"# PROP Use_Debug_Libraries 0\n"
       
  1093 		);
       
  1094 	}
       
  1095 	elsif ($Bld=~/DEB$/o) {
       
  1096 		$DspText.=join('',
       
  1097 			"# PROP Use_Debug_Libraries 1\n"
       
  1098 		);
       
  1099 	}
       
  1100 
       
  1101 	$DspText.=join('',
       
  1102 		"# PROP Output_Dir \"$ChopRelPath\"\n",
       
  1103 		"# PROP Intermediate_Dir \"$ChopBldPath\"\n",
       
  1104 		"# PROP Cmd_Line \"\"$ENV{EPOCROOT}epoc32\\tools\\MAKE.exe\" -r -f ",&main::BaseMak,"_$Bld.mak \"\n",
       
  1105 		"# PROP Rebuild_Opt \"REBUILD\"\n",
       
  1106 		"# PROP Target_File \"",$Trg,"\"\n"
       
  1107 	);
       
  1108 
       
  1109 	if ($Bld=~/REL$/o) {
       
  1110 		$DspText.=join('',
       
  1111 			"# PROP Bsc_Name \"",$BaseTrg,".bsc\"\n"
       
  1112 		);
       
  1113 	}
       
  1114 	elsif ($Bld=~/DEB$/o) {
       
  1115 		$DspText.=join('',
       
  1116 			"# PROP Bsc_Name \"\"\n"
       
  1117 		);
       
  1118 	}
       
  1119 
       
  1120 	$DspText.=join('',
       
  1121 		"# PROP Target_Dir \"\"\n"
       
  1122 	);
       
  1123 
       
  1124 	$DspText.=join('',
       
  1125 		"\n"
       
  1126 	);
       
  1127 
       
  1128 }
       
  1129 
       
  1130 sub VS2003Bld(){
       
  1131 	my $BaseTrg=&main::BaseTrg;
       
  1132 	my $Bld=&main::Bld;
       
  1133 	my @BldList=&main::BldList;
       
  1134 	my $ChopBldPath=&main::Path_Chop(&main::BldPath);
       
  1135 	my $ChopRelPath=&main::Path_Chop(&main::Path_MakeRltToBase(&main::MakeFilePath, &main::RelPath));
       
  1136 	my $Trg=&main::Trg;
       
  1137 
       
  1138 	$VcprojText.=join('',
       
  1139 		"\t\t<Configuration\n",
       
  1140 		"\t\t\tName=\"",$IdeBlds{$Bld},"\"\n",
       
  1141 		"\t\t\tOutputDirectory=\"$ChopRelPath\"\n",
       
  1142 		"\t\t\tIntermediateDirectory=\"$ChopBldPath\"\n",
       
  1143 		"\t\t\tConfigurationType=\"0\"\n",
       
  1144 		"\t\t\tUseOfMFC=\"0\"\n",
       
  1145 		"\t\t\tATLMinimizesCRunTimeLibraryUsage=\"FALSE\">\n",
       
  1146 		"\t\t\t<Tool\n",
       
  1147 		"\t\t\t\tName=\"VCNMakeTool\"\n",
       
  1148 		"\t\t\t\tBuildCommandLine=\"\&quot;$ENV{EPOCROOT}epoc32\\tools\\make.exe\&quot; -r -f ",&main::BaseMak,".mak $Bld\"\n",
       
  1149 		"\t\t\t\tReBuildCommandLine=\"\&quot;$ENV{EPOCROOT}epoc32\\tools\\make.exe\&quot; -r -f ",&main::BaseMak,".mak CLEAN $Bld \"\n",
       
  1150 		"\t\t\t\tCleanCommandLine=\"\&quot;$ENV{EPOCROOT}epoc32\\tools\\make.exe\&quot; -r -f ",&main::BaseMak,".mak CLEAN$Bld\"\n",
       
  1151 		"\t\t\t\tOutput=\"$ChopRelPath\\$Trg\"/>\n",
       
  1152 		"\t\t</Configuration>\n"
       
  1153 		);
       
  1154 
       
  1155 }
       
  1156 
       
  1157 sub PMStartSrcList {
       
  1158 
       
  1159 	&main::Output(
       
  1160 		"# SOURCES\n",
       
  1161 		"\n"
       
  1162 	);
       
  1163 
       
  1164 	if($PlatName eq "VS6") {
       
  1165 		VS6StartSrcList();
       
  1166 	}
       
  1167 	else
       
  1168 	{
       
  1169 		VS2003StartSrcList();
       
  1170 	}
       
  1171 }
       
  1172 
       
  1173 sub VS6StartSrcList(){
       
  1174 	my @BldList=&main::BldList;
       
  1175 
       
  1176 
       
  1177 	$DspText.=join('',
       
  1178 		"\n!ENDIF\n\n",
       
  1179 		"# Begin Target\n",
       
  1180 		"\n"
       
  1181 	);
       
  1182 	foreach (@BldList) {
       
  1183 		$DspText.=join('',
       
  1184 			"# Name \"".$IdeBlds{$_}."\"\n"
       
  1185 		);
       
  1186 	}
       
  1187 	$DspText.=join('',
       
  1188 		"# Begin Group \"Source Files\"\n",
       
  1189 		"\n",
       
  1190 		"# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90\"\n"
       
  1191 	);
       
  1192 
       
  1193 }
       
  1194 
       
  1195 sub VS2003StartSrcList(){
       
  1196 
       
  1197 	$VcprojText.=join('',
       
  1198 		"\t</Configurations>\n",
       
  1199 		"\t<References>\n",
       
  1200 		"\t</References>\n"
       
  1201 	);
       
  1202 
       
  1203 	$VcprojText.=join('',
       
  1204 		"\t<Files>\n",
       
  1205 		"\t\t<Filter\n",
       
  1206 		"\t\t\tName=\"Source Files\"\n",
       
  1207 		"\t\t\tFilter=\"cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90\"\n",
       
  1208 		"\t\t\tUniqueIdentifier=\"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}\">\n"
       
  1209 	);
       
  1210 
       
  1211 }
       
  1212 
       
  1213 
       
  1214 sub PMBitMapBld {
       
  1215 
       
  1216 	&Generic_BitMapBld;
       
  1217 
       
  1218 	# Need to copy generic resource into emulated Z drive
       
  1219 
       
  1220 	my $BitMapRef=&main::BitMapRef;
       
  1221 
       
  1222 	my $ChopTrgPath="";
       
  1223 	if ($$BitMapRef{TrgPath}) {
       
  1224 		$ChopTrgPath.="\\$$BitMapRef{TrgPath}";
       
  1225 		chop $ChopTrgPath;
       
  1226 	}
       
  1227 
       
  1228 	my @BldList=&main::BldList;
       
  1229 	my $Bld;
       
  1230 	foreach $Bld (@BldList) {
       
  1231 		my $path="\$(EPOCTRG$Bld)$ChopTrgPath";
       
  1232 		&main::Output(
       
  1233 			&Generic_Quote("$path\\$$BitMapRef{Trg}"), " : ", 
       
  1234 			&Generic_Quote("$$BitMapRef{GenericTrg}"), "\n",
       
  1235 			"\t", &Generic_CopyAction(),
       
  1236 			"\n"
       
  1237 		);
       
  1238 	}
       
  1239 }
       
  1240 
       
  1241 sub PMResrcBld {
       
  1242 
       
  1243 	&Generic_ResrcBld; 
       
  1244 
       
  1245 	# Need to copy generic resource into emulated Z drive
       
  1246 
       
  1247 	my $ResourceRef=&main::ResourceRef;
       
  1248 	my @BldList=&main::BldList;
       
  1249 
       
  1250 	foreach my $Bld (@BldList) {
       
  1251 		&main::Output(
       
  1252 			&Generic_Quote("\$(EPOCTRG$Bld)\\$$ResourceRef{Trg}"), " : ", 
       
  1253 			&Generic_Quote("$$ResourceRef{GenericTrg}"), "\n",
       
  1254 			"\t", &Generic_CopyAction(),
       
  1255 			"\n"
       
  1256 		);
       
  1257 	}
       
  1258 
       
  1259 	if($PlatName eq "VS6") {
       
  1260 		VS6ResrcBld();
       
  1261 	}
       
  1262 	else
       
  1263 	{
       
  1264 		VS2003ResrcBld();
       
  1265 	}
       
  1266 
       
  1267 }
       
  1268 
       
  1269 sub VS6ResrcBld() {
       
  1270 
       
  1271 	my $ResourceRef=&main::ResourceRef;
       
  1272 	my @BldList=&main::BldList;
       
  1273 
       
  1274 	my $Resrc=ucfirst lc &main::Path_Split('File', $$ResourceRef{Source});
       
  1275 	my $BaseResrc=&main::Path_Split('Base', $$ResourceRef{Source});
       
  1276 	my $SrcPath=&main::Path_Split('Path', $$ResourceRef{Source});
       
  1277 	my $TrgPath=&main::Path_Split('Path', $$ResourceRef{Trg});
       
  1278 	my @LangList=($$ResourceRef{Lang});
       
  1279 	
       
  1280 	my $inputpath="$SrcPath$Resrc";
       
  1281 	
       
  1282 	$DspText.=join('',
       
  1283 		"# Begin Source File\n",
       
  1284 		"\n",
       
  1285 		"SOURCE=$inputpath\n"
       
  1286 	);
       
  1287 
       
  1288 	my $ChopBldPath=&main::Path_Chop(&main::BldPath);
       
  1289 	my @DepList=&main::DepList;
       
  1290 	my $PathBaseDsp=&main::MakeFilePath.&main::BaseMak;
       
  1291 	my $RelPath=&main::RelPath;
       
  1292 
       
  1293 	$DspText.=join('',
       
  1294 		"USERDEP__$BaseResrc="
       
  1295 	);
       
  1296 	my $Dep;
       
  1297 	foreach $Dep (@DepList) {
       
  1298 		$DspText.=join('',
       
  1299 			"\"$Dep\"\t"
       
  1300 		);
       
  1301 	}
       
  1302 	$DspText.=join('',
       
  1303 		"\n"
       
  1304 	);
       
  1305 
       
  1306 	my $Bld;
       
  1307 	foreach $Bld (@BldList) {
       
  1308 		my $ResrcTrgFullName="$RelPath$Bld\\$TrgPath$BaseResrc.r";
       
  1309 		if ($Bld eq $BldList[0]) {
       
  1310 			$DspText.=join('',
       
  1311 				'!IF'
       
  1312 			);
       
  1313 		}
       
  1314 		else {
       
  1315 			$DspText.=join('',
       
  1316 				'!ELSEIF'
       
  1317 			);
       
  1318 		}
       
  1319 		$DspText.=join('',
       
  1320 			"  \"\$(CFG)\" == \"$IdeBlds{$Bld}\"\n",
       
  1321 			"\n"
       
  1322 		);
       
  1323 		$DspText.=join('',
       
  1324 			"# PROP Intermediate_Dir \"$ChopBldPath\"\n",
       
  1325 			"# Begin Custom Build - Building resources from $Resrc\n",
       
  1326 			"InputPath=$inputpath\n",
       
  1327 			"\n",
       
  1328 			"BuildCmds= \\\n",
       
  1329 			"\tnmake -nologo -f \"${PathBaseDsp}.SUP.MAKE\"\\\n",
       
  1330 			"  \"$ResrcTrgFullName\"\n"
       
  1331 		);
       
  1332 		my $Lang;
       
  1333 		foreach $Lang (@LangList) {
       
  1334 #			change again to avoid VC5 linking the resource
       
  1335 			my $TmpLang=$Lang;
       
  1336 			if ($TmpLang eq 'SC') {
       
  1337 				$TmpLang.='.dummy';
       
  1338 			}
       
  1339 			$DspText.=join('',
       
  1340 				"\n",
       
  1341 				"\"$ResrcTrgFullName$TmpLang\" : \$(SOURCE) \"\$(INTDIR)\"\\\n",
       
  1342 				" \"\$(OUTDIR)\"\n",
       
  1343 				"   \$(BuildCmds)\n",
       
  1344 			);
       
  1345 		}
       
  1346 		$DspText.=join('',
       
  1347 			"# End Custom Build\n",
       
  1348 			"\n"
       
  1349 		);
       
  1350 	}
       
  1351 	$DspText.=join('',
       
  1352 		"!ENDIF \n",
       
  1353 		"\n",
       
  1354 		"# End Source File\n"
       
  1355 	);
       
  1356 
       
  1357 }
       
  1358 
       
  1359 sub VS2003ResrcBld() {
       
  1360 
       
  1361 }
       
  1362 
       
  1363 sub PMDoc {
       
  1364 
       
  1365 ###### from PMDoc of VC6 
       
  1366 	
       
  1367 	if($PlatName eq "VS6") {
       
  1368 		VS6Doc();
       
  1369 	}
       
  1370 	else
       
  1371 	{
       
  1372 		VS2003Doc();
       
  1373 	}
       
  1374 
       
  1375 }
       
  1376 
       
  1377 sub VS6Doc() {
       
  1378 
       
  1379 	my $SrcPath=&main::SrcPath;
       
  1380 
       
  1381 	$DspText.=join('',
       
  1382 		"# Begin Source File\n",
       
  1383 		"\n",
       
  1384 		"SOURCE=",$SrcPath,ucfirst lc &main::Doc,"\n",
       
  1385 		"# PROP Exclude_From_Build 1\n",
       
  1386 		"# End Source File\n"
       
  1387 	);
       
  1388 
       
  1389 }
       
  1390 sub VS2003Doc() {
       
  1391 
       
  1392 
       
  1393 }
       
  1394 
       
  1395 sub PMAifBld {
       
  1396 
       
  1397 	&Generic_AifBld;
       
  1398 
       
  1399 	# Need to copy generic resource into emulated Z drive
       
  1400 
       
  1401 	my $AifRef=&main::AifRef;
       
  1402 	my $TrgDir="";
       
  1403 	if (&Generic_Definition("TRGDIR") ne "") {
       
  1404 		$TrgDir="\\\$(TRGDIR)";
       
  1405 	}
       
  1406 
       
  1407 	my @BldList=&main::BldList;
       
  1408 	my $Bld;
       
  1409 	foreach $Bld (@BldList) {
       
  1410 		my $path="\$(EPOCTRG$Bld)$TrgDir";
       
  1411 		&main::Output(
       
  1412 			&Generic_Quote("$path\\$$AifRef{Trg}"), " : ",
       
  1413 			&Generic_Quote("$$AifRef{GenericTrg}"), "\n",
       
  1414 			"\t", &Generic_CopyAction(),
       
  1415 			"\n"
       
  1416 		);
       
  1417 	}
       
  1418 }
       
  1419 
       
  1420 
       
  1421 sub PMStartSrc {
       
  1422 	my $Src=&main::Src;
       
  1423 
       
  1424 	&main::Output(
       
  1425 		"# Source $Src\n",
       
  1426 		"\n"
       
  1427 	);
       
  1428 
       
  1429 	if($PlatName eq "VS6") {
       
  1430 		VS6StartSrc();
       
  1431 	}
       
  1432 	else
       
  1433 	{
       
  1434 		VS2003StartSrc();
       
  1435 	}
       
  1436 
       
  1437 }
       
  1438 
       
  1439 sub VS6StartSrc() {
       
  1440 
       
  1441 	$DspText.=join('',
       
  1442 		"# Begin Source File\n",
       
  1443 		"\n",
       
  1444 		"SOURCE=",&main::SrcPath,ucfirst lc &main::Src,"\n",
       
  1445 		"# End Source File\n"
       
  1446 	);
       
  1447 
       
  1448 }
       
  1449 
       
  1450 sub VS2003StartSrc(){
       
  1451 	$VcprojText.=join('',
       
  1452 		"\t\t\t<File\n",
       
  1453 		"\t\t\t\tRelativePath=\"",&main::Path_MakeRltToBase(&main::MakeFilePath, &main::SrcPath),ucfirst lc &main::Src,"\">\n",
       
  1454 		"\t\t\t</File>\n"
       
  1455 	);
       
  1456 
       
  1457 }
       
  1458 
       
  1459 sub PMSrcDepend {
       
  1460 	my @BldList=&main::BldList;	
       
  1461 	my @DepList=&main::DepList;
       
  1462 	my $BaseSrc=&main::BaseSrc;
       
  1463 	$BaseSrc =~ s/\.UID/_UID_/i if ($BaseSrc eq $uidfile);
       
  1464 
       
  1465 	return if (@DepList == 0);
       
  1466 
       
  1467 	foreach (@BldList) {
       
  1468 		&main::Output(
       
  1469 			&Generic_Quote("\$(EPOCBLD$_)\\$BaseSrc.o"), " \\\n",
       
  1470 		);
       
  1471 	}
       
  1472 	&main::Output(
       
  1473 		":"
       
  1474 	);
       
  1475 	foreach (@DepList) {
       
  1476 		&main::Output(
       
  1477 		" \\\n\t", &Generic_Quote($_)
       
  1478 		);
       
  1479 	}
       
  1480 	&main::Output(
       
  1481 		"\n",
       
  1482 		"\n"
       
  1483 	);
       
  1484 
       
  1485 	# Generate user header list for this src, merge with list for all sources
       
  1486 	foreach (&main::DepList) {
       
  1487 		$PrjHdrs{$_}='unusedval';
       
  1488 	}
       
  1489 
       
  1490 }
       
  1491 
       
  1492 sub PMSrcBldDepend {
       
  1493 	my $Bld=&main::Bld;
       
  1494 	my @DepList=&main::DepList;
       
  1495 	my $BaseSrc=&main::BaseSrc;
       
  1496 	$BaseSrc =~ s/\.UID/_UID_/i if ($BaseSrc eq $uidfile);
       
  1497 
       
  1498 	return if (@DepList == 0);
       
  1499 
       
  1500 	&main::Output(
       
  1501 		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o"), " :",
       
  1502 	);
       
  1503 	foreach (@DepList) {
       
  1504 		&main::Output(
       
  1505 			" \\\n\t", &Generic_Quote($_)
       
  1506 		);
       
  1507 	}
       
  1508 	&main::Output(
       
  1509 		"\n",
       
  1510 		"\n"
       
  1511 	);
       
  1512 }
       
  1513 
       
  1514 sub PMEndSrcBld {
       
  1515 	my $BaseSrc=&main::BaseSrc;
       
  1516 	$BaseSrc =~ s/\.UID/_UID_/i if ($BaseSrc eq $uidfile);
       
  1517 	my $Bld=&main::Bld;
       
  1518 	my $Plat=&main::Plat;
       
  1519 	my $Src=&main::Src;
       
  1520 	my $SrcPath=&main::SrcPath;
       
  1521 	my $Ext=&main::ExtSrc;
       
  1522 	my $Cia = (lc($Ext) eq '.cia') ? 1 : 0;
       
  1523 
       
  1524 	if ($Cia) {
       
  1525 		&main::Output(
       
  1526 			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.o"), " : ",
       
  1527 			&Generic_Quote("$SrcPath$Src"), "\n",
       
  1528 			"\techo $Src\n",
       
  1529 			"\t\$(CW$Bld) -lang c++ -o \"\$\@\" -c \"$SrcPath$Src\"\n",
       
  1530 			"\n",
       
  1531 #			assembler listing target - uses implicit rule to do disassembly
       
  1532 			"LISTING$Bld$BaseSrc\_ : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.lis"), "\n",
       
  1533 			"\t", &Generic_CopyAction("$SrcPath$BaseSrc\_.$Plat.lst"),
       
  1534 			"\n"
       
  1535 		);
       
  1536 	} else {
       
  1537 		&main::Output(
       
  1538 			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o"), " : ",
       
  1539 			&Generic_Quote("$SrcPath$Src"), "\n",
       
  1540 			"\techo $Src\n",
       
  1541 			"\t\$(CW$Bld) -o \"\$\@\" -c \"$SrcPath$Src\"\n",
       
  1542 			"\n",
       
  1543 #			assembler listing target - uses implicit rule to do disassembly
       
  1544 			"LISTING$Bld$BaseSrc : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), "\n",
       
  1545 			"\t", &Generic_CopyAction("$SrcPath$BaseSrc.$Plat.lst"),
       
  1546 			"\n"
       
  1547 		);
       
  1548 	}
       
  1549 
       
  1550 
       
  1551 
       
  1552 }
       
  1553 
       
  1554 sub PMEndSrc {
       
  1555 
       
  1556 	&main::Output(
       
  1557 		"\n",
       
  1558 		"\n"
       
  1559 	);
       
  1560 }
       
  1561 
       
  1562 sub PMEndSrcList {
       
  1563 
       
  1564 	my $show_options = "source";
       
  1565 	$show_options = "source,unmangled,comments" if ($MWLD eq "mwldsym2.exe");
       
  1566 	
       
  1567 	&main::Output(
       
  1568 		"\n",
       
  1569 		"# Implicit rule for generating .lis files\n",
       
  1570 		"\n",
       
  1571 		".SUFFIXES : .lis .o\n",
       
  1572 		"\n",
       
  1573 		".o.lis:\n",
       
  1574 		"\t\$(COMPILER_PATH)$MWLD -msgstyle gcc -S -show $show_options \$< -o \$\@\n",
       
  1575 		"\n",
       
  1576 		"\n"
       
  1577 	);
       
  1578 
       
  1579 	if ($Win32Resrc) {
       
  1580 		my @BldList=&main::BldList;
       
  1581 		my @DepList=&main::Deps_GenDependsL($Win32Resrc);
       
  1582 
       
  1583 		&main::Output(
       
  1584 			"# Win32 Resource $Win32Resrc\n",
       
  1585 			"\n",
       
  1586 			"DEPEND="
       
  1587 		);
       
  1588 		foreach (@DepList) {
       
  1589 			&main::Output(
       
  1590 				" \\\n\t", &Generic_Quote($_)
       
  1591 			);
       
  1592 		}
       
  1593 		&main::Output(
       
  1594 			"\n",
       
  1595 			"\n"
       
  1596 		);
       
  1597 	
       
  1598 		my $Bld;
       
  1599 		my $resbase=&main::Path_Split('Base',$Win32Resrc);
       
  1600 		my $respath=&main::Path_Chop(&main::Path_Split('Path',$Win32Resrc));
       
  1601 		foreach $Bld (@BldList) {
       
  1602 			&main::Output(
       
  1603 				&Generic_Quote("\$(EPOCBLD$Bld)\\$resbase.res"), " : ",
       
  1604 				&Generic_Quote($Win32Resrc), " \$(DEPEND)\n",
       
  1605 				"\tmwwinrc -o \$\@ \"$Win32Resrc\"\n",
       
  1606 				"\n"
       
  1607 			);
       
  1608 		}
       
  1609 		&main::Output(
       
  1610 			"\n",
       
  1611 			"\n"
       
  1612 		);
       
  1613 	}
       
  1614 
       
  1615 	# Deal with accumulated MAKEDIRS etc.
       
  1616 
       
  1617 	&Generic_End;
       
  1618 
       
  1619 	my $BaseDsp=&main::BaseMak;
       
  1620 	my $PathBaseDsp=&main::MakeFilePath.$BaseDsp;
       
  1621 
       
  1622 	&main::Path_DelFiles("$PathBaseDsp.MAK","$PathBaseDsp.MDP","$PathBaseDsp.NCB","$PathBaseDsp.OPT","$PathBaseDsp.PLG","$PathBaseDsp.SLN","$PathBaseDsp.VCPROJ","$PathBaseDsp.DSW","$PathBaseDsp.DSP","${PathBaseDsp}_UREL.MAK","${PathBaseDsp}_UDEB.MAK");
       
  1623 
       
  1624 	if($PlatName eq "VS6")
       
  1625 	{
       
  1626 		VS6EndSrcList();
       
  1627 	}
       
  1628 	elsif($PlatName eq "VS2003")
       
  1629 	{
       
  1630 		VS2003EndSrcList();
       
  1631 	}
       
  1632 }
       
  1633 
       
  1634 sub VS6EndSrcList() {
       
  1635 
       
  1636 	my $BaseDsp=&main::BaseMak;    
       
  1637 	my $PathBaseDsp=&main::MakeFilePath.$BaseDsp;  
       
  1638 	my $BaseTrg=&main::BaseTrg;
       
  1639 
       
  1640 	$DspText.=join('',
       
  1641 		"# End Group\n",
       
  1642 		"# Begin Group \"Resource Files\"\n",
       
  1643 		"\n",
       
  1644 		"# PROP Default_Filter \"ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe\"\n"
       
  1645 	);
       
  1646 	if ($Win32Resrc) {
       
  1647 		$DspText.=join('',
       
  1648 			"# Begin Source File\n",
       
  1649 			"\n",
       
  1650 			"SOURCE=",ucfirst lc $Win32Resrc,"\n",
       
  1651 			"# End Source File\n"
       
  1652 		);
       
  1653 		# Generate user header list for this src, merge with list for all sources
       
  1654 		foreach (&main::Deps_GenDependsL($Win32Resrc)) {
       
  1655 			$PrjHdrs{$_}='unusedval';
       
  1656 		}
       
  1657 	}
       
  1658 	$DspText.=join('',
       
  1659 		"# End Group\n"
       
  1660 	);
       
  1661 
       
  1662 	# Use the global %PrjHdrs Hash to produce user header listing
       
  1663 	$DspText.=join('',
       
  1664 		"# Begin Group \"Header Files\"\n",
       
  1665 		"\n",
       
  1666 		"# PROP Default_Filter \"h;hpp;hxx;hm;inl;fi;fd\"\n"
       
  1667 	);
       
  1668 	foreach (keys %PrjHdrs) {
       
  1669 		$DspText.=join('',
       
  1670 			"# Begin Source File\n",
       
  1671 			"\n",
       
  1672 			"SOURCE=",&main::Path_Split('Path',$_),ucfirst lc &main::Path_Split('File',$_),"\n",
       
  1673 			"# End Source File\n"
       
  1674 		);
       
  1675 	}
       
  1676 
       
  1677 
       
  1678 	$DspText.=join('',
       
  1679 		"# End Group\n",
       
  1680 		"# Begin Group \"Make Files\"\n",
       
  1681 		"\n",
       
  1682 		"# PROP Default_Filter \"mak;mk\"\n"
       
  1683 	);
       
  1684 	$DspText.=join('',
       
  1685 		"# Begin Source File\n",
       
  1686 		"\n",
       
  1687 		"SOURCE=",ucfirst lc $PathBaseDsp,".mak\n",
       
  1688 		"# End Source File\n"
       
  1689 	);
       
  1690 
       
  1691 	$DspText.=join('',
       
  1692 		"# End Group\n",
       
  1693 		"# End Target\n",
       
  1694 		"# End Project\n",
       
  1695 	);
       
  1696 
       
  1697 
       
  1698 	&main::CreateExtraFile("$PathBaseDsp.dsp",$DspText);
       
  1699 
       
  1700 	my $RelMakText=join('',
       
  1701 		"\n",
       
  1702 		"BLD: UREL\n",
       
  1703 		"REBUILD : CLEANUREL UREL\n",
       
  1704 		"\n",
       
  1705 		"include ",&main::BaseMak,".mak\n",
       
  1706 		"\n"
       
  1707 	);
       
  1708 
       
  1709 	&main::CreateExtraFile("${PathBaseDsp}_UREL.mak",$RelMakText);
       
  1710 
       
  1711 
       
  1712 	my $DebMakText=join('',
       
  1713 		"\n",
       
  1714 		"BLD: UDEB\n",
       
  1715 		"REBUILD : CLEANUDEB UDEB\n",
       
  1716 		"\n",
       
  1717 		"include ",&main::BaseMak,".mak\n",
       
  1718 		"\n"
       
  1719 	);
       
  1720 
       
  1721 	&main::CreateExtraFile("${PathBaseDsp}_UDEB.mak",$DebMakText);
       
  1722 
       
  1723 	my $DswText=join(
       
  1724 		"\n",
       
  1725 		"Microsoft Developer Studio Workspace File, Format Version 6.00",
       
  1726 		'# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!',
       
  1727 		'',
       
  1728 		'#'x79,
       
  1729 		'',
       
  1730 		"Project: \"$BaseDsp\"=.\\$BaseDsp.dsp - Package Owner=<4>",
       
  1731 		'',
       
  1732 		'Package=<5>',
       
  1733 		'{{{',
       
  1734 		'}}}',
       
  1735 		'',
       
  1736 		'Package=<4>',
       
  1737 		'{{{',
       
  1738 		'}}}',
       
  1739 		'',
       
  1740 		'#'x79,
       
  1741 		'',
       
  1742 		'Global:',
       
  1743 		'',
       
  1744 		'Package=<5>',
       
  1745 		'{{{',
       
  1746 		'}}}',
       
  1747 		'',
       
  1748 		'Package=<3>',
       
  1749 		'{{{',
       
  1750 		'}}}',
       
  1751 		'',
       
  1752 		'#'x79,
       
  1753 		''
       
  1754 	);
       
  1755 
       
  1756 	&main::CreateExtraFile("$PathBaseDsp.DSW",$DswText);
       
  1757 
       
  1758 
       
  1759 }
       
  1760 
       
  1761 sub VS2003EndSrcList() {
       
  1762 
       
  1763 	my $BaseDsp=&main::BaseMak;    
       
  1764 	my $PathBaseDsp=&main::MakeFilePath.$BaseDsp;  
       
  1765 
       
  1766 # Use the global %PrjHdrs Hash to produce user header listing
       
  1767 	$VcprojText.=join('',
       
  1768 		"\t\t</Filter>\n",
       
  1769 		"\t\t<Filter\n",
       
  1770 		"\t\t\tName=\"Header Files\"\n",
       
  1771 		"\t\t\tFilter=\"h;hpp;hxx;hm;inl;fi;fd\"\n",
       
  1772 		"\t\t\tUniqueIdentifier=\"{93995380-89BD-4b04-88EB-625FBE52EBFB}\">\n"
       
  1773 	);
       
  1774 
       
  1775 	foreach (keys %PrjHdrs) {
       
  1776 		$VcprojText.=join('',
       
  1777 			"\t\t\t<File\n",
       
  1778 			"\t\t\t\tRelativePath=\"",&main::Path_MakeRltToBase(&main::MakeFilePath, &main::Path_Split('Path',$_)) 
       
  1779 							, &main::Path_Split('File',$_),"\">","\n",
       
  1780 			"\t\t\t</File>\n"
       
  1781 		);
       
  1782 	}	
       
  1783 	$VcprojText.=join('',
       
  1784 		"\t\t</Filter>\n"
       
  1785 	);
       
  1786 
       
  1787 	$VcprojText.=join('',
       
  1788 		"\t\t<Filter\n",
       
  1789 		"\t\t\tName=\"Resource Files\"\n",
       
  1790 		"\t\t\tFilter=\"ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe\"\n",
       
  1791 		"\t\t\tUniqueIdentifier=\"{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}\">\n"
       
  1792 	);
       
  1793 
       
  1794 	if ($Win32Resrc) {
       
  1795 		$VcprojText.=join('',
       
  1796 			"\t\t\t<File\n",
       
  1797 			"\t\t\t\tRelativePath=\"", &main::Path_MakeRltToBase(&main::MakeFilePath, $Win32Resrc),"\">\n",
       
  1798 			"\t\t\t</File>\n"
       
  1799 		);
       
  1800 		# Generate user header list for this src, merge with list for all sources
       
  1801 		foreach (&main::Deps_GenDependsL($Win32Resrc)) {
       
  1802 			$PrjHdrs{$_}='unusedval';
       
  1803 		}
       
  1804 	}
       
  1805 
       
  1806 	$VcprojText.=join('',
       
  1807 		"\t\t</Filter>\n",
       
  1808 		"\t\t<Filter\n",
       
  1809 		"\t\t\tName=\"Make Files\"\n",
       
  1810 		"\t\t\tFilter=\"Mak;mk\">\n"
       
  1811 	);
       
  1812 
       
  1813 	$VcprojText.=join('',
       
  1814 		"\t\t\t<File\n",
       
  1815 		"\t\t\t\tRelativePath=\"",&main::Path_MakeRltToBase(&main::MakeFilePath, $PathBaseDsp),".mak\">\n",
       
  1816 		"\t\t\t</File>\n"
       
  1817 	);
       
  1818 
       
  1819 	$VcprojText.=join('',
       
  1820 		"\t\t</Filter>\n",
       
  1821 		"\t</Files>\n",
       
  1822 		"\t<Globals>\n",
       
  1823 		"\t</Globals>\n",
       
  1824 		"</VisualStudioProject>\n"
       
  1825 	);
       
  1826 
       
  1827 	&main::CreateExtraFile("$PathBaseDsp.vcproj",$VcprojText);
       
  1828 
       
  1829 
       
  1830 	my $SlnText=join(
       
  1831 		"\n",
       
  1832 		"Microsoft Visual Studio Solution File, Format Version 8.00",
       
  1833 		"Project\(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\"\) = \"$BaseDsp\", \"$BaseDsp.vcproj\", \"{$guid}\"",
       
  1834 		"\tProjectSection(ProjectDependencies) = postProject",
       
  1835 		"\tEndProjectSection",
       
  1836 		'EndProject',
       
  1837 		'Global',
       
  1838 		"\tGlobalSection(SolutionConfiguration) = preSolution",
       
  1839 		"\t\tDebug = Debug",
       
  1840 		"\t\tRelease = Release",
       
  1841 		"\tEndGlobalSection",
       
  1842 		"\tGlobalSection(ProjectConfiguration) = postSolution",
       
  1843 		"\t\t{$guid}.Debug.ActiveCfg = Debug|Win32",
       
  1844 		"\t\t{$guid}.Debug.Build.0 = Debug|Win32",
       
  1845 		"\t\t{$guid}.Release.ActiveCfg = Release|Win32",
       
  1846 		"\t\t{$guid}.Release.Build.0 = Release|Win32",
       
  1847 		"\tEndGlobalSection",
       
  1848 		"\tGlobalSection(ExtensibilityGlobals) = postSolution",
       
  1849 		"\tEndGlobalSection",
       
  1850 		"\tGlobalSection(ExtensibilityAddIns) = postSolution",
       
  1851 		"\tEndGlobalSection",
       
  1852 		'EndGlobal',
       
  1853 		''
       
  1854 	);
       
  1855 
       
  1856 	&main::CreateExtraFile("$PathBaseDsp.Sln",$SlnText);
       
  1857 
       
  1858 }
       
  1859 
       
  1860 1;