sbsv1/abld/platform/cl_tools.pm
author lorewang
Thu, 11 Nov 2010 11:26:32 +0800
changeset 677 44e49837144a
parent 599 fa7a3cc6effd
permissions -rw-r--r--
update release info
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
599
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     1
# Copyright (c) 2003-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
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    15
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    16
package Cl_tools;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    17
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    18
# declare variables global for module
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    19
my @Win32LibList=();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    20
my $BaseAddressFlag;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    21
my $Win32Resrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    22
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    23
my $MWCC;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    24
my $MWLD;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    25
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    26
require Exporter;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    27
@ISA=qw(Exporter);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    28
@EXPORT=qw(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    29
	PMHelp_Mmp
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    30
	PMCheckPlatformL
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    31
	PMPlatProcessMmp
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    32
	PMStartBldList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    33
	PMBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    34
	PMStartSrcList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
	PMStartSrc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    36
	PMSrcDepend
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    37
	PMSrcBldDepend
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    38
	PMEndSrcBld
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
	PMEndSrc
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
	PMEndSrcList
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    42
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    43
use Winutl;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    44
use cl_generic;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
sub PMHelp_Mmp {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47
	&Winutl_Help_Mmp;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    48
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    49
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    50
sub PMCheckPlatformL {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    51
	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
    52
		die "Can't specify anything but EXE or LIB targettypes for this platform\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    53
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    54
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    55
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    56
sub PMPlatProcessMmp (@) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    57
	&Winutl_DoMmp(\@_, $ENV{MWCSym2Includes});
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    58
	$BaseAddressFlag=&Winutl_BaseAddress;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    59
	if ($BaseAddressFlag ne "") {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    60
		$BaseAddressFlag=" -imagebase \"$BaseAddressFlag\"";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    61
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    62
	@Win32LibList=&Winutl_Win32LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    63
	$Win32Resrc=&Winutl_Win32Resrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    64
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    65
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    66
sub PMStartBldList($) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    67
	my ($makecmd) = @_;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    68
	my $BaseTrg=&main::BaseTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    69
	my @BldList=&main::BldList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    70
	my @ChopSysIncPaths=&main::Path_Chop(&main::SysIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    71
	my @ChopUserIncPaths=&main::Path_Chop(&main::UserIncPaths);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    72
	my $DefFile=&main::DefFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    73
	my $BasicTrgType=&main::BasicTrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    74
	my $LibPath=&main::LibPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    75
	my @MacroList=&main::MacroList();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    76
	my $VariantFile=&main::VariantFile();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    77
	my $Plat=&main::Plat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    78
	my $Trg=&main::Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    79
	my $TrgType=&main::TrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    80
	my $WarningLevel=&main::CompilerOption("CW");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    81
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    82
	# check version of CodeWarrior for Symbian OS
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    83
	if (defined($ENV{MWSym2Libraries})) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    84
		my $allthere=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    85
		foreach (split/;/,$ENV{MWSym2Libraries}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    86
			s/^\+//;	# remove leading "+", if any
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    87
			if (!-d $_) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    88
				$allthere=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    89
				last;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    90
			}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    91
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    92
		if ($allthere) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    93
			$MWCC = "mwccsym2.exe";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    94
			$MWLD = "mwldsym2.exe";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    95
			print "Detected CodeWarrior for Symbian OS, version 2.0\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    96
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    97
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    98
	if (!defined($MWCC)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    99
		if (defined($ENV{CWFolder}) && -d $ENV{CWFolder}) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   100
			$MWCC = "mwcc.exe";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   101
			$MWLD = "mwld.exe";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   102
			print "Detected CodeWarrior for Symbian OS, version 1.0\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   103
			die "ERROR: This version of CodeWarrior is not suitable for Symbian OS version 8\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   104
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   105
		else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   106
			die "ERROR: Unable to identify a valid CodeWarrior for Symbian OS installation\n";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   107
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   108
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   109
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   110
	Generic_Header(0,$makecmd);	# define standard things using absolute paths
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   111
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   112
	my $TrgDir="";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   113
	if (&Generic_Definition("TRGDIR") ne "") {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   114
		$TrgDir="\$(TRGDIR)\\";
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
# Change - winutl.pm checks MWCWinx86Includes, but mwccsym2.exe seems to use MWCIncludes
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   118
	if ($MWCC eq "mwccsym2.exe" && !defined($ENV{MWCIncludes})) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   119
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   120
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   121
			"MWCIncludes:=\$(MWCSym2Includes)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   122
			"export MWCIncludes\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   123
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   124
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   125
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   126
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   127
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   128
		"# EPOC DEFINITIONS\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   129
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   130
		"INCDIR  = -cwd source -i-"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   131
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   132
	foreach (@ChopUserIncPaths,@ChopSysIncPaths) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   133
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   134
			" \\\n -i \"$_\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   135
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   136
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   137
	use Pathutl;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   138
	if($VariantFile){
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   139
	    my $variantFilePath = Path_Split('Path',$VariantFile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   140
	    $VariantFile  = Path_Split('FILE',$VariantFile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   141
	    # workaround for codewarrior defect:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   142
	    # codewarrior at the moment doesn't accept an absolute path with the
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   143
	    # the -include option unless it contains a drive letter, this is solved
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   144
	    # by including the directory and the file separately
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   145
	    &main::Output("\\\n -i \"$variantFilePath\" -include \"$VariantFile\"");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   146
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   147
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   148
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   149
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   150
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   151
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   152
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   153
		"CWFLAGS =",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   154
		" -wchar_t off",	# do not treat wchar_t as a predefined type
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   155
		" -align 4",		# long alignment
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   156
		" -warnings on",	# selection of warnings
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   157
		" -w nohidevirtual",	# turn off "hides inherited virtual function" warning
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   158
		   ",nounusedexpr",	# turn off "expression has no side effect" warning
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   159
		" -msgstyle gcc",	# use GCC-style message format
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   160
		# " -strict on",		# strict ANSI/ISO C++ checking
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   161
		" -enum int",		# use int for enumeration types
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   162
		" -str pool",		# pool strings into a single data object
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   163
		" $WarningLevel"		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   164
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   165
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   166
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   167
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   168
		" -stdinc"		# insist because mwccsym2 has -nostdinc as the default(?)
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
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   172
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   173
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   174
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   175
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   176
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   177
		"CWDEFS  = "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   178
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   179
	foreach(@MacroList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   180
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   181
			" -d \"$_\""
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   182
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   183
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   184
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   185
		" \$(USERDEFS)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   186
		"\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
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   190
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   191
			"CW$_ = $MWCC"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   192
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   193
		if (/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   194
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   195
				' -g -O0'   # debug information, no optimisation
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   196
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   197
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   198
		elsif (/REL$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   199
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   200
				' -O4,s'    # highest level of optimisation, optimise for space
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   201
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   202
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   203
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   204
			' $(CWFLAGS)'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   205
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   206
		foreach (&main::MacroList($_)) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   207
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   208
				" -d $_"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   209
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   210
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   211
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   212
			" \$(CWDEFS) \$(INCDIR)\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   213
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   214
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   215
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   216
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   217
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   218
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   219
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   220
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   221
		&main::Output(
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
		&main::Output (
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   226
			" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   227
			"\t", &Generic_Quote("\$(EPOCTRG$_)\\$TrgDir$Trg")
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
#		lib has to come after the main target so that a .DEF file will be generated if the project is not frozen
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   232
		if ($DefFile and not &main::ExportUnfrozen) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   233
			&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   234
				" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   235
				"\tLIBRARY\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   236
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   237
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   238
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   239
			"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   240
			"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   241
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   242
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   243
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   244
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   245
		"LIBRARY : MAKEWORKLIBRARY",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   246
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   247
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   248
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   249
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   250
		"FREEZE :\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   251
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   252
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   253
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   254
		"CLEANLIBRARY :\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   255
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   256
	&Generic_MakeWorkDir('MAKEWORKLIBRARY',"${LibPath}UDEB");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   257
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   258
	&Generic_Releaseables;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   259
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   260
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   261
my $uidfile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   262
sub PMBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   263
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   264
	my @SrcList=&main::SrcList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   265
	my $BaseTrg=&main::BaseTrg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   266
	my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   267
	my $ChopBldPath=&main::Path_Chop(&main::BldPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   268
	my $DefFile=&main::DefFile;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   269
	my $EPOCIncPath=&main::EPOCIncPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   270
	my $FirstLib=&main::FirstLib;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   271
	my $BasicTrgType=&main::BasicTrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   272
	my @LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   273
	my $RelPath=&main::RelPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   274
	my $Trg=&main::Trg;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   275
	my $TrgPath=&main::TrgPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   276
	my $TrgType=&main::TrgType;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   277
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   278
	$uidfile = "$BaseTrg.UID";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   279
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   280
	if ($Bld =~ /DEB/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   281
		@LibList=&main::DebugLibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   282
	} else {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   283
		@LibList=&main::LibList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   284
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   285
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   286
	my $BLDTRGPATH = "\$(EPOCTRG$Bld)\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   287
	if ($TrgPath) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   288
		$BLDTRGPATH .= "\$(TRGDIR)\\";	    # handles TARGETPATH
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   289
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   290
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   291
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   292
#	releasables
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   293
	my @releaseables;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   294
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   295
	my $toolspath=&main::EPOCToolsPath();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   296
	push @releaseables, "$toolspath$Trg";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   297
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   298
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   299
		"WHAT$Bld : WHATGENERIC\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   300
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   301
		"CLEAN$Bld : CLEANBUILD$Bld CLEANRELEASE$Bld\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   302
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   303
		"CLEANBUILD$Bld : \n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   304
		"\t\@perl -S ermdir.pl \"\$(EPOCBLD$Bld)\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   305
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   306
		"CLEANRELEASE$Bld : CLEANGENERIC\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   307
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   308
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   309
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   310
	&Generic_WhatCleanTargets($Bld, "WHAT$Bld", "CLEANRELEASE$Bld", @releaseables);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   311
	&Generic_MakeWorkDir("MAKEWORK$Bld", &main::BldPath);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   312
	&Generic_MakeWorkDir("MAKEWORK$Bld", "$RelPath$TrgPath");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   313
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   314
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   315
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   316
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   317
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   318
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   319
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   320
		"LISTING$Bld : MAKEWORK$Bld"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   321
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   322
	foreach (@SrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   323
		my $BaseSrc = &main::Path_Split('Base', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   324
		my $Ext = &main::Path_Split('Ext', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   325
		$BaseSrc = "uid" if ($BaseSrc eq $uidfile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   326
		
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   327
   		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   328
			" \\\n\tLISTING$Bld$BaseSrc"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   329
   		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   330
   	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   331
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   332
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   333
		"\n"
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
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   337
		"LIBS$Bld="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   338
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   339
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   340
	foreach (@LibList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   341
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   342
			" \\\n\t", &Generic_Quote("\$(EPOCLINK$Bld)\\$_")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   343
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   344
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   345
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   346
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   347
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   348
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   349
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   350
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   351
		"LINK_OBJS$Bld="
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   352
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   353
	my $have_uidfile = 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   354
	foreach (@SrcList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   355
		my $BaseSrc = &main::Path_Split('Base', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   356
		my $Ext = &main::Path_Split('Ext', $_);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   357
		if ($BaseSrc eq $uidfile) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   358
			$have_uidfile = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   359
			next;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   360
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   361
   		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   362
			" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   363
			"\t", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   364
   		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   365
   	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   366
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   367
	if ($have_uidfile) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   368
		# ensure that the uid file is at the end of the list, as it's implicit in
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   369
		# CodeWarrior IDE projects.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   370
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   371
			" \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   372
			"\t", &Generic_Quote("\$(EPOCBLD$Bld)\\uid.o")
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   373
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   374
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   375
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   376
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   377
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   378
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   379
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   380
	&main::OutFormat(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   381
		"COMMON_LINK_FLAGS$Bld=",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   382
		' -msgstyle gcc',
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   383
		' -stdlib'		# use default runtime library for compiler help functions
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   384
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   385
	if ($MWLD eq "mwcc.exe") {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   386
		&main::OutFormat(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   387
			' -warnings on'	# on by default in mwccsym2.exe
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   391
	&main::OutFormat(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   392
		' -subsystem console'
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
	if ($Bld=~/DEB$/o) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   396
		&main::OutFormat(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   397
				' -g'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   398
			);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   399
		}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   400
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   401
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   402
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   403
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   404
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   405
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   406
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   407
		"LINK_FLAGS$Bld= \$(COMMON_LINK_FLAGS$Bld) \$(LIBS$Bld) \\\n\t",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   408
		" -o \"$BLDTRGPATH$Trg\"" 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   409
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   410
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   411
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   412
		' -noimplib'
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   413
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   414
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   415
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   416
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   417
		"\n"
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
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   421
		&Generic_Quote("$BLDTRGPATH$Trg"), " : \$(LINK_OBJS$Bld) "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   422
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   423
	if (-e $DefFile) { # effectively "if project frozen ..."
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   424
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   425
			&Generic_Quote($DefFile)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   426
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   427
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   428
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   429
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   430
		" \$(LIBS$Bld)\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   431
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   432
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   433
#	Perform the final link step
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   434
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   435
		"\t$MWLD "
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   436
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   437
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   438
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   439
		"\$(LINK_FLAGS$Bld) \$(LINK_OBJS$Bld)\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   440
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   441
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   442
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   443
		"\tcopy \"$BLDTRGPATH$Trg\" \"",&main::EPOCToolsPath,"$Trg\"\n"
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
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   447
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   448
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   449
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   450
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   451
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   452
sub PMStartSrcList {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   453
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   454
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   455
		"# SOURCES\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   456
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   457
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   458
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   459
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   460
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   461
sub PMStartSrc {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   462
	my $Src=&main::Src;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   463
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   464
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   465
		"# Source $Src\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   466
		"\n"
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   470
sub PMSrcDepend {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   471
	my @BldList=&main::BldList;	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   472
	my @DepList=&main::DepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   473
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   474
	$BaseSrc = "uid" if ($BaseSrc eq $uidfile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   475
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   476
	return if (@DepList == 0);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   477
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   478
	foreach (@BldList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   479
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   480
			&Generic_Quote("\$(EPOCBLD$_)\\$BaseSrc.o"), " \\\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   481
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   482
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   483
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   484
		":"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   485
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   486
	foreach (@DepList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   487
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   488
		" \\\n\t", &Generic_Quote($_)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   489
		);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   490
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   491
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   492
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   493
		"\n"
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
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   497
sub PMSrcBldDepend {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   498
	my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   499
	my @DepList=&main::DepList;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   500
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   501
	$BaseSrc = "uid" if ($BaseSrc eq $uidfile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   502
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   503
	return if (@DepList == 0);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   504
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   505
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   506
		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o"), " :",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   507
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   508
	foreach (@DepList) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   509
		&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   510
			" \\\n\t", &Generic_Quote($_)
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
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   514
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   515
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   516
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   517
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   518
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   519
sub PMEndSrcBld {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   520
	my $BaseSrc=&main::BaseSrc;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   521
	$BaseSrc = "uid" if ($BaseSrc eq $uidfile);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   522
	my $Bld=&main::Bld;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   523
	my $Plat=&main::Plat;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   524
	my $Src=&main::Src;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   525
	my $SrcPath=&main::SrcPath;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   526
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   527
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   528
		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o"), " : ",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   529
		&Generic_Quote("$SrcPath$Src"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   530
		"\t\$(CW$Bld) -o \"\$\@\" -c \"$SrcPath$Src\"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   531
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   532
#		assembler listing target - uses implicit rule to do disassembly
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   533
		"LISTING$Bld$BaseSrc : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), "\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   534
		"\t", &Generic_CopyAction("$SrcPath$BaseSrc.$Plat.lst"),
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   535
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   536
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   537
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   538
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   539
sub PMEndSrc {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   540
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   541
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   542
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   543
		"\n"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   544
	);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   545
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   546
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   547
sub PMEndSrcList {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   548
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   549
	my $show_options = "source";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   550
	$show_options = "source,unmangled,comments" if ($MWLD eq "mwldsym2.exe");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   551
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   552
	&main::Output(
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   553
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   554
		"# Implicit rule for generating .lis files\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   555
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   556
		".SUFFIXES : .lis .o\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   557
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   558
		".o.lis:\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   559
		"\t$MWLD -S -show $show_options \$< -o \$\@\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   560
		"\n",
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   561
		"\n"
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
	# Deal with accumulated MAKEDIRS etc.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   565
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
   566
	&Generic_End;
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
1;