# MAKSYS.PM
#
# Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
#


package Maksys;

require Exporter;
@ISA=qw(Exporter);
@EXPORT=qw(
	Hack_TheOutput
);


sub Hack_TheOutput($) {
	my $Text=$_[0];
	my $Trg=&main::BaseTrg;
	my $Plat=&main::Plat;
	my $BaseM=&main::BaseMak;

# solve by creating xcons.lib from deffile?
	if ($Trg=~/^EUSER$/o && $Plat=~/^(MARM|MAWD|MISA|MMAD|SARM|SARMBE|SROS)$/o) {
		$Text=~s/\.in\" \$\(LIBS\)/\.in\"/igo;
	}
# euser with minimum size optimisation (REL) under VC5 doesn't work, even with SP3
	if ($Trg=~/^EUSER$/o && $Plat=~/^(WINS|WINC|MX86)$/o) {
		$Text=~s/REL = cl.exe  \/MD \/O1 \/Ob1/REL = cl.exe  \/MD \/Od \/Ob1/igo;
		$Text=~s/DEB = cl.exe  \/MDd \/Zi \/Od/DEB = cl.exe  \/MDd \/Zi \/Od \/Ob1/igo;
	}
# solve by creating xcons.lib from deffile?
	if ($Trg=~/^(EFSRV|EUSER)$/o && $Plat=~/^(WINS|WINC|MX86)$/o) {
		$Text=~s/\$\(LIBS\) \$\(LINK_OBJS\)/\$\(LINK_OBJS\)/igo;
	}
	if ($BaseM=~/^XCONS$/o && $Plat=~/^(WINS|WINC|MX86)$/o) {
		$Text=~s/"\$\(EPOCTRG.{5,6}edll\.obj"//igo;
		$Text=~s/ \/nodefaultlib//igo;
		$Text=~s/ \/entry:"_E32Dll"//igo;
	}
	if ($BaseM=~/^(XCONS|XFILE)$/o && $Plat=~/^(WINS|WINC|MX86)$/o) {
		$Text=~s/(\tdel.*?)BLD(.*?\n)/$&$1TRG$2/igo;
	}

	return $Text;
}

1;
