diff --git a/abld b/abld
new file mode 100644
index 0000000..e273bf3
--- /dev/null
+++ b/abld
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# abld - shell frontend for abld.pl, part of GnuPoc project
+#
+# (c) 2001-2002 Alfred E. Heggestad
+#
+#    This program is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License version 2 as
+#    published by the Free Software Foundation.
+#
+
+#
+# note: small tweak to get symlinks working. 'pwd' returns the path as seen
+#       by `pwd` - but 'cwd' returns the real path, as used by the tool chain.
+#       this also works if no symlinks are used:
+#
+#       perl -S abld.pl `pwd`/ "$@"
+    
+perl -S abld.pl `perl -e 'use Cwd; my $cwd = cwd(); print "$cwd/"'` "$@"
diff --git a/abld.pl b/abld.pl
index 5716c31..7e08324 100644
--- a/abld.pl
+++ b/abld.pl
@@ -1,3 +1,5 @@
+#!/usr/bin/perl -w
+#
 # ABLD.PL
 #
 # Copyright (c) 1997-2001 Symbian Ltd.  All rights reserved.
@@ -14,12 +16,11 @@ BEGIN {
 	require 5.005_03;
 # establish the path to the Perl libraries: currently the same directory as this script
 	$PerlLibPath = $FindBin::Bin;	# X:/epoc32/tools
-	$PerlLibPath =~ s/\//\\/g;	# X:\epoc32\tools
-	$PerlLibPath .= "\\";
+	$PerlLibPath .= "\/";
 }
 
 use lib $PerlLibPath;
-use E32env;
+use e32env;
 
 # command data structure
 my %Commands=(
@@ -60,7 +61,7 @@ my %Commands=(
 	},
 	FREEZE=>{
 		program=>1,
-		function=>'Freezes exported functions in a .DEF file',
+		function=>'Freezes exported functions in a .def file',
 	},
 	HELP=>{
 		noplatform=>1,
@@ -69,7 +70,7 @@ my %Commands=(
 	},
 	LIBRARY=>{
 		program=>1,
-		function=>'Creates import libraries from the frozen .DEF files',
+		function=>'Creates import libraries from the frozen .def files',
 	},
 	LISTING=>{
 		build=>1,
@@ -127,10 +128,10 @@ my $BldInfDir;
 my $PrjBldDir;
 BEGIN {
 	$BldInfDir=shift @ARGV;
-	$PrjBldDir=$E32env::Data{BldPath};
-	$PrjBldDir=~s-^(.*)\\-$1-o;
+	$PrjBldDir=$e32env::Data{BldPath};
+	$PrjBldDir=~s-^(.*)\/-$1-o;
 	$PrjBldDir.=$BldInfDir;
-	$PrjBldDir=~m-(.*)\\-o; # remove backslash because some old versions of perl can't cope
+	$PrjBldDir=~m-(.*)\/-o; # remove backslash because some old versions of perl can't cope
 	unless (-d $1) {
 		die "ABLD ERROR: Project Bldmake directory \"$PrjBldDir\" does not exist\n";
 	}
@@ -138,12 +139,12 @@ BEGIN {
 
 # check the platform module exists and then load it
 BEGIN {
-	unless (-e "${PrjBldDir}Platform.pm") {
-		die "ABLD ERROR: \"${PrjBldDir}Platform.pm\" not yet created\n";
+	unless (-e "${PrjBldDir}platform.pm") {
+		die "ABLD ERROR: \"${PrjBldDir}platform.pm\" not yet created\n";
 	}
 }
 use lib $PrjBldDir;
-use Platform;
+use platform;
 
 # change directory to the BLD.INF directory - we might begin to do
 # things with relative paths in the future.
@@ -244,7 +245,7 @@ chdir($BldInfDir) or die "ABLD ERROR: Can't CD to \"$BldInfDir\"\n";
 		}
 		else {
 			COMPARAM1 : {
-				if (grep(/^$Plat$/, ('ALL', @Platform::Plats))) {
+				if (grep(/^$Plat$/i, ('ALL', @platform::Plats))) {
 					last COMPARAM1;
 				}
 #				check whether the platform might in fact be a build, and
@@ -259,8 +260,8 @@ chdir($BldInfDir) or die "ABLD ERROR: Can't CD to \"$BldInfDir\"\n";
 #				check whether the platform might in fact be a program, and
 #				set the platform, build and program accordingly if it is
 				if ($CommandHash{program}) {
-					if  (((not $Test) and grep /^$Plat$/, @{$Platform::Programs{ALL}})
-							or ($Test and grep /^$Plat$/, @{$Platform::TestPrograms{ALL}})) {
+					if  (((not $Test) and grep /^$Plat$/, @{$platform::Programs{ALL}})
+							or ($Test and grep /^$Plat$/, @{$platform::TestPrograms{ALL}})) {
 						$Program=$Plat;
 						$Plat='ALL';
 						$Bld='ALL';
@@ -304,8 +305,8 @@ chdir($BldInfDir) or die "ABLD ERROR: Can't CD to \"$BldInfDir\"\n";
 #					check whether the build might in fact be a program, and
 #					set the build and program if it is
 					if ($CommandHash{program}) {
-						if  (((not $Test) and grep /^$Bld$/, @{$Platform::Programs{$Plat}})
-								or ($Test and grep /^$Bld$/, @{$Platform::TestPrograms{$Plat}})) {
+						if  (((not $Test) and grep /^$Bld$/, @{$platform::Programs{$Plat}})
+								or ($Test and grep /^$Bld$/, @{$platform::TestPrograms{$Plat}})) {
 							$Program=$Bld;
 							$Bld='ALL';
 							last COMPARAM2;
@@ -335,13 +336,13 @@ chdir($BldInfDir) or die "ABLD ERROR: Can't CD to \"$BldInfDir\"\n";
 #	get the program parameter for those commands which require it
 	if ($CommandHash{program}) {
 		unless ($Program) {
-			unless ($Program=uc shift @ARGV) {
+			unless ($Program=shift @ARGV) {
 				$Program=''; #default - means ALL
 			}
 			else {
 #				check that the program is supported
-				unless (((not $Test) and grep /^$Program$/, @{$Platform::Programs{$Plat}})
-						or ($Test and grep /^$Program$/, @{$Platform::TestPrograms{$Plat}})) {
+				unless (((not $Test) and grep /^$Program$/, @{$platform::Programs{$Plat}})
+						or ($Test and grep /^$Program$/, @{$platform::TestPrograms{$Plat}})) {
 					my $Error="This project does not support $Test program \"$Program\"";
 					if ($Plat eq 'ALL') {
 						$Error.=" for any platform\n";
@@ -409,7 +410,7 @@ chdir($BldInfDir) or die "ABLD ERROR: Can't CD to \"$BldInfDir\"\n";
 		
 	unless ($CommandHash{noplatform}) {
 		if ($Plat eq 'ALL') {
-			@Plats=@Platform::RealPlats;
+			@Plats=@platform::RealPlats;
 #			Adjust the "ALL" list according to the availability of compilers
 			@Plats=grep !/WINSCW$/o, @Plats unless (defined $ENV{CWFolder} || defined $ENV{MWSym2Libraries});
 #			@Plats=grep !/WINS$/o, @Plats if (!defined $ENV{MSDevDir});
@@ -430,8 +431,9 @@ chdir($BldInfDir) or die "ABLD ERROR: Can't CD to \"$BldInfDir\"\n";
 		}
 
 		foreach $Plat (@Plats) {
-			unless (-e "$PrjBldDir$Plat$Test.make") {
-				die "ABLD ERROR: \"$PrjBldDir$Plat$Test.make\" not yet created\n";
+			my $lcplat = lc $Plat;
+			unless (-e "$PrjBldDir$lcplat$Test.make") {
+				die "ABLD ERROR: \"$PrjBldDir$lcplat$Test.make\" not yet created\n";
 			}
 		}
 		undef $Plat;
@@ -443,7 +445,7 @@ chdir($BldInfDir) or die "ABLD ERROR: Can't CD to \"$BldInfDir\"\n";
 		@Commands=@{$CommandHash{subcommands}};
 		if ($Command eq 'BUILD') { # avoid makefile listings here
 			if ($Options{what} or $Options{check}) {
-				@Commands=grep !/^MAKEFILE$/o, @{$CommandHash{subcommands}};
+				@Commands=grep !/^MAKEFILE$/io, @{$CommandHash{subcommands}};
 			}
 		}
 	}
@@ -473,14 +475,15 @@ chdir($BldInfDir) or die "ABLD ERROR: Can't CD to \"$BldInfDir\"\n";
 
 #	handle the exports related calls first
 	if (($Command)=grep /^(.*EXPORT)$/o, @Commands) { # EXPORT, CLEANEXPORT
-		unless (-e "${PrjBldDir}EXPORT$Test.make") {
-			die "ABLD ERROR: \"${PrjBldDir}EXPORT$Test.make\" not yet created\n";
+		unless (-e "${PrjBldDir}export$Test.make") {
+			die "ABLD ERROR: \"${PrjBldDir}export$Test.make\" not yet created\n";
 		}
 		unless ($Options{what} or $Options{check}) {
-			push @Calls, "make -r $KeepgoingFlag -f \"${PrjBldDir}EXPORT$Test.make\" $Command$VerboseMacro$KeepgoingMacro";
+			my $Command2 = uc $Command;
+			push @Calls, "make -r $KeepgoingFlag -f \"${PrjBldDir}export$Test.make\" $Command2$VerboseMacro$KeepgoingMacro";
 		}
 		else {
-			push @Calls, "make -r -f \"${PrjBldDir}EXPORT$Test.make\" WHAT";
+			push @Calls, "make -r -f \"${PrjBldDir}export$Test.make\" WHAT";
 		}
 		@Commands=grep !/EXPORT$/o, @Commands;
 	}
@@ -523,17 +526,19 @@ chdir($BldInfDir) or die "ABLD ERROR: Can't CD to \"$BldInfDir\"\n";
 				unless ($Options{what} or $Options{check}) {
 					if ($Program) { # skip programs if they're not supported for a platform
 						unless ($Test) {
-							unless (grep /^$Program$/, @{$Platform::Programs{$Plat}}) {
+							unless (grep /^$Program$/, @{$platform::Programs{$Plat}}) {
 								next PLATFORM;
 							}
 						}
 						else {
-							unless (grep /^$Program$/, @{$Platform::TestPrograms{$Plat}}) {
+							unless (grep /^$Program$/, @{$platform::TestPrograms{$Plat}}) {
 								next PLATFORM;
 							}
 						}
 					}
-					push @Calls, "make -r $KeepgoingFlag -f \"$PrjBldDir$Plat$Test.make\" $Command$Program$CFG$Source$VerboseMacro$KeepgoingMacro";
+#					my $lc_command = lc $Command;
+					my $lc_plat = lc $Plat;
+					push @Calls, "make -r $KeepgoingFlag -f \"$PrjBldDir$lc_plat$Test.make\" $Command$Program$CFG$Source$VerboseMacro$KeepgoingMacro";
 					next;
 				}
 				unless (${$Commands{$Command}}{what}) {
@@ -541,21 +546,22 @@ chdir($BldInfDir) or die "ABLD ERROR: Can't CD to \"$BldInfDir\"\n";
 				}
 				if ($Program) { # skip programs if they're not supported for a platform
 					unless ($Test) {
-						unless (grep /^$Program$/, @{$Platform::Programs{$Plat}}) {
+						unless (grep /^$Program$/, @{$platform::Programs{$Plat}}) {
 							next PLATFORM;
 						}
 					}
 					else {
-						unless (grep /^$Program$/, @{$Platform::TestPrograms{$Plat}}) {
+						unless (grep /^$Program$/, @{$platform::TestPrograms{$Plat}}) {
 							next PLATFORM;
 						}
 					}
 				}
 				my $Makefile='';
-				if ($Command=~/MAKEFILE$/o) {
+				if ($Command=~/MAKEFILE$/io) {
 					$Makefile='MAKEFILE';
 				}
-				push @Calls, "make -r -f \"$PrjBldDir$Plat$Test.make\" WHAT$Makefile$Program $CFG";
+				my $lcplat = lc $Plat;
+				push @Calls, "make -r -f \"$PrjBldDir$lcplat$Test.make\" WHAT$Makefile$Program $CFG";
 			}
 		}
 	}
@@ -566,7 +572,6 @@ chdir($BldInfDir) or die "ABLD ERROR: Can't CD to \"$BldInfDir\"\n";
 	my $Call;
 	unless ($Options{what} or $Options{check}) {
 		foreach $Call (@Calls) {
-			print "  $Call\n";
 			open PIPE, "$Call |";
 			while (<PIPE>) {
 				print;
@@ -615,7 +620,7 @@ ENDHERESTRING
 
 	print
 		"project platforms:\n",
-		"   @Platform::Plats\n"
+		"   @platform::Plats\n"
 	;
 	exit 1;
 }
@@ -641,7 +646,7 @@ sub Help ($) {
 
 	my %CommandHash=%{$Commands{$Command}};
 
-	print 'ABLD';
+	print 'abld';
 	unless ($CommandHash{notest}) {
 		print ' [test]';
 	}
diff --git a/aiftool b/aiftool
new file mode 100644
index 0000000..e05dea0
--- /dev/null
+++ b/aiftool
@@ -0,0 +1,74 @@
+#! /bin/bash
+#
+# aiftool - Unix frontend for aiftool.exe
+#
+# (c) 2001-2006 Alfred E. Heggestad 
+#
+#    This program is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or
+#    (at your option) any later version.
+#
+# Arguments:
+#
+#   $1 input resource filename
+#   $2 input mbmname
+#
+
+usage()
+{
+echo 'AIFTOOL filename mbmname'
+echo 'Use this command to produce an AIF from'
+echo '- a resource file containing language, caption'
+echo '  and capability specifications'
+echo '- a multi-bitmap file containing icons and masks'
+echo '  in various sizes'
+echo 'Specify'
+echo '  filename: the name of the input resource file; the'
+echo '            .rss extension is added by AIFTOOL'
+echo '  mbmname:  the name of the input .mbm file: you'
+echo '            must specify the extension'
+}
+
+echo AIF tool
+
+#
+# check arguments - need at least 2 of them
+#
+if [ $# -lt 2  ] ; then usage ; exit 0 ; fi
+if [ $1 = ""   ] ; then usage ; exit 0 ; fi
+if [ $1 = "/?" ] ; then usage ; exit 0 ; fi
+if [ $1 = "/h" ] ; then usage ; exit 0 ; fi
+if [ $1 = "/H" ] ; then usage ; exit 0 ; fi
+
+
+#
+# compile the resource file
+#
+echo Compiling resource file
+arm-epoc-pe-cpp -I. -I../inc -I../../epoc32/include -I$EPOCROOT/epoc32/include -D_UNICODE < $1.rss > $1.rpp
+wine $EPOCROOT/epoc32/tools/rcomp.exe -D_UNICODE -oaif.rsc -h$1.rs~ -i$1.rss -s$1.rpp
+rm -f $1.rs~
+rm -f $1.rpp
+
+#
+# duplicate mbm file
+#
+cp $2 aif.mbm
+
+
+#
+# run Aiftool
+#
+echo Running AIF writer
+#emxaif aif.rsc $2 -o $1.aif
+wine $EPOCROOT/epoc32/release/winc/udeb/aiftool.exe .
+
+#
+# cleanup
+#
+mv out.aif $1.aif
+#rm -f aif.rsc
+#rm -f aif.mbm
+
+# EOF - aiftool
diff --git a/bldmake b/bldmake
new file mode 100644
index 0000000..3619320
--- /dev/null
+++ b/bldmake
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# bldmake - bash interface for bldmake.pl, part of GnuPoc project
+#
+# (c) 2001 Alfred E. Heggestad
+#
+#    This program is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License version 2 as
+#    published by the Free Software Foundation.
+#
+
+perl -S bldmake.pl "$@"
diff --git a/bldmake.pl b/bldmake.pl
index bd497fb..73b5180 100644
--- a/bldmake.pl
+++ b/bldmake.pl
@@ -1,3 +1,5 @@
+#!/usr/bin/perl -w
+#
 # BLDMAKE.PL
 #
 # Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
@@ -19,17 +21,16 @@ BEGIN {
 	require 5.005_03;
 # establish the path to the Perl libraries: currently the same directory as this script
 	$PerlLibPath = $FindBin::Bin;	# X:/epoc32/tools
-	$PerlLibPath =~ s/\//\\/g;	# X:\epoc32\tools
-	$PerlLibPath .= "\\";
+	$PerlLibPath .= "\/";
 }
 
 use lib $PerlLibPath;
-use E32env;
-use E32Plat;
-use Modload;
-use Output;
-use Pathutl;
-use E32Variant;
+use e32env;
+use e32plat;
+use modload;
+use output;
+use pathutl;
+use e32variant;
 
 my %Options;
 my %KeepGoing;
@@ -76,7 +77,7 @@ my $variantMacroHRHFile = Variant_GetMacroHRHFile();
 			);
 		}
 		print(
-			"Macros defined for BLD.INF preprocessing of MMPFILE sections:\n"
+			"Macros defined for bld.inf preprocessing of MMPFILE sections:\n"
 		);
 		foreach $PlatName (@PlatList) {
 			my %Plat;
@@ -91,24 +92,24 @@ my $variantMacroHRHFile = Variant_GetMacroHRHFile();
 	}
 
 
-#	check that the BLD.INF file exists
-#	maybe BLDMAKE should allow a path to be specified leading to the BLD.INF file
+#	check that the bld.inf file exists
+#	maybe BLDMAKE should allow a path to be specified leading to the bld.inf file
 	my $BldInfPath=&Path_WorkPath;
-	unless (-e "${BldInfPath}BLD.INF") {
-		&FatalError("Can't find \"${BldInfPath}BLD.INF\"");
+	unless (-e "${BldInfPath}bld.inf") {
+		&FatalError("Can't find \"${BldInfPath}bld.inf\"");
 	}
 
-	if (!-d $E32env::Data{EPOCPath}){
-		&FatalError("Directory \"$E32env::Data{EPOCPath}\" does not exist");
+	if (!-d $e32env::Data{EPOCPath}){
+		&FatalError("Directory \"$e32env::Data{EPOCPath}\" does not exist");
 	}
 
 #	decide the output directory
-	my $OutDir=&Path_Chop($E32env::Data{BldPath}).$BldInfPath;
+	my $OutDir=&Path_Chop($e32env::Data{BldPath}).$BldInfPath;
 
 #	Work out the path for the IBY files
-	my $RomDir=&Path_Chop($E32env::Data{RomPath}).$BldInfPath;
+	my $RomDir=&Path_Chop($e32env::Data{RomPath}).$BldInfPath;
 
-#	Work out the name for the BLD.INF module
+#	Work out the name for the bld.inf module
 	my @Dirs=&Path_Dirs($BldInfPath);
 	my $Module='';
 	foreach (@Dirs) {
@@ -129,18 +130,18 @@ my $variantMacroHRHFile = Variant_GetMacroHRHFile();
 		exit;
 	}
 
-#	parse BLD.INF - to get the platforms and the export files
-	eval { &Load_ModuleL('PREPFILE'); };
+#	parse bld.inf - to get the platforms and the export files
+	eval { &Load_ModuleL('prepfile'); };
 	&FatalError($@) if $@;
 
 	my @RealPlats=();
 	my @Exports=();
 	my @TestExports=();
 	if ($Options{v}) {
-		print "Reading \"${BldInfPath}BLD.INF\" for platforms and exports\n";
+		print "Reading \"${BldInfPath}bld.inf\" for platforms and exports\n";
 	}
 	&ParseBldInf(\@RealPlats, \@Exports, \@TestExports, $BldInfPath, 
-		$E32env::Data{EPOCIncPath}, $E32env::Data{EPOCPath});
+		$e32env::Data{EPOCIncPath}, $e32env::Data{EPOCPath});
 	
 #	get any IDE platforms required into a new platforms list, and
 #	Create a hash to contain the 'real' names of the platforms, i.e. WINS rather than VC6
@@ -168,7 +169,7 @@ my $variantMacroHRHFile = Variant_GetMacroHRHFile();
 	my @DoPlats=@Plats;
 	unless ($CLPlat eq 'ALL') {
 		unless (grep /^$CLPlat$/, @Plats) {
-			&FatalError("Platform $CLPlat not supported by \"${BldInfPath}BLD.INF\"\n");
+			&FatalError("Platform $CLPlat not supported by \"${BldInfPath}bld.inf\"\n");
 		}
 		@DoPlats=($CLPlat);
 		@DoRealPlats=$Real{$CLPlat};
@@ -176,17 +177,17 @@ my $variantMacroHRHFile = Variant_GetMacroHRHFile();
 	undef $CLPlat;
 			
 #	sort out the export directories we might need to make
-	my @ExportDirs=ExportDirs(\@Exports);
-	my @TestExportDirs=ExportDirs(\@TestExports);
+	my @ExportDirs=&ExportDirs(\@Exports);
+	my @TestExportDirs=&ExportDirs(\@TestExports);
 
-#	parse the BLD.INF file again for each platform supported by the project
+#	parse the bld.inf file again for each platform supported by the project
 #	storing the information in a big data structure
 	my %AllPlatData;
 	my %AllPlatTestData;
 	my $Plat;
 	foreach $Plat (@RealPlats) {
 		if ($Options{v}) {
-			print "Reading \"${BldInfPath}BLD.INF\" for $Plat\n";
+			print "Reading \"${BldInfPath}bld.inf\" for $Plat\n";
 		}
 		my (@PlatData, @PlatTestData);
 		&ParseBldInfPlat(\@PlatData, \@PlatTestData, $Plat, $BldInfPath);
@@ -197,42 +198,44 @@ my $variantMacroHRHFile = Variant_GetMacroHRHFile();
 
 	if ($Command eq 'BLDFILES') {
 
-#		create the perl file, PLATFORM.PM, listing the platforms
+#		create the perl file, platform.pm, listing the platforms
 		if ($Options{v}) {
-			print "Creating \"${OutDir}PLATFORM.PM\"\n";
+			print "Creating \"${OutDir}platform.pm\"\n";
 		}
 		&CreatePlatformPm($OutDir, \@Plats, \@RealPlats, \%Real, \%AllPlatData, \%AllPlatTestData);
 
-#		create the .BAT files required to call ABLD.PL
-		if ($Options{v}) {
-			print "Creating \"${BldInfPath}ABLD.BAT\"\n";
-		}
-		&CreatePerlBat($BldInfPath);
+		# Note from alfredh:
+		#
+		#     I removed the creation of the abld shell file
+		#     because it is not necessary. Instead, the file
+		#     is now in /epoc32/tools directory
+		#
 
 #		create the makefile for exporting files
 		if ($Options{v}) {
-			print "Creating \"${OutDir}EXPORT.MAKE\"\n";
+			print "Creating \"${OutDir}export.make\"\n";
 		}
-		&CreateExportMak("${OutDir}EXPORT.MAKE", \@Exports, \@ExportDirs);
+		&CreateExportMak("${OutDir}export.make", \@Exports, \@ExportDirs);
 
 #		create the makefile for exporting test files
 		if ($Options{v}) {
-			print "Creating \"${OutDir}EXPORTTEST.MAKE\"\n";
+			print "Creating \"${OutDir}exporttest.make\"\n";
 		}
-		&CreateExportMak("${OutDir}EXPORTTEST.MAKE", \@TestExports, \@TestExportDirs);
+		&CreateExportMak("${OutDir}exporttest.make", \@TestExports, \@TestExportDirs);
 
 #		create the platform meta-makefiles
 		foreach (@DoPlats) {
 			if ($Options{v}) {
-				print "Creating \"$OutDir$_.MAKE\"\n";
+				my $tmp = lc $_;
+				print "Creating \"$OutDir$tmp.make\"\n";
 			}
-			&CreatePlatMak($OutDir, $E32env::Data{BldPath}, $AllPlatData{$Real{$_}}, $_, $Real{$_}, $RomDir, $Module, $BldInfPath);
+			&CreatePlatMak($OutDir, $e32env::Data{BldPath}, $AllPlatData{$Real{$_}}, $_, $Real{$_}, $RomDir, $Module, $BldInfPath);
 		}
 		foreach (@DoPlats) {
 			if ($Options{v}) {
-				print "Creating \"$OutDir${_}TEST.MAKE\"\n";
+				print "Creating \"$OutDir${_}test.make\"\n";
 			}
-			&CreatePlatMak($OutDir, $E32env::Data{BldPath}, $AllPlatTestData{$Real{$_}}, $_, $Real{$_}, $RomDir, $Module, $BldInfPath, 'TEST');
+			&CreatePlatMak($OutDir, $e32env::Data{BldPath}, $AllPlatTestData{$Real{$_}}, $_, $Real{$_}, $RomDir, $Module, $BldInfPath, 'TEST');
 		}
 
 #		create the platform test batch files
@@ -246,7 +249,7 @@ my $variantMacroHRHFile = Variant_GetMacroHRHFile();
 #		report any near-fatal errors
 		if (scalar keys %KeepGoing) {
 		    print STDERR
-			    "\n${BldInfPath}BLD.INF WARNING(S):\n",
+			    "\n${BldInfPath}bld.inf WARNING(S):\n",
 			    sort keys %KeepGoing
 			    ;
 		}
@@ -266,7 +269,7 @@ my $variantMacroHRHFile = Variant_GetMacroHRHFile();
 
 sub Usage () {
 
-	eval { &Load_ModuleL('E32TPVER'); };
+	eval { &Load_ModuleL('e32tpver'); };
 	&FatalError($@) if $@;
 
 	print
@@ -278,7 +281,7 @@ sub Usage () {
 		"<command>: (case insensitive)\n",
 		" BLDFILES - create build batch files\n",
 		" CLEAN    - remove all files bldmake creates\n",
-		" INF      - display basic BLD.INF syntax\n",
+		" INF      - display basic bld.inf syntax\n",
 		" PLAT     - display platform macros\n",
 		"\n",
 		"<platform>: (case insensitive)\n",
@@ -295,7 +298,7 @@ sub ShowBldInfSyntax () {
 
 	print <<ENDHERE;
 
-BLD.INF - Syntax
+bld.inf - Syntax
 
 /* Use C++ comments if required */
 // (Curly braces denote optional arguments)
@@ -313,7 +316,7 @@ PRJ_EXPORTS
 PRJ_TESTEXPORTS
 [<source path>\<source file>]	{<destination>}
 // list each file exported from source on a separate line
-// {<destination>} defaults to BLD.INF dir
+// {<destination>} defaults to bld.inf dir
 
 PRJ_MMPFILES
 [<mmp path>\<mmp file>] {tidy} {ignore}
@@ -348,7 +351,7 @@ sub ParseBldInf ($$$$$) {
 	my ($PlatsRef, $ExportsRef, $TestExportsRef, $BldInfPath, $EPOCIncPath, $EPOCPath)=@_;
 
 	my @Prj2D;
-	eval { &Prepfile_ProcessL(\@Prj2D, "${BldInfPath}BLD.INF",$variantMacroHRHFile); };
+	eval { &Prepfile_ProcessL(\@Prj2D, "${BldInfPath}bld.inf",$variantMacroHRHFile); };
 	&FatalError($@) if $@;
 	
 	my @SupportedPlats=&Plat_List();
@@ -365,10 +368,11 @@ sub ParseBldInf ($$$$$) {
 	my $Section=0;
 	my @PrjFileDie;
 	my $Line;
-	my $CurFile="${BldInfPath}BLD.INF";
+	my $CurFile="${BldInfPath}bld.inf";
 	LINE: foreach $Line (@Prj2D) {
 		my $LineNum=shift @$Line;
 		$_=shift @$Line;
+		$_=~s/\\/\//g; # backwards comp - convert backslash to forward slash
 		if ($LineNum eq '#') {
 			$CurFile=$_;
 			next LINE;
@@ -394,9 +398,9 @@ sub ParseBldInf ($$$$$) {
 			unshift @$Line, $_;
 			my $Candidate;
 			CANDLOOP: foreach $Candidate (@$Line) {
-				$Candidate=uc $Candidate;
+				$Candidate=lc $Candidate;
 #				expand DEFAULT
-				if ($Candidate eq 'DEFAULT') {
+				if ($Candidate eq 'default') {
 					$DefaultPlatsUsed=1;
 					my $Default;
 					foreach $Default (@DefaultPlats) {
@@ -416,7 +420,7 @@ sub ParseBldInf ($$$$$) {
 						next CANDLOOP;
 					}
 #					check platform is in the default list
-					unless (grep /^$Candidate$/, @DefaultPlats) {
+					unless (grep /^$Candidate$/i, @DefaultPlats) {
 						push @PrjFileDie, "$CurFile($LineNum) : Platform $Candidate specified for removal is not in DEFAULT list\n";
 						next CANDLOOP;
 					}
@@ -430,7 +434,7 @@ sub ParseBldInf ($$$$$) {
 						}
 #				check platform is supported
 
-				unless (grep /^$Candidate$/, @SupportedPlats) {
+				unless (grep /^$Candidate$/i, @SupportedPlats) {
 					WarnOrDie(\@PrjFileDie, "$CurFile($LineNum) : Unsupported platform $Candidate specified\n");
 					next CANDLOOP;
 				}
@@ -441,7 +445,7 @@ sub ParseBldInf ($$$$$) {
 				}
 #				add the platform
 				unless ($PlatformCheck{$Candidate}) {
-					push @Plats, $Candidate;
+					push @Plats, uc $Candidate;
 					$PlatformCheck{$Candidate}="$CurFile: $LineNum";
 				}
 			}
@@ -455,6 +459,7 @@ sub ParseBldInf ($$$$$) {
 			if (@$Line) {
 #				get the destination file if it's specified
 				$Releasable=shift @$Line;
+				$Releasable=~s/\\/\//g;      # force to forward slash
 			}
 			if (@$Line) {
 				push @PrjFileDie, "$CurFile($LineNum) : Too many arguments in exports section line\n";
@@ -499,7 +504,7 @@ sub ParseBldInf ($$$$$) {
 	}
 	if (@PrjFileDie) {
 		print STDERR
-			"\n${BldInfPath}BLD.INF FATAL ERROR(S):\n",
+			"\n${BldInfPath}bld.inf FATAL ERROR(S):\n",
 			@PrjFileDie
 		;
 		exit 1;
@@ -539,14 +544,14 @@ sub ExportDirs ($) {
 sub ParseBldInfPlat ($$$$) {
 	my ($DataRef, $TestDataRef, $Plat, $BldInfPath)=@_;
 
-#	get the platform .MMP macros
+#	get the platform .mmp macros
 	my %Plat;
 	eval { &Plat_GetL($Plat,\%Plat); };
 	&FatalError($@) if $@;
 
-#	get the raw data from the BLD.INF file
+#	get the raw data from the bld.inf file
 	my @Prj2D;
-	eval { &Prepfile_ProcessL(\@Prj2D, "${BldInfPath}BLD.INF", $variantMacroHRHFile, @{$Plat{MmpMacros}}); };
+	eval { &Prepfile_ProcessL(\@Prj2D, "${BldInfPath}bld.inf", $variantMacroHRHFile, @{$Plat{MmpMacros}}); };
 	&FatalError($@) if $@;
 	
 #	process the raw data
@@ -554,7 +559,7 @@ sub ParseBldInfPlat ($$$$) {
 	my $Section=0;
 	my @PrjFileDie;
 	my $Line;
-	my $CurFile="${BldInfPath}BLD.INF";
+	my $CurFile="${BldInfPath}bld.inf";
 	LINE: foreach $Line (@Prj2D) {
 
 		my %Data;
@@ -567,46 +572,48 @@ sub ParseBldInfPlat ($$$$) {
 		}
 		
 #		upper-case all the data here
-		foreach (@$Line) {
-			$_=uc $_;
-		}
+#		foreach (@$Line) {
+#			$_=uc $_;
+#		}
 
 		$_=shift @$Line;
 
 #		check for section headers - don't test for the right ones here
 #		because we do that in the first parse function
 
-		if (/^PRJ_(\w*)$/o) {
-			$Section=$1;
+		if (/^PRJ_(\w*)$/oi) {
+			$Section=uc $1;
 			next LINE;
 		}
 
-#		check for the sections we're interested in and get the .MMP file details
+#		check for the sections we're interested in and get the .mmp file details
 		if ($Section=~/^(MMPFILES|TESTMMPFILES)$/o) {
 
-			$Data{Ext}='.MMP';
+			$Data{Ext}='.mmp';
 
 #			check for MAKEFILE statements for custom building
-			if (/^MAKEFILE$/o) {
-				$Data{Makefile}=2;  # hack - treat MAKEFILE=>NMAKEFILE   =1;
+			if (/^MAKEFILE$/oi) {
+				$Data{Makefile}=1;  # hack - treat MAKEFILE=>NMAKEFILE   =1;
 				$_=shift @$Line;
 				$Data{Ext}=&Path_Split('Ext', $_);
 			}
-			if (/^NMAKEFILE$/o) {
+			if (/^NMAKEFILE$/oi) {
 				$Data{Makefile}=2;
 				$_=shift @$Line;
 				$Data{Ext}=&Path_Split('Ext', $_);
 			}
-			if (/^GNUMAKEFILE$/o) {
+			if (/^GNUMAKEFILE$/oi) {
 				$Data{Makefile}=1;
 				$_=shift @$Line;
 				$Data{Ext}=&Path_Split('Ext', $_);
 			}
+
+			$_=~s/\\/\//g; # convert backslash to forward slash
 			
 #			path considered relative to the current file
 			$Data{Path}=&Path_Split('Path', &Path_MakeAbs($CurFile, $_));
 
-#			this function doesn't care whether the .MMPs are listed with their extensions or not
+#			this function doesn't care whether the .mmp's are listed with their extensions or not
 			$Data{Base}=&Path_Split('Base', $_);
 
 #			check the file isn't already specified
@@ -616,6 +623,8 @@ sub ParseBldInfPlat ($$$$) {
 			}
 			$Check{$Data{Base}}="$CurFile: $LineNum";
 
+		        $Data{Base}=~s/\\/\//g;      # force to forward slash
+
 #			check the file exists
 			unless (-e "$Data{Path}$Data{Base}$Data{Ext}") {
 				WarnOrDie(\@PrjFileDie, "$CurFile($LineNum) : $Data{Path}$Data{Base}$Data{Ext} does not exist\n");
@@ -625,6 +634,7 @@ sub ParseBldInfPlat ($$$$) {
 #			process the file's attributes
 			if ($Section eq 'MMPFILES') {
 				foreach (@$Line) {
+				#$_ = uc $_; # alfredh: hack TODOAEH
 					if (/^TIDY$/o) {
 						$Data{Tidy}=1;
 						next;
@@ -632,11 +642,11 @@ sub ParseBldInfPlat ($$$$) {
 					if (/^IGNORE$/o) {
 						next LINE;
 					}
-					push @PrjFileDie, "$CurFile($LineNum) : Don't understand .MMP file argument \"$_\"\n";
+					push @PrjFileDie, "$CurFile($LineNum) : Don't understand .mmp file argument \"$_\"\n";
 				}
 			}
 
-#			process the test .MMP file's attributes
+#			process the test .mmp file's attributes
 			elsif ($Section eq 'TESTMMPFILES') {
 				foreach (@$Line) {
 					if (/^TIDY$/o) {
@@ -654,7 +664,7 @@ sub ParseBldInfPlat ($$$$) {
 						$Data{Support}=1;
 						next;
 					}
-					push @PrjFileDie, "$CurFile($LineNum) : Don't understand test .MMP file argument \"$_\"\n";
+					push @PrjFileDie, "$CurFile($LineNum) : Don't understand test .mmp file argument \"$_\"\n";
 				}
 			}
 
@@ -675,7 +685,7 @@ sub ParseBldInfPlat ($$$$) {
 #	exit if there are errors
 	if (@PrjFileDie) {
 		print STDERR
-			"\n\"${BldInfPath}BLD.INF\" FATAL ERROR(S):\n",
+			"\n\"${BldInfPath}bld.inf\" FATAL ERROR(S):\n",
 			@PrjFileDie
 		;
 		exit 1;
@@ -700,12 +710,14 @@ sub CreatePlatformPm ($$$$$$) {
 	}
 
 	&Output(
-		"# Bldmake-generated perl file - PLATFORM.PM\n",
+		"#!/usr/bin/perl -w\n",
+		"#\n",
+		"# Bldmake-generated perl file - platform.pm\n",
 		"\n",
 		"# use a perl integrity checker\n",
 		"use strict;\n",
 		"\n",
-		"package Platform;\n",
+		"package platform;\n",
 		"\n",
 		"use vars qw(\@Plats \@RealPlats %Programs %TestPrograms);\n",
 		"\n",
@@ -776,8 +788,8 @@ sub CreatePlatformPm ($$$$$$) {
 		"1;\n"
 	);
 
-#	write the PLATFORM.PM file
-	&WriteOutFileL($BatchPath."PLATFORM.PM");
+#	write the platform.pm file
+	&WriteOutFileL($BatchPath."platform.pm");
 }
 
 sub CreatePerlBat ($) {
@@ -819,10 +831,9 @@ sub CreatePerlBat ($) {
 sub CreateExportMak ($$$) {
 	my ($Makefile, $ExportsRef, $ExpDirsRef)=@_;
 
-#	create EXPORT.MAKE
+#	create export.make
 
-	my $erasedefn = "\@erase";
-	$erasedefn = "\@erase 2>>nul" if ($ENV{OS} eq "Windows_NT");
+	my $erasedefn = "\@rm -f";
 	&Output(
 		"ERASE = $erasedefn\n",
 		"\n",
@@ -842,7 +853,7 @@ sub CreateExportMak ($$$) {
 	else {
 		&Output(
 			" \n",
-			"\t\@echo Nothing to do\n"
+#			"\t\@echo Nothing to do\n"
 		);
 	}
 	&Output(
@@ -879,7 +890,7 @@ sub CreateExportMak ($$$) {
 		my $src=&Path_Quote($$ref{Source});
 		&Output(
 			"$dst : $src\n",
-			    "\tcopy \"\$?\" \"\$\@\"\n",
+			    "\tcp \"\$?\" \"\$\@\"\n",
 			"\n"
 		);
 	}
@@ -909,9 +920,9 @@ sub CreateExportMak ($$$) {
 	else {
 		&Output(
 			"CLEANEXPORT :\n",
-			"\t\@echo Nothing to do\n",
+#			"\t\@echo Nothing to do\n",
 			"WHAT :\n",
-			"\t\@rem do nothing\n"
+#			"\t\@rem do nothing\n"
 		);
 	}
 	
@@ -927,21 +938,17 @@ sub CreatePlatMak ($$$$$$$$$) {
 		$Test='';
 	}
 	else {
-		$Test='TEST';
+		$Test='test';
 	}
 
-	my $OutRomFile="$RomDir$RealPlat$Test.IBY";
-	my $GCCDir="gcc\\bin";
+	my $OutRomFile="$RomDir$RealPlat$Test.iby";
 	
-	my $erasedefn = "\@erase";
-	$erasedefn = "\@erase 2>>nul" if ($ENV{OS} eq "Windows_NT");
+	my $erasedefn = "\@rm -f";
 	&Output(
-		"# set Path for custom builds using GCC - must set Path and PATH\n",
-		'Path:=',&main::Path_Drive,$E32env::Data{EPOCPath},$GCCDir,";\$(Path)\n",
-		"PATH:=\$(Path)\n",
-		"\n",
-		"# prevent MAKEFLAGS variable from upsetting calls to NMAKE\n",
-		"unexport MAKEFLAGS\n",
+		"#\n",
+		"#   this makefile is for GNU make\n",
+		"#   generated by GnuPoc - EPOC SDK for GNU/Linux\n",
+		"#\n",
 		"\n",
 		"ERASE = $erasedefn\n",
 		"\n",
@@ -986,7 +993,7 @@ sub CreatePlatMak ($$$$$$$$$) {
 	if ($whatcount==0) {
 		&Output(
 			"\n",
-			"\t\@rem do nothing\n" 
+#			"\t\@rem do nothing\n" 
 		);
 	}
 	&Output(
@@ -1008,7 +1015,7 @@ sub CreatePlatMak ($$$$$$$$$) {
 	else {
 		&Output(
 			"\n",
-			"\t\@echo Nothing to do\n"
+#			"\t\@echo Nothing to do\n"
 		);
 	}
 	&Output(
@@ -1077,8 +1084,8 @@ sub CreatePlatMak ($$$$$$$$$) {
 
 #		standard commands
 		unless ($$Ref{Makefile}) {
-			my $MakefilePath=join('', &Path_Chop($E32MakePath), $$Ref{Path}, $$Ref{Base}, "\\", $RealPlat, "\\");
-			my $RealMakefile="-f \"$MakefilePath$$Ref{Base}.$RealPlat\"";
+			my $MakefilePath=join('', &Path_Chop($E32MakePath), $$Ref{Path}, $$Ref{Base}, "\/", lc $RealPlat, "\/");
+			my $RealMakefile="-f \"$MakefilePath$$Ref{Base}." . lc $RealPlat . "\"";
 			my $MakefileBase="$MakefilePath$$Ref{Base}";		
 			&Output(
 				"MAKEFILE$$Ref{Base}_FILES= \\\n",
@@ -1127,7 +1134,7 @@ sub CreatePlatMak ($$$$$$$$$) {
 				    "\t$CallMake $RealMakefile MAKEWORK\$(CFG) LISTING\$(CFG)\$(SOURCE)\n",
 				"\n",
 				"FINAL$$Ref{Base} :\n",
-				    "\t\@rem do nothing\n",
+#				    "\t\@rem do nothing\n",
 				"\n",
 			);
 			foreach $Command (qw(CLEAN RESOURCE)) {
@@ -1174,10 +1181,19 @@ sub CreatePlatMak ($$$$$$$$$) {
 			if ($$Ref{Makefile}==2) {
 				$MakefileCall="cd $ChopRefPath;$CallNmake";
 			} else {
-				$MakefileCall="$CallGNUmake -C $ChopRefPath";
+				my $epocroot = $ENV{EPOCROOT};
+				$epocroot =~ s/\//\\\\/g;
+				my $winChopRefPath = $ChopRefPath;
+				$winChopRefPath =~ s/\//\\\\/g;
+#				$MakefileCall="EPOCROOT=$epocroot wine $CallGNUmake -C $winChopRefPath";
+				$MakefileCall="EPOCROOT=$epocroot extmake \$(VERBOSE) \$(KEEPGOING) -C $winChopRefPath";
 			}
-			$MakefileCall.=" -f \"$$Ref{Base}$$Ref{Ext}\" TO_ROOT=";
-			$MakefileCall.=&Path_Chop(&Path_UpToRoot($$Ref{Path}));
+			my $makefile = "$$Ref{Base}$$Ref{Ext}";
+			my $to_root = &Path_Chop(&Path_UpToRoot($$Ref{Path}));
+			$makefile =~ s/\//\\\\/g;
+			$to_root =~ s/\//\\\\/g;
+			$MakefileCall.=" -f \"$makefile\" TO_ROOT=";
+			$MakefileCall.=$to_root;
 			&Output(
 # should change to MAKEFILE
 				"MAKEFILE$$Ref{Base} :\n",
@@ -1242,8 +1258,9 @@ sub CreatePlatMak ($$$$$$$$$) {
 		}
 
 	}
-	
-	&WriteOutFileL("$BatchPath$Plat$Test.MAKE");
+
+	$Plat = lc $Plat;
+	&WriteOutFileL("$BatchPath$Plat$Test.make");
 }
 
 sub CreatePlatBatches ($$$) {
diff --git a/bmconv b/bmconv
new file mode 100644
index 0000000..8f7b564
--- /dev/null
+++ b/bmconv
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# bmconv - bash frontend for bmconv.exe, part of GnuPoc project
+#
+# (c) 2001-2006 Alfred E. Heggestad
+#
+#    This program is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License version 2 as
+#    published by the Free Software Foundation.
+#
+
+PGM=`basename $0`
+echo "executing $PGM.exe"
+ROOT=$EPOCROOT/epoc32/tools
+wine $ROOT/$PGM.exe "$@"
diff --git a/checkgcc.pm b/checkgcc.pm
index f6dbd83..9b09757 100644
--- a/checkgcc.pm
+++ b/checkgcc.pm
@@ -1,3 +1,5 @@
+#!/usr/bin/perl -w
+#
 # CHECKGCC.PM
 #
 # Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
@@ -6,22 +8,21 @@
 
 # module for checking gcc is set up correctly
 
-package CheckGcc;
+package checkgcc;
 
 
 BEGIN {
-	# die if CPP.EXE in a dodgy place in the path
-	my @Paths=split ';', $ENV{Path};
+	# die if CPP in a dodgy place in the path
+	my @Paths=split ':', $ENV{PATH};
 	unshift @Paths,'.';	# add the current directory
 	foreach (@Paths) {
-		s-/-\\-go;	# for those working with UNIX shells
-		s-^(.*[^\\])$-$1\\-o;   # ensure path ends with a backslash
-		if ((-e $_.'CPP.EXE') or (-e $_.'CPP.BAT') or (-e $_.'CPP.CMD')) {
-			unless (/\\GCC\\BIN\\$/i) {
+		s-^(.*[^\/])$-$1\/-o;   # ensure path ends with a slash
+		if (-e $_.'arm-epoc-pe-cpp') {
+			unless (/\/bin\/$/i) {
 				die
 					"ERROR: First CPP executable found in path is in $_,\n",
-					"but the required CPP.EXE was expected to be found in a directory\n",
-					"with a name ending in \\GCC\\BIN\\, where the Cygnus tools\n",
+					"but the required CPP was expected to be found in a directory\n",
+					"with a name ending in /bin/, where the Cygnus tools\n",
 					"this program depends upon are stored.\n",
 					"Is your path set up correctly?\n"
 				;
diff --git a/cjpeg b/cjpeg
new file mode 100644
index 0000000..32db777
--- /dev/null
+++ b/cjpeg
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# cjpeg - bash frontend for cjpeg.exe, part of GnuPoc project
+#
+# (c) 2001 Alfred E. Heggestad
+#
+#    This program is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License version 2 as
+#    published by the Free Software Foundation.
+#
+
+PGM=`basename $0`
+echo "executing $PGM.exe"
+ROOT=$EPOCROOT/epoc32/tools
+wine $ROOT/$PGM.exe "$@"
diff --git a/cl_codewarrior.pm b/cl_codewarrior.pm
index 13ef05c..06f5024 100644
--- a/cl_codewarrior.pm
+++ b/cl_codewarrior.pm
@@ -4,7 +4,7 @@
 #
 
 
-package Cl_codewarrior;
+package cl_codewarrior;
 
 # declare variables global for module
 my @Win32LibList=();
@@ -39,7 +39,7 @@ require Exporter;
 	PMEndSrcList
 );
 
-use Winutl;
+use winutl;
 use cl_generic;
 
 sub PMHelp_Mmp {
@@ -120,7 +120,7 @@ sub PMStartBldList($) {
 
 	my $TrgDir="";
 	if (&Generic_Definition("TRGDIR") ne "") {
-		$TrgDir="\$(TRGDIR)\\";
+		$TrgDir="\$(TRGDIR)/";
 	}
 
 # Hack - mwwinrc.exe uses MWWinx86Includes or MWCIncludes, but some installations
@@ -146,7 +146,7 @@ sub PMStartBldList($) {
 			" \\\n -i \"$_\""
 		);
 	}
-	use Pathutl;
+	use pathutl;
 	if($VariantFile){
 	    my $variantFilePath = Path_Split('Path',$VariantFile);
 	    $VariantFile  = Path_Split('FILE',$VariantFile);
@@ -206,7 +206,7 @@ sub PMStartBldList($) {
 
 	foreach (@BldList) {
 		&main::Output(
-			"CW$_ = $MWCC"
+			"CW$_ = wine $MWCC"
 		);
 		if (/DEB$/o) {
 			&main::Output(
@@ -254,12 +254,12 @@ sub PMStartBldList($) {
 		if ($BasicTrgType !~ /IMPLIB/io) {
 			&main::Output (
 				" \\\n",
-				"\t", &Generic_Quote("\$(EPOCTRG$_)\\$TrgDir$Trg")
+				"\t", &Generic_Quote("\$(EPOCTRG$_)/$TrgDir$Trg")
 			);
 			if (&Winutl_CopyForStaticLinkage) {
 				&main::Output(
 					" \\\n",
-					"\t", &Generic_Quote("\$(EPOCTRG$_)\\$Trg")
+					"\t", &Generic_Quote("\$(EPOCTRG$_)/$Trg")
 				);
 			}
 		}
@@ -286,7 +286,7 @@ sub PMStartBldList($) {
 
 		my $BitMapRef;
 		foreach $BitMapRef (@$BitMapStructRef) {
-			my $file="\$(EPOCTRG$_)\\$$BitMapRef{TrgPath}$$BitMapRef{Trg}";
+			my $file="\$(EPOCTRG$_)/$$BitMapRef{TrgPath}$$BitMapRef{Trg}";
 			&Generic_MakeWorkFile($makework,$file);
 			&main::Output(
 				" \\\n",
@@ -297,7 +297,7 @@ sub PMStartBldList($) {
 
 		my $ResourceRef;
 		foreach $ResourceRef (@$ResourceStructRef) {
-			my $file="\$(EPOCTRG$_)\\$$ResourceRef{Trg}";
+			my $file="\$(EPOCTRG$_)/$$ResourceRef{Trg}";
 			&Generic_MakeWorkFile($makework,$file);
 			&main::Output(	# must come before main target because source for target will depend on the
 			" \\\n",		# *.rsg file in $EPOCIncPath
@@ -308,7 +308,7 @@ sub PMStartBldList($) {
 
 		my $AifRef;
 		foreach $AifRef (@$AifStructRef) {
-			my $file="\$(EPOCTRG$_)\\$TrgDir$$AifRef{Trg}";
+			my $file="\$(EPOCTRG$_)/$TrgDir$$AifRef{Trg}";
 			&Generic_MakeWorkFile($makework,$file);
 			&main::Output(
 				" \\\n",
@@ -345,11 +345,11 @@ sub PMStartBldList($) {
 			if (-e $DefFile) { # effectively "if project frozen ..."
 				my $LibLinkAs = ($BasicTrgType=~/^IMPLIB$/io) ? $LinkAs : $Trg;
 				&main::Output(
-					" ", &Generic_Quote("\$(EPOCLIB)\\UDEB\\$ExportLibrary.lib"), "\n",
+					" ", &Generic_Quote("\$(EPOCLIB)/udeb/$ExportLibrary.lib"), "\n",
 					"\n",
-					&Generic_Quote("\$(EPOCLIB)\\UDEB\\$ExportLibrary.lib"), " : ",
+					&Generic_Quote("\$(EPOCLIB)/udeb/$ExportLibrary.lib"), " : ",
 					&Generic_Quote($DefFile), "\n",
-					"\t$MWLD \$\? -importlib -o \$\@",
+					"\twine $MWLD \$\? -importlib -o \$\@",
 					" -addcommand \"out:$LibLinkAs\" -warnings off",
 					"\n"
 				);
@@ -357,7 +357,7 @@ sub PMStartBldList($) {
 			else {
 				&main::Output(
 					"\n",
-					"\t\@echo WARNING: Not attempting to create \"\$(EPOCLIB)\\UDEB\\$ExportLibrary.lib\".\n",
+					"\t\@echo WARNING: Not attempting to create \"\$(EPOCLIB)/udeb/$ExportLibrary.lib\".\n",
 					"\t\@echo When exports are frozen in \"$DefFile\", regenerate Makefile.\n"
 				);
 			}
@@ -365,7 +365,7 @@ sub PMStartBldList($) {
 		else {
 			&main::Output(
 				"\n",
-				"\t\@echo Not attempting to create \"\$(EPOCLIB)\\UDEB\\$ExportLibrary.lib\"\n",
+				"\t\@echo Not attempting to create \"\$(EPOCLIB)/udeb/$ExportLibrary.lib\"\n",
 				"\t\@echo from frozen .DEF file, since EXPORTUNFROZEN specified.\n"
 			);
 		}
@@ -378,7 +378,7 @@ sub PMStartBldList($) {
 	if ($DefFile and $BasicTrgType!~/^IMPLIB$/io) {
 		&main::Output(
 #			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
-			"\tperl -S efreeze.pl \"$DefFile\" \"\$(EPOCBLD)\\$ExportLibrary.def\" \n"
+			"\tperl -S efreeze.pl \"$DefFile\" \"\$(EPOCBLD)/$ExportLibrary.def\" \n"
 		);
 	}
 	&main::Output(
@@ -387,13 +387,13 @@ sub PMStartBldList($) {
 	);
 	if ($DefFile and !$NoExportLibrary) {
 		&main::Output(
-			"\t-\$(ERASE) \"\$(EPOCLIB)\\UDEB\\$ExportLibrary.lib\"\n"
+			"\t-\$(ERASE) \"\$(EPOCLIB)/udeb/$ExportLibrary.lib\"\n"
 		);
 	}
 	&main::Output(
 		"\n"
 	);
-	&Generic_MakeWorkDir('MAKEWORKLIBRARY',"${LibPath}UDEB");
+	&Generic_MakeWorkDir('MAKEWORKLIBRARY',"${LibPath}udeb");
 
 	&Generic_Releaseables;
 }
@@ -429,9 +429,9 @@ sub PMBld {
 		@LibList=&main::LibList;
 	}
 
-	my $BLDTRGPATH = "\$(EPOCTRG$Bld)\\";
+	my $BLDTRGPATH = "\$(EPOCTRG$Bld)/";
 	if ($TrgPath) {
-		$BLDTRGPATH .= "\$(TRGDIR)\\";	    # handles TARGETPATH
+		$BLDTRGPATH .= "\$(TRGDIR)/";	    # handles TARGETPATH
 	}
 
 	# REAL TARGETS
@@ -452,15 +452,15 @@ sub PMBld {
 				push @releaseables,"$BLDTRGPATH$Trg.map";
 			}
 			if (&Winutl_CopyForStaticLinkage) {
-				push @releaseables, "\$(EPOCTRG$Bld)\\$Trg";
+				push @releaseables, "\$(EPOCTRG$Bld)/$Trg";
 			}
 			my $BitMapRef;
 			foreach $BitMapRef (@$BitMapStructRef) {
-				push @releaseables, "\$(EPOCTRG$Bld)\\$$BitMapRef{TrgPath}$$BitMapRef{Trg}";
+				push @releaseables, "\$(EPOCTRG$Bld)/$$BitMapRef{TrgPath}$$BitMapRef{Trg}";
 			}
 			my $ResourceRef;
 			foreach $ResourceRef (@$ResourceStructRef) {
-				push @releaseables,"\$(EPOCTRG$Bld)\\$$ResourceRef{Trg}";
+				push @releaseables,"\$(EPOCTRG$Bld)/$$ResourceRef{Trg}";
 			}
 			my $AifRef;
 			foreach $AifRef (@$AifStructRef) {
@@ -468,7 +468,7 @@ sub PMBld {
 			}
 		}
 		if (-e $DefFile and !$NoExportLibrary) { # effectively "if project frozen ..."
-			push @releaseables, "\$(EPOCLIB$Bld)\\$ExportLibrary.lib";
+			push @releaseables, "\$(EPOCLIB$Bld)/$ExportLibrary.lib";
 		}
 		if ($Bld=~/DEB$/o) {
 			# debugging support files?
@@ -523,12 +523,12 @@ sub PMBld {
 	);
 	foreach (@StatLibList) {
 		&main::Output(
-			" \\\n\t", &Generic_Quote("\$(EPOCSTATLINK$Bld)\\$_")
+			" \\\n\t", &Generic_Quote("\$(EPOCSTATLINK$Bld)/$_")
 		);
 	}
 	foreach (@LibList) {
 		&main::Output(
-			" \\\n\t", &Generic_Quote("\$(EPOCLINK$Bld)\\$_")
+			" \\\n\t", &Generic_Quote("\$(EPOCLINK$Bld)/$_")
 		);
 	}
 	&main::Output(
@@ -547,14 +547,14 @@ sub PMBld {
 		}
 		&main::Output(
 			" \\\n",
-			"\t", &Generic_Quote("\$(EPOCBLD$Bld)\\$_.o")
+			"\t", &Generic_Quote("\$(EPOCBLD$Bld)/$_.o")
 		);
 	}
 	if ($Win32Resrc) {
 		my $resbase=&main::Path_Split('Base',$Win32Resrc);
 		&main::Output(
 			" \\\n",
-			"\t", &Generic_Quote("\$(EPOCBLD$Bld)\\$resbase.res")
+			"\t", &Generic_Quote("\$(EPOCBLD$Bld)/$resbase.res")
 		);
 	}
 	if ($have_uidfile) {
@@ -562,7 +562,7 @@ sub PMBld {
 		# CodeWarrior IDE projects.
 		&main::Output(
 			" \\\n",
-			"\t", &Generic_Quote("\$(EPOCBLD$Bld)\\uid.o")
+			"\t", &Generic_Quote("\$(EPOCBLD$Bld)/uid.o")
 		);
 	}
 	&main::Output(
@@ -584,14 +584,14 @@ sub PMBld {
 # tools hack
 		unless (&main::Plat eq 'TOOLS') {
 			&main::OutFormat(
-				" \"\$(EPOCSTATLINK$Bld)\\$FirstLib\""
+				" \"\$(EPOCSTATLINK$Bld)/$FirstLib\""
 			);
 		}
 # tools hack end
 	}
 	foreach my $lib (@Win32LibList) {
-		 my $win32lib = $lib;    # take a copy, to avoid updating contents of Win32LibList!
-		$win32lib = "-l$win32lib" unless ($win32lib =~ /\\/);
+		my $win32lib = $lib;    # take a copy, to avoid updating contents of Win32LibList!
+		$win32lib = "-l$win32lib" unless ($win32lib =~ /\//);
 		&main::OutFormat(
 			" ",lc $win32lib
 		);
@@ -637,10 +637,10 @@ sub PMBld {
 	if ($BasicTrgType=~/^DLL$/o) {
 		&main::Output(
 			"STAGE1_LINK_FLAGS$Bld= \$(COMMON_LINK_FLAGS$Bld) \$(LIBS$Bld) \\\n\t",
-			" -o \"\$(EPOCBLD$Bld)\\$Trg\"", 
+			" -o \"\$(EPOCBLD$Bld)/$Trg\"", 
 			' -export dllexport', 
 			' -nocompactimportlib', 
-			" -implib \"\$(EPOCBLD$Bld)\\$ExportLibrary.lib\"",
+			" -implib \"\$(EPOCBLD$Bld)/$ExportLibrary.lib\"",
 			" -addcommand \"out:$Trg\" -warnings off",
 			"\n",
 		);
@@ -658,11 +658,11 @@ sub PMBld {
 	}
 	if ($BasicTrgType=~/^DLL$/o) {
 		&main::Output(
-			" -f \"\$(EPOCBLD)\\$ExportLibrary.def\"",	# use generated .DEF file
+			" -f \"\$(EPOCBLD)/$ExportLibrary.def\"",	# use generated .DEF file
 		);
 		if (&main::ExportUnfrozen) {
 			&main::Output(
-				" -implib \"\$(EPOCLIB)\\UDEB\\$ExportLibrary.lib\"",
+				" -implib \"\$(EPOCLIB)/udeb/$ExportLibrary.lib\"",
 				" -addcommand \"out:$Trg\" -warnings off"
 			);
 		}
@@ -694,7 +694,7 @@ sub PMBld {
 # tools hack
 		unless (&main::Plat eq 'TOOLS') {
 			&main::Output(
-				" ", &Generic_Quote("\$(EPOCSTATLINK$Bld)\\$FirstLib")
+				" ", &Generic_Quote("\$(EPOCSTATLINK$Bld)/$FirstLib")
 			);
 		}
 	}
@@ -707,21 +707,21 @@ sub PMBld {
 #	Link by name first time round for dlls
 	if ($BasicTrgType=~/^DLL$/o) {
 		&main::Output(
-			"\t$MWLD \$(STAGE1_LINK_FLAGS$Bld) \$(LINK_OBJS$Bld)\n",
-			"\t\$(ERASE) \"\$(EPOCBLD$Bld)\\$Trg\"\n",
+			"\twine $MWLD \$(STAGE1_LINK_FLAGS$Bld) \$(LINK_OBJS$Bld)\n",
+			"\t\$(ERASE) \"\$(EPOCBLD$Bld)/$Trg\"\n",
 		);
 
 #		Generate an export info file
 		my $show_options = "names,verbose";
 		$show_options = "names,unmangled,verbose" if ($MWLD eq "mwldsym2.exe");
 		&main::Output(
-			"\t$MWLD -S -show only,$show_options -o \"\$(EPOCBLD$Bld)\\$ExportLibrary.inf\" \"\$(EPOCBLD$Bld)\\$ExportLibrary.lib\"\n"
+			"\twine $MWLD -S -show only,$show_options -o \"\$(EPOCBLD$Bld)/$ExportLibrary.inf\" \"\$(EPOCBLD$Bld)/$ExportLibrary.lib\"\n"
 		);
 
 #		call makedef to reorder the export information
 		&main::Output(
 #			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
-			"\tperl -S makedef.pl -Inffile \"\$(EPOCBLD$Bld)\\$ExportLibrary.inf\""
+			"\tperl -S makedef.pl -Inffile \"\$(EPOCBLD$Bld)/$ExportLibrary.inf\""
 		);
 		if (-e $DefFile) { # effectively "if project frozen ..."
 			&main::Output(
@@ -741,15 +741,15 @@ sub PMBld {
 			}
 		}
 		&main::Output(
-			" \"\$(EPOCBLD)\\$ExportLibrary.def\" \n",
-			"\t\$(ERASE) \"\$(EPOCBLD$Bld)\\$ExportLibrary.inf\"\n",
-			"\t\$(ERASE) \"\$(EPOCBLD$Bld)\\$ExportLibrary.lib\"\n"
+			" \"\$(EPOCBLD)/$ExportLibrary.def\" \n",
+			"\t\$(ERASE) \"\$(EPOCBLD$Bld)/$ExportLibrary.inf\"\n",
+			"\t\$(ERASE) \"\$(EPOCBLD$Bld)/$ExportLibrary.lib\"\n"
 		);
 	}
 
 #	Perform the final link step
 	&main::Output(
-		"\t$MWLD "
+		"\twine $MWLD "
 	);
 	if ($BasicTrgType=~/^LIB$/o) {
 		&main::Output(
@@ -771,7 +771,7 @@ sub PMBld {
 		&Generic_MakeWorkDir("MAKEWORK$Bld", "\$(EPOCTRG$Bld)");
 		&main::Output(
 			"\n",
-			&Generic_Quote("\$(EPOCTRG$Bld)\\$Trg"), " : ", 
+			&Generic_Quote("\$(EPOCTRG$Bld)/$Trg"), " : ", 
 			&Generic_Quote("$BLDTRGPATH$Trg"), "\n",
 			"\t", &Generic_CopyAction(),
 		);
@@ -801,7 +801,7 @@ sub PMBitMapBld {
 
 	my $ChopTrgPath="";
 	if ($$BitMapRef{TrgPath}) {
-		$ChopTrgPath.="\\$$BitMapRef{TrgPath}";
+		$ChopTrgPath.="/$$BitMapRef{TrgPath}";
 		chop $ChopTrgPath;
 	}
 
@@ -810,7 +810,7 @@ sub PMBitMapBld {
 	foreach $Bld (@BldList) {
 		my $path="\$(EPOCTRG$Bld)$ChopTrgPath";
 		&main::Output(
-			&Generic_Quote("$path\\$$BitMapRef{Trg}"), " : ", 
+			&Generic_Quote("$path/$$BitMapRef{Trg}"), " : ", 
 			&Generic_Quote("$$BitMapRef{GenericTrg}"), "\n",
 			"\t", &Generic_CopyAction(),
 			"\n"
@@ -829,7 +829,7 @@ sub PMResrcBld {
 
 	foreach my $Bld (@BldList) {
 		&main::Output(
-			&Generic_Quote("\$(EPOCTRG$Bld)\\$$ResourceRef{Trg}"), " : ", 
+			&Generic_Quote("\$(EPOCTRG$Bld)/$$ResourceRef{Trg}"), " : ", 
 			&Generic_Quote("$$ResourceRef{GenericTrg}"), "\n",
 			"\t", &Generic_CopyAction(),
 			"\n"
@@ -846,7 +846,7 @@ sub PMAifBld {
 	my $AifRef=&main::AifRef;
 	my $TrgDir="";
 	if (&Generic_Definition("TRGDIR") ne "") {
-		$TrgDir="\\\$(TRGDIR)";
+		$TrgDir="/\$(TRGDIR)";
 	}
 
 	my @BldList=&main::BldList;
@@ -854,7 +854,7 @@ sub PMAifBld {
 	foreach $Bld (@BldList) {
 		my $path="\$(EPOCTRG$Bld)$TrgDir";
 		&main::Output(
-			&Generic_Quote("$path\\$$AifRef{Trg}"), " : ",
+			&Generic_Quote("$path/$$AifRef{Trg}"), " : ",
 			&Generic_Quote("$$AifRef{GenericTrg}"), "\n",
 			"\t", &Generic_CopyAction(),
 			"\n"
@@ -881,7 +881,7 @@ sub PMSrcDepend {
 
 	foreach (@BldList) {
 		&main::Output(
-			&Generic_Quote("\$(EPOCBLD$_)\\$BaseSrc.o"), " \\\n",
+			&Generic_Quote("\$(EPOCBLD$_)/$BaseSrc.o"), " \\\n",
 		);
 	}
 	&main::Output(
@@ -907,7 +907,7 @@ sub PMSrcBldDepend {
 	return if (@DepList == 0);
 
 	&main::Output(
-		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o"), " :",
+		&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.o"), " :",
 	);
 	foreach (@DepList) {
 		&main::Output(
@@ -925,16 +925,16 @@ sub PMEndSrcBld {
 	$BaseSrc = "uid" if ($BaseSrc eq $uidfile);
 	my $Bld=&main::Bld;
 	my $Plat=&main::Plat;
-	my $Src=ucfirst lc &main::Src;
+	my $Src=&main::Src;
 	my $SrcPath=&main::SrcPath;
 
 	&main::Output(
-		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o"), " : ",
+		&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.o"), " : ",
 		&Generic_Quote("$SrcPath$Src"), "\n",
 		"\t\$(CW$Bld) -o \"\$\@\" -c \"$SrcPath$Src\"\n",
 		"\n",
 #		assembler listing target - uses implicit rule to do disassembly
-		"LISTING$Bld$BaseSrc : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), "\n",
+		"LISTING$Bld$BaseSrc : ", &Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.lis"), "\n",
 		"\t", &Generic_CopyAction("$SrcPath$BaseSrc.lst.$Plat"),
 		"\n"
 	);
@@ -960,7 +960,7 @@ sub PMEndSrcList {
 		".SUFFIXES : .lis .o\n",
 		"\n",
 		".o.lis:\n",
-		"\t$MWLD -S -show $show_options \$< -o \$\@\n",
+		"\twine $MWLD -S -show $show_options \$< -o \$\@\n",
 		"\n",
 		"\n"
 	);
@@ -989,7 +989,7 @@ sub PMEndSrcList {
 		my $respath=&main::Path_Chop(&main::Path_Split('Path',$Win32Resrc));
 		foreach $Bld (@BldList) {
 			&main::Output(
-				&Generic_Quote("\$(EPOCBLD$Bld)\\$resbase.res"), " : ",
+				&Generic_Quote("\$(EPOCBLD$Bld)/$resbase.res"), " : ",
 				&Generic_Quote($Win32Resrc), " \$(DEPEND)\n",
 				"\tmwwinrc -o \$\@ \"$Win32Resrc\"\n",
 				"\n"
diff --git a/cl_gcc.pm b/cl_gcc.pm
index a011f70..6068ad3 100644
--- a/cl_gcc.pm
+++ b/cl_gcc.pm
@@ -4,10 +4,10 @@
 #
 
 
-package Cl_gcc;
+package cl_gcc;
 
-my $GccPrefix='';
-my $ToolPrefix='';
+my $GccPrefix='arm-epoc-pe-';
+my $ToolPrefix='arm-epoc-pe-';
 my $HelperLib='';
 my %PlatOpt=(
 	'Dlltool'=>'',
@@ -81,8 +81,8 @@ sub PMStartBldList($) {
 	my $BaseTrg=&main::BaseTrg;
 	my $BasicTrgType=&main::BasicTrgType;
 	my @BldList=&main::BldList;
-	my @ChopRTWSysIncPaths=&main::Path_Chop(&main::Path_RltToWork(&main::SysIncPaths));
-	my @ChopRTWUserIncPaths=&main::Path_Chop(&main::Path_RltToWork(&main::UserIncPaths));
+	my @ChopRTWSysIncPaths=&main::Path_Chop(&main::SysIncPaths);
+	my @ChopRTWUserIncPaths=&main::Path_Chop(&main::UserIncPaths);
 	my @CompatibleABIs=&main::CompatibleABIs;
 	my $DefFile=&main::DefFile;
 	my $EPOCPath=&main::EPOCPath;
@@ -106,7 +106,8 @@ sub PMStartBldList($) {
 
 #	set up CompatibleABI lib path hash
 	foreach (@CompatibleABIs) {
-		$ABILibPath{$_}=&main::Path_Strip("$LibPath..\\$_\\");
+	  my $lcabi = lc $_; # alfredh: hack ARMI->armi, etc
+		$ABILibPath{$_}=&main::Path_Strip("$LibPath..\/$lcabi\/");
 	}
 	my %ABIRTWLibPath=();
 	foreach (@CompatibleABIs) {
@@ -143,43 +144,25 @@ sub PMStartBldList($) {
 	else {
 		&main::FatalError("Platform module - ABI \"$ABI\" unrecognised");
 	}
-	$Dlltool=$ToolPrefix.'dlltool';
+	$Dlltool=$ToolPrefix.'dlltool --as=arm-epoc-pe-as';
 	$Archive=$ToolPrefix.'ar';
 	$Link=$ToolPrefix.'ld';
 	$Objcopy=$ToolPrefix.'objcopy';
 
 	&Generic_Header(1,$Makecmd);	# define standard things using relative paths
 
-#	GCC needs a fully-qualified path
-	if ($Makecmd eq "nmake") {
-		&main::Output(
-			"\n",
-			"PATH=",&main::Path_Drive,$EPOCPath,"gcc\\bin;\$(PATH)\n",
-			"\n"
-		);
-	}
-	else {
-		&main::Output(
-			"\n",
-			"# must set both PATH and Path to make it work correctly\n",
-			"Path:=",&main::Path_Drive,$EPOCPath,"gcc\\bin;\$(Path)\n",
-			"PATH:=\$(Path)\n",
-			"\n"
-		);
-	}
-
 	&main::Output(
 		"INCDIR  ="
 	);
 
 	foreach (@ChopRTWUserIncPaths) {
 		&main::Output(
-			" -I \"$_\""
+			" -I $_"
 		);
 	}
 	foreach (@ChopRTWSysIncPaths) {
 		&main::Output(
-			" -I \"$_\""
+			" -I $_"
 		);
 	}
 	if($VariantFile){
@@ -218,7 +201,7 @@ sub PMStartBldList($) {
 		);
 		if (/REL$/o) {
 			&main::Output(
-				      ' -s -fomit-frame-pointer ',
+				      ' -fomit-frame-pointer ',
 				      $PlatOpt{Optimize}
 			);
 		}
@@ -256,7 +239,7 @@ sub PMStartBldList($) {
 
 		&main::Output (
 			" \\\n\t",
-			&Generic_Quote("\$(EPOCTRG$_)\\$Trg")
+			&Generic_Quote("\$(EPOCTRG$_)/$Trg")
 		);
 
 #		lib has to come after the main target so that a .DEF file will be generated if the project is not frozen
@@ -300,13 +283,13 @@ sub PMStartBldList($) {
 		unless (&main::ExportUnfrozen) {
 			if (-e $DefFile) { # effectively "if project frozen ..."
 				&main::Output(
-					" ", &Generic_Quote("\$(EPOCLIB)\\UREL\\$BaseTrg.LIB")
+					" ", &Generic_Quote("\$(EPOCLIB)/urel/$BaseTrg.lib")
 				);
 				foreach (@CompatibleABIs) {
 					&main::Output(
-						" ", &Generic_Quote("$ABILibPath{$_}UREL\\$BaseTrg.LIB")
+						" ", &Generic_Quote("$ABILibPath{$_}urel/$BaseTrg.lib")
 					);
-					&Generic_MakeWorkDir('MAKEWORKLIBRARY',"$ABILibPath{$_}UREL");
+					&Generic_MakeWorkDir('MAKEWORKLIBRARY',"$ABILibPath{$_}urel");
 				}
 				&main::Output(
 					"\n"
@@ -323,7 +306,7 @@ sub PMStartBldList($) {
 		else {
 			&main::Output(
 				"\n",
-				"\t\@echo Not attempting to create \"\$(EPOCLIB)\\UREL\\$BaseTrg.LIB\"\n",
+				"\t\@echo Not attempting to create \"\$(EPOCLIB)/urel/$BaseTrg.lib\"\n",
 				"\t\@echo from frozen .DEF file, since EXPORTUNFROZEN specified.\n"
 			);
 		}
@@ -332,18 +315,18 @@ sub PMStartBldList($) {
 			"\n",
 			"# REAL TARGET - LIBRARY\n",
 			"\n",
-			&Generic_Quote("\$(EPOCLIB)\\UREL\\$BaseTrg.LIB"), " : ",
+			&Generic_Quote("\$(EPOCLIB)/urel/$BaseTrg.lib"), " : ",
 			&Generic_Quote($DefFile), "\n",
-			"\t$Dlltool $PlatOpt{Dlltool} --output-lib \"\$(EPOCLIB)\\UREL\\$BaseTrg.LIB\" \\\n",
+			"\t$Dlltool $PlatOpt{Dlltool} --output-lib \"\$(EPOCLIB)/urel/$BaseTrg.lib\" \\\n",
 			"\t\t--def \"",&main::Path_RltToWork($DefFile),"\" \\\n",
 			"\t\t--dllname \"$LinkAs\" \n"
 		);
 		foreach (@CompatibleABIs) {
 			&main::Output(
 				"\n",
-				&Generic_Quote("$ABILibPath{$_}UREL\\$BaseTrg.LIB"), " : ",
+				&Generic_Quote("$ABILibPath{$_}urel/$BaseTrg.lib"), " : ",
 				&Generic_Quote($DefFile), "\n",
-				"\t$Dlltool $ABIDlltool{$_} --output-lib \"$ABIRTWLibPath{$_}UREL\\$BaseTrg.LIB\" \\\n",
+				"\t$Dlltool $ABIDlltool{$_} --output-lib \"$ABIRTWLibPath{$_}urel/$BaseTrg.lib\" \\\n",
 				"\t\t--def \"",&main::Path_RltToWork($DefFile),"\" \\\n",
 				"\t\t--dllname \"$LinkAs\" \n"
 			);
@@ -357,7 +340,7 @@ sub PMStartBldList($) {
 	if ($DefFile) {
 		&main::Output(
 #			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
-			"\tperl -S efreeze.pl \"$DefFile\" \"\$(EPOCBLD)\\$BaseTrg.def\" \n"
+			"\tperl -S efreeze.pl \"$DefFile\" \"\$(EPOCBLD)/$BaseTrg.def\" \n"
 		);
 	}
 	&main::Output(
@@ -366,11 +349,11 @@ sub PMStartBldList($) {
 	);
 	if ($DefFile) {
 		&main::Output(
-			"\t-\$(ERASE) \"\$(EPOCLIB)\\UREL\\$BaseTrg.LIB\"\n"
+			"\t-\$(ERASE) \"\$(EPOCLIB)/urel/$BaseTrg.lib\"\n"
 		);
 		foreach (@CompatibleABIs) {
 			&main::Output(
-				"\t-\$(ERASE) \"$ABILibPath{$_}UREL\\$BaseTrg.LIB\"\n"
+				"\t-\$(ERASE) \"$ABILibPath{$_}urel/$BaseTrg.lib\"\n"
 			);
 		}
 	}
@@ -378,7 +361,7 @@ sub PMStartBldList($) {
 		"\n",
 		"\n"
 	);
-	&Generic_MakeWorkDir('MAKEWORKLIBRARY',"${LibPath}UREL");
+	&Generic_MakeWorkDir('MAKEWORKLIBRARY',"${LibPath}urel");
 
 	&Generic_Releaseables;
 }
@@ -407,6 +390,8 @@ sub PMBld {
 	my $TrgType=&main::TrgType;
 	my @UidList=&main::UidList;
 
+	my $Bld2 = lc $Bld;
+
 	if ($Bld =~ /DEB/) {
 		@LibList = &main::DebugLibList;
 	} else {
@@ -432,12 +417,12 @@ sub PMBld {
 	
 	push @releaseables, "$RelPath$Trg";
 	if ($BasicTrgType=~/^(DLL|EXE)$/o) {
-		push @releaseables, "$RelPath$Trg.MAP";
+		push @releaseables, "$RelPath$Trg.map";
 	}
 	if (-e $DefFile) { # effectively "if project frozen ..."
-		push @releaseables, "$LibPath$BaseTrg.LIB";
+		push @releaseables, "$LibPath$BaseTrg.lib";
 		foreach (@CompatibleABIs) {
-			push @releaseables, "$ABILibPath{$_}UREL\\$BaseTrg.LIB";
+			push @releaseables, "$ABILibPath{$_}urel/$BaseTrg.lib";
 		}
 	}
 
@@ -447,7 +432,7 @@ sub PMBld {
 		"CLEAN$Bld : CLEANBUILD$Bld CLEANRELEASE$Bld\n",
 		"\n",
 		"CLEANBUILD$Bld : \n",
-		"\t\@perl -S ermdir.pl \"\$(EPOCBLD$Bld)\"\n",
+		"\t\@rm -rf \"\$(EPOCBLD$Bld)\"\n",
 		"\n",
 		"CLEANRELEASE$Bld : CLEANGENERIC\n",
 		"\n"
@@ -476,37 +461,37 @@ sub PMBld {
 	if ($BasicTrgType=~/^DLL$/o) { # Add the DLL stub library
 		&main::Output(
 			" \\\n\t",
-			&Generic_Quote("\$(EPOCSTATLINK$Bld)\\EDLLSTUB.LIB")
+			&Generic_Quote("\$(EPOCSTATLINK$Bld)\/edllstub.lib")
 		);
 	}
 	if ($BasicTrgType=~/^(DLL|EXE)/o) { # Add the GCC helper fns
 		&main::Output(
 			" \\\n\t",
-			&Generic_Quote("\$(EPOCSTATLINK$Bld)\\EGCC.LIB")
+			&Generic_Quote("\$(EPOCSTATLINK$Bld)\/egcc.lib")
 		);
 	}
 	if ($HelperLib) {
 		&main::Output(
 			" \\\n\t",
-			&Generic_Quote("\$(EPOCSTATLINK$Bld)\\$HelperLib")
+			&Generic_Quote("\$(EPOCSTATLINK$Bld)\/$HelperLib")
 		);
 	}
 	foreach (@StatLibList) {
 		&main::Output(
 			" \\\n\t",
-			&Generic_Quote("\$(EPOCSTATLINK$Bld)\\$_")
+			&Generic_Quote("\$(EPOCSTATLINK$Bld)\/$_")
 		);
 	}
 	foreach (@ASSPLibList) {
 		&main::Output(
 			" \\\n\t",
-			&Generic_Quote("\$(EPOCASSPLINK$Bld)\\$_")
+			&Generic_Quote("\$(EPOCASSPLINK$Bld)\/$_")
 		);
 	}
 	foreach (@LibList) {
 		&main::Output(
 			" \\\n\t",
-			&Generic_Quote("\$(EPOCLINK$Bld)\\$_")
+			&Generic_Quote("\$(EPOCLINK$Bld)\/$_")
 		);
 	}
 	&main::Output(
@@ -515,8 +500,8 @@ sub PMBld {
 	);
 
 	&main::Output(
-		&Generic_Quote("\$(EPOCTRG$Bld)\\$Trg"), " : ",
-		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseTrg.in")
+		&Generic_Quote("\$(EPOCTRG$Bld)\/$Trg"), " : ",
+		&Generic_Quote("\$(EPOCBLD$Bld)\/$BaseTrg.in")
 	);
 	if (-e $DefFile) { # effectively "if project frozen ..."
 		&main::Output(
@@ -525,22 +510,26 @@ sub PMBld {
 	}
 	if ($BasicTrgType=~/^(EXE|DLL)$/o) {
 		&main::Output(
-			" ", &Generic_Quote("\$(EPOCSTATLINK$Bld)\\$FirstLib")
+			" ", &Generic_Quote("\$(EPOCSTATLINK$Bld)/$FirstLib")
 		);
 	}
 	&main::Output(
 		" \$(LIBS$Bld)\n"
 	);
 
+	&main::Output(
+		"\t\@echo $Trg\n"
+	);
+
 	if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEDLL$/o) {
 
 #		generate a .DEF file from the objects and static libraries
 		&main::Output(
-			"\t$Dlltool $PlatOpt{Dlltool} --output-def \"\$(EPOCBLD$Bld)\\$BaseTrg.inf\" \"\$(EPOCBLD$Bld)\\$BaseTrg.in\""
+			"\t$Dlltool $PlatOpt{Dlltool} --output-def \"\$(EPOCBLD$Bld)/$BaseTrg.inf\" \"\$(EPOCBLD$Bld)/$BaseTrg.in\""
 		);
 		foreach (@StatLibList) {
 			&main::Output(
-				" \"\$(EPOCSTATLINK$Bld)\\$_\""
+				" \"\$(EPOCSTATLINK$Bld)/$_\""
 			);
 		}
 		&main::Output(
@@ -550,7 +539,7 @@ sub PMBld {
 #		reorder the .DEF file taking frozen exports into account if there are any
 		&main::Output(
 #			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
-			"\tperl -S makedef.pl -Deffile \"\$(EPOCBLD$Bld)\\$BaseTrg.inf\""
+			"\tperl -S makedef.pl -Deffile \"\$(EPOCBLD$Bld)/$BaseTrg.inf\""
 		);
 		if (-e $DefFile) { # effectively "if project frozen ..."
 			&main::Output(
@@ -568,24 +557,24 @@ sub PMBld {
 			}
 		}
 		&main::Output(
-			" \"\$(EPOCBLD)\\$BaseTrg.def\"\n"
+			" \"\$(EPOCBLD)/$BaseTrg.def\"\n"
 		);
 
 #		delete the unordered definition file
 		&main::Output(
-			"\t-\$(ERASE) \"\$(EPOCBLD$Bld)\\$BaseTrg.inf\"\n"
+			"\t-\$(ERASE) \"\$(EPOCBLD$Bld)/$BaseTrg.inf\"\n"
 		);
 
 #		generate an export object from the ordered .DEF file
 		&main::Output(
-			"\t$Dlltool $PlatOpt{Dlltool} --def \"\$(EPOCBLD)\\$BaseTrg.def\" \\\n",
-			"\t\t--output-exp \"\$(EPOCBLD$Bld)\\$BaseTrg.exp\" \\\n",
+			"\t$Dlltool $PlatOpt{Dlltool} --def \"\$(EPOCBLD)/$BaseTrg.def\" \\\n",
+			"\t\t--output-exp \"\$(EPOCBLD$Bld)/$BaseTrg.exp\" \\\n",
 			"\t\t--dllname \"$LinkAs\""
 		);
 		if (&main::ExportUnfrozen) {
 			&main::Output(
 				"\\\n",
-				"\t\t--output-lib \"\$(EPOCLIB)\\UREL\\$BaseTrg.LIB\""
+				"\t\t--output-lib \"\$(EPOCLIB)/urel/$BaseTrg.lib\""
 			);
 		}
 		&main::Output(
@@ -600,7 +589,7 @@ sub PMBld {
 			);	
 		if ($BasicTrgType=~/^DLL$/o) {
 			&main::Output(
-				" $PlatOpt{Entry} _E32Dll -u _E32Dll \"\$(EPOCBLD$Bld)\\$BaseTrg.exp\" --dll \\\n"
+				" $PlatOpt{Entry} _E32Dll -u _E32Dll \"\$(EPOCBLD$Bld)/$BaseTrg.exp\" --dll \\\n"
 			);
 		}
 		elsif ($BasicTrgType=~/^EXE$/o) {
@@ -611,8 +600,8 @@ sub PMBld {
 #		--whole-archive is required here apparently because of a bug in the gcc toolchain
 #		the flag can probably be removed with a later version of gcc
 		&main::Output(
-			"\t\t--base-file \"\$(EPOCBLD$Bld)\\$BaseTrg.bas\" -o \"\$(EPOCBLD$Bld)\\$Trg\" \\\n",
-			"\t\t\"\$(EPOCSTATLINK$Bld)\\$FirstLib\" --whole-archive \"\$(EPOCBLD$Bld)\\$BaseTrg.in\" \\\n",
+			"\t\t--base-file \"\$(EPOCBLD$Bld)\/$BaseTrg.bas\" -o \"\$(EPOCBLD$Bld)\/$Trg\" \\\n",
+			"\t\t\"\$(EPOCSTATLINK$Bld)\/$FirstLib\" --whole-archive \"\$(EPOCBLD$Bld)\/$BaseTrg.in\" \\\n",
 			"\t\t--no-whole-archive"
 		);
 		&main::Output(
@@ -622,11 +611,11 @@ sub PMBld {
 #		delete temporary files
 		if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEDLL$/o) {
 			&main::Output(
-				"\t-\$(ERASE) \"\$(EPOCBLD$Bld)\\$BaseTrg.exp\"\n"
+				"\t-\$(ERASE) \"\$(EPOCBLD$Bld)/$BaseTrg.exp\"\n"
 			);
 		}
 		&main::Output(
-			"\t-\$(ERASE) \"\$(EPOCBLD$Bld)\\$Trg\"\n"
+			"\t-\$(ERASE) \"\$(EPOCBLD$Bld)/$Trg\"\n"
 		);
 
 #		call dlltool to do base relocations (and dll exports)
@@ -635,18 +624,18 @@ sub PMBld {
 		);
 		if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEDLL$/o) {
 			&main::Output(
-				"\t\t--def \"\$(EPOCBLD)\\$BaseTrg.def\" \\\n",
+				"\t\t--def \"\$(EPOCBLD)/$BaseTrg.def\" \\\n",
 				"\t\t--dllname \"$LinkAs\" \\\n"
 			);
 		}
 		&main::Output(
-			"\t\t--base-file \"\$(EPOCBLD$Bld)\\$BaseTrg.bas\" \\\n",
-			"\t\t--output-exp \"\$(EPOCBLD$Bld)\\$BaseTrg.exp\" \n"
+			"\t\t--base-file \"\$(EPOCBLD$Bld)/$BaseTrg.bas\" \\\n",
+			"\t\t--output-exp \"\$(EPOCBLD$Bld)/$BaseTrg.exp\" \n"
 		);
 
 #		delete temporary files
 		&main::Output(
-			"\t-\$(ERASE) \"\$(EPOCBLD$Bld)\\$BaseTrg.bas\"\n"
+			"\t-\$(ERASE) \"\$(EPOCBLD$Bld)/$BaseTrg.bas\"\n"
 		);
 
 #		call ld to link the target
@@ -671,9 +660,9 @@ sub PMBld {
 #		--whole-archive is required here apparently because of a bug in the gcc toolchain
 #		the flag can probably be removed with a later version of gcc
 		&main::Output(
-			"\t\t\"\$(EPOCBLD$Bld)\\$BaseTrg.exp\" \\\n",
-			"\t\t-Map \"\$(EPOCTRG$Bld)\\$Trg.map\" -o \"\$(EPOCBLD$Bld)\\$Trg\" \\\n",
-			"\t\t\"\$(EPOCSTATLINK$Bld)\\$FirstLib\" --whole-archive \"\$(EPOCBLD$Bld)\\$BaseTrg.in\" \\\n",
+			"\t\t\"\$(EPOCBLD$Bld)/$BaseTrg.exp\" \\\n",
+			"\t\t-Map \"\$(EPOCTRG$Bld)/$Trg.map\" -o \"\$(EPOCBLD$Bld)/$Trg\" \\\n",
+			"\t\t\"\$(EPOCSTATLINK$Bld)/$FirstLib\" --whole-archive \"\$(EPOCBLD$Bld)/$BaseTrg.in\" \\\n",
 			"\t\t--no-whole-archive"
 		);
 		&main::Output(
@@ -682,17 +671,17 @@ sub PMBld {
 
 #		delete temporary files
 		&main::Output(
-			"\t-\$(ERASE) \"\$(EPOCBLD$Bld)\\$BaseTrg.exp\"\n"
+			"\t-\$(ERASE) \"\$(EPOCBLD$Bld)/$BaseTrg.exp\"\n"
 		);
 
 		if ($Bld=~/DEB$/o) {
 			&main::Output(
-				"\t$Objcopy -X \"\$(EPOCBLD$Bld)\\$Trg\" \"\$(EPOCTRG$Bld)\\$BaseTrg.sym\"\n"
+				"\t$Objcopy -X \"\$(EPOCBLD$Bld)/$Trg\" \"\$(EPOCTRG$Bld)/$BaseTrg.sym\"\n"
 			);
 		}
 
 		&main::Output(
-			"\tpetran $PlatOpt{Petran} \"\$(EPOCBLD$Bld)\\$Trg\" \"\$\@\" \\\n",
+			"\tpetran $PlatOpt{Petran} \"\$(EPOCBLD$Bld)/$Trg\" \"\$\@\" \\\n",
 			"\t\t"
 		);
 		if (&main::AllowDllData) {
@@ -747,12 +736,12 @@ sub PMBld {
 			"\n"
 		);
 		&main::Output(
-			"\t-\$(ERASE) \"\$(EPOCBLD$Bld)\\$Trg\"\n"
+			"\t-\$(ERASE) \"\$(EPOCBLD$Bld)\/$Trg\"\n"
 		);
 	}
 	elsif ($BasicTrgType=~/^LIB$/o) {
 		&main::Output(
-			"\tcopy \"\$(EPOCBLD$Bld)\\$BaseTrg.in\" \"\$(EPOCSTATLINK$Bld)\\$Trg\"\n"
+			"\tcp \"\$(EPOCBLD$Bld)\/$BaseTrg.in\" \"\$(EPOCSTATLINK$Bld)\/$Trg\"\n"
 		);
 	}
 
@@ -782,15 +771,15 @@ sub PMBld {
 				);
 			}
 			&main::Output(
-				" \\\n\t", &Generic_Quote("\$(EPOCBLD$Bld)\\$_.o")
+				" \\\n\t", &Generic_Quote("\$(EPOCBLD$Bld)\/$_.o")
 			);
 			$counter1++;
 		}
 		&main::Output(
 			"\n",
 			"\n",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseTrg.in"), " : ", @objvarlist,"\n",
-			"\tif exist \"\$\@\" del \"\$\@\"\n"
+			&Generic_Quote("\$(EPOCBLD$Bld)\/$BaseTrg.in"), " : ", @objvarlist,"\n",
+#			"\tif exist \"\$\@\" del \"\$\@\"\n"
 		);
 		foreach (@objvarlist) {
 			# Add the files to the list in groups
@@ -809,7 +798,7 @@ sub PMBld {
 		);
 		foreach (@BaseSrcList) {
 			&main::Output(
-				" \\\n\t", &Generic_Quote("\$(EPOCBLD$Bld)\\$_.o")
+				" \\\n\t", &Generic_Quote("\$(EPOCBLD$Bld)\/$_.o")
 			);
 		}
 		&main::Output(
@@ -817,8 +806,8 @@ sub PMBld {
 			"\n"
 		);
 		&main::Output(
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseTrg.in"), " : \$(OBJECTS$Bld)\n",
-			"\tif exist \"\$\@\" del \"\$\@\"\n",
+			&Generic_Quote("\$(EPOCBLD$Bld)\/$BaseTrg.in"), " : \$(OBJECTS$Bld)\n",
+#			"\tif exist \"\$\@\" del \"\$\@\"\n",
 			"\t$Archive cr \$\@ \$^\n",
 			"\n\n"
 		);
@@ -870,8 +859,8 @@ sub PMSrcDepend {
 
 	foreach (@BldList) {
 		&main::Output(
-			&Generic_Quote("\$(EPOCBLD$_)\\$BaseSrc.lis"), " ",
-			&Generic_Quote("\$(EPOCBLD$_)\\$BaseSrc.o"), " \\\n",
+			&Generic_Quote("\$(EPOCBLD$_)\/$BaseSrc.lis"), " ",
+			&Generic_Quote("\$(EPOCBLD$_)\/$BaseSrc.o"), " \\\n",
 		);
 	}
 	&main::Output(
@@ -896,8 +885,8 @@ sub PMSrcBldDepend {
 	return if (@DepList == 0);
 
 	&main::Output(
-		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), " ",
-		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o"), " :",
+		&Generic_Quote("\$(EPOCBLD$Bld)\/$BaseSrc.lis"), " ",
+		&Generic_Quote("\$(EPOCBLD$Bld)\/$BaseSrc.o"), " :",
 	);
 	foreach (@DepList) {
 		&main::Output(
@@ -914,7 +903,8 @@ sub PMEndSrcBld {
 	my $ABI=&main::ABI;
 	my $BaseSrc=&main::BaseSrc;
 	my $Bld=&main::Bld;
-	my $Src=ucfirst lc &main::Src;
+#	my $Src=ucfirst lc &main::Src;
+	my $Src=&main::Src;
 	my $SrcPath=&main::SrcPath;
 
 	my $RTWSrcPath=&main::Path_Chop(&main::Path_RltToWork($SrcPath));
@@ -923,17 +913,18 @@ sub PMEndSrcBld {
 	$Src =~ s/\.s$/.S/i;
 
 	&main::Output(
-		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o"), " : ",
+		&Generic_Quote("\$(EPOCBLD$Bld)\/$BaseSrc.o"), " : ",
 		&Generic_Quote("$SrcPath$Src"), "\n",
-		"\t\$(GCC$Bld) -I \"$RTWSrcPath\" \$(INCDIR) -o \$\@ \"$RTWSrcPath\\$Src\"\n",
+		"\t\@echo $BaseSrc.o\n",
+		"\t\$(GCC$Bld) -I \"$RTWSrcPath\" \$(INCDIR) -o \$\@ \"$RTWSrcPath\/$Src\"\n",
 		"\n",
 #		generate an assembly listing target too
-		"LISTING$Bld$BaseSrc : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), "\n",
+		"LISTING$Bld$BaseSrc : ", &Generic_Quote("\$(EPOCBLD$Bld)\/$BaseSrc.lis"), "\n",
 		"\t", &Generic_CopyAction("$SrcPath$BaseSrc.lst.$ABI"),
 		"\n",
-		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), " : ",
+		&Generic_Quote("\$(EPOCBLD$Bld)\/$BaseSrc.lis"), " : ",
 		&Generic_Quote("$SrcPath$Src"), "\n",
-		"\t\$(GCC$Bld) -Wa,-adln -I \"$RTWSrcPath\" \$(INCDIR) -o nul: \"$RTWSrcPath\\$Src\" > \$\@\n",
+		"\t\$(GCC$Bld) -Wa,-adln -I \"$RTWSrcPath\" \$(INCDIR) -o nul: \"$RTWSrcPath\/$Src\" > \$\@\n",
 		"\n"
 	);
 }
diff --git a/cl_generic.pm b/cl_generic.pm
index cc549a2..f5018c9 100644
--- a/cl_generic.pm
+++ b/cl_generic.pm
@@ -38,10 +38,10 @@ sub Generic_Header ($$) {
 	
 	$MakefileType=($makefileType eq "nmake")? 0:1;
 
-	my $LibSubDir="UDEB";
+	my $LibSubDir="udeb";
 #regression hack
 	if (&main::PlatOS eq 'EPOC32') {
-		$LibSubDir="UREL";
+		$LibSubDir="urel";
 	}
 #regression hack end
 
@@ -75,10 +75,15 @@ sub Generic_Header ($$) {
 	my $DataPath=&main::Path_Chop(&main::DataPath);
 	my $TrgPath=&main::Path_Chop(&main::TrgPath);
 
-	my $erasedefn = "\@erase";
-	$erasedefn = "\@erase 2>>nul" if ($ENV{OS} eq "Windows_NT");
+	my $erasedefn = "\@rm -f ";
 
 	&main::Output(
+		"#\n",
+		"#   this makefile is for GNU make\n",
+		"#   generated by GnuPoc - SymbianOS SDK for GNU/Linux\n",
+		"#\n",
+		     );
+	&main::Output(
 		"\n",
 		'# CWD ',             &main::Path_WorkPath, "\n",
 		'# MMPFile ',         &main::MmpFile,       "\n",
@@ -106,15 +111,16 @@ sub Generic_Header ($$) {
 	
 	my @BldList=&main::BldList;
 	foreach (@BldList) {
+		my $Bld2 = lc $_;
 		&main::Output(
 			"\n"
 		);
-		Generic_Define("EPOCBLD$_", "\$(EPOCBLD)\\$_");
-		Generic_Define("EPOCTRG$_", "\$(EPOCTRG)\\$_");
-		Generic_Define("EPOCLIB$_", "\$(EPOCLIB)\\$LibSubDir");
-		Generic_Define("EPOCLINK$_", "\$(EPOCLINK)\\$LibSubDir");
-		Generic_Define("EPOCSTATLINK$_", "\$(EPOCSTATLINK)\\$_");
-		Generic_Define("EPOCASSPLINK$_", "\$(EPOCASSPLINK)\\$LibSubDir");
+		Generic_Define("EPOCBLD$_", "\$(EPOCBLD)\/$Bld2");
+		Generic_Define("EPOCTRG$_", "\$(EPOCTRG)\/$Bld2");
+		Generic_Define("EPOCLIB$_", "\$(EPOCLIB)\/$LibSubDir");
+		Generic_Define("EPOCLINK$_", "\$(EPOCLINK)\/$LibSubDir");
+		Generic_Define("EPOCSTATLINK$_", "\$(EPOCSTATLINK)\/$Bld2");
+		Generic_Define("EPOCASSPLINK$_", "\$(EPOCASSPLINK)\/$LibSubDir");
 	}
 
 	&main::Output(
@@ -264,7 +270,7 @@ sub Generic_WhatCleanTargets($$$@) {
 		&main::Output(
 			"\n",
 			"\n$whattarget $cleantarget :\n",
-			"\t\@rem none\n"
+#			"\t\@rem none\n"
 		);
 	} else {
 # emit list of releasables in batches to avoid overflowing the 2048 character 
@@ -377,8 +383,8 @@ sub Generic_Releaseables {
 	foreach $AifRef (@$AifStructRef) {
 # regression hack - workaround lack of AIF directory
 		$$AifRef{TrgFile}=&main::Path_Split('File',$$AifRef{Trg});  # record for later
-		my $path=&main::Path_Split('Path',"$ResrcPath$$AifRef{Trg}");  
-		my $file="\$(EPOCDATA)\\$ResrcPath$$AifRef{Trg}";
+		my $path=&main::Path_Split('Path',"$ResrcPath$$AifRef{Trg}");
+		my $file="\$(EPOCDATA)\/$ResrcPath$$AifRef{Trg}";
 		my $xip="_xip";
 		my $base=&main::Path_Split('Base',"$file");
 		my $root=&main::Path_Split('Path',"$file");
@@ -386,7 +392,7 @@ sub Generic_Releaseables {
 		my $file_xip="$root"."$base$xip$ext";	# since XIP AIF format is generated
 		if ($path eq "") {
 			# no target path for the AIF file, so not a releasable
-			$file="$SavedBldPath\\$$AifRef{Trg}";
+			$file="$SavedBldPath\/$$AifRef{Trg}";
 		} else {
 			$Files{$file}=1;
 			$Files{$file_xip}=1;
@@ -401,13 +407,13 @@ sub Generic_Releaseables {
 	my $BitMapRef;
 	foreach $BitMapRef (@$BitMapStructRef) {
 		my $path=$$BitMapRef{TrgPath};
-		my $file="\$(EPOCDATA)\\$path$$BitMapRef{Trg}";
+		my $file="\$(EPOCDATA)\/$path$$BitMapRef{Trg}";
 		$$BitMapRef{GenericTrg}=$file;	    # record for later
 		$Files{$file}=1;
 		&Generic_MakeWorkFile('GENERIC_MAKEWORK',$file);
 		if ($$BitMapRef{Hdr}) {
 			my $mbg=&main::Path_Split('Base', $$BitMapRef{Trg});
-			$mbg="\$(EPOCINC)\\$mbg.MBG";
+			$mbg="\$(EPOCINC)\/$mbg.mbg";
 			&Generic_MakeWorkDir('GENERIC_MAKEWORK',$EPOCIncPath);
 			$Files{$mbg}=1;
 		}
@@ -416,12 +422,12 @@ sub Generic_Releaseables {
 	my $ResourceStructRef=&main::ResourceStructRef;
 	my $ResourceRef;
 	foreach $ResourceRef (@$ResourceStructRef) {
-		my $file="\$(EPOCDATA)\\$$ResourceRef{Trg}";
+		my $file="\$(EPOCDATA)\/$$ResourceRef{Trg}";
 		$$ResourceRef{GenericTrg}=$file;	# record for later
 		$Files{$file}=1;
 		&Generic_MakeWorkFile('GENERIC_MAKEWORK',$file);
 		if ($$ResourceRef{Hdr}) {
-			my $rsg="\$(EPOCINC)\\$$ResourceRef{BaseTrg}.RSG";
+			my $rsg="\$(EPOCINC)\/$$ResourceRef{BaseTrg}.rsg";
 			&Generic_MakeWorkDir('GENERIC_MAKEWORK',$EPOCIncPath);
 			$Files{$rsg}=1;
 		}
@@ -529,7 +535,7 @@ sub Generic_ResrcBld {
 	my $RTWSrcPath=&main::Path_RltToWork($SrcPath);
 	my $ChopRTWSrcPath=&main::Path_Chop($RTWSrcPath);
 
-	my $ResrcHdr=join '', &main::EPOCIncPath(), $BaseResrc, '.RSG';
+	my $ResrcHdr=join '', &main::EPOCIncPath(), $BaseResrc, '.rsg';
 	my $RTWResrcHdr=&main::Path_RltToWork($ResrcHdr);
 	
 
@@ -538,8 +544,8 @@ sub Generic_ResrcBld {
 	my $HeaderOption = "";
 	my $HeaderCopyCmd = "";
 	if ($$ResourceRef{Hdr}) {
-		$HeaderOption = " -h\"$SavedBldPath\\$BaseResrc.rsg\"";
-		$HeaderCopyCmd = "\tperl -S ecopyfile.pl \"$SavedBldPath\\$BaseResrc.rsg\" \"$ResrcHdr\"\n";
+		$HeaderOption = " -h\"$SavedBldPath\/$BaseResrc.rsg\"";
+		$HeaderCopyCmd = "\tperl -S ecopyfile.pl \"$SavedBldPath\/$BaseResrc.rsg\" \"$ResrcHdr\"\n";
 	}
 	
 	%Files = &Lockit_Releasables($WorkPath,$$ResourceRef{Source}, \%Files, "");
@@ -564,8 +570,9 @@ sub Generic_ResrcBld {
 			" -I \"$_\""
 		);
 	}
+	my $uclang = uc $$ResourceRef{Lang};
 	&main::Output(
-		" -DLANGUAGE_$$ResourceRef{Lang} -u \"$$ResourceRef{Source}\" ",
+		" -DLANGUAGE_$uclang -u \"$$ResourceRef{Source}\" ",
 		"-o\$\@ $HeaderOption -t\"$SavedBldPath\"  -l\"$EPOCDataDir:$WorkPath\"\n",
 		$HeaderCopyCmd,
 		"\n"
diff --git a/cl_win.pm b/cl_win.pm
index 2d46db2..9a9fae6 100644
--- a/cl_win.pm
+++ b/cl_win.pm
@@ -2,9 +2,11 @@
 #
 # Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
 #
+# modified by GnuPoc ER6 to generate GNU Make makefiles instead of
+# NMake makefiles - CL.EXE and LINK.EXE ++ runs under WINE
+#
 
-
-package Cl_win;
+package cl_win;
 
 # declare variables global for module
 my @Win32LibList=();
@@ -36,7 +38,7 @@ require Exporter;
 	PMEndSrcList
 );
 
-use Winutl;
+use winutl;
 use cl_generic;
 
 sub PMHelp_Mmp {
@@ -60,7 +62,7 @@ sub PMPlatProcessMmp (@) {
 
 sub PMStartBldList($) {
 	my ($makecmd) = @_;
-	die "Cannot generate $makecmd makefiles\n" if ($makecmd ne "nmake");
+	die "Cannot generate $makecmd makefiles\n" if ($makecmd ne "make");
 	my $AifStructRef=&main::AifStructRef;
 	my $BaseTrg=&main::BaseTrg;
 	my $BitMapStructRef=&main::BitMapStructRef;
@@ -83,7 +85,7 @@ sub PMStartBldList($) {
 
 	my $TrgDir="";
 	if (&Generic_Definition("TRGDIR") ne "") {
-		$TrgDir="\$(TRGDIR)\\";
+		$TrgDir="\$(TRGDIR)/";
 	}
 	if (&main::Plat eq "WINC") {	# target path ignored under WINC
 		$TrgDir="";
@@ -105,6 +107,10 @@ sub PMStartBldList($) {
 	}
 
 	&main::Output(
+		"#\n",
+		"#   this makefile is for GNU make\n",
+		"#   generated by GnuPoc - EPOC SDK for GNU/Linux\n",
+		"#\n",
 		"\n",
 		"\n"
 	);
@@ -150,8 +156,9 @@ sub PMStartBldList($) {
 		"CLDEFS  ="
 	);
 	foreach(@MacroList) {
+	        my $tmp = uc $_;
 		&main::Output(
-			" /D \"$_\""
+			" /D $tmp"
 		);
 	}
 	&main::Output(
@@ -161,7 +168,7 @@ sub PMStartBldList($) {
 
 	foreach (@BldList) {
 		&main::Output(
-			"CL$_ = cl.exe"
+			"CL$_ = wine CL.EXE"
 		);
 		if ($BasicTrgType=~/^EXE$/o) {
 			&main::Output(
@@ -210,7 +217,7 @@ sub PMStartBldList($) {
 		);
 		if (/DEB$/o) {
 			&main::Output(
-				" /FR\"\$(EPOCBLD$_)/\" /Fd\"\$(EPOCTRG$_)\\$TrgDir$BaseTrg.pdb\""
+				" /FR\"\$(EPOCBLD$_)/\" /Fd\"\$(EPOCTRG$_)/$TrgDir$BaseTrg.pdb\""
 			);
 		}
 		foreach (&main::MacroList($_)) {
@@ -234,18 +241,18 @@ sub PMStartBldList($) {
 
 		&main::Output (
 			" \\\n",
-			"\t\"\$(EPOCTRG$_)\\$TrgDir$Trg\""
+			"\t\$(EPOCTRG$_)/$TrgDir$Trg"
 		);
 		unless (/REL$/o) {
 			&main::Output(
 				" \\\n",
-				"\t\"\$(EPOCTRG$_)\\$BaseTrg.bsc\""
+				"\t\$(EPOCTRG$_)/$BaseTrg.bsc"
 			);
 		}
 		if (&Winutl_CopyForStaticLinkage) {
 			&main::Output(
 				" \\\n",
-				"\t\"\$(EPOCTRG$_)\\$Trg\""
+				"\t\$(EPOCTRG$_)/$Trg"
 			);
 		}
 
@@ -272,18 +279,18 @@ sub PMStartBldList($) {
 
 		my $BitMapRef;
 		foreach $BitMapRef (@$BitMapStructRef) {
-			my $file="\$(EPOCTRG$_)\\$$BitMapRef{TrgPath}$$BitMapRef{Trg}";
+			my $file="\$(EPOCTRG$_)/$$BitMapRef{TrgPath}$$BitMapRef{Trg}";
 			&Generic_MakeWorkFile($makework,$file);
 			&main::Output(
 				" \\\n",
-				"\t\"$file\""
+				"\t$file"
 			);
 		}
 		undef $BitMapRef;
 
 		my $ResourceRef;
 		foreach $ResourceRef (@$ResourceStructRef) {
-			my $file="\$(EPOCTRG$_)\\$$ResourceRef{Trg}";
+			my $file="\$(EPOCTRG$_)/$$ResourceRef{Trg}";
 			&Generic_MakeWorkFile($makework,$file);
 			&main::Output(	# must come before main target because source for target will depend on the
 			" \\\n",		# *.rsg file in $EPOCIncPath
@@ -294,11 +301,11 @@ sub PMStartBldList($) {
 
 		my $AifRef;
 		foreach $AifRef (@$AifStructRef) {
-			my $file="\$(EPOCTRG$_)\\$TrgDir$$AifRef{Trg}";
+			my $file="\$(EPOCTRG$_)/$TrgDir$$AifRef{Trg}";
 			&Generic_MakeWorkFile($makework,$file);
 			&main::Output(
 				" \\\n",
-				"\t\"$file\""
+				"\t$file"
 			);
 		}
 		undef $AifRef;
@@ -327,13 +334,13 @@ sub PMStartBldList($) {
 		unless (&main::ExportUnfrozen) {
 			if (-e $DefFile) { # effectively "if project frozen ..."
 				&main::Output(
-					" \"\$(EPOCLIB)\\UDEB\\$BaseTrg.LIB\"\n"
+					" \$(EPOCLIB)/udeb/$BaseTrg.lib\n"
 				);
 			}
 			else {
 				&main::Output(
 					"\n",
-					"\t\@echo WARNING: Not attempting to create \"\$(EPOCLIB)\\UDEB\\$BaseTrg.LIB\".\n",
+					"\t\@echo WARNING: Not attempting to create \"\$(EPOCLIB)/udeb/$BaseTrg.lib\".\n",
 					"\t\@echo When exports are frozen in \"$DefFile\", regenerate Makefile.\n"
 				);
 			}
@@ -341,7 +348,7 @@ sub PMStartBldList($) {
 		else {
 			&main::Output(
 				"\n",
-				"\t\@echo Not attempting to create \"\$(EPOCLIB)\\UDEB\\$BaseTrg.LIB\"\n",
+				"\t\@echo Not attempting to create \"\$(EPOCLIB)/udeb/$BaseTrg.lib\"\n",
 				"\t\@echo from frozen .DEF file, since EXPORTUNFROZEN specified.\n"
 			);
 		}
@@ -350,9 +357,9 @@ sub PMStartBldList($) {
 			"\n",
 			"# REAL TARGET - LIBRARY\n",
 			"\n",
-			"\"\$(EPOCLIB)\\UDEB\\$BaseTrg.LIB\" : \"$DefFile\"\n",
-			"\tlib.exe /nologo /machine:i386 /nodefaultlib /name:\"$Trg\" /def:\"$DefFile\" /out:\"\$(EPOCLIB)\\UDEB\\$BaseTrg.LIB\"\n",
-			"\tdel \"\$(EPOCLIB)\\UDEB\\$BaseTrg.exp\"\n"
+			"\$(EPOCLIB)/udeb/$BaseTrg.lib : $DefFile\n",
+			"\twine lib.exe /nologo /machine:i386 /nodefaultlib /name:\"$Trg\" /def:\"$DefFile\" /out:\"\$(EPOCLIB)/udeb/$BaseTrg.lib\"\n",
+			"\trm \"\$(EPOCLIB)/udeb/$BaseTrg.exp\"\n"
 		);
 	}
 	&main::Output(
@@ -363,7 +370,7 @@ sub PMStartBldList($) {
 	if ($DefFile) {
 		&main::Output(
 #			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
-			"\tperl -S efreeze.pl \"$DefFile\" \"\$(EPOCBLD)\\$BaseTrg.def\" \n"
+			"\tperl -S efreeze.pl \"$DefFile\" \"\$(EPOCBLD)/$BaseTrg.def\" \n"
 		);
 	}
 	&main::Output(
@@ -372,10 +379,10 @@ sub PMStartBldList($) {
 	);
 	if ($DefFile) {
 		&main::Output(
-			"\t-\$(ERASE) \"\$(EPOCLIB)\\UDEB\\$BaseTrg.LIB\"\n"
+			"\t-\$(ERASE) \"\$(EPOCLIB)/udeb/$BaseTrg.lib\"\n"
 		);
 	}
-	&Generic_MakeWorkDir('MAKEWORKLIBRARY',"${LibPath}UDEB");
+	&Generic_MakeWorkDir('MAKEWORKLIBRARY',"${LibPath}udeb");
 
 	&Generic_Releaseables;
 }
@@ -411,13 +418,13 @@ sub PMBld {
 		@LibList=&main::LibList;
 	}
 
-	my $BLDTRGPATH = "\$(EPOCTRG$Bld)\\";
-	my $BLDDATAPATH = "\$(EPOCTRG$Bld)\\";
+	my $BLDTRGPATH = "\$(EPOCTRG$Bld)/";
+	my $BLDDATAPATH = "\$(EPOCTRG$Bld)/";
 	if (&main::Plat ne "WINC") {	# target paths ignored under WINC
 		if (&Generic_Definition("TRGDIR") ne "") {
-			$BLDTRGPATH .= "\$(TRGDIR)\\";	    # handles TARGETPATH
+			$BLDTRGPATH .= "\$(TRGDIR)/";	    # handles TARGETPATH
 		}
-		$BLDDATAPATH .= "\$(DATADIR)\\";
+		$BLDDATAPATH .= "\$(DATADIR)/";
 	}
 
 	# REAL TARGETS
@@ -434,25 +441,25 @@ sub PMBld {
 	unless (&main::Plat() eq 'TOOLS') {
 		push @releaseables, "$BLDTRGPATH$Trg";
 		if (&Winutl_CopyForStaticLinkage) {
-			push @releaseables, "\$(EPOCTRG$Bld)\\$Trg";
+			push @releaseables, "\$(EPOCTRG$Bld)/$Trg";
 		}
 		my $BitMapRef;
 		foreach $BitMapRef (@$BitMapStructRef) {
-			push @releaseables, "\$(EPOCTRG$Bld)\\$$BitMapRef{TrgPath}$$BitMapRef{Trg}";
+			push @releaseables, "\$(EPOCTRG$Bld)/$$BitMapRef{TrgPath}$$BitMapRef{Trg}";
 		}
 		my $ResourceRef;
 		foreach $ResourceRef (@$ResourceStructRef) {
-			push @releaseables, "\$(EPOCTRG$Bld)\\$$ResourceRef{Trg}";
+			push @releaseables, "\$(EPOCTRG$Bld)/$$ResourceRef{Trg}";
 		}
 		my $AifRef;
 		foreach $AifRef (@$AifStructRef) {
 			push @releaseables, "$BLDTRGPATH$$AifRef{Trg}";
 		}
 		if (-e $DefFile) { # effectively "if project frozen ..."
-			push @releaseables, "\$(EPOCLIB$Bld)\\$BaseTrg.LIB";
+			push @releaseables, "\$(EPOCLIB$Bld)/$BaseTrg.lib";
 		}
 		if ($Bld=~/DEB$/o) {
-			push @releaseables,"$BLDTRGPATH$BaseTrg.PDB";
+			push @releaseables,"$BLDTRGPATH$BaseTrg.pdb";
 		}
 	}
 	else {
@@ -500,32 +507,32 @@ sub PMBld {
 		foreach (@BaseSrcList) {
 			&main::Output(
 				" \\\n",
-				"\t\"\$(EPOCBLD$Bld)\\$_.sbr\""
+				"\t\$(EPOCBLD$Bld)\/$_.sbr"
 			);
 		}
 		&main::Output(
 			"\n",
 			"\n",
-		"\"\$(EPOCTRG$Bld)\\$BaseTrg.bsc\" : \$(BSC32_SBRS)\n",
-		"\tbscmake.exe \@<<\n",
+		"\$(EPOCTRG$Bld)\/$BaseTrg.bsc : \$(BSC32_SBRS)\n",
+		"\twine bscmake.exe \\\n",
 		"\t/nologo /o\$\@ \$(BSC32_SBRS)\n",
-		"<<\n",
+#		"<<\n",
 		"\n",
 		"\n"
 		);
 	}
 
 	&main::Output(
-		"LIBS="
+		"LIBS_",$Bld,"="
 	);
 	foreach (@StatLibList) {
 		&main::Output(
-			" \\\n\t\"\$(EPOCSTATLINK$Bld)\\$_\""
+			" \\\n\t\$(EPOCSTATLINK$Bld)\/$_"
 		);
 	}
 	foreach (@LibList) {
 		&main::Output(
-			" \\\n\t\"\$(EPOCLINK$Bld)\\$_\""
+			" \\\n\t\$(EPOCLINK$Bld)\/$_"
 		);
 	}
 	&main::Output(
@@ -533,19 +540,64 @@ sub PMBld {
 		"\n"
 	);
 
+#
+# extra lib defs to satisfy wine
+#
 	&main::Output(
-		"LINK_OBJS="
+		"LIBS_",$Bld,"_WIN="
+	);
+	foreach (@StatLibList) {
+		&main::Output(
+			" \\\n\tZ:\$(EPOCSTATLINK$Bld)\/$_"
+		);
+	}
+	foreach (@LibList) {
+		&main::Output(
+			" \\\n\tZ:\$(EPOCLINK$Bld)\/$_"
+		);
+	}
+	&main::Output(
+		"\n",
+		"\n"
+	);
+# ------------------
+
+
+	&main::Output(
+		"LINK_OBJS_",$Bld,"="
 	);
 	foreach (@BaseSrcList) {
 		&main::Output(
 			" \\\n",
-			"\t\"\$(EPOCBLD$Bld)\\$_.obj\""
+			"\t\$(EPOCBLD$Bld)\/$_.obj"
 		);
 	}
 	if ($Win32Resrc) {
 		&main::Output(
 			" \\\n",
-			"\t\"\$(EPOCBLD$Bld)\\",&main::Path_Split('Base',$Win32Resrc),".res\""
+			"\t\$(EPOCBLD$Bld)\/",&main::Path_Split('Base',$Win32Resrc),".res"
+		);
+	}
+	&main::Output(
+		"\n",
+		"\n"
+	);
+#
+# extra obj defs to satisfy wine
+#
+	&main::Output(
+		"LINK_OBJS_",$Bld,"_WIN="
+	);
+	foreach (@BaseSrcList) {
+		&main::Output(
+			" \\\n",
+			"\tZ:\$(EPOCBLD$Bld)\/$_.obj"
+		);
+	}
+	if ($Win32Resrc) {
+		&main::Output(
+			" \\\n",
+			"\tZ:\$(EPOCBLD$Bld)\/",&main::Path_Split('Base',$Win32Resrc),".res"
 		);
 	}
 	&main::Output(
@@ -555,10 +607,10 @@ sub PMBld {
 
 	if ($BasicTrgType=~/^DLL$/o) {
 		&main::OutFormat(
-			"STAGE1_LINK_FLAGS="
+			"STAGE1_LINK_FLAGS_",$Bld,"="
 		);
 		&main::OutFormat(
-			"\"\$(EPOCSTATLINK$Bld)\\$FirstLib\""
+			"Z:\$(EPOCSTATLINK$Bld)\/$FirstLib" # 4 extra backslashes to keep Wine happy
 		);
 		foreach (@Win32LibList) {
 			&main::OutFormat(
@@ -566,7 +618,7 @@ sub PMBld {
 			);
 		}
 		&main::OutFormat(
-			" \$(LIBS) /nologo$BaseAddressFlag /entry:\"_E32Dll\" /subsystem:windows /dll"
+			" \$(LIBS_",$Bld,"_WIN) /nologo$BaseAddressFlag /entry:\"_E32Dll\" /subsystem:windows /dll"
 		);
 		if ($Bld=~/DEB$/o) {
 			&main::OutFormat(
@@ -574,7 +626,7 @@ sub PMBld {
 			);
 		}
 		&main::OutFormat(
-			" /incremental:no /machine:IX86 /nodefaultlib /include:\"",'?_E32Dll@@YGHPAXI0@Z',"\" /out:\"\$(EPOCBLD$Bld)\\$Trg\" $WarningLevel"
+			" /incremental:no /machine:IX86 /nodefaultlib /include:\"",'?_E32Dll@@YGHPAXI0@Z',"\" /out:\"\$(EPOCBLD$Bld)/$Trg\" $WarningLevel"
 		);
 		&main::Output(
 			"\n",
@@ -583,13 +635,13 @@ sub PMBld {
 	}
 
 	&main::OutFormat(
-		'LINK_FLAGS='
+		"LINK_FLAGS_",$Bld,"="
 	);
 	if ($BasicTrgType=~/^(EXE|DLL)$/o) {
 # tools hack
 		unless (&main::Plat eq 'TOOLS') {
 			&main::OutFormat(
-				" \"\$(EPOCSTATLINK$Bld)\\$FirstLib\""
+				" Z:\$(EPOCSTATLINK$Bld)\/$FirstLib"
 			);
 		}
 # tools hack end
@@ -600,7 +652,7 @@ sub PMBld {
 		);
 	}
 	&main::OutFormat(
-		' $(LIBS) /nologo'
+		" \$(LIBS_",$Bld,"_WIN) /nologo"
 	);
 	if ($BasicTrgType=~/^DLL$/o) {
 		&main::OutFormat(
@@ -628,7 +680,7 @@ sub PMBld {
 	}
 	if ($BasicTrgType=~/^DLL$/o) {
 		&main::OutFormat(
-			" /dll \"\$(EPOCBLD$Bld)\\$BaseTrg.exp\""
+			" /dll \"\$(EPOCBLD$Bld)/$BaseTrg.exp\""
 		);
 	}
 	if ($BasicTrgType=~/^(DLL|EXE)$/o) {
@@ -677,47 +729,46 @@ sub PMBld {
 	);
 
 	&main::Output(
-		"\"$BLDTRGPATH$Trg\" : \$(LINK_OBJS)"
+		"$BLDTRGPATH$Trg : \$(LINK_OBJS_",$Bld,")"
 	);
 	if (-e $DefFile) { # effectively "if project frozen ..."
 		&main::Output(
-			" \"$DefFile\""
+			" $DefFile"
 		);
 	}
 	if ($BasicTrgType=~/^(DLL|EXE)$/o) {
 # tools hack
 		unless (&main::Plat eq 'TOOLS') {
 			&main::Output(
-				" \"\$(EPOCSTATLINK$Bld)\\$FirstLib\""
+				" \$(EPOCSTATLINK$Bld)/$FirstLib"
 			);
 		}
 	}
 # tools hack end
 	&main::Output(
-		" \$(LIBS)\n"
+		" \$(LIBS_",$Bld,")\n"
 	);
 
 
 #	Link by name first time round for dlls
 	if ($BasicTrgType=~/^DLL$/o) {
 		&main::Output(
-			"\tlink.exe \@<<\n",
-			"\t\t\$(STAGE1_LINK_FLAGS) \$(LINK_OBJS)\n",
-			"<<\n",
-			"\tdel \"\$(EPOCBLD$Bld)\\$Trg\"\n",
-			"\tdel \"\$(EPOCBLD$Bld)\\$BaseTrg.exp\"\n"
+			"\twine link.exe \\\n",
+			"\t\t\$(STAGE1_LINK_FLAGS_",$Bld,") \$(LINK_OBJS_",$Bld,"_WIN)\n",
+			"\trm \"\$(EPOCBLD$Bld)/$Trg\"\n",
+			"\trm \"\$(EPOCBLD$Bld)/$BaseTrg.exp\"\n"
 		);
 
 #		Generate an export info file
 		&main::Output(
-			"\tdumpbin /exports /out:\"\$(EPOCBLD$Bld)\\$BaseTrg.inf\" \"\$(EPOCBLD$Bld)\\$BaseTrg.lib\"\n",
-			"\tdel \"\$(EPOCBLD$Bld)\\$BaseTrg.lib\"\n"
+			"\twine dumpbin /exports /out:\"\$(EPOCBLD$Bld)/$BaseTrg.inf\" Z:\"\$(EPOCBLD$Bld)/$BaseTrg.lib\"\n",
+			"\trm \"\$(EPOCBLD$Bld)/$BaseTrg.lib\"\n"
 		);
 
 #		call makedef to reorder the export information
 		&main::Output(
-#			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
-			"\tperl -S makedef.pl -Inffile \"\$(EPOCBLD$Bld)\\$BaseTrg.inf\""
+#			call perl on the script here so make will die if there are errors - this doesn't happen if calling perl in a batch file
+			"\tperl -S makedef.pl -Inffile \"\$(EPOCBLD$Bld)/$BaseTrg.inf\""
 		);
 		if (-e $DefFile) { # effectively "if project frozen ..."
 			&main::Output(
@@ -737,49 +788,48 @@ sub PMBld {
 			}
 		}
 		&main::Output(
-			" \"\$(EPOCBLD)\\$BaseTrg.def\" \n",
-			"\tdel \"\$(EPOCBLD$Bld)\\$BaseTrg.inf\"\n"
+			" \"\$(EPOCBLD)/$BaseTrg.def\" \n",
+			"\trm \"\$(EPOCBLD$Bld)/$BaseTrg.inf\"\n"
 		);
 
 		# create the export object from the .DEF file
 		&main::Output(
-			"\tlib.exe  /nologo /machine:i386 /nodefaultlib /name:\"$Trg\" /def:\"\$(EPOCBLD)\\$BaseTrg.def\" /out:\"\$(EPOCBLD$Bld)\\$BaseTrg.lib\"\n"
+			"\twine lib.exe  /nologo /machine:i386 /nodefaultlib /name:\"$Trg\" /def:\"\$(EPOCBLD)/$BaseTrg.def\" /out:\"\$(EPOCBLD$Bld)/$BaseTrg.lib\"\n"
 		);
 		if (&main::ExportUnfrozen) {
 			&main::Output(
-			"\tcopy \"\$(EPOCBLD$Bld)\\$BaseTrg.lib\" \"\$(EPOCLIB)\\UDEB\\$BaseTrg.LIB\"\n"
+			"\tcp \"\$(EPOCBLD$Bld)/$BaseTrg.lib\" \"\$(EPOCLIB)/udeb/$BaseTrg.lib\"\n"
 			);
 		}
 		&main::Output(
-			"\tdel \"\$(EPOCBLD$Bld)\\$BaseTrg.lib\"\n"
+			"\trm \"\$(EPOCBLD$Bld)/$BaseTrg.lib\"\n"
 		);
 	}
 
 	if ($BasicTrgType=~/^(DLL|EXE)$/o) {
 		&main::Output(
-			"\tlink.exe \@<<\n"
+			"\twine link.exe \\\n"
 		);
 	}
 	elsif ($BasicTrgType=~/^LIB$/o) {
 		&main::Output(
-			"\tlib.exe \@<<\n"
+			"\twine lib.exe \\\n"
 		);
 	}
 	&main::Output(
-		"\t\t\$(LINK_FLAGS) \$(LINK_OBJS)\n",
-		"<<\n"
+		"\t\t\$(LINK_FLAGS_",$Bld,") \$(LINK_OBJS_",$Bld,"_WIN)\n",
 	);
 
 	if ($BasicTrgType=~/^DLL$/o) {
 		&main::Output(
-			"\tdel \"\$(EPOCBLD$Bld)\\$BaseTrg.exp\"\n"
+			"\trm \"\$(EPOCBLD$Bld)/$BaseTrg.exp\"\n"
 		);
 	}
 
 # tools hack
 	if (&main::Plat eq 'TOOLS') {
 		&main::Output(
-			"\tcopy \"$BLDTRGPATH$Trg\" \"",&main::EPOCToolsPath,"$Trg\"\n"
+			"\tcp \"$BLDTRGPATH$Trg\" \"",&main::EPOCToolsPath,"$Trg\"\n"
 		);
 	}
 # tools hack end
@@ -787,8 +837,8 @@ sub PMBld {
 		&Generic_MakeWorkDir("MAKEWORK$Bld", "\$(EPOCTRG$Bld)");
 		&main::Output(
 			"\n",
-			"\"\$(EPOCTRG$Bld)\\$Trg\" : \"$BLDTRGPATH$Trg\"\n",
-			"\tcopy \$\? \$\@\n"
+			"\$(EPOCTRG$Bld)/$Trg : $BLDTRGPATH$Trg\n",
+			"\tcpy \$\? \$\@\n"
 		);
 	}
 
@@ -816,7 +866,7 @@ sub PMBitMapBld {
 
 	my $ChopTrgPath="";
 	if ($$BitMapRef{TrgPath}) {
-		$ChopTrgPath.="\\$$BitMapRef{TrgPath}";
+		$ChopTrgPath.="/$$BitMapRef{TrgPath}";
 		chop $ChopTrgPath;
 	}
 
@@ -825,7 +875,7 @@ sub PMBitMapBld {
 	foreach $Bld (@BldList) {
 		my $path="\$(EPOCTRG$Bld)$ChopTrgPath";
 		&main::Output(
-			&Generic_Quote("$path\\$$BitMapRef{Trg}"), " : ", 
+			&Generic_Quote("$path/$$BitMapRef{Trg}"), " : ", 
 			&Generic_Quote("$$BitMapRef{GenericTrg}"), "\n",
 			"\t", &Generic_CopyAction(),
 			"\n"
@@ -845,7 +895,7 @@ sub PMResrcBld {
 
 	foreach my $Bld (@BldList) {
 		&main::Output(
-			&Generic_Quote("\$(EPOCTRG$Bld)\\$$ResourceRef{Trg}"), " : ", 
+			&Generic_Quote("\$(EPOCTRG$Bld)/$$ResourceRef{Trg}"), " : ", 
 			&Generic_Quote("$$ResourceRef{GenericTrg}"), "\n",
 			"\t", &Generic_CopyAction(),
 			"\n"
@@ -862,7 +912,7 @@ sub PMAifBld {
 	my $AifRef=&main::AifRef;
 	my $TrgDir="";
 	if (&Generic_Definition("TRGDIR") ne "") {
-		$TrgDir="\\\$(TRGDIR)";
+		$TrgDir="/\$(TRGDIR)";
 	}
 	if (&main::Plat eq "WINC") {	# target path ignored under WINC
 		$TrgDir="";
@@ -871,9 +921,9 @@ sub PMAifBld {
 	my @BldList=&main::BldList;
 	my $Bld;
 	foreach $Bld (@BldList) {
-		my $file="\$(EPOCTRG$Bld)$TrgDir\\$$AifRef{Trg}";
+		my $file="\$(EPOCTRG$Bld)$TrgDir/$$AifRef{Trg}";
 		&main::Output(
-			"\"$file\" : \"$$AifRef{GenericTrg}\"\n",
+			"$file : $$AifRef{GenericTrg}\n",
 			"\tperl -S ecopyfile.pl \$? \$\@\n",
 			"\n"
 		);
@@ -898,7 +948,7 @@ sub PMSrcDepend {
 	);
 	foreach (@DepList) {
 		&main::Output(
-		" \\\n\t\"$_\""
+		" \\\n\t$_"
 		);
 	}
 	&main::Output(
@@ -925,11 +975,18 @@ sub PMSrcBldDepend {
 	);
 	foreach (@DepList) {
 		&main::Output(
-			" \\\n\t\"$_\""
+			" \\\n\t$_"
 		);
 	}
 	&main::Output(
-		"\n",
+		" -D_UNICODE < $RTWAifDir$$AifRef{Resrc} > ${RTWAifDir}aif.rpp\n",
+		"\twine \$(EPOCROOT)/epoc32/tools/rcomp.exe -u -o\"\$(EPOCBLD$Bld)\/aif.rsc\" -h\"\$(EPOCBLD$Bld)/aif.rs~\" -i\"$RTWAifDir$$AifRef{Resrc}\" -s\"${RTWAifDir}aif.rpp\"\n",
+		"\trm -f ${RTWAifDir}aif.rpp\n",
+		"\trm -f \$(EPOCBLD$Bld)\/aif.rs~\n",
+		"\t", &main::EPOCRelPath, "winc\/udeb\/aiftool.exe \$(EPOCBLD$Bld)\/ #\n",
+		"\trm -f \$(EPOCBLD$Bld)\/aif.*\n",
+		"\tcp \$(EPOCBLD$Bld)\/out.aif \$\@\n",
+		"\trm -f \$(EPOCBLD$Bld)\/out.aif\n",
 		"\n"
 	);
 }
@@ -938,18 +995,18 @@ sub PMEndSrcBld {
 	my $BaseSrc=&main::BaseSrc;
 	my $Bld=&main::Bld;
 	my $Plat=&main::Plat;
-	my $Src=ucfirst lc &main::Src;
+	my $Src=&main::Src;
 	my $SrcPath=&main::SrcPath;
 
 	&main::Output(
-		"\"\$(EPOCBLD$Bld)\\$BaseSrc.obj\" \"\$(EPOCBLD$Bld)\\$BaseSrc.sbr\" : \"$SrcPath$Src\" \$(DEPEND$Bld)\n",
-		"\t\$(CL$Bld) /Fo\"\$(EPOCBLD$Bld)/\" /c \"$SrcPath$Src\"\n",
+		"\$(EPOCBLD$Bld)/$BaseSrc.obj \$(EPOCBLD$Bld)/$BaseSrc.sbr : $SrcPath$Src \$(DEPEND$Bld)\n",
+		"\t\$(CL$Bld) /Fo\"\$(EPOCBLD$Bld)/\" /c Z:\"$SrcPath$Src\"\n",
 		"\n",
 #		assembler listing target 
-		"LISTING$Bld$BaseSrc : \"\$(EPOCBLD$Bld)\\$BaseSrc.lis\"\n",
-		"\tcopy \$? \"$SrcPath$BaseSrc.lst.$Plat\"\n",
+		"LISTING$Bld$BaseSrc : \$(EPOCBLD$Bld)/$BaseSrc.lis\n",
+		"\tcp \$? \"$SrcPath$BaseSrc.lst.$Plat\"\n",
 		"\n",
-		"\"\$(EPOCBLD$Bld)\\$BaseSrc.lis\": \"$SrcPath$Src\" \$(DEPEND$Bld)\n",
+		"\$(EPOCBLD$Bld)/$BaseSrc.lis: $SrcPath$Src \$(DEPEND$Bld)\n",
 		"\t\$(CL$Bld) /Fa\"\$\@\" /Fo\"\$(EPOCBLD$Bld)/\" /c \"$SrcPath$Src\"\n",
 		"\n"
 	);
@@ -975,7 +1032,7 @@ sub PMEndSrcList {
 		);
 		foreach (@DepList) {
 			&main::Output(
-				" \\\n\t\"$_\""
+				" \\\n\t$_"
 			);
 		}
 		&main::Output(
@@ -986,7 +1043,7 @@ sub PMEndSrcList {
 		my $Bld;
 		foreach $Bld (@BldList) {
 			&main::Output(
-				"\"\$(EPOCBLD$Bld)\\",&main::Path_Split('Base',$Win32Resrc),".res\" : \"$Win32Resrc\" \$(DEPEND)\n",
+				"\$(EPOCBLD$Bld)\/",&main::Path_Split('Base',$Win32Resrc),".res : $Win32Resrc \$(DEPEND)\n",
 				"\trc /l 0x809 /fo\$\@ /i \"",&main::Path_Chop(&main::Path_Split('Path',$Win32Resrc)),"\" \"$Win32Resrc\"\n",
 				"\n"
 			);
diff --git a/cshlpcmp.pl b/cshlpcmp.pl
index 6eb5877..cfad042 100644
--- a/cshlpcmp.pl
+++ b/cshlpcmp.pl
@@ -1,4 +1,4 @@
-#!perl
+#!/usr/bin/perl
 ################################################################################
 #
 # Program: cshlpcmp 
@@ -41,23 +41,23 @@ Independent JPEG Group.
 
 #add the local library path to the global one
 use FindBin;
-use lib $FindBin::Bin."\\perllib","$FindBin::Bin\\cshlpcmp\\perl";
+use lib $FindBin::Bin."/perllib","$FindBin::Bin/cshlpcmp/perl";
 
 #Standard libraries
 use Carp;
 use strict;
 
 #use the DOM xml module
-use XML::DOM;
+use xml::dom;
 
 # use the devtools library
 use devtools;
 
 #objects
-use ProjFile;
+use projfile;
 use args;
 use params;
-use Conv; #rtf2Xml converter
+use conv; #rtf2Xml converter
 
 # global reference to the commandline parameters
 $main::params=undef;
@@ -98,7 +98,9 @@ sub main
 
     my $projectFile = New CProjFile;
 
-    $projectFile->Parse($main::params->ParamItem("projectfile")->Value());
+    my $file = $main::params->ParamItem("projectfile")->Value();
+    $file =~ s/\\/\//g;
+    $projectFile->Parse($file);
 
     #create the converter object
     my $converter = New CConverter($projectFile);
@@ -144,9 +146,11 @@ sub Initilise
     $main::params = $args->ParseCommandLine(\@ARGV);
 
     # if a log file was requested
-    if($main::params->Exists("logFile"))
+    if($main::params->Exists("logfile"))
 		{
-		my $log = New CLog($main::params->ParamItem("logFile")->Value());
+		my $logfile = $main::params->ParamItem("logfile")->Value();
+		$logfile =~ s/\\/\//g;
+		my $log = New CLog($logfile);
 		}
 
     my $log = New CLog(); # So we can error in this function
diff --git a/cshlpcmp/perl/asptmlfl.pm b/cshlpcmp/perl/asptmlfl.pm
index 3c6098b..239d28b 100644
--- a/cshlpcmp/perl/asptmlfl.pm
+++ b/cshlpcmp/perl/asptmlfl.pm
@@ -1303,9 +1303,13 @@ sub _ProcGraphicNodes
 							#make a copy of the graphic node
 							my $graphicNodeCopy = $graphicNode->cloneNode(1);
 							
+							my $epoc = $epocFileName;
+							my $html = $htmlFileName;
+							$epoc =~ s/\//\\/g;
+							$html =~ s/\//\\/g;
 							$graphicNodeCopy->removeAttribute("filename");
-							$graphicNodeCopy->setAttribute("epocfilename",$epocFileName);
-							$graphicNodeCopy->setAttribute("htmlfilename",$htmlFileName);
+							$graphicNodeCopy->setAttribute("epocfilename",$epoc);
+							$graphicNodeCopy->setAttribute("htmlfilename",$html);
 							
 							#store this mbm graphic
 							$self->_iMbmList->AddItem($epocFileName,$graphicNodeCopy);
diff --git a/cshlpcmp/perl/cshlpfl.pm b/cshlpcmp/perl/cshlpfl.pm
index 885cf67..3335420 100644
--- a/cshlpcmp/perl/cshlpfl.pm
+++ b/cshlpcmp/perl/cshlpfl.pm
@@ -137,10 +137,15 @@ sub ToEPOCHelp
 	my $self = shift;
 
 	# call the cshlpwtr application to convert the CsHlp file to an EPOCHelp file
-	my $command= $self->_iCSHlpWtrExe." \"-if".$self->_iCsHlpFile."\" \"-of".$self->_iEPOCHelpFile."\"";
+	my $CsHlpFile = $self->_iCsHlpFile;
+	my $EPOCHelpFile = $self->_iEPOCHelpFile;
+	$CsHlpFile =~ s/\//\\/g;
+	$EPOCHelpFile =~ s/\//\\/g;
+	my $command= "wine ".$self->_iCSHlpWtrExe." \"-if".$CsHlpFile."\" \"-of".$EPOCHelpFile."\"";
 
 	$self->_iLog->Log($command."\n");
 
+	$command =~ s/\\/\\\\/g;
 	my $return=system($command);
 
 	#check if cshlpwtr managed to run
diff --git a/cshlpcmp/perl/csptmlfl.pm b/cshlpcmp/perl/csptmlfl.pm
index e7b2b9e..e26dd78 100644
--- a/cshlpcmp/perl/csptmlfl.pm
+++ b/cshlpcmp/perl/csptmlfl.pm
@@ -1569,9 +1569,10 @@ sub _ProcGraphicLinkNode
 	#make the fileName 
 	if ( ($archive !~ /[\\\/]$/) && ($archive ne "") )
 		{
-		$archive = $archive."\\";
+		$archive = $archive."\/";
 		}
 	my $fileName=$archive.$name;
+	$fileName =~ s/\\/\//g;
 
 	#check that the mbm graphic file exists and is not zero size
 	if(! -s $self->_iGraphicsDir.$fileName.".mbm")
diff --git a/cshlpcmp/perl/custfile.pm b/cshlpcmp/perl/custfile.pm
index 4684806..6b02476 100644
--- a/cshlpcmp/perl/custfile.pm
+++ b/cshlpcmp/perl/custfile.pm
@@ -1055,6 +1055,7 @@ sub _GetGraphicID($)
 	my $self=shift;
 
 	my($aFileName) = @_;
+	$aFileName =~ s/\\/\//g;
 
 	# get the epoc filename for the graphic
 	my($epocFileName)=$aFileName.".mbm";
@@ -1106,6 +1107,7 @@ sub _CreateGraphicNode($)
 	{
 	my $self=shift;
 	my($aGraphicFileName)=@_;
+	$aGraphicFileName =~ s/\//\\/g;
 
 	#create the graphic tag
 	my $element = $self->_iCsHlpDom->createElement("graphic");
diff --git a/cshlpcmp/perl/parastyle.pm b/cshlpcmp/perl/parastyle.pm
index a572910..04cd622 100644
--- a/cshlpcmp/perl/parastyle.pm
+++ b/cshlpcmp/perl/parastyle.pm
@@ -17,7 +17,7 @@ use strict;
 
 use devtools;
 use log;
-use XML::DOM;
+use xml::dom;
 
 ################################################################################
 #
diff --git a/cshlpcmp/perl/projfile.pm b/cshlpcmp/perl/projfile.pm
index e42c67c..541735f 100644
--- a/cshlpcmp/perl/projfile.pm
+++ b/cshlpcmp/perl/projfile.pm
@@ -42,6 +42,7 @@ sub New
 
 	#get the current working directory
 	my $cwd = cwd();
+	$cwd =~ s/([^\/])$/$1\//; # append a slash if one isn't found
 	
 	my $self  = {};
 
@@ -335,6 +336,7 @@ sub Parse($)
 	{
 	my $self = shift;
 	my($aProjectFile)=@_;
+	$aProjectFile =~ s/\\/\//g;
 
 	#get a new xml parsing object
 	my $parser = new XML::DOM::Parser;
@@ -512,6 +514,7 @@ sub _ProcDirectoriesNodes($)
 					$text = "";
 					}
 				my $path = $self->_RelateToDir($projectDir, $text);
+				$path =~ s/\\/\//g;
 
 				if($tagName eq "input")
 					{
@@ -524,7 +527,10 @@ sub _ProcDirectoriesNodes($)
 					#get the output directory
                                         if ($main::params->Exists("outputdir"))
 					    {
-					    $self->_iOutputDir ($main::params->ParamItem("outputdir")->Value());
+					    my $dir = $main::params->ParamItem("outputdir")->Value();
+					    $dir =~ s/\\/\//g;
+					    $dir = $self->_RelateToDir(cwd(), $dir);
+					    $self->_iOutputDir ($dir);
                                             }
 					else
 					    {
@@ -542,7 +548,7 @@ sub _ProcDirectoriesNodes($)
 							  substr($self->_iOutputDir(), 0, index($self->_iOutputDir(),':')+1);
 							}
 						$nullFile = $nullFile."\\nul";
-						open(NULL,">>$nullFile") or $self->_iLog->LogDie("The output directory '".$self->_iOutputDir."' is on a drive that doesn't exist, so cannot be created.");
+#						open(NULL,">>$nullFile") or $self->_iLog->LogDie("The output directory '".$self->_iOutputDir."' is on a drive that doesn't exist, so cannot be created.");
 
 						mkpath($self->_iOutputDir);
 						}
@@ -567,7 +573,10 @@ sub _ProcDirectoriesNodes($)
 					#get the working directory
                                         if ($main::params->Exists("workingdir"))
 					    {
-					    $self->_iWorkingDir ($main::params->ParamItem("workingdir")->Value());
+					    my $dir = $main::params->ParamItem("workingdir")->Value();
+					    $dir =~ s/\\/\//g;
+					    $dir = $self->_RelateToDir(cwd(), $dir);
+					    $self->_iWorkingDir ($dir);
 					    }
 					else
 					    {
@@ -584,7 +593,7 @@ sub _ProcDirectoriesNodes($)
 							$nullFile = substr($self->_iWorkingDir(),0,index($self->_iWorkingDir(),':')+1);
 							}
 						$nullFile = $nullFile."\\nul";
-						open(NULL,">>$nullFile") or $self->_iLog->LogDie("The working directory '".$self->_iWorkingDir."' is on a drive that doesn't exist, so cannot be created.");
+#						open(NULL,">>$nullFile") or $self->_iLog->LogDie("The working directory '".$self->_iWorkingDir."' is on a drive that doesn't exist, so cannot be created.");
 
 						mkpath($self->_iWorkingDir);
 						}
@@ -634,7 +643,7 @@ sub _RelateToDir($$)
 
 	if ($path =~ /[^\\\/]$/)
 		{
-		$path = $path."\\";
+		$path = $path."\/";
 		}
 	
 	return $path;
@@ -694,13 +703,13 @@ sub _RelateTo($$)
 		$path = $path.$aPath; # Move to the new path
 		}
 
-	# Convert unix slashes to DOS ones
-	$path =~ s/\//\\/g;
+	# Convert DOS slashes to unix ones
+	$path =~ s/\\/\//g;
 
 	# Remove /dir/.. which cancel out
-	while ($path =~ /\\[^\.\\]+\\\.\./)
+	while ($path =~ /\/[^\.\/]+\/\.\./)
 		{
-		$path =~ s/\\[^\.\\]+\\\.\.//;
+		$path =~ s/\/[^\.\/]+\/\.\.//;
 		}
 	
 	return $path;
diff --git a/cshlpcmp/perl/rtffile.pm b/cshlpcmp/perl/rtffile.pm
index 8f64e10..273b6ca 100644
--- a/cshlpcmp/perl/rtffile.pm
+++ b/cshlpcmp/perl/rtffile.pm
@@ -106,12 +106,13 @@ sub ToPtml
     my($rtfFile)=ExtractFileNameNoExt($self->_iRtfFile);
 
     # call the rtf2ptml application to convert the rtf files to ptml
-    $inputDir =~ s/([~\\\/])$/$1\//;
-    $outputDir =~ s/([~\\\/])$/$1\//;
+    $inputDir =~ s/([^\\\/])$/$1\//;
+    $outputDir =~ s/([^\\\/])$/$1\//;
     my($command)="rtf2ptml \"-id".$inputDir."\" \"-od".$outputDir."\" \"-ox.ptml.xml\" \"-dtd".$self->_GetDTDUrl()."\" \"-xsl".$self->_GetXSLUrl()."\" \"".$rtfFile."\"";
 
     $self->_iLog->Log($command."\n");
 
+    $command =~ s/\\/\\\\/g;
     my $return=system($command);
 
     #check if rtf2ptml managed to run
diff --git a/defutl.pm b/defutl.pm
index 4b854c7..3f4985c 100644
--- a/defutl.pm
+++ b/defutl.pm
@@ -8,7 +8,7 @@
 # General Def file utilities
 #---------------------------
 
-package Defutl;
+package defutl;
 
 require Exporter;
 @ISA=qw(Exporter);
diff --git a/e32env.pm b/e32env.pm
index 64a1fe3..f5a4536 100644
--- a/e32env.pm
+++ b/e32env.pm
@@ -6,7 +6,7 @@
 # Contains information for makmake and associated e32tools perl programs
 # within the Epoc32 Environment
 
-package E32env;
+package e32env;
 
 
 use vars qw(%Data);
@@ -14,40 +14,27 @@ use vars qw(%Data);
 BEGIN {
 	my $epocroot = $ENV{EPOCROOT};
 	die "ERROR: Must set the EPOCROOT environment variable\n" if (!defined($epocroot));
-	$epocroot =~ s-/-\\-go;	# for those working with UNIX shells
 	die "ERROR: EPOCROOT must not include a drive letter\n" if ($epocroot =~ /^.:/);
-	die "ERROR: EPOCROOT must be an absolute path without a drive letter\n" if ($epocroot !~ /^\\/);
+	die "ERROR: EPOCROOT must be an absolute path without a drive letter\n" if ($epocroot !~ /^\//);
 	die "ERROR: EPOCROOT must not be a UNC path\n" if ($epocroot =~ /^\\\\/);
-	die "ERROR: EPOCROOT must end with a backslash\n" if ($epocroot !~ /\\$/);
-	open PIPE, "set EPOCROOT |";
-	my $found=0;
-	while (<PIPE>) {
-		if (/^EPOCROOT=.*/)
-			{
-			$found=1;
-			last;
-			}
-	}
-	close PIPE;
-	die "EPOCROOT environment variable must be capitalised\n" if (!$found);
+	die "ERROR: EPOCROOT must end with a slash\n" if ($epocroot !~ /\/$/);
 	print "WARNING: EPOCROOT does not specify an existing directory\n" if (!-d $epocroot);
 
-	$epocroot=~ s-\\$--;		# chop trailing \\
+	$epocroot=~ s-\/$--;		# chop trailing /
 
-	$Data{EPOCPath} = $epocroot."\\EPOC32\\";
+	$Data{EPOCPath} = $epocroot."/epoc32/";
 
-	$Data{EPOCDataPath} = $epocroot."\\EPOC32\\DATA\\";
-	$Data{EPOCIncPath} = $epocroot."\\EPOC32\\INCLUDE\\";
-	$Data{BldPath} = $epocroot."\\EPOC32\\BUILD\\";
+	$Data{EPOCDataPath} = $epocroot."/epoc32/data/";
+	$Data{EPOCIncPath} = $epocroot."/epoc32/include/";
+	$Data{BldPath} = $epocroot."/epoc32/build/";
 #regression hack
-#	$Data{LinkPath} = $epocroot."\\EPOC32\\LIBRARY\\";
-	$Data{LinkPath} = $epocroot."\\EPOC32\\RELEASE\\";
+	$Data{LinkPath} = $epocroot."/epoc32/release/";
 #regression hack end
-	$Data{RelPath} = $epocroot."\\EPOC32\\RELEASE\\";
-	$Data{EPOCToolsPath} = $epocroot."\\EPOC32\\TOOLS\\";
-	$Data{RomPath} = $epocroot."\\EPOC32\\ROM\\";
+	$Data{RelPath} = $epocroot."/epoc32/release/";
+	$Data{EPOCToolsPath} = $epocroot."/epoc32/tools/";
+	$Data{RomPath} = $epocroot."/epoc32/rom/";
 
-	$Data{DataPath} = "Z\\SYSTEM\\DATA\\";
+	$Data{DataPath} = "z/system/data/";
 }
 
 1;
diff --git a/e32plat.pm b/e32plat.pm
index 41f25c3..dd22f78 100644
--- a/e32plat.pm
+++ b/e32plat.pm
@@ -1,3 +1,5 @@
+#!/usr/bin/perl -w
+#
 # E32PLAT.PM
 #
 # Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
@@ -9,7 +11,7 @@
 #
 # all data is uppercase
 
-package E32Plat;
+package e32plat;
 
 require Exporter;
 @ISA=qw(Exporter);
@@ -35,7 +37,8 @@ sub Plat_SetVerbose () {
 my %BldLists=(
 	EPOC32=>['UREL','UDEB'],
 	WINS=>['UDEB','UREL'],
-	TOOLS=>['DEB','REL']
+	TOOLS=>['DEB','REL'],
+	linux=>['UDEB','UREL']
 );
 
 my %BldMacros=(
@@ -172,7 +175,7 @@ my %Plat=(
 		Compiler=>'VC32',
 		CPU=>'WINS',
 		MakeMod=>'Cl_win',
-		MakeCmd=>'nmake',
+		MakeCmd=>'make',
 		OS=>'WINS',
 	},
 	#VC6=>{
@@ -250,13 +253,22 @@ sub Plat_Init ($) { # takes path to ASSP modules
 
 #	get a list of modules
 	opendir DIR, $Path;
-	my @ASSPs=grep s/^([^\.].*)\.ASSP$/$1/, map { uc $_ } readdir DIR;
+
+	my @ASSPs;
+	@files = readdir DIR;
+	foreach (@files) {
+	  if (m/^([^\.].*)\.assp$/) {
+	    push @ASSPs, uc $1;
+	  }
+	}
+	# alfredh: strangely enough this does not work on linux
+	#=grep s|^([^/.].*)\.assp$|$1|, map { uc $_ } readdir DIR;
 	closedir DIR;
 
 #	open each module in turn, and add it to the array
 	my $ASSP;
 	foreach $ASSP (@ASSPs) {
-		my $File=$Path.$ASSP.'.assp';
+		my $File= lc $Path.$ASSP.'.assp';
 #		check whether the assp is already defined
 		if (defined %{$Plat{$ASSP}}) {
 			warn(
@@ -282,6 +294,8 @@ sub Plat_Init ($) { # takes path to ASSP modules
 			if (/^\s*$/o) {
 				next;
 			}
+#			upper-case data
+			$_=uc $_; #TODOAEH
 #			get the key-value pair
 			unless (/^\s*(\w+)\s+(\w+)\s*$/o) {
 				push @Errors, "$File($.) : warning: syntax error - only key-value pairs allowed\n";
@@ -317,7 +331,9 @@ sub Plat_Init ($) { # takes path to ASSP modules
 
 sub Plat_GetL ($$$) { # takes Platform name, ref to plat hash, ref to bldmacrohash
 	my ($Candidate,$PlatHash_ref,$BldMacrosHash_ref)=@_;
-	$Candidate=uc $Candidate;
+
+	$Candidate = uc $Candidate;
+
 # is platform in our list?
 	unless (defined $Plat{$Candidate}) {
 		die "ERROR: Platform \"$Candidate\" not supported\n";
@@ -334,7 +350,7 @@ sub Plat_GetL ($$$) { # takes Platform name, ref to plat hash, ref to bldmacroha
 
 	$PlatHash{Compiler}='GCC32' unless $PlatHash{Compiler};
 	$PlatHash{OS}='EPOC32' unless $PlatHash{OS};
-	$PlatHash{MakeMod}='Cl_gcc' unless $PlatHash{MakeMod};
+	$PlatHash{MakeMod}='cl_gcc' unless $PlatHash{MakeMod};
 	$PlatHash{MakeCmd}='make' unless $PlatHash{MakeCmd};
 	$PlatHash{CPU}='MARM' unless $PlatHash{CPU};
 	$PlatHash{Single}=0 unless $PlatHash{Single};
@@ -422,13 +438,14 @@ sub Plat_AssocIDE ($) {
 #	return the IDE associated with a "Real" platform if there is one
 	my ($Candidate)=@_;
 
+	$Candidate = uc $Candidate;
+
 	unless (defined $Plat{$Candidate}) {
 		die "ERROR: Platform \"$Candidate\" not supported\n";
 	}
 
 	my $Key;
 	foreach $Key (keys %Plat) {
-	print $key;
 		if (${Plat{$Key}}{Real}) {
 			if (${Plat{$Key}}{Real} eq $Candidate) {
 				return $Key;
diff --git a/e32tpver.pm b/e32tpver.pm
index ee9c51b..7f0298b 100644
--- a/e32tpver.pm
+++ b/e32tpver.pm
@@ -6,7 +6,7 @@
 
 # Returns the version number for E32TOOLP - update for each release
 
-package E32tpver;
+package e32tpver;
 require Exporter;
 @ISA=qw(Exporter);
 @EXPORT=qw(
diff --git a/e32variant.pm b/e32variant.pm
index d668ee7..8d665be 100644
--- a/e32variant.pm
+++ b/e32variant.pm
@@ -1,4 +1,4 @@
-package E32Variant;
+package e32variant;
 
 require Exporter;
 
@@ -6,7 +6,7 @@ require Exporter;
 
 @EXPORT = qw(Variant_GetMacroList Variant_GetMacroHRHFile);
 
-use Pathutl;
+use pathutl;
 
 # using $FindBin::Bin to figure out the location of the epoc32\tools directory as 
 # IDE doesn't understand env{EPOCROOT}
@@ -16,7 +16,7 @@ my $PerlBinPath;	# fully qualified pathname of the directory containing this scr
 BEGIN {
 	require 5.005_03;		# check user has a version of perl that will cope
 	$PerlBinPath = $FindBin::Bin;	# X:/epoc32/tools
-	$PerlBinPath =~ s/\//\\/g;	# X:\epoc32\tools
+#	$PerlBinPath =~ s/\//\//g;	# X:\epoc32\tools
 }
 
 # get epocroot if it is set
@@ -83,9 +83,9 @@ sub Variant_GetMacroList{
 
     my @macros = ();
     my $vfile = Variant_GetMacroHRHFile();
-    
+
     if($vfile)
-    {   
+    {
 	$vfile = &Path_RltToWork($vfile);
 	open CPPPIPE,"cpp -undef -dM $vfile |" or die "ERROR: Can't invoke CPP.EXE\n";
 	while(<CPPPIPE>){
diff --git a/efreeze.pl b/efreeze.pl
index 552e880..aff0738 100644
--- a/efreeze.pl
+++ b/efreeze.pl
@@ -19,14 +19,13 @@ BEGIN {
 	require 5.005_03;
 # establish the path to the Perl libraries: currently the same directory as this script
 	$PerlLibPath = $FindBin::Bin;	# X:/epoc32/tools
-	$PerlLibPath =~ s/\//\\/g;	# X:\epoc32\tools
-	$PerlLibPath .= "\\";
+	$PerlLibPath .= "\/";
 }
 
 use lib $PerlLibPath;
-use Defutl;
-use E32tpver;
-use Pathutl;
+use defutl;
+use e32tpver;
+use pathutl;
 
 
 # THE MAIN PROGRAM SECTION
diff --git a/epoc b/epoc
new file mode 100644
index 0000000..7f7c19a
--- /dev/null
+++ b/epoc
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# epoc - bash interface for epoc.pl, part of GnuPoc project
+#
+# (c) 2002 Alfred E. Heggestad
+#
+#    This program is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License version 2 as
+#    published by the Free Software Foundation.
+#
+
+perl -S epoc.pl "$@"
diff --git a/epoc.pl b/epoc.pl
index 9d59708..4a3afbf 100644
--- a/epoc.pl
+++ b/epoc.pl
@@ -1,3 +1,4 @@
+#!/usr/bin/perl -w
 #
 # Launcher for the Symbian Emulator, including
 # functionality to read the $ENV{EPOCROOT}epoc32\data\BuildInfo.txt
@@ -18,7 +19,7 @@ $numArgs = $#ARGV + 1;
 
 if($numArgs == 0) 
 	{
-    	&launchEmulator("udeb","winscw");
+    	&launchEmulator("udeb","wins");
     	exit(0);
 	}
 
@@ -32,7 +33,7 @@ if($numArgs == 1)
 	{ 
 	if(lc($ARGV[0]) eq "-rel") 
 		{
-    		&launchEmulator("urel","winscw");
+    		&launchEmulator("urel","wins");
     		exit(0);
 		}
 
@@ -107,8 +108,8 @@ sub launchEmulator
 
     my $epocroot = &getEpocroot;
     my $drive = &getDrive;
-    my $emu = $drive . $epocroot . "epoc32" . "\\" 
-	      . "release\\" . $win . "\\" . $type . "\\" . "epoc.exe";
+    my $emu = $drive . $epocroot . "epoc32" . "/" 
+	      . "release/" . $win . "/" . $type . "/" . "epoc.exe";
     -e $emu ||
 	die "ERROR: File \"$emu\" not found.\n\n" .
 	    "The EPOCROOT environment variable does not identify\n" .
@@ -117,7 +118,7 @@ sub launchEmulator
 		    "directory - it should have no drive qualifier and\n" .
 			"must end with a backslash.\n";
     # If the execute is successful, this never returns.
-    exec("\"" . $emu . "\"") || die "Failed to execute the emulator \"$emu\": $!";
+    exec("wine " . $emu) || die "Failed to execute the emulator \"$emu\": $!";
 }
 
 sub printHelp
@@ -137,8 +138,8 @@ sub printVersion
     my $epocroot = &getEpocroot;
     my $drive = &getDrive;
 
-    my $binfo = $drive . $epocroot . "epoc32" . "\\" 
-	        . "data" . "\\" . "BuildInfo.txt";
+    my $binfo = $drive . $epocroot . "epoc32" . "\/" 
+	        . "data" . "\/" . "buildinfo.txt";
 
     -e $binfo || die "ERROR: File \"" . $binfo . "\" does not exist.\n";
     open(IFILE, $binfo) ||
@@ -205,11 +206,9 @@ sub getEpocroot
     my $epocroot = $ENV{EPOCROOT};
     die "ERROR: Must set the EPOCROOT environment variable.\n"
 	if (!defined($epocroot));
-    $epocroot =~ s-/-\\-go;	# for those working with UNIX shells
     die "ERROR: EPOCROOT must be an absolute path, " .
-	"not containing a drive letter.\n" if ($epocroot !~ /^\\/);
+	"not containing a drive letter.\n" if ($epocroot !~ /^\//);
     die "ERROR: EPOCROOT must not be a UNC path.\n" if ($epocroot =~ /^\\\\/);
-    die "ERROR: EPOCROOT must end with a backslash.\n" if ($epocroot !~ /\\$/);
     die "ERROR: EPOCROOT must specify an existing directory.\n" 
 	if (!-d $epocroot);
     return $epocroot;
diff --git a/epocaif.pl b/epocaif.pl
index e110929..9ba134e 100644
--- a/epocaif.pl
+++ b/epocaif.pl
@@ -1,3 +1,5 @@
+#!/usr/bin/perl -w
+#
 # epocaif.pl
 #
 # Copyright (c) Symbian Software Ltd 2001  2004.  All rights reserved.
@@ -18,11 +20,10 @@ my $curdrive="x";	    	# will be initialised when first needed
 BEGIN {
 	require 5.005_03;		# check user has a version of perl that will cope
 	$PerlBinPath = $FindBin::Bin;	# X:/epoc32/tools
-	$PerlBinPath =~ s/\//\\/g;	# X:\epoc32\tools
 }
 use lib $PerlBinPath;
-use E32Variant;         # for variant specific macros
-use Pathutl;
+use e32variant;         # for variant specific macros
+use pathutl;
 
 sub print_usage
 	{
@@ -38,9 +39,9 @@ The available options are
    -Ixxx  -- C++ preprocessor arguments
    -o	  -- output AIF file name including path
    -t	  -- tempory directory for intermediate files
-   -b	  -- list of bitmaps Eg., "-b/c8\\location\\bmp1 /c8\\location\\bmp2.."
+   -b	  -- list of bitmaps Eg., "-b/c8\/location\/bmp1 /c8\/location\/bmp2.."
    -m	  -- compiled MBM file (alternative to -b)
-   -l	  -- if specified, captures all source to \\epoc32\\localisation\\...
+   -l	  -- if specified, captures all source to \/epoc32\/localisation\/...
 
 The aif resource file is then passed through the C++ preprocessor, using any 
 specified preprocessor arguments, and then compiled with RCOMP.EXE to 
@@ -106,7 +107,7 @@ while (@ARGV)
 		next;
 		}
 
-	if ($arg =~ /^-t(.*)\\?$/)
+	if ($arg =~ /^-t(.*)\/?$/)
 		{
 		$tmpdir =$1;
 		next;
@@ -149,8 +150,8 @@ if ($errors || $sourcefile eq "")
 
 my $rss_base = basename($sourcefile);
 my ($rssfile) = split(/\./, $rss_base);	    # remove extension
-my $rpp_name = "$tmpdir\\$rssfile.rpp";
-my $outputfile="$tmpdir\\AIF.RSC";	
+my $rpp_name = "$tmpdir\/$rssfile.rpp";
+my $outputfile="$tmpdir\/aif.rsc";	
 my $headerfile=$opt_h;
 
 if ($opt_v)
@@ -173,7 +174,7 @@ if($variantMacroHRHFile){
     $cpp_spec .= " -I \"" . &Path_RltToWork($variantFilePath) . "\" -include " . &Path_RltToWork($variantMacroHRHFile) . " "; 
 }
 
-$cpp_spec .= "-I $PerlBinPath\\..\\include ";	# extra path to support shared tools
+$cpp_spec .= "-I $PerlBinPath\/..\/include ";	# extra path to support shared tools
 $cpp_spec .= "-D_UNICODE ";
 
 $cpp_spec .= quoted_path($sourcefile) ." -o ". quoted_path($rpp_name);
@@ -184,7 +185,6 @@ system($cpp_spec);
 my $cpp_status = $?;
 die "* cpp failed\n" if ($cpp_status != 0);
 
-
 #-------------------------------------------------------
 # Copy source to epoc32\localisation
 #
@@ -206,7 +206,8 @@ use lockit_info;
 #
 
 my $rcomp_spec = "rcomp -u ";
-$rcomp_spec .= "-:$tmpdir\\_dump_of_resource_ "; # causes Rcomp to dump each resource (uncompressed and unpadded) in $tmpdir\\_dump_of_resource_1, $tmpdir\\_dump_of_resource_2, etc
+#my $rcomp_spec = "wine \$EPOCROOT/epoc32/tools/rcomp.exe -u ";
+$rcomp_spec .= "-:$tmpdir\/_dump_of_resource_ "; # causes Rcomp to dump each resource (uncompressed and unpadded) in $tmpdir\/_dump_of_resource_1, $tmpdir\/_dump_of_resource_2, etc
 $rcomp_spec .= "$opt_o $opt_h -s\"$rpp_name\" -i\"$sourcefile\"";
 
 print "* $rcomp_spec\n" if ($opt_v);
@@ -227,15 +228,19 @@ unlink $rpp_name;
 
 if ($opt_b ne "")
 	{
-	print "* bmconv /q $tmpdir\\AIF.MBM $opt_b\n" if ($opt_v);
-	system("bmconv /q $tmpdir\\AIF.MBM $opt_b");
+	my $outdir = $tmpdir;
+
+	$outdir = "/.$outdir" if ($outdir =~ /^\//); # fix the case when $outdir is /home/...
+
+	print "* bmconv /q $outdir\/aif.mbm $opt_b\n" if ($opt_v);
+	system("bmconv /q $outdir\/aif.mbm $opt_b");
 	if ($? != 0)
 		{
 		print "* BMCONV failed\n";
 		exit 1;
 		}
-	print "* bmconv /q /s $tmpdir\\AIF_XIP.MBM $opt_b\n" if ($opt_v);
-	system("bmconv /q /s $tmpdir\\AIF_xip.MBM $opt_b");
+	print "* bmconv /q /s $outdir\/aif_xip.mbm $opt_b\n" if ($opt_v);
+	system("bmconv /q /s $outdir\/aif_xip.mbm $opt_b");
 	
 	if ($? != 0)
 		{
@@ -245,23 +250,23 @@ if ($opt_b ne "")
 	}
 elsif ($opt_m ne "")
 	{
-	print "* copy $opt_m $tmpdir\\AIF.MBM\n" if ($opt_v); 
-	copy($opt_m, "$tmpdir\\AIF.MBM");
+	print "* copy $opt_m $tmpdir\/aif.mbm\n" if ($opt_v); 
+	copy($opt_m, "$tmpdir\/aif.mbm");
 	# no xip file genarated 
 	$xipaif=0;
 	}
 else
 	{
 	# no bitmap specified - this is legitimate
-	unlink("$tmpdir\\AIF.MBM");
-	unlink("$tmpdir\\AIF_xip.MBM");
+	unlink("$tmpdir\/aif.mbm");
+	unlink("$tmpdir\/aif_xip.mbm");
 	}
 
 #-------------------------------------------------------
-# Get the from UID from the first four bytes of "$tmpdir\\_dump_of_resource_1"
+# Get the from UID from the first four bytes of "$tmpdir\/_dump_of_resource_1"
 #
 
-open(DUMP_OF_RESOURCE_1, "< $tmpdir\\_dump_of_resource_1") or die("* Can't open dump file\n");
+open(DUMP_OF_RESOURCE_1, "< $tmpdir\/_dump_of_resource_1") or die("* Can't open dump file\n");
 binmode(DUMP_OF_RESOURCE_1);
 my $data;
 my $numberOfBytesRead=read(DUMP_OF_RESOURCE_1, $data, 4);
@@ -276,8 +281,8 @@ close(DUMP_OF_RESOURCE_1) or die("* Can't close dump file\n");
 # Produce the AIF file from the RSC and MBM files
 #
 
-my $uidcrc = "uidcrc.exe 0x101fb032 0 ".sprintf('0x%08x', $uid)." $tmpdir\\out.aif";
-my $uidcrc_xip = "uidcrc.exe 0x101fb032 0 ".sprintf('0x%08x', $uid)." $tmpdir\\out_xip.aif";
+my $uidcrc = "uidcrc 0x101fb032 0 ".sprintf('0x%08x', $uid)." $tmpdir\/out.aif";
+my $uidcrc_xip = "uidcrc 0x101fb032 0 ".sprintf('0x%08x', $uid)." $tmpdir\/out_xip.aif";
 
 print "* $uidcrc\n" if ($opt_v);
 system($uidcrc);
@@ -298,17 +303,17 @@ if ($xipaif ne 0)
 	}
 
 
-open(OUT_AIF, ">> $tmpdir\\out.aif") or die("* Can't open temporary file\n");
+open(OUT_AIF, ">> $tmpdir\/out.aif") or die("* Can't open temporary file\n");
 binmode(OUT_AIF);
 
 if ($xipaif ne 0)
 	{
-	open(OUTXIP_AIF, ">> $tmpdir\\out_xip.aif") or die("* Can't open temporary file\n");
+	open(OUTXIP_AIF, ">> $tmpdir\/out_xip.aif") or die("* Can't open temporary file\n");
 	binmode(OUTXIP_AIF);
 	}
 
 print "* Writing length of the RSC-block\n" if ($opt_v);
-my $lengthOfRscBlock=-s("$tmpdir\\aif.rsc");
+my $lengthOfRscBlock=-s("$tmpdir\/aif.rsc");
 my $numberOfPaddingBytes=(4-($lengthOfRscBlock%4))%4;
 print(OUT_AIF pack('V', $lengthOfRscBlock));
 if ($xipaif ne 0)
@@ -316,10 +321,10 @@ if ($xipaif ne 0)
 	print(OUTXIP_AIF pack('V', $lengthOfRscBlock));
 	}
 print "* Appending the RSC-block\n" if ($opt_v);
-&appendFile(\*OUT_AIF, "$tmpdir\\aif.rsc");
+&appendFile(\*OUT_AIF, "$tmpdir\/aif.rsc");
 if ($xipaif ne 0)
 	{
-	&appendFile(\*OUTXIP_AIF, "$tmpdir\\aif.rsc");
+	&appendFile(\*OUTXIP_AIF, "$tmpdir\/aif.rsc");
 	}
 # append any necessary padding bytes so that the file-offset of the start of the MBM-block is a multiple of 4-bytes
 print(OUT_AIF ('_' x $numberOfPaddingBytes));
@@ -327,15 +332,15 @@ if ($xipaif ne 0)
 	{
 	print(OUTXIP_AIF ('_' x $numberOfPaddingBytes));
 	}
-if (-e("$tmpdir\\aif.mbm"))
+if (-e("$tmpdir\/aif.mbm"))
 	{
 	print "* Appending the MBM-block\n" if ($opt_v);
-	&appendFile(\*OUT_AIF, "$tmpdir\\aif.mbm");
+	&appendFile(\*OUT_AIF, "$tmpdir\/aif.mbm");
 	}
-if (-e("$tmpdir\\aif_xip.mbm"))
+if (-e("$tmpdir\/aif_xip.mbm"))
 	{
 	print "* Appending the XIPMBM-block\n" if ($opt_v);
-	&appendFile(\*OUTXIP_AIF, "$tmpdir\\aif_xip.mbm");
+	&appendFile(\*OUTXIP_AIF, "$tmpdir\/aif_xip.mbm");
 	}
 
 close(OUT_AIF) or die("* Can't close temporary file\n");
@@ -343,23 +348,23 @@ if ($xipaif ne 0)
 	{
 	close(OUTXIP_AIF) or die("* Can't close temporary file\n");
 	}
-print "* copy $tmpdir\\out.aif $TrgPath\n" if ($opt_v);
-copy("$tmpdir\\out.aif", "$TrgPath");
+print "* copy $tmpdir\/out.aif $TrgPath\n" if ($opt_v);
+copy("$tmpdir\/out.aif", "$TrgPath");
 if ($xipaif ne 0)
 	{
 	my $basepath = &Path_Split('Path', $TrgPath);
 	my $ext=&Path_Split('Ext',  $TrgPath);
 	my $basename = basename($TrgPath, $ext);
 	my $xip="_xip";
-	print "* copy $tmpdir\\out_xip.aif $basepath$basename$xip$ext\n" if ($opt_v);
-	copy("$tmpdir\\out_xip.aif", "$basepath$basename$xip$ext");
+	print "* copy $tmpdir\/out_xip.aif $basepath$basename$xip$ext\n" if ($opt_v);
+	copy("$tmpdir\/out_xip.aif", "$basepath$basename$xip$ext");
 	}
-unlink("$tmpdir\\_dump_of_resource_*");
-unlink("$tmpdir\\aif.rsc");
-unlink("$tmpdir\\aif.mbm");
-unlink("$tmpdir\\out.aif");
-unlink("$tmpdir\\aif_xip.mbm");
-unlink("$tmpdir\\out_xip.aif");
+unlink("$tmpdir\/_dump_of_resource_*");
+unlink("$tmpdir\/aif.rsc");
+unlink("$tmpdir\/aif.mbm");
+unlink("$tmpdir\/out.aif");
+unlink("$tmpdir\/aif_xip.mbm");
+unlink("$tmpdir\/out_xip.aif");
 exit 0;
 
 #-------------------------------------------------------
@@ -369,7 +374,7 @@ exit 0;
 sub quoted_path
     {
     my ($arg) = @_;
-    return "\"$arg\"" if ($arg !~ /^\\[^\\]/);	# not an absolute path
+    return "\"$arg\"" if ($arg !~ /^\/[^\/]/);	# not an absolute path
     if ($curdrive eq "x")
 		{
 		$curdrive="";
diff --git a/epocmbm.pl b/epocmbm.pl
index ef41dc7..a75b44b 100644
--- a/epocmbm.pl
+++ b/epocmbm.pl
@@ -14,7 +14,7 @@ my $epocroot;
 BEGIN {
 	require 5.005_03;		# check user has a version of perl that will cope
 	$PerlBinPath = $FindBin::Bin;	# X:/epoc32/tools
-	$PerlBinPath =~ s/\//\\/g;	# X:\epoc32\tools
+#	$PerlBinPath =~ s/\//\\/g;	# X:\epoc32\tools
 }
 
 use lib $PerlBinPath;
@@ -89,8 +89,12 @@ my $headerfile=$opt_h;
 if ($opt_b ne "")
 	{
 	$opt_h = "\/h\"$headerfile\"" if ($headerfile ne "");
-	print "* bmconv /q $opt_h $opt_o $opt_b\n" if ($opt_v);
-	system("bmconv /q $opt_h $opt_o $opt_b");
+
+	my $outfile = $opt_o;
+	$outfile = "/.$outfile" if ($outfile =~ /^\//); # fix the case when $outfile is /home/...
+
+	print "* bmconv /q $opt_h $outfile $opt_b\n" if ($opt_v);
+	system("bmconv /q $opt_h $outfile $opt_b");
 	if ($? != 0)
 		{
 		print "* BMCONV failed\n";
diff --git a/epocrc.pl b/epocrc.pl
index 875aa5d..5148b0f 100644
--- a/epocrc.pl
+++ b/epocrc.pl
@@ -1,3 +1,5 @@
+#!/usr/bin/perl -w
+#
 # epocrc.pl
 #
 # Copyright (c) 2000 Symbian Ltd.  All rights reserved.
@@ -17,12 +19,11 @@ my $PerlBinPath;	# fully qualified pathname of the directory containing this scr
 BEGIN {
 	require 5.005_03;		# check user has a version of perl that will cope
 	$PerlBinPath = $FindBin::Bin;	# X:/epoc32/tools
-	$PerlBinPath =~ s/\//\\/g;	# X:\epoc32\tools
 }
 use lib $PerlBinPath;
 use lockit_info;
-use E32Variant;         # for variant specific macros
-use Pathutl;
+use e32variant;         # for variant specific macros
+use pathutl;
 
 sub print_usage
 	{
@@ -131,7 +132,7 @@ while (@ARGV)
 		}
 	if ($arg =~ /^-t(.*)\\?$/)
 		{
-		$tmpdir ="$1\\";
+		$tmpdir ="$1\/";
 		next;
 		}
 	if ($arg =~ /^-l(.*)$/)
@@ -239,7 +240,7 @@ if ($opt_l ne "")
 
 my $rcomp_spec = "rcomp ";
 $rcomp_spec .= "-u " if ($unicode);
-$rcomp_spec .= "$opt_o $opt_h -s\"$rpp_name\" -i\"$sourcefile\"";
+$rcomp_spec .= " $opt_o $opt_h -s$rpp_name -i$sourcefile";
 
 print "* $rcomp_spec\n" if ($opt_v);
 system($rcomp_spec);
diff --git a/eshell b/eshell
new file mode 100644
index 0000000..162482b
--- /dev/null
+++ b/eshell
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# eshell - bash interface for eshell.pl, part of GnuPoc project
+#
+# (c) 2002 Alfred E. Heggestad
+#
+#    This program is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License version 2 as
+#    published by the Free Software Foundation.
+#
+
+perl -S eshell.pl "$@"
diff --git a/eshell.pl b/eshell.pl
index bde3d43..c6c72cd 100644
--- a/eshell.pl
+++ b/eshell.pl
@@ -1,3 +1,4 @@
+#!/usr/bin/perl -w
 #
 # Eshell Launcher
 #
@@ -16,7 +17,7 @@ $numArgs = $#ARGV + 1;
 
 if($numArgs == 0) 
 	{
-    	&launchEshell("udeb","winscw");
+    	&launchEshell("udeb","wins");
     	exit(0);
 	}
 
@@ -30,7 +31,7 @@ if($numArgs == 1)
 	{ 
 	if(lc($ARGV[0]) eq "-rel") 
 		{
-    		&launchEshell("urel","winscw");
+    		&launchEshell("urel","wins");
     		exit(0);
 		}
 
@@ -98,8 +99,8 @@ sub launchEshell
     my ($type,$win) = @_;
     $epocroot = &getEpocroot;
     $drive = &getDrive;
-    $emu = $drive . $epocroot . "epoc32" . "\\" 
-	. "release\\" . $win . "\\" . $type . "\\" . "eshell.exe";
+    $emu = $drive . $epocroot . "epoc32" . "/" 
+	. "release/" . $win . "/" . $type . "/" . "eshell.exe";
     -e $emu ||
 	die "ERROR: File \"$emu\" not found.\n\n" .
 	    "The EPOCROOT environment variable does not identify\n" .
@@ -112,7 +113,7 @@ sub launchEshell
 	$emu.=" -MConsole --";
 			
     # If the execute is successful, this never returns.
-    exec($emu) || die "Failed to execute eshell \"$emu\": $!";
+    exec("wine " . $emu) || die "Failed to execute eshell \"$emu\": $!";
 }
 
 sub printHelp
@@ -134,11 +135,9 @@ sub getEpocroot
     my $epocroot = $ENV{EPOCROOT};
     die "ERROR: Must set the EPOCROOT environment variable.\n"
 	if (!defined($epocroot));
-    $epocroot =~ s-/-\\-go;	# for those working with UNIX shells
     die "ERROR: EPOCROOT must be an absolute path, " .
-	"not containing a drive letter.\n" if ($epocroot !~ /^\\/);
     die "ERROR: EPOCROOT must not be a UNC path.\n" if ($epocroot =~ /^\\\\/);
-    die "ERROR: EPOCROOT must end with a backslash.\n" if ($epocroot !~ /\\$/);
+    die "ERROR: EPOCROOT must end with a forward slash.\n" if ($epocroot !~ /\/$/);
     die "ERROR: EPOCROOT must specify an existing directory.\n" 
 	if (!-d $epocroot);
     return $epocroot;
diff --git a/extmake b/extmake
new file mode 100644
index 0000000..e2045c1
--- /dev/null
+++ b/extmake
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+wine make "$@"
+
diff --git a/fixupsym.pl b/fixupsym.pl
index 46e584a..4227cc5 100644
--- a/fixupsym.pl
+++ b/fixupsym.pl
@@ -349,7 +349,7 @@ sub help ()
   {
 	my $build;
 	
-	&Load_ModuleL('E32TPVER');
+	&Load_ModuleL('e32tpver');
 	print "\nfixupsym - " .
 	  "Fix up executables with locations taken from a ROM image (Build ",
 	  &E32tpver, ")\n";
diff --git a/genbldinf.pl b/genbldinf.pl
new file mode 100644
index 0000000..242f56d
--- /dev/null
+++ b/genbldinf.pl
@@ -0,0 +1,38 @@
+#!/usr/bin/perl -w
+#
+# genbldinf.pl - part of GnuPoc project
+#
+# Recursively generate a bld.inf file from a given subsystem
+#
+# (c) 2001 Alfred E. Heggestad
+#
+#    This program is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License version 2 as
+#    published by the Free Software Foundation.
+#
+
+my $BLDINF = "bld.inf";
+
+print "OS: $^O\n";
+
+unlink $BLDINF if (-f $BLDINF);
+
+$_ = `find . -iname $BLDINF`;
+
+s/(.*bld.inf.*)/\#include "$1"/igm;
+
+if ($^O eq "MSWin32") {
+  print "win32 hack:\n";
+  s|/|\\|gm;
+  $_ = lc $_;
+}
+
+open FO, ">$BLDINF" or die "Could not create $BLDINF";
+print FO "//\n";
+print FO "// bld.inf - generated by 'genbldinf.pl' - part of GnuPoc project\n";
+print FO "//\n";
+print FO $_;
+close FO;
+
+print "creating $BLDINF with:\n";
+system ("cat $BLDINF");
diff --git a/genutl.pm b/genutl.pm
index 671fb5e..8a6b7a4 100644
--- a/genutl.pm
+++ b/genutl.pm
@@ -6,7 +6,7 @@
 
 # Contains utility subroutines for MAKMAKE and associated scripts
 
-package Genutl;
+package genutl;
 
 require Exporter;
 @ISA=qw(Exporter);
diff --git a/hpsym.pl b/hpsym.pl
index dfac048..a20d7d3 100644
--- a/hpsym.pl
+++ b/hpsym.pl
@@ -161,7 +161,7 @@ sub help ()
   {
 	my $build;
 
-	&Load_ModuleL('E32TPVER');
+	&Load_ModuleL('e32tpver');
 	print "\nhpsym - Produce symbolic info in \"HP GPA Symbol File Format\"" .
 	  " suitable for use\n        with a HP logic analyser (Build ",
 	  &E32tpver, ")\n";
diff --git a/ide_vc6.pm b/ide_vc6.pm
index 8a4a9c4..a8011ce 100644
--- a/ide_vc6.pm
+++ b/ide_vc6.pm
@@ -890,7 +890,8 @@ sub PMResrcBld {
 			foreach (@ChopSysIncPaths) {
 				$SupText.=" -I \"$_\"";
 			}
-			$SupText.=" -DLANGUAGE_$Lang -u \"$SrcPath$Resrc\"";
+			my $uclang = uc $Lang;
+			$SupText.=" -DLANGUAGE_$uclang -u \"$SrcPath$Resrc\"";
 			$SupText.=" -o\"$ResrcTrgFullName$Lang\" -h\"$SrcPath$BaseResrc.rs~\" -t\"\$(EPOCBLD$Bld)\"\n";
 # 			hack because if a .RSC file is output then VC5 tries to link it to the main target as a Win32 resource file
 			if ($Lang eq 'SC') {
diff --git a/lockit_info.pm b/lockit_info.pm
index 0144848..1793d94 100644
--- a/lockit_info.pm
+++ b/lockit_info.pm
@@ -29,15 +29,15 @@ sub Check_Epocroot
 	{
 	$epocroot = $ENV{EPOCROOT};
 	die "ERROR: Must set the EPOCROOT environment variable\n" if (!defined($epocroot));
-	$epocroot =~ s-/-\\-go;	# for those working with UNIX shells
+#	$epocroot =~ s-/-\\-go;	# for those working with UNIX shells
 	die "ERROR: EPOCROOT must not include a drive letter\n" if ($epocroot =~ /^.:/);
-	die "ERROR: EPOCROOT must be an absolute path without a drive letter\n" if ($epocroot !~ /^\\/);
-	die "ERROR: EPOCROOT must not be a UNC path\n" if ($epocroot =~ /^\\\\/);
-	die "ERROR: EPOCROOT must end with a backslash\n" if ($epocroot !~ /\\$/);
+	die "ERROR: EPOCROOT must be an absolute path without a drive letter\n" if ($epocroot !~ /^\//);
+	die "ERROR: EPOCROOT must not be a UNC path\n" if ($epocroot =~ /^\/\//);
+	die "ERROR: EPOCROOT must end with a slash\n" if ($epocroot !~ /\/$/);
 	die "ERROR: EPOCROOT must specify an existing directory\n" if (!-d $epocroot);
 
-	$epocroot=~ s-\\$--;		# chop trailing \\
-	$epocPath = "$epocroot\\epoc32\\localisation";
+	$epocroot=~ s-\/$--;		# chop trailing /
+	$epocPath = "$epocroot\/epoc32\/localisation";
 	}
 
 
@@ -46,14 +46,14 @@ sub Lockit_SrcFile()
 {
 	my ($ResrcFile, $RppFile,$Resrc_Options, $FileType, $Bitmaps)= @_;
 	my ($Tgtdir, $CWDir) = split(/:/, $Resrc_Options);
-	$Tgtdir =~s-^(.*)\\$-$1-o; # remove terminating backslash
-	$Tgtdir=~s-^\\--o; # remove leading backslash
-	
+	$Tgtdir =~s-^(.*)\/$-$1-o; # remove terminating backslash
+	$Tgtdir=~s-^\/--o; # remove leading backslash
+
 	Check_Epocroot();
 	my $FilePath = Setup_LockitPath($CWDir, $ResrcFile, $FileType);
 
 	# update rppfile in epoc32\localisation if -l option specified and generating resource
-	copy("$RppFile", "$FilePath\\$ResrcFile.rpp");
+	copy("$RppFile", "$FilePath\/$ResrcFile.rpp");
 
 	# update bitmaps in epoc32\localisation if -l option and bitmaps specified
 	if ($CWDir && ($Bitmaps ne ""))
@@ -65,12 +65,12 @@ sub Lockit_SrcFile()
 
 		my (@AifBitmaps) = split(/ /, $Bitmaps);
 		foreach $BmpRef (@AifBitmaps) {
-			$BmpRef =~ /^([^\\]+)(\\.*)$/;
+			$BmpRef =~ m|^(/[^\/]+)(\/.*)$|i;
 			my $CDepth = $1;
 			my $bmp = $2;
 			Copy_Files($bmp, $FilePath);
 			my $file_base= basename($bmp);
-			chmod (0666,"$FilePath\\$file_base");
+			chmod (0666,"$FilePath\/$file_base");
 		}
 	}
 
@@ -78,11 +78,11 @@ sub Lockit_SrcFile()
 	{
 		Open_InfoFile($ResrcFile);
 
-		WriteTo_Info ( "\n\\$Tgtdir\\$ResrcFile.$FileType :" );
+		WriteTo_Info ( "\n\/$Tgtdir\/$ResrcFile.$FileType :" );
 
 		if($FileType =~ /RSC/i && $RppFile ne "") {
 			WriteTo_Info (
-				 " $ResrcFile.RPP"
+				 " $ResrcFile.rpp"
 			)
 		}
 
@@ -97,12 +97,12 @@ sub Lockit_SrcFile()
 			my $BmpRef;
 			my (@AifBitmaps) = split(/ /, $Bitmaps);
 			foreach $BmpRef (@AifBitmaps) {
-				$BmpRef =~ /^([^\\]+)(\\.*)$/;
+				$BmpRef =~ m|^(/[^\/]+)(\/.*)$|i;
 				my $CDepth = $1;
 				my $bmp = $2;
 				my $file_base= basename($bmp);
 				WriteTo_Info (
-					 " $CDepth\\$file_base"
+					 " $CDepth\/$file_base"
 				);
 			}
 		}
@@ -116,7 +116,6 @@ sub Lockit_SrcFile()
 sub Copy_Files ()
 	{
 	my ($SourceName, $TargetName) = @_;
-
 	copy($SourceName, $TargetName);
 	}
 
@@ -125,9 +124,9 @@ sub Create_InfoFile ()
 	{
 	my ($CreateLockitPath, $CreateInfoFile, $Datadir) = @_;
 	if ( !-e "$CreateLockitPath") { mkpath($CreateLockitPath); }
-	if ( !-e "$epocPath\\group") { mkpath("$epocPath\\group"); }
-	if ( !-e "$epocPath\\group\\$CreateInfoFile.INFO") {	
-		open INFO,">$epocPath\\group\\$CreateInfoFile.INFO" or die "ERROR: Can not create file \"$CreateInfoFile\"\n"; 
+	if ( !-e "$epocPath\/group") { mkpath("$epocPath\/group"); }
+	if ( !-e "$epocPath\/group\/$CreateInfoFile.info") {	
+		open INFO,">$epocPath\/group\/$CreateInfoFile.info" or die "ERROR: Can not create file \"$CreateInfoFile\"\n"; 
 		print INFO "DATADIR: $Datadir\n";
 		close INFO;
 	}
@@ -137,7 +136,7 @@ sub Create_InfoFile ()
 sub Open_InfoFile ($)
 	{
 	my $FileToOpen = $_[0];
-	open INFO,">>$epocPath\\group\\$FileToOpen.INFO" or die "ERROR: Can not open  \"$epocPath\\group\\$FileToOpen\"\n";
+	open INFO,">>$epocPath\/group\/$FileToOpen.info" or die "ERROR: Can not open  \"$epocPath\/group\/$FileToOpen\"\n";
 	}
 
 
@@ -156,7 +155,7 @@ sub LineExists ()
 	my $LineCheck = $_[1];
 	my $exists = 0;
 
-	open INFO,"$epocPath\\group\\$FileToOpen.INFO" or die "ERROR: Can not open \"$FileToOpen\"\n";
+	open INFO,"$epocPath\/group\/$FileToOpen.info" or die "ERROR: Can not open \"$FileToOpen\"\n";
 		while(<INFO>) {
 			if (/$LineCheck/i) { $exists = 1; return $exists; } 
 		}
@@ -169,28 +168,29 @@ sub LineExists ()
 sub Setup_LockitPath
 	{
 	my ($ComponentSrcPath, $Resrc, $FileType) = @_;
-	my ($temp, $CWDir) = split(/\\/, $ComponentSrcPath);
+	my ($temp, $CWDir) = split(/\//, $ComponentSrcPath);
 	my $FilePath = $epocPath;
 
 	if($FileType =~ /RSS/i) { $FileType = "rsc"; }
+	if($FileType =~ /RSC/i) { $FileType = "rsc"; }
 	if($FileType =~ /^acl|abw|aif|a[0-9]/i) {
-		$FilePath .= "\\aif";
+		$FilePath .= "\/aif";
 	}
 	
 ## change added to support cnf file generation
 	if ($FileType =~ /CNF/i) { 
-		$FilePath .= "\\cnf"; 
+		$FilePath .= "\/cnf";
 	}
 
-	my $WorkPath = ""; 
+	my $WorkPath = "";
 
 	if($Resrc !~ /^$CWDir$/i) {
-		$WorkPath = "$Resrc"; 
+		$WorkPath = "$Resrc";
 	}
 
-	$FilePath .= "\\$WorkPath\\$FileType";
+	$FilePath .= "\/$WorkPath\/$FileType";
 
-	&Create_InfoFile("$FilePath", "$Resrc", "\\$WorkPath");
+	&Create_InfoFile("$FilePath", "$Resrc", "\/$WorkPath");
 
 	return $FilePath;
 	}
@@ -205,20 +205,20 @@ sub Lockit_Releasables
 	my ($BaseResrc,$FileType) = split(/\./, $Resrc);
 	
 	Check_Epocroot();
-	my $LockitInfoPath = uc("$epocPath\\GROUP\\$BaseResrc.INFO");
+	my $LockitInfoPath = "$epocPath\/group\/$BaseResrc.info";
 
 	my $LockitPath = Setup_LockitPath($ComponentSrcPath, $BaseResrc, $FileType);
 	
 	my %Files = %$href;
 
-	$Bitmaps = uc($Bitmaps);
+#	$Bitmaps = uc($Bitmaps);
 	if($FileType =~ /RSS|ACL|ABW|AIF|A[0-9]/i && $Bitmaps eq ""){
-		$LockitPath .= "\\$BaseResrc.RPP";
+		$LockitPath .= "\/$BaseResrc.rpp";
 	}
 	else {
-		$LockitPath .= "\\$Bitmaps";
+		$LockitPath .= "\/$Bitmaps";
 	}
-	$LockitPath = uc($LockitPath);
+#	$LockitPath = uc($LockitPath);
 	$Files{$LockitPath} =1;
 	$Files{$LockitInfoPath} =1;
 	return %Files;
diff --git a/makdeps.pm b/makdeps.pm
index 344a67d..cde5fcf 100644
--- a/makdeps.pm
+++ b/makdeps.pm
@@ -7,7 +7,7 @@
 # Module which wraps the dependency information provided the preprocessor when invoked with certain switches
 # so that dependency information rather than preprocessing information is produced.
 
-package Makdeps;
+package makdeps;
 require Exporter;
 @ISA=qw(Exporter);
 @EXPORT=qw(
@@ -21,8 +21,8 @@ require Exporter;
 	Deps_GenDependsL
 );
 
-use Checkgcc;
-use Pathutl;
+use checkgcc;
+use pathutl;
 
 my $ChopSysDecoyPath;
 my $EPOCIncPath;
@@ -48,7 +48,7 @@ BEGIN {	# NB don't initialise essential items to be provided later by calling mo
 	@StdPaths=();
 	@SysFlags=();
 	@UserFlags=();
-	$SysDecoyPath=&Path_WorkPath."TEMPMAKSYSDECOY\\";
+	$SysDecoyPath=&Path_WorkPath."TEMPMAKSYSDECOY/";
 	$S_SysDecoyPath=quotemeta($SysDecoyPath);
 	$ChopSysDecoyPath=&Path_Chop($SysDecoyPath);
 }
@@ -62,7 +62,7 @@ sub Deps_InitL ($@) {	# abs Generated Hdr dir, StdIncsysdir (with drive letter i
 # work and the user will have to sort it out.  If it doesn't contain files and has been left lying around
 # because someone has killed the program half-way through, then rmdir will remove it and mkdir will work OK
 	rmdir $ChopSysDecoyPath if -d $ChopSysDecoyPath;
-	mkdir $ChopSysDecoyPath,2 or die "ERROR: Can't make temp dir \"$ChopSysDecoyPath\"\nIf it already exists, please remove it\n";
+	mkdir $ChopSysDecoyPath or die "ERROR: Can't make temp dir \"$ChopSysDecoyPath\"\nIf it already exists, please remove it\n";
 }
 sub Deps_SetVerbose {
 	$Mode{'Verbose'}=1;
@@ -79,7 +79,7 @@ sub Deps_SetSysIncPaths (@) {	# takes list abs paths
 	@SysFlags=&Path_Chop(&Path_RltToWork(@SysPaths)); # newer gcc doesn't like trailing backslash
 	my $Flag;
 	foreach $Flag (@SysFlags) {
-		$Flag=~s/^(.*)$/-I "$1"/o;
+		$Flag=~s/^(.*)$/-I "$1"/o if $Flag;
 	}
 }
 sub Deps_SetUserIncPaths (@) {	# takes list of abs paths
@@ -99,6 +99,7 @@ sub Deps_SetPlatMacros (@) {
 	my $Flag;
 	foreach $Flag (@PlatMacros) {
 		$Flag=~s/^(.*)$/-D$1/o;
+		$Flag = uc $Flag; # force uppercase for macros
 	}
 }
 
@@ -129,9 +130,9 @@ sub Deps_GenDependsL ($@) {	# takes abs source filepath and list of Build Macros
 
 	my $RTWSrcPath=&Path_Chop(&Path_Split('Path',$RTWSrc)); # newer gcc doesn't like trailing backslash
 	if ($Mode{'Verbose'}) {
-		print "CPP.EXE -undef -M -MG -nostdinc -I \"$RTWSrcPath\" @UserFlags -I- @SysFlags @PlatMacros @BldMacros \"$RTWSrc\"\n";
+		print "arm-epoc-pe-cpp -M -MG -nostdinc -I \"$RTWSrcPath\" @UserFlags -I- @SysFlags @PlatMacros @BldMacros \"$RTWSrc\"\n";
 	}
-	open CPPPIPE,"CPP.EXE -undef -M -MG -nostdinc -I \"$RTWSrcPath\" @UserFlags -I- -I \"$RTWSysDecoyPath\" @SysFlags @PlatMacros @BldMacros \"$RTWSrc\" |" or die "ERROR: Can't invoke CPP.EXE\n";
+	open CPPPIPE,"arm-epoc-pe-cpp -M -MG -nostdinc -I \"$RTWSrcPath\" @UserFlags -I- -I \"$RTWSysDecoyPath\" @SysFlags @PlatMacros @BldMacros \"$RTWSrc\" |" or die "ERROR: Can't invoke CPP\n";
 
 	# XYZ.CPP.o: \
 	#  ..\..\..\base\bafl\src\xyz.cpp \
@@ -147,13 +148,14 @@ sub Deps_GenDependsL ($@) {	# takes abs source filepath and list of Build Macros
 		s/\\ /;/go;	# convert embedded spaces (\<space>) into semicolon which can't occur in filenames
 		# avoid the target of the rule by requiring whitespace in front of each element
 		while (/\s(\S+)/go) {
-			my $dep = uc $1;
+#			my $dep = uc $1; # TODOAEH
+			my $dep = $1; # TODOAEH
 			$dep =~ s/;/ /go;	# spaces were turned into semicolon, so convert back again here
-			$dep =~ s-/-\\-go;	# replace forward slashes with backward slashes
+#			$dep =~ s-/-\\-go;	# replace forward slashes with backward slashes
 			push @RTWDepList,$dep;
 		}
 	}
-	close CPPPIPE or die "ERROR: CPP.EXE failure\n";
+	close CPPPIPE or die "ERROR: CPP failure\n";
 
 	# drop the first dependent, which is the source file itself
 	shift @RTWDepList;
@@ -214,7 +216,7 @@ sub TestDepends (@) { # takes source list of absolute dependencies - called by G
 # any files listed as existing in the system decoy directory will be missing system include files
 			$File=$1;
 # change any missing generated header entries so that they are thought to be in $EPOCIncPath, where they will be generated to
-			if ($File=~/\.(RSG|MBG)$/o) {
+			if ($File=~/\.(rsg|mbg)$/o) {
 				push @GoodList, "$EPOCIncPath$File";
 				next DEPLOOP;
 			}
@@ -277,7 +279,7 @@ sub TestDepends (@) { # takes source list of absolute dependencies - called by G
 		my $GenHdr=0;
 		foreach $Bad (@BadUserList) {
 			print STDERR " \"$Bad\"";
-			if ($File=~/\.(RSG|MBG)$/o) {
+			if ($File=~/\.(rsg|mbg)$/o) {
 				$GenHdr=1;
 			}
 		}
diff --git a/makedef.pl b/makedef.pl
index 8a0222d..d8a212b 100644
--- a/makedef.pl
+++ b/makedef.pl
@@ -18,13 +18,12 @@ my $PerlBinPath;	# fully qualified pathname of the directory containing this scr
 BEGIN {
 	require 5.005_03;				# check user has a version of perl that will cope
 	$PerlBinPath = $FindBin::Bin;	# X:/epoc32/tools
-	$PerlBinPath =~ s/\//\\/g;		# X:\epoc32\tools
 }
 use lib $PerlBinPath;
 
-use Defutl;
-use E32tpver;
-use Pathutl;
+use defutl;
+use e32tpver;
+use pathutl;
 use File::Copy;
 
 # THE MAIN PROGRAM SECTION
@@ -189,6 +188,7 @@ sub ReadInfFileL ($$$) {
 	my %exports;	# MWLD workaround - record mangled names in case we don't see the demangled ones
 	my $Line;
 	while ($Line=<FILE>) {
+		$Line =~ s/\r$//; # strip trailing cr
 		$LineNum++;
 		if ($InfType == 0) {
 			if ($Line =~ /\*\*\* ARCHIVE SYMBOL TABLE.* \*\*\*/o) {
@@ -229,6 +229,7 @@ sub ReadInfFileL ($$$) {
 			if ($Line =~ /\*\*\* Unmangled Symbols \*\*\*/o) {
 				<FILE>; 
 				$Line = <FILE>; 
+				$Line =~ s/\r$//; # strip trailing cr
 				$LineNum+=2;
 				if ($Line !~ /^\s*\d+:\s+(\S+)$/o) {
 				    print STDERR "MAKEDEF WARNING: unknown inf file format\n";
@@ -240,6 +241,7 @@ sub ReadInfFileL ($$$) {
 					$Name = $1;
 				}
 				$Line = <FILE>; 
+				$Line =~ s/\r$//; # strip trailing cr
 				$LineNum++;
 				next if ($Line !~ /^\s+(.+)$/o);
 				$Comment = $1;
diff --git a/makekeys b/makekeys
new file mode 100644
index 0000000..0425a5b
--- /dev/null
+++ b/makekeys
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# makekeys - bash frontend for bmconv.exe, part of GnuPoc project
+#
+# (c) 2001-2006 Alfred E. Heggestad
+#
+#    This program is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License version 2 as
+#    published by the Free Software Foundation.
+#
+
+PGM=`basename $0`
+echo "executing $PGM.exe"
+ROOT=$EPOCROOT/epoc32/tools
+wine $ROOT/$PGM.exe "$@"
diff --git a/makesis b/makesis
new file mode 100644
index 0000000..8974727
--- /dev/null
+++ b/makesis
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# makesis - bash frontend for makesis.exe, part of GnuPoc project
+#
+# (c) 2001-2006 Alfred E. Heggestad
+#
+#    This program is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License version 2 as
+#    published by the Free Software Foundation.
+#
+
+PGM=`basename $0`
+echo "executing $PGM.exe"
+ROOT=$EPOCROOT/epoc32/tools
+wine $ROOT/$PGM.exe "$@"
diff --git a/makhelp.pm b/makhelp.pm
index 40b9656..3a5ad75 100644
--- a/makhelp.pm
+++ b/makhelp.pm
@@ -4,7 +4,7 @@
 #
 
 
-package Makhelp;
+package makhelp;
 require Exporter;
 @ISA=qw(Exporter);
 @EXPORT=qw(
@@ -14,7 +14,7 @@ require Exporter;
 );
 
 
-use E32tpver;
+use e32tpver;
 # also requires main module to have loaded platform module(s) and Modload.pm and Trgtype.pm
 
 sub Help_Invocation () {
@@ -26,7 +26,7 @@ sub Help_Invocation () {
 		"MAKMAKE {flags} [{MMPFilePath}MMPFileRoot] [Platform]\n",
 		"\n",
 		"Flags: (case insensitive)\n",
-		" -D               -> create makefile in ", $E32env::Data{BldPath}, "[project]\\[platform]\\\n",
+		" -D               -> create makefile in ", $e32env::Data{BldPath}, "[project]\\[platform]\\\n",
 		" -MMP             -> information - basic mmp syntax\n",
 		" -PLAT [platform] -> information - platform-specific mmp syntax\n",
 		" -V               -> verbose mode\n",
@@ -82,7 +82,7 @@ ASSPABI
 ASSPEXPORTS
 ASSPLIBRARY            [ASSP_libraries]
 DEFFILE                [{path}{deffile} (default -
-                          \[project]\B[platform]\[target basename].DEF)]
+                          \[project]B[platform]\[target basename].DEF)]
 DOCUMENT               [sourcepath-relative_documents]
 COMPRESSTARGET
 NOCOMPRESSTARGET
diff --git a/makmake b/makmake
new file mode 100644
index 0000000..9199434
--- /dev/null
+++ b/makmake
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# makmake - bash frontend for makmake.pl, part of GnuPoc project
+#
+# (c) 2001-2002 Alfred E. Heggestad
+#
+#    This program is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License version 2 as
+#    published by the Free Software Foundation.
+#
+
+perl -S makmake.pl "$@"
diff --git a/makmake.pl b/makmake.pl
index 68cab2a..4f8ea5a 100644
--- a/makmake.pl
+++ b/makmake.pl
@@ -1,3 +1,5 @@
+#!/usr/bin/perl -w
+#
 # MAKMAKE.PL
 #
 # Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
@@ -19,18 +21,17 @@ BEGIN {
 	require 5.005_03;
 # establish the path to the Perl libraries: currently the same directory as this script
 	$PerlLibPath = $FindBin::Bin;	# X:/epoc32/tools
-	$PerlLibPath =~ s/\//\\/g;	# X:\epoc32\tools
-	$PerlLibPath .= "\\";
+	$PerlLibPath .= "\/";
 }
 
 use lib $PerlLibPath;
-use E32env;
-use E32Plat;
-use E32Variant;
-use Genutl;
-use Modload;
-use Pathutl;
-use Trgtype;
+use e32env;
+use e32plat;
+use e32variant;
+use genutl;
+use modload;
+use pathutl;
+use trgtype;
 
 # THE MAIN PROGRAM SECTION
 ##########################
@@ -58,7 +59,7 @@ my @PlatOverrideList=();
 	$Options{makemakefile}='1' unless ($Options{mmp} || $Options{plat});
 
 	if ($Options{mmp} or $Options{plat}) {
-		eval { &Load_ModuleL('MAKHELP'); };
+		eval { &Load_ModuleL('makhelp'); };
 		die $@ if $@;
 	}
 
@@ -103,10 +104,10 @@ my @PlatOverrideList=();
 		$PlatArg=$PlatOverrideList[0];
 	}
 
-	$MMPFILE=uc pop @ARGV;
+	$MMPFILE=pop @ARGV;
 	die "ERROR: Can't specify MMP file on a different drive\n" if $MMPFILE=~/^\w:\\/o;
 	if ($MMPFILE!~/.MMP$/o) {
-		$MMPFILE.='.MMP';
+		$MMPFILE.='.mmp';
 	}
 	$MMPFILE=&Path_AbsToWork($MMPFILE);
 
@@ -116,7 +117,7 @@ my @PlatOverrideList=();
 		&Mmp_SetVerbose;
 	}
 	if ($Options{d}) {
-		die "ERROR: $E32env::Data{EPOCPath} does not exist\n" if (!-d $E32env::Data{EPOCPath});
+		die "ERROR: $e32env::Data{EPOCPath} does not exist\n" if (!-d $e32env::Data{EPOCPath});
 	}
 
 	
@@ -190,10 +191,10 @@ die $@ if $@;
 	# set up the makefile filepath - need to do this before loading the platform module
 	# because UID source file will be added and set up in the makefile path under WINS
 	if ($Options{d}) {
-		$MAKEFILE=join ('', $Path{Bld}, &Path_Split('Base',$MMPFILE), $TruePlat{Ext});
+		$MAKEFILE=join ('', $Path{Bld}, &Path_Split('Base',$MMPFILE), lc $TruePlat{Ext});
 	}
 	else {
-		$MAKEFILE=join "", &Path_WorkPath, &Path_Split('Base',$MMPFILE), $TruePlat{Ext};
+		$MAKEFILE=join "", &Path_WorkPath, &Path_Split('Base',$MMPFILE), lc $TruePlat{Ext};
 	}
 }
 
@@ -279,7 +280,7 @@ my $ResrcIsSys;
 	# Load the Dependency Generator
 	eval { &Load_ModuleL('MAKDEPS'); };
 	die $@ if $@;
-	eval { &Deps_InitL($E32env::Data{EPOCIncPath},@StdIncPaths); };
+	eval { &Deps_InitL($e32env::Data{EPOCIncPath},@StdIncPaths); };
 	die $@ if $@;
 	if ($Options{v}) {
 		&Deps_SetVerbose;
@@ -325,7 +326,8 @@ my $ResrcIsSys;
 		if ($Options{v}) {
 			print "Resource: \"$$CurResourceRef{Trg}\"\n";
 		}
-		eval { @CurDepList=&Deps_GenDependsL($$CurResourceRef{Source}, ("LANGUAGE_$$CurResourceRef{Lang}")); };
+		my $uclang = $$CurResourceRef{Lang};
+		eval { @CurDepList=&Deps_GenDependsL($$CurResourceRef{Source}, ("LANGUAGE_$uclang")); };
 		die $@ if $@;
 		&PMResrcBld if defined &PMResrcBld;
 		undef @CurDepList;
@@ -343,11 +345,9 @@ my $ResrcIsSys;
 
 # Add tools-relative include path to sys includes, to allow for shared include\aiftool.rh
 	use FindBin;
-	$FindBin::Bin =~ /:(.*)\//;
-	my $extraIncPath = $1;
-	$extraIncPath =~ s/\//\\/g;
+	my $extraIncPath = $FindBin::Bin;
 	my @SavedSysIncPaths = @SysIncPaths;
-	push @SysIncPaths, "$extraIncPath\\INCLUDE";
+	push @SysIncPaths, "$extraIncPath\/include";
 	&Deps_SetSysIncPaths(@SysIncPaths);
 
 	my $LoopAifRef;
@@ -498,7 +498,7 @@ my $ResrcIsSys;
 				elsif ($FixedProcess) {
 					$RomDecorations.='fixed';
 				}
-				my $IbyTextFrom="$RomFileType=$E32env::Data{RelPath}$Plat{Real}\\##BUILD##\\$Trg";
+				my $IbyTextFrom="$RomFileType=$e32env::Data{RelPath}$Plat{Real}\\##BUILD##\\$Trg";
 				my $IbyTextTo="$RomPath$RomFile";
 				my $Spaces= 60>length($IbyTextFrom) ? 60-length($IbyTextFrom) : 1; 
 #				&Output("\t\@echo \"", $IbyTextFrom, ' 'x$Spaces, "$IbyTextTo $RomDecorations\"\n");
@@ -515,7 +515,7 @@ my $ResrcIsSys;
 					$RomFile=$$ref{File};
 				}
 				my $RomDecorations='attrib=r';
-				my $IbyTextFrom="$RomFileType=$E32env::Data{RelPath}$Plat{Real}\\##BUILD##\\$Trg";
+				my $IbyTextFrom="$RomFileType=$e32env::Data{RelPath}$Plat{Real}\\##BUILD##\\$Trg";
 				my $IbyTextTo="$RomPath$RomFile";
 				my $Spaces= 60>length($IbyTextFrom) ? 60-length($IbyTextFrom) : 1; 
 #				&Output("\t\@echo \"", $IbyTextFrom, ' 'x$Spaces, "$IbyTextTo $RomDecorations\"\n");
@@ -581,7 +581,7 @@ sub SetVarsFromMmp ($) {
 	eval { &Plat_GetL($platname,\%Plat,\%BldMacros); };
 	return $@ if $@;
 	&Mmp_Reset;
-	eval { &Mmp_ProcessL($E32env::Data{EPOCPath}, $MMPFILE, \%Plat); };
+	eval { &Mmp_ProcessL($e32env::Data{EPOCPath}, $MMPFILE, \%Plat); };
 	return $@ if $@;
 
 	%WarningLevel=&Mmp_WarningLevel;
@@ -640,35 +640,36 @@ sub SetVarsFromMmp ($) {
 	undef %Path;
 
 #	set up ASSP link path - this is the path where the target looks for ASSP-specific import libraries
-	$Path{ASSPLink}="$E32env::Data{LinkPath}$Plat{ASSP}\\";
+	$Path{ASSPLink}="$e32env::Data{LinkPath}" . lc $Plat{ASSP} . "\/";
 
 #	set up build path
-	$Path{Bld}=join('', &Path_Chop($E32env::Data{BldPath}), &Path_Split('Path',$MMPFILE), &Path_Split('Base',$MMPFILE), "\\$Plat{Real}\\");
+	$Path{Bld}=join('', &Path_Chop($e32env::Data{BldPath}), &Path_Split('Path',$MMPFILE), &Path_Split('Base',$MMPFILE), "\/", lc $Plat{Real}, "\/");
 
 #	set up lib path - this is the path where the target puts it's import library
-	$Path{Lib}="$E32env::Data{LinkPath}";
+	$Path{Lib}="$e32env::Data{LinkPath}";
 	unless ($ASSPExports) {
-		$Path{Lib}.="$ABI\\";
+		$Path{Lib}.= lc "$ABI\/"; # alfredh: ARM4->arm4, ARMI->armi
 	}
 	else {
-		$Path{Lib}.="$Plat{ASSP}\\";
+		$Path{Lib}.= lc "$Plat{ASSP}\/";
 	}
 
 #	set up link path - this is the place where the target looks for ordinary libraries
-	$Path{Link}="$E32env::Data{LinkPath}$ABI\\";
+	$Path{Link}="$e32env::Data{LinkPath}". lc $ABI . "\/";
 
 #	set up stat link path - this is where the target looks for static libraries
-	$Path{StatLink}="$E32env::Data{LinkPath}";
+	$Path{StatLink}="$e32env::Data{LinkPath}";
 	unless ($Plat{OS} eq 'WINS') {	# WINC and WINS versions of EEXE are different
-		$Path{StatLink}.="$ABI\\"; # ARM static libraries are currently always ASSP-independent
+		$Path{StatLink}.= lc "$ABI\/"; # ARM static libraries are currently always ASSP-independent
 	}
 	else {
-		$Path{StatLink}.="$Plat{ASSP}\\"; # WINC static libraries are currently always ASSP-specific
+		$Path{StatLink}.= lc "$Plat{ASSP}\/"; # WINC static libraries are currently always ASSP-specific
 	}
 
 #	set up release path
 	unless ($TrgType{Basic} eq 'LIB') {
-		$Path{Rel}="$E32env::Data{RelPath}$Plat{Real}\\";
+		$Path{Rel}="$e32env::Data{RelPath}";
+		$Path{Rel}.= lc "$Plat{Real}\/";
 	}
 	else {
 		$Path{Rel}=$Path{StatLink}; # static libraries can't #define the __SINGLE__ macro
@@ -729,10 +730,10 @@ sub ASSPLinkPath () {
 	if ($CurBld) {
 #regression hack
 		if ($Plat{OS} eq 'EPOC32') {
-			$Path.="UREL\\";
+			$Path.="urel\/";
 		}
 		else {
-			$Path.="UDEB\\";
+			$Path.="udeb\/";
 		}
 #regression hack end
 	}
@@ -789,7 +790,8 @@ sub BldList () {
 sub BldPath () {
 	my $Path=$Path{"Bld"};
 	if ($CurBld) {
-		$Path.="$CurBld\\";
+		$CurBld = lc $CurBld;
+		$Path.="$CurBld\/";
 	}
 	$Path;
 }
@@ -803,7 +805,7 @@ sub DataLinkAddress () {
 	$DataLinkAddress;
 }
 sub DataPath () {
-	$E32env::Data{DataPath};
+	$e32env::Data{DataPath};
 }
 sub DebugLibList () {
 	@DebugLibList;
@@ -832,19 +834,19 @@ sub DocList () {
 	sort @DocList;
 }
 sub EPOCPath () {
-	$E32env::Data{EPOCPath};
+	$e32env::Data{EPOCPath};
 }
 sub EPOCDataPath () {
-	$E32env::Data{EPOCDataPath};
+	$e32env::Data{EPOCDataPath};
 }
 sub EPOCIncPath () {
-	$E32env::Data{EPOCIncPath};
+	$e32env::Data{EPOCIncPath};
 }
 sub EPOCRelPath () {
-	$E32env::Data{RelPath};
+	$e32env::Data{RelPath};
 }
 sub EPOCToolsPath () {
-	$E32env::Data{EPOCToolsPath};
+	$e32env::Data{EPOCToolsPath};
 }
 sub Exports () {
 	@{$TrgType{Exports}{$Plat{"DefFile"}}};
@@ -873,10 +875,10 @@ sub LibPath () {
 	if ($CurBld) {
 #regression hack
 		if ($Plat{OS} eq 'EPOC32') {
-			$Path.="UREL\\";
+			$Path.="urel\/";
 		}
 		else {
-			$Path.="UDEB\\";
+			$Path.="udeb\/";
 		}
 #regression hack end
 	}
@@ -891,10 +893,10 @@ sub LinkPath () {
 	if ($CurBld) {
 #regression hack
 		if ($Plat{OS} eq 'EPOC32') {
-			$Path.="UREL\\";
+			$Path.="urel\/";
 		}
 		else {
-			$Path.="UDEB\\";
+			$Path.="udeb\/";
 		}
 #regression hack end
 	}
@@ -954,7 +956,8 @@ sub ProcessPriority () {
 sub RelPath () {
 	my $Path=$Path{Rel};
 	if ($CurBld) {
-		$Path.="$CurBld\\";
+		$CurBld = lc $CurBld;
+		$Path.="$CurBld\/";
 	}
 	$Path;
 }
@@ -1003,7 +1006,7 @@ sub StatLibList () {
 sub StatLinkPath () {
 	my $Path=$Path{StatLink};
 	if ($CurBld) {
-		$Path.="$CurBld\\";
+		$Path.= lc "$CurBld\/";
 	}
 	$Path;
 }
diff --git a/maksym.pl b/maksym.pl
index 46c2762..febfd8a 100644
--- a/maksym.pl
+++ b/maksym.pl
@@ -262,7 +262,7 @@ sub help ()
   {
 	my $build;
 
-	&Load_ModuleL('E32TPVER');
+	&Load_ModuleL('e32tpver');
 	print "\nmaksym - Produce symbolic information given a ROM image (Build ",
 	  &E32tpver, ")\n";
 	&usage;
diff --git a/memtrace.pl b/memtrace.pl
index 188e77b..d57ba66 100644
--- a/memtrace.pl
+++ b/memtrace.pl
@@ -223,7 +223,7 @@ sub help ()
 	{
 	my $build;
 	
-	&Load_ModuleL('E32TPVER');
+	&Load_ModuleL('e32tpver');
 	print "\nmemtrace - " .
 	  "Postprocess EPOC memory usage trace (Build ", &E32tpver, ")\n";
 	&usage;
diff --git a/mmp.pm b/mmp.pm
index 7420dd1..382a592 100644
--- a/mmp.pm
+++ b/mmp.pm
@@ -1,3 +1,5 @@
+#!/usr/bin/perl -w
+#
 # MMP.PM
 #
 # Copyright (c) 1997-2003 Symbian Ltd.  All rights reserved.
@@ -6,7 +8,7 @@
 
 # Processes an mmp file and sets up subroutines to return the data
 
-package Mmp;
+package mmp;
 
 require Exporter;
 @ISA=qw(Exporter);
@@ -25,7 +27,7 @@ require Exporter;
 	Mmp_CallDllEntryPoints
 	Mmp_CompatibleABIs
 	Mmp_DataLinkAddress
-	Mmp_DebugLibList 
+	Mmp_DebugLibList
 	Mmp_Def
 	Mmp_DocHash
 	Mmp_ExportUnfrozen
@@ -45,7 +47,7 @@ require Exporter;
 	Mmp_RomTargets
 	Mmp_SrcHash
 	Mmp_StackSize
-	Mmp_StatLibList 
+	Mmp_StatLibList
 	Mmp_SysIncPaths
 	Mmp_Trg
 	Mmp_TrgType
@@ -57,10 +59,10 @@ require Exporter;
 );
 
 
-use Genutl;
-use Prepfile;
-use Pathutl;
-use Trgtype;
+use genutl;
+use prepfile;
+use pathutl;
+use trgtype;
 
 my %Mode;
 
@@ -97,7 +99,7 @@ my $ProcessPriority='';
 my @ResourceStruct;
 my @RamTargets;
 my @RomTargets=({}); # include default
-my %SrcHash;    
+my %SrcHash;
 my $StackSize='';
 my @StatLibList;
 my @SysIncPaths;
@@ -204,7 +206,7 @@ sub Mmp_ProcessL ($$) {
 	my ($CurSrcPath, $MmpMacro, $Line);
 	$CurSrcPath=$MmpPath;
 
-#	include the .MMP file as a document
+#	include the .mmp file as a document
 	@{$DocHash{$MmpPath}}=(&Path_Split('File', $MMPFILE));
 	$CheckDoc{$MMPFILE}='zero - specified by default';
 
@@ -215,9 +217,9 @@ sub Mmp_ProcessL ($$) {
 		@$origLine = @$Line;
 		shift 	@$origLine;
 		shift   @$origLine;
-		foreach $Item (@$Line){
-			$Item = uc $Item;
-			}
+#		foreach $Item (@$Line){ TODOAEH
+#			$Item = uc $Item;
+#			}
 		my $LineNum=shift @$Line;
 		$_=shift @$Line;
 		if ($LineNum eq '#') {
@@ -226,7 +228,7 @@ sub Mmp_ProcessL ($$) {
 		}
 
 		if ($PlatTxtSwitch) {
-			if (/^END$/o) {
+			if (/^END$/oi) {
 				$PlatTxtSwitch=0;
 				next LINE;
 			}
@@ -234,7 +236,7 @@ sub Mmp_ProcessL ($$) {
 			next LINE;
 		}
 		if ($OtherPlatSwitch) {
-			if (/^END$/o) {
+			if (/^END$/oi) {
 				$OtherPlatSwitch=0;
 				next LINE;
 			}
@@ -242,21 +244,20 @@ sub Mmp_ProcessL ($$) {
 		}
 		# ----------- handle body of START BITMAP ... END -------------
 		if (%CurBitMap) {
-			if (/^SOURCE$/o) {
+			if (/^SOURCE$/oi) {
 				unless (@$Line>1) {
 					push @MmpDie, "$CurFile($LineNum) : Not enough arguments for Bitmap keyword SOURCE\n";
 				}
 				my $cldepth = shift @$Line;
 				my @ClDepths = split(/,/, $cldepth);
 				foreach (@ClDepths) {
-					$_ = lc $_; # bmconv can't handle upper-case 'C's
-					unless (/^c?\d\d?$/o) {
+#					$_ = lc $_; # bmconv can't handle upper-case 'C's
+					unless (/^c?\d\d?$/io) {
 						push @MmpDie, "$CurFile($LineNum) : BITMAP color depth \"$_\" - unexpected format\n";
 					}
 				}
 				@ClDepths = (@ClDepths) x @$Line;	# make a sufficiently long list of color depths
 				foreach (@$Line) {
-					$_=lc $_;	# bmconv generates a header with case-sensitive enums
 					my $bitmap = "$CurBitMapSrcPath$_";
 					push @{$CurBitMap{Source}}, { # sources must be kept in order
 						Src=>$bitmap,
@@ -268,26 +269,27 @@ sub Mmp_ProcessL ($$) {
 				}
 				next LINE;
 			}
-			if (/^END$/o) {
+			if (/^END$/oi) {
 				$CurBitMapSrcPath=$MmpPath;
 				my %BitMap=%CurBitMap;
 				undef %CurBitMap;
 				push @BitMapStruct, \%BitMap;
 				next LINE;
 			}
-			if (/^SOURCEPATH$/o) {
+			if (/^SOURCEPATH$/oi) {
 				unless ($CurBitMapSrcPath=shift @$Line) {
 					push @MmpDie, "$CurFile($LineNum) : No path specified with Bitmap keyword SOURCEPATH\n";
 					next LINE;
 				}
-				$CurBitMapSrcPath=~s-^(.*[^\\])$-$1\\-o;   # ensure path ends with a backslash
+				$CurBitMapSrcPath=~s/\\/\//g;      # force to forward slash
+				$CurBitMapSrcPath=~s-^(.*[^\/])$-$1\/-o;   # ensure path ends with a backslash
 				$CurBitMapSrcPath=&Path_MakeAbs($CurFile,$CurBitMapSrcPath);
 				if (@$Line) {
 					push @MmpWarn, "$CurFile($LineNum) : Too many arguments for Bitmap keyword SOURCEPATH\n";
 				}
 				next LINE;
 			}
-			if (/^HEADER$/o) {
+			if (/^HEADER$/oi) {
 				if ($CurBitMap{Hdr}) {
 					push @MmpWarn, "$CurFile($LineNum) : Bitmap HEADER already specified at line $CurBitMap{Hdr}\n";
 					next LINE;
@@ -300,7 +302,7 @@ sub Mmp_ProcessL ($$) {
 			}
 
 
-			if (/^TARGETPATH$/o) {
+			if (/^TARGETPATH$/oi) {
 				if ($CurBitMap{TrgPath}) {
 					push @MmpWarn, "$CurFile($LineNum) : Bitmap TARGETPATH already specified\n";
 					next LINE;
@@ -309,9 +311,10 @@ sub Mmp_ProcessL ($$) {
 					push @MmpDie, "$CurFile($LineNum) : No path specified with Bitmap keyword TARGETPATH\n";
 					next LINE;
 				}
-				$CurBitMap{TrgPath}=~s-^\\(.*)$-$1-o;        # remove leading backslash, if any
-				$CurBitMap{TrgPath}=~s-^(.*[^\\])$-$1\\-o;   # ensure path ends with a backslash
-				$CurBitMap{TrgPath}="Z\\$CurBitMap{TrgPath}";
+				$CurBitMap{TrgPath}=~s/\\/\//g;              # force to forward slash
+				$CurBitMap{TrgPath}=~s-^\/(.*)$-$1-o;        # remove leading backslash, if any
+				$CurBitMap{TrgPath}=~s-^(.*[^\/])$-$1\/-o;   # ensure path ends with a backslash
+				$CurBitMap{TrgPath}="z\/$CurBitMap{TrgPath}";
 				if (@$Line) {
 					push @MmpWarn, "$CurFile($LineNum) : Too many arguments for Bitmap keyword TARGETPATH\n";
 				}
@@ -322,7 +325,7 @@ sub Mmp_ProcessL ($$) {
 		
 		# ----------- handle body of START RESOURCE ... END -------------
 		if (%CurResource) {
-			if (/^END$/o) {
+			if (/^END$/oi) {
 				$CurResource{SrcPath}=$CurSrcPath;
 				my %Resource=%CurResource;
 				undef %CurResource;
@@ -330,7 +333,7 @@ sub Mmp_ProcessL ($$) {
 				undef %ResourceCheckLang;
 				next LINE;
 			}
-			if (/^HEADER$/o) {
+			if (/^HEADER$/oi) {
 				if ($CurResource{Hdr}) {
 					push @MmpWarn, "$CurFile($LineNum) : Resource HEADER already specified at line $CurResource{Hdr}\n";
 					next LINE;
@@ -341,7 +344,7 @@ sub Mmp_ProcessL ($$) {
 				}
 				next LINE;
 			}
-			if (/^LANG$/o) {
+			if (/^LANG$/oi) {
 				if (@$Line) {
 					my $Candidate;
 					foreach $Candidate (@$Line) {
@@ -349,7 +352,7 @@ sub Mmp_ProcessL ($$) {
 							push @MmpWarn, "$CurFile($LineNum) : Duplicate Language \"$Candidate\" at line $ResourceCheckLang{$Candidate}\n";
 							next; 
 						}
-						push @{$CurResource{Lang}}, $Candidate;
+						push @{$CurResource{Lang}}, lc $Candidate;
 						$ResourceCheckLang{$Candidate}="$CurFile($LineNum)";
 					}
 					next LINE;
@@ -357,7 +360,7 @@ sub Mmp_ProcessL ($$) {
 				push @MmpWarn, "$CurFile($LineNum) : No Languages specified for keyword LANG\n";
 				next LINE;
 			}
-			if (/^TARGETPATH$/o) {
+			if (/^TARGETPATH$/oi) {
 				if ($CurResource{TrgPath}) {
 					push @MmpWarn, "$CurFile($LineNum) : Resource TARGETPATH already specified\n";
 					next LINE;
@@ -366,15 +369,16 @@ sub Mmp_ProcessL ($$) {
 					push @MmpDie, "$CurFile($LineNum) : No path specified with Resource keyword TARGETPATH\n";
 					next LINE;
 				}
-				$CurResource{TrgPath}=~s-^\\(.*)$-$1-o;        # remove leading backslash, if any
-				$CurResource{TrgPath}=~s-^(.*[^\\])$-$1\\-o;   # ensure path ends with a backslash
-				$CurResource{TrgPath}="Z\\$CurResource{TrgPath}";
+				$CurResource{TrgPath}=~s/\\/\//g;              # force to forward slash
+				$CurResource{TrgPath}=~s-^/(.*)$-$1-o;        # remove leading slash, if any
+				$CurResource{TrgPath}=~s-^(.*[^\/])$-$1\/-o;   # ensure path ends with a slash
+				$CurResource{TrgPath}="z/$CurResource{TrgPath}";
 				if (@$Line) {
 					push @MmpWarn, "$CurFile($LineNum) : Too many arguments for Resource keyword TARGETPATH\n";
 				}
 				next LINE;
 			}
-			if (/^UID$/o) {
+			if (/^UID$/oi) {
 				if (@$Line) {
 					if (scalar @$Line>2) {
 						push @MmpWarn, "$CurFile($LineNum) : Can't specify more than 2 Uids\n";
@@ -399,7 +403,7 @@ sub Mmp_ProcessL ($$) {
 		}
 		
 		# ----------- handle top-level MMP file -------------------	
-		if (/^START$/) {
+		if (/^START$/i) {
 			unless ($_=shift @$Line) {
 				push @MmpWarn, "$CurFile($LineNum) : No Argument specified for START block\n";
 				next LINE;
@@ -410,22 +414,24 @@ sub Mmp_ProcessL ($$) {
 					next LINE;
 				}
 			}
-			if ($_ eq 'BITMAP') {
+			if (uc $_ eq 'BITMAP') {
 				unless ($CurBitMap{Trg}=shift @$Line) {
 					push @MmpWarn, "$CurFile($LineNum) : No Bitmap Target specified\n";
 					$CurBitMap{Trg}='NoTargetSpecified';
 				}
+				$CurBitMap{Trg}=~s/\\/\//g;      # force to forward slash
 				if (@$Line) {
 					push @MmpWarn, "$CurFile($LineNum) : Too many arguments for START BITMAP clause\n";
 				}
 				next LINE;
 			}
-			if ($_ eq 'RESOURCE') {
+			if (uc $_ eq 'RESOURCE') {
 				if (scalar @$Line != 1) {
 					push @MmpWarn, "$CurFile($LineNum) : Wrong number of arguments for START RESOURCE clause\n";
 				} 
 				else {
-				    my $src=shift @$Line;
+					my $src=shift @$Line;
+					$src=~s/\\/\//g;      # force to forward slash
 					$CurResource{BaseTrg}=&Path_Split('Base',$src);
 					$CurResource{Source}="$CurSrcPath$src";
 				}
@@ -435,15 +441,18 @@ sub Mmp_ProcessL ($$) {
 			next LINE;
 		}
 
-		if (/^AIF$/o) {
+		if (/^AIF$/oi) {
 			my ($trg, $dir, $file, $clDepth, @bitmaps)=@$Line;
 			unless ($file) { # bitmaps aren't essential
 				push @MmpDie, "$CurFile($LineNum) : Not enough arguments for keyword AIF\n";
 				next LINE;
 			}
 			my %Data;
+			$trg=~s/\\/\//g;      # force to forward slash
 			$Data{Trg} = $trg;	# BUG: may include directory
-			$dir=~s-^(.*[^\\])$-$1\\-o;   # ensure path ends with a backslash
+			$dir=~s/\\/\//g;      # force to forward slash
+			$file=~s/\\/\//g;      # force to forward slash
+			$dir=~s-^(.*[^\/])$-$1\/-o;   # ensure path ends with a slash
 			$Data{Source}=&Path_MakeAbs($CurFile, "$dir$file");
 			unless (-e "$Data{Source}") {
 				push @MmpWarn, "$CurFile($LineNum) : AIF source \"$Data{Source}\" not found\n";
@@ -465,7 +474,8 @@ sub Mmp_ProcessL ($$) {
 			}
 			@ClDepths = (@ClDepths) x @bitmaps;	# make a sufficiently long list of color depths
 			foreach $file (@bitmaps) {
-				if ($file !~ /^\\/) {
+				$file=~s/\\/\//g;      # force to forward slash
+				if ($file !~ /^\//) {
 					$file = &Path_MakeAbs($CurFile, "$dir$file");
 				}
 				push @{$Data{BitMaps}}, { # sources must be kept in order
@@ -478,21 +488,21 @@ sub Mmp_ProcessL ($$) {
 			}
 			next LINE;
 		}
-		if (/^ASSPABI$/o) {
+		if (/^ASSPABI$/oi) {
 			if (@$Line) {
 				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
 			}
 			$ASSPABISwitch=1;
 			next LINE;
 		}
-		if (/^ASSPEXPORTS$/o) {
+		if (/^ASSPEXPORTS$/oi) {
 			if (@$Line) {
 				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
 			}
 			$ASSPExports=1;
 			next LINE;
 		}
-		if (/^ASSPLIBRARY$/o) {
+		if (/^ASSPLIBRARY$/oi) {
 			if (@$Line) {
 				my $Candidate;
 				foreach $Candidate (@$Line) {
@@ -508,7 +518,7 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : No Libraries specified for keyword ASSPLIBRARY\n";
 			next LINE;
 		}
-		if (/^DEBUGLIBRARY$/o) {
+		if (/^DEBUGLIBRARY$/oi) {
 			if (@$Line) {
 				my $Candidate;
 				foreach $Candidate (@$Line) {
@@ -524,7 +534,7 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : No Libraries specified for keyword DEBUGLIBRARY\n";
 			next LINE;
 		}
-		if (/^DEFFILE$/o)  {
+		if (/^DEFFILE$/oi)  {
 			if ($CheckDef) {
 				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine DEFFILE\n";
 				next LINE;
@@ -534,6 +544,7 @@ sub Mmp_ProcessL ($$) {
 				push @MmpWarn, "$CurFile($LineNum) : No file specified for keyword DEFFILE\n";
 				next LINE;
 			}
+			$_=~s/\\/\//g;      # force to forward slash
 			$Def{Base}=&Path_Split('Base',$_);
 			$Def{Ext}=&Path_Split('Ext',$_);
 			$Def{Path}=&Path_Split('Path',$_);
@@ -542,10 +553,11 @@ sub Mmp_ProcessL ($$) {
 			}
 			next LINE;
 		}
-		if (/^DOCUMENT$/o) {
+		if (/^DOCUMENT$/oi) {
 			if (@$Line) {
 				my $Candidate;
 				foreach $Candidate (@$Line) {
+ 					$Candidate=~s/\\/\//g;      # force to forward slash
 					if ($CheckDoc{"$CurSrcPath$Candidate"}) {
 						push @MmpWarn, "$CurFile($LineNum) : Duplicate Document \"$CurSrcPath$Candidate\" at line ", $CheckDoc{"$CurSrcPath$Candidate"}, "\n";
 						next; 
@@ -561,21 +573,21 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : No Files specified for keyword DOCUMENT\n";
 			next LINE;
 		}
-		if (/^EPOCALLOWDLLDATA$/o) {
+		if (/^EPOCALLOWDLLDATA$/oi) {
 			if (@$Line) {
 				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
 			}
 			$AllowDllData=1;
 			next LINE;
 		}
-		if (/^EPOCCALLDLLENTRYPOINTS$/o) {
+		if (/^EPOCCALLDLLENTRYPOINTS$/oi) {
 			if (@$Line) {
 				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
 			}
 			$CallDllEntryPoints=1;
 			next LINE;
 		}
-		if (/^EPOCDATALINKADDRESS$/o) {
+		if (/^EPOCDATALINKADDRESS$/oi) {
 			if (@$Line) { 
 				my $temp=&main::Genutl_AnyToHex(shift @$Line);
 				if (defined $temp) {
@@ -587,14 +599,14 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : No data link address specified for keyword $_\n";
 			next LINE;
 		}
-		if (/^EPOCFIXEDPROCESS$/o) {
+		if (/^EPOCFIXEDPROCESS$/oi) {
 			if (@$Line) {
 				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
 			}
 			$FixedProcess=1;
 			next LINE;
 		}
-		if (/^EPOCHEAPSIZE$/o) {
+		if (/^EPOCHEAPSIZE$/oi) {
 			if (@$Line) {
 				my $tempMin=&main::Genutl_AnyToHex(shift @$Line);
 				if (defined $tempMin) {
@@ -617,7 +629,7 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : No minimum heap size specified for keyword $_\n";
 			next LINE;
 		}
-		if (/^EPOCPROCESSPRIORITY$/o) {
+		if (/^EPOCPROCESSPRIORITY$/oi) {
 			if ($ProcessPriority) {
 				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine EPOCPROCESSPRIORITY\n";
 				next LINE;
@@ -632,7 +644,7 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : No Priority specified for keyword EPOCPROCESSPRIORITY\n";
 			next LINE;
 		}
-		if (/^EPOCSTACKSIZE$/o) {
+		if (/^EPOCSTACKSIZE$/oi) {
 			if (@$Line) {
 				my $temp=&main::Genutl_AnyToHex(shift @$Line);
 				if (defined $temp) {
@@ -645,28 +657,28 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : No stack size specified for keyword STACKSIZE\n";
 			next LINE;
 		}
-		if (/^COMPRESSTARGET$/o) {
+		if (/^COMPRESSTARGET$/oi) {
 			if (@$Line) {
 				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
 			}
 			$CompressTarget=1;
 			next LINE;
 		}
-		if (/^NOCOMPRESSTARGET$/o) {
+		if (/^NOCOMPRESSTARGET$/oi) {
 			if (@$Line) {
 				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
 			}
 			$CompressTarget=0;
 			next LINE;
 		}
-		if (/^EXPORTUNFROZEN$/o) {
+		if (/^EXPORTUNFROZEN$/oi) {
 			if (@$Line) {
 				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
 			}
 			$ExportUnfrozen=1;
 			next LINE;
 		}
-		if (/^FIRSTLIB$/o) {
+		if (/^FIRSTLIB$/oi) {
 			if ($FirstLib) {
 				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine FIRSTLIB\n";
 				next LINE;
@@ -677,7 +689,7 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : Nothing specified for keyword FIRSTLIB\n";
 			next LINE;
 		}
-		if (/^LANG$/o) {
+		if (/^LANG$/oi) {
 			if (@$Line) {
 				my $Candidate;
 				foreach $Candidate (@$Line) {
@@ -685,7 +697,7 @@ sub Mmp_ProcessL ($$) {
 						push @MmpWarn, "$CurFile($LineNum) : Duplicate Language \"$Candidate\" at line $CheckLang{$Candidate}\n";
 						next; 
 					}
-					push @LangList, $Candidate;
+					push @LangList, lc $Candidate;
 					$CheckLang{$Candidate}="$CurFile($LineNum)";
 				}
 				next LINE;
@@ -693,7 +705,7 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : No Languages specified for keyword LANG\n";
 			next LINE;
 		}
-		if (/^LIBRARY$/o) {
+		if (/^LIBRARY$/oi) {
 			if (@$Line) {
 				my $Candidate;
 				foreach $Candidate (@$Line) {
@@ -710,7 +722,7 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : No Libraries specified for keyword LIBRARY\n";
 			next LINE;
 		}
-		if (/^LINKAS$/o) {
+		if (/^LINKAS$/oi) {
 			if ($LinkAs) {
 				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine LINKAS\n";
 				next LINE;
@@ -721,7 +733,7 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : No name specified for keyword LINKAS\n";
 			next LINE;
 		}
-		if (/^EXPORTLIBRARY$/o) {
+		if (/^EXPORTLIBRARY$/oi) {
 			if ($NoExportLibrary) {
 				push @MmpDie, "$CurFile($LineNum) : Can't specify both EXPORTLIBRARY and NOEXPORTLIBRARY\n";
 				next LINE;
@@ -736,7 +748,7 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : No name specified for keyword EXPORTLIBRARY\n";
 			next LINE;
 		}
-		if (/^NOEXPORTLIBRARY$/o) {
+		if (/^NOEXPORTLIBRARY$/oi) {
 			if ($ExportLibrary) {
 				push @MmpDie, "$CurFile($LineNum) : Can't specify both EXPORTLIBRARY and NOEXPORTLIBRARY\n";
 				next LINE;
@@ -744,13 +756,13 @@ sub Mmp_ProcessL ($$) {
 			$NoExportLibrary = 1;
 			next LINE;
 		}
-		if (/^MACRO$/o) {
+		if (/^MACRO$/oi) {
 			if (@$origLine) {
 				my $Candidate;
 				foreach $Candidate (@$origLine) {
 					if ($CheckMacro{$Candidate}) {
 						push @MmpWarn, "$CurFile($LineNum) : Duplicate Macro \"$Candidate\" at line $CheckMacro{$Candidate}\n";
-						next; 
+						next;
 					}
 					push @Macros, $Candidate;
 					$CheckMacro{$Candidate}="$CurFile($LineNum)";
@@ -759,7 +771,7 @@ sub Mmp_ProcessL ($$) {
 			}
 			next LINE; 
 		}
-		if (/^NOSTRICTDEF$/o) {
+		if (/^NOSTRICTDEF$/oi) {
 			if ($NoStrictDef) {
 				push @MmpWarn, "$CurFile($LineNum) : NOSTRICTDEF already set\n";
 				next LINE;
@@ -770,7 +782,7 @@ sub Mmp_ProcessL ($$) {
 			$NoStrictDef=1;
 			next LINE;
 		}
-		if (/^RAMTARGET$/o) {
+		if (/^RAMTARGET$/oi) {
 			if ($CheckRamTargets) {
 				push @MmpWarn, "$CurFile($LineNum) : RAM targets already specified at line $CheckRamTargets\n";
 				next LINE;
@@ -794,10 +806,11 @@ sub Mmp_ProcessL ($$) {
 			}
 			next LINE;
 		}
-		if (/^RESOURCE$/o) {
+		if (/^RESOURCE$/oi) {
 			if (@$Line) {
 				my $Candidate;
 				foreach $Candidate (@$Line) {
+ 					$Candidate=~s/\\/\//g;      # force to forward slash
 					if ($CheckResrc{$Candidate}) {
 						push @MmpDie, "$CurFile($LineNum) : Duplicate Resource $Candidate at line $CheckResrc{$Candidate}\n";
 						next;
@@ -820,7 +833,7 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : No Resources specified for keyword RESOURCE\n";
 			next LINE; 
 		}
-		if (/^ROMTARGET$/o) {
+		if (/^ROMTARGET$/oi) {
 			if ($CheckRomTargets) {
 				push @MmpWarn, "$CurFile($LineNum) : ROM targets already specified at line $CheckRomTargets\n";
 				next LINE;
@@ -845,11 +858,11 @@ sub Mmp_ProcessL ($$) {
 			}
 			next LINE;
 		}
-		if (/^SOURCE$/o) {
+		if (/^SOURCE$/oi) {
 			if (@$Line) {
 				my $Candidate;
 				foreach $Candidate (@$Line) {
-					$Candidate =~ s/^\\//;	# remove leading \, if any
+ 					$Candidate=~s/\\/\//g;      # force to forward slash
 					if ($CheckSrc{$Candidate}) {
 						push @MmpDie, "$CurFile($LineNum) : Duplicate Source \"$Candidate\" at line $CheckSrc{$Candidate}\n";
 						next;
@@ -862,9 +875,10 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : No Sources specified for keyword SOURCE\n";
 			next LINE; 
 		}
-		if (/^SOURCEPATH$/o) {
+		if (/^SOURCEPATH$/oi) {
 			if ($CurSrcPath=shift @$Line) {
-				$CurSrcPath=~s-^(.*[^\\])$-$1\\-o;	# in case no terminating backslash
+ 				$CurSrcPath=~s/\\/\//g;      # force to forward slash
+				$CurSrcPath=~s-^(.*[^\/])$-$1\/-o;	# in case no terminating slash
 				$CurSrcPath=&Path_MakeEAbs($EPOCPath,$CurFile,$CurSrcPath);
 				if (-d &Path_Chop($CurSrcPath)) {
 					next LINE;
@@ -875,7 +889,7 @@ sub Mmp_ProcessL ($$) {
 			push @MmpDie, "$CurFile($LineNum) : No Source Path specified for keyword SOURCEPATH\n";
 			next LINE;
 		}
-		if (/^STATICLIBRARY$/o) {
+		if (/^STATICLIBRARY$/oi) {
 			if (@$Line) {
 				my $Candidate;
 				foreach $Candidate (@$Line) {
@@ -891,7 +905,7 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : No Libraries specified for keyword STATICLIBRARY\n";
 			next LINE;
 		}
-		if (/^STRICTDEPEND$/o) {
+		if (/^STRICTDEPEND$/oi) {
 			if ($MmpFlag{StrictDepend}) {
 				push @MmpWarn, "$CurFile($LineNum) : STRICTDEPEND already set\n";
 				next LINE;
@@ -902,11 +916,12 @@ sub Mmp_ProcessL ($$) {
 			$MmpFlag{StrictDepend}=1;
 			next LINE;
 		}
-		if (/^SYSTEMINCLUDE$/o){
+		if (/^SYSTEMINCLUDE$/oi){
 			if (@$Line) {
 				my $Candidate;
 				foreach $Candidate (@$Line) {
-					$Candidate=~s-^(.*[^\\])$-$1\\-o;   # ensure path ends with a backslash
+ 					$Candidate=~s/\\/\//g;      # force to forward slash
+					$Candidate=~s-^(.*[^\/])$-$1\/-o;   # ensure path ends with a slash
 					$Candidate=&Path_MakeEAbs($EPOCPath,$CurFile,$Candidate);
 					if ($CheckSysInc{$Candidate}) {
 						push @MmpWarn, "$CurFile($LineNum) : Duplicate SYSTEMINCLUDE path $Candidate at line $CheckSysInc{$Candidate}\n";
@@ -924,10 +939,11 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : No Paths specified for keyword SYSTEMINCLUDE\n";
 			next LINE;
 		}
-		if (/^SYSTEMRESOURCE$/o) {
+		if (/^SYSTEMRESOURCE$/oi) {
 			if (@$Line) {
 				my $Candidate;
 				foreach $Candidate (@$Line) {
+ 					$Candidate=~s/\\/\//g;      # force to forward slash
 					if ($CheckSysResrc{$Candidate}) {
 						push @MmpDie, "$CurFile($LineNum) : Duplicate Resource \"$Candidate\" at line $CheckSysResrc{$Candidate}\n";
 						next; 
@@ -940,7 +956,7 @@ sub Mmp_ProcessL ($$) {
 					$CurResource{BaseTrg}=&Path_Split('Base',$Candidate);
 					$CurResource{Source}=$source;
 					$CurResource{Hdr}="$CurFile($LineNum)";
-					$CurResource{TrgPath}="Z\\SYSTEM\\DATA\\";	# UC to match e32env.pm
+					$CurResource{TrgPath}="z/system/data/";	# UC to match e32env.pm
 					my %Resource=%CurResource;
 					undef %CurResource;
 					push @ResourceStruct, \%Resource;
@@ -950,7 +966,7 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : No Resources specified for keyword SYSTEMRESOURCE\n";
 			next LINE; 
 		}
-		if (/^TARGET$/o) {
+		if (/^TARGET$/oi) {
 			if ($Trg) {
 				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine TARGET\n";
 				next LINE;
@@ -961,7 +977,7 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : No Target specified for keyword TARGET\n";
 			next LINE;
 		}
-		if (/^TARGETPATH$/o) {
+		if (/^TARGETPATH$/oi) {
 			if ($TrgPath) {
 				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine TARGETPATH\n";
 				next LINE;
@@ -970,15 +986,16 @@ sub Mmp_ProcessL ($$) {
 				push @MmpWarn, "$CurFile($LineNum) : No Path specified for keyword TARGETPATH\n";
 				next LINE;
 			}
-			$TrgPath=~s-^\\(.*)$-$1-o;
-			$TrgPath=~s-^(.*[^\\])$-$1\\-o;
-			$TrgPath="Z\\$TrgPath";
+			$TrgPath=~s/\\/\//g;              # force to forward slash
+			$TrgPath=~s-^\/(.*)$-$1-o;
+			$TrgPath=~s-^(.*[^\/])$-$1\/-o;
+			$TrgPath="z\/$TrgPath";
 			if (@$Line) {
 				push @MmpWarn, "$CurFile($LineNum) : Too many arguments for keyword TARGETPATH\n";
 			}
 			next LINE;
 		}
-		if (/^TARGETTYPE$/o) {
+		if (/^TARGETTYPE$/oi) {
 			if ($TrgType) {
 				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine TARGETTYPE\n";
 				next LINE;
@@ -993,7 +1010,7 @@ sub Mmp_ProcessL ($$) {
 			}
 			next LINE;
 		}
-		if (/^UID$/o) {
+		if (/^UID$/oi) {
 			if (@$Line) {
 				foreach (@$Line) {
 					if ($#UidList>=1) {
@@ -1013,11 +1030,12 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : No Uids specified for keyword UID\n";
 			next LINE;
 		}
-		if (/^USERINCLUDE$/o) {
+		if (/^USERINCLUDE$/oi) {
 			if (@$Line) {
 				my $Candidate;
 				foreach $Candidate (@$Line) {
-					$Candidate=~s-^(.*[^\\])$-$1\\-o;   # ensure path ends with a backslash
+ 					$Candidate=~s/\\/\//g;      # force to forward slash
+					$Candidate=~s-^(.*[^\/])$-$1\/-o;   # ensure path ends with a slash
 					$Candidate=&Path_MakeEAbs($EPOCPath,$CurFile,$Candidate);
 					if ($CheckUserInc{$Candidate}) {
 						push @MmpWarn, "$CurFile($LineNum) : Duplicate USERINCLUDE path \"$Candidate\" at line $CheckUserInc{$Candidate}\n";
@@ -1035,7 +1053,7 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : No Paths specified for keyword USERINCLUDE\n";
 			next LINE;
 		}
-		if (/^SRCDBG$/o) {
+		if (/^SRCDBG$/oi) {
 			if (@$Line) {
 				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
 			}
@@ -1043,7 +1061,7 @@ sub Mmp_ProcessL ($$) {
 			next LINE;
 		}
 		
-		if (/^OPTION$/o) {
+		if (/^OPTION$/oi) {
 			if (@$origLine >= 2) {
 				my $compilerkey=uc shift @$origLine;
 				if (!defined($Compiler{$compilerkey})) {
@@ -1102,7 +1120,7 @@ sub Mmp_ProcessL ($$) {
 	}
 
 	# check for languages
-	@LangList=('SC') unless @LangList;
+	@LangList=('sc') unless @LangList;
 
 #	ensure all bitmaps have targetpaths and check for duplicate bitmaps
 	my %BitMapCheck;
@@ -1135,7 +1153,7 @@ sub Mmp_ProcessL ($$) {
 		foreach my $lang (@list) {
 			my %newResourceRef = %{$ResourceRef};
 			$newResourceRef{Lang} = $lang;
-			$newResourceRef{Trg} = "$base.R$lang";
+			$newResourceRef{Trg} = "$base.r$lang";
 			push @PerLanguageResourceStruct, \%newResourceRef;
 		}
 	}
@@ -1239,7 +1257,7 @@ sub Mmp_ProcessL ($$) {
 #	Get the EPOC entrypoint static library - must be done after EXEDLL basic types reconciled
 	unless ($FirstLib) {
 		unless ($TrgType{FirstLib}) {
-			$FirstLib="E$TrgType{Basic}.LIB";
+			$FirstLib= lc "E$TrgType{Basic}.lib";
 		}
 		else {
 			$FirstLib=$TrgType{FirstLib};
@@ -1301,21 +1319,21 @@ sub Mmp_ProcessL ($$) {
 			$Def{Base}=&Path_Split('Base',$LinkAs);
 		}
 		unless ($Def{Ext}) {
-			$Def{Ext}='.DEF';
+			$Def{Ext}='.def';
 		}
 		unless ($Def{Path}) {
 			unless ($ASSPExports) {
-				$Def{Path}=&Path_Strip(&Path_Split('Path',$MMPFILE)."..\\B$$Plat_ref{DefFile}\\");
+				$Def{Path}=&Path_Strip(&Path_Split('Path',$MMPFILE)."..\/b".lc $$Plat_ref{DefFile}."\/");
 			}
 			else {
-				$Def{Path}=&Path_Strip(&Path_Split('Path',$MMPFILE)."..\\B$$Plat_ref{ASSP}\\");
+				$Def{Path}=&Path_Strip(&Path_Split('Path',$MMPFILE)."..\/b".lc $$Plat_ref{ASSP}."\/");
 			}
 		}
 #		now that we've dumped narrow, treat the 'U' basename suffix as part of the frozen
 #		.DEF file basename.  Once we've dumped the suffix we won't have to store the extension
 #		separately either
 		unless ($NoStrictDef) {
-			$Def{Base}.='U';
+			$Def{Base}.='u';
 		}
 
 #		check deffile exists
diff --git a/modload.pm b/modload.pm
index bb08510..38bde43 100644
--- a/modload.pm
+++ b/modload.pm
@@ -7,7 +7,7 @@
 # Runtime module-loading routine for loading e32tools modules into 'main' module
 
 
-package Modload;
+package modload;
 
 require Exporter;
 @ISA=qw(Exporter);
@@ -19,7 +19,7 @@ require Exporter;
 );
 
 
-use Pathutl;
+use pathutl;
 
 my %Mode=(
 	Verbose=>0
@@ -40,14 +40,14 @@ sub Load_ModuleL (@) {
 	my @ModBaseList=@_;
 	my $ModBase;
 	foreach $ModBase (@ModBaseList) {
-		$ModBase=uc $ModBase;
-		die "ERROR: Can't load \"$ModulePath$ModBase.PM\"\n" unless -e "$ModulePath$ModBase.PM";
+		$ModBase=lc $ModBase;
+		die "ERROR: Can't load \"$ModulePath$ModBase.pm\"\n" unless -e "$ModulePath$ModBase.pm";
 		if ($Mode{Verbose}) {
-			print "Loading Module: \"",$ModBase,".PM\"\n";
+			print "Loading Module: \"",$ModBase,".pm\"\n";
 		}
 		package main;
-		require $ModBase.".PM" or die "ERROR: Can't load function from \"$ModulePath$ModBase.PM\"\n";
-		my $Package=ucfirst lc $ModBase;
+		require $ModBase.".pm" or die "ERROR: Can't load function from \"$ModulePath$ModBase.pm\"\n";
+		my $Package=$ModBase;
 		$Package->import;
 	}
 }
diff --git a/output.pm b/output.pm
index afd6c8e..0335e0b 100644
--- a/output.pm
+++ b/output.pm
@@ -6,7 +6,7 @@
 
 # Text formatting module
 
-package Output;
+package output;
 require Exporter;
 @ISA=qw(Exporter);
 @EXPORT=qw(
@@ -15,7 +15,6 @@ require Exporter;
 );
 
 
-
 my $Len=80;
 my $PreWrap="\\";
 my $PreWrapLen=length($PreWrap);
@@ -86,9 +85,8 @@ sub OutWrite () {
 
 sub Output (@) {
 	OutWrite if $Buf;	# output the formatted text before doing any more output
-	my $Item;
-	foreach $Item (@_) {
-		$Text.=$Item;
+	foreach (@_) {
+	  $Text .= $_ if $_;
 	}
 }
 
diff --git a/pathutl.pm b/pathutl.pm
index 9aff425..93527a9 100644
--- a/pathutl.pm
+++ b/pathutl.pm
@@ -9,7 +9,7 @@
 #	Distinguish paths from filepaths by assuming paths end with "\"
 #	therefore ensure this is the case for all paths coming into programs using this module
 
-package Pathutl;
+package pathutl;
 
 require Exporter;
 @ISA=qw(Exporter);
@@ -50,10 +50,10 @@ sub helper_MakeRlt ($@) {
 	my ($BaseRef,@List)=@_;
 	foreach my $p (@List) {
 		my $filename=&Path_Split('File',$p);
-		my @plist=&Path_Dirs(uc $p);
+		my @plist=&Path_Dirs($p);
 		my $upcount=scalar @{$BaseRef};
 		foreach (@{$BaseRef}) {
-			if ($_ ne $plist[0]) {
+			if (not $plist[0] or $_ ne $plist[0]) {
 				last;
 			}
 			$upcount -= 1;
@@ -61,12 +61,12 @@ sub helper_MakeRlt ($@) {
 		}
 		$p="";
 		while ($upcount-->0) {
-			$p .= "..\\";
+			$p .= "..\/";
 		}
 		foreach (@plist) {
-			$p .= "$_\\";
+			$p .= "$_\/";
 		}
-		$p=".\\" if ($p eq "");		# ensure a well-formed result if path == work
+		$p=".\/" if ($p eq "");		# ensure a well-formed result if path == work
 		$p .= $filename;
 	}
 	return wantarray ? @List : $List[0];	
@@ -82,7 +82,7 @@ sub Path_RltToWork (@) {
 sub Path_MakeRltToBase ($@) {	#args: $_[0] Base $_[1]... list of (Abs FilePath/Path)
 # make a path, or list of paths, relative to a particular directory specified by the first
 # path passed into the function
-	return undef unless $_[0]=~m-(|\\$)-o;	# allow for null value passed in
+	return undef unless $_[0]=~m-(|\/$)-o;	# allow for null value passed in
 	my ($Base,@List)=@_;
 	my @BasePathList=&Path_Dirs(uc $Base);
 	@List=&helper_MakeRlt(\@BasePathList,@List);
@@ -118,25 +118,25 @@ sub Path_Split ($$) {	#args: $_[0] 'Path' or 'Base' or 'Ext' $_[1] Abs/Rel FileP
 	my ($Sect,$P)=@_;
 	$Sect=ucfirst lc $Sect;
 	if ($Sect eq 'Path') {
-		if ($P=~/^(.*\\)/o) {
+		if ($P=~/^(.*\/)/o) {
 			return $1;
 		}
 		return '';
 	}
 	if ($Sect eq 'Base') {
-		if ($P=~/\\?([^\\]*?)(\.[^\\\.]*)?$/o) {
+		if ($P=~/\/?([^\/]*?)(\.[^\/\.]*)?$/o) {
 			return $1;
 		}
 		return '';
 	}
 	if ($Sect eq 'Ext') {
-		if ($P=~/(\.[^\\\.]*)$/o) {
+		if ($P=~/(\.[^\/\.]*)$/o) {
 			return $1;
 		}
 		return '';
 	}
 	if ($Sect eq 'File') {
-		if ($P=~/([^\\]*)$/o) {
+		if ($P=~/([^\/]*)$/o) {
 			return $1;
 		}
 		return '';
@@ -146,25 +146,25 @@ sub Path_Split ($$) {	#args: $_[0] 'Path' or 'Base' or 'Ext' $_[1] Abs/Rel FileP
 
 sub Path_Dirs ($) {	#args: $_[0] Abs FilePath/Path
 # return an ordered list of individual directories that make up a path
-	return undef unless $_[0]=~m-^\\-o;
+	return undef unless $_[0]=~m-^\/-o;
 	my $P=&Path_Split('Path',$_[0]);
-	return undef unless $P=~s-^(.*)\\$-$1-o;
-	$P=~s-^\\(.*)-$1-o;
-	split /\\/,$P;
+	return undef unless $P=~s-^(.*)\/$-$1-o;
+	$P=~s-^\/(.*)-$1-o;
+	split /\//,$P;
 }
 
 sub Path_StepDirs ($) { #args: $_[0] Abs FilePath/Path
 # return an ordered list of paths - starting with the directory in the root directory from the
 # path passed into the function, each subsequent path contains the next directory from the path
 # passed into the function, and the last path is the same as the path passed into the function
-	return undef unless $_[0]=~m-^\\-o;
+	return undef unless $_[0]=~m-^\/-o;
 	my $P=$_[0];
 	my @Dirs=&Path_Dirs($P);
 	my @StepDirs;
 	my $dir;
-	my $stepDir="\\";
+	my $stepDir="\/";
 	foreach $dir (@Dirs) {
-		$stepDir.="$dir\\";
+		$stepDir.="$dir\/";
 		push @StepDirs, $stepDir;
 	}
 	@StepDirs;
@@ -172,10 +172,10 @@ sub Path_StepDirs ($) { #args: $_[0] Abs FilePath/Path
 
 sub Path_Strip ($) {	#args: $_[0] Abs FilePath/Path
 # Remove excess occurrences of '..' and '.' from a path
-	return undef unless $_[0]=~m-^\\-o;
+	return undef unless $_[0]=~m-^\/-o;
 	my $P=$_[0];
-	while ($P=~s-\\\.\\-\\-go) { }
-	while ($P=~s-\\(?!\.{2}\\)[^\\]*\\\.{2}(?=\\)--go) { }
+	while ($P=~s-\/\.\/-\/-go) { }
+	while ($P=~s-\/(?!\.{2}\/)[^\/]*\/\.{2}(?=\/)--go) { }
 	$P;
 }
 
@@ -184,10 +184,10 @@ sub Path_MakePathL (@) {	#args: @_ list of Abs FilePath/Path
 	my @Paths=@_;
 	my $P;
 	foreach $P (@Paths) { 
-		return undef unless $P=~m-^\\-o;
+		return undef unless $P=~m-^\/-o;
 		$P=&Path_Split('Path',$P);
 		$P=&Path_Strip($P);
-		$P=~m-(.*)\\-o;
+		$P=~m-(.*)\/-o;
 		if (-d $1) {
 			if ($Mode{'Verbose'}) {
 				print "Existing Path: \"$P\"\n";
@@ -205,26 +205,26 @@ sub Path_MakePathL (@) {	#args: @_ list of Abs FilePath/Path
 sub Path_UpToRoot ($) {	#args: $_[0] Abs FilePath/Path
 # return the path that will lead from the directory the path passed into the function
 # specifies back up to the root directory
-	return undef unless $_[0]=~m-^\\-o;
+	return undef unless $_[0]=~m-^\/-o;
 	my $Path=$_[0];
 	my $UpP;
-	while ($Path=~m-\\-go) {
-		$UpP.="..\\";
+	while ($Path=~m-\/-go) {
+		$UpP.="..\/";
 	}
 	undef $Path;
-	$UpP=~s-^(.*)\.\.\\-$1-o;
-	$UpP=".\\" unless $UpP;
+	$UpP=~s-^(.*)\.\.\/-$1-o;
+	$UpP=".\/" unless $UpP;
 }
 
 sub Path_MakeRlt ($@) {	#args: $_[0] Start UpPath $_[1]... list of (Abs FilePath/Path)
 # make a path, or list of paths, relative to a particular directory specified by the first
 # path passed into the function which leads upwards from a particular directory
-	return undef unless $_[0]=~m-(|\\$)-o;	# allow for null value passed in
+	return undef unless $_[0]=~m-(|\/$)-o;	# allow for null value passed in
 	my ($UpPath,@List)=@_;
 	my $p;
 	foreach $p (@List) {
-		return undef unless $p=~m-^\\-o;
-		$p=~s-^\\(.*)$-$1-o;
+		return undef unless $p=~m-^\/-o;
+		$p=~s-^\/(.*)$-$1-o;
 		$p=$UpPath.$p;
 	}
 	return wantarray ? @List : $List[0];	
@@ -234,7 +234,7 @@ sub Path_MakeAbs ($@) {	#args: $_[0] Start Abs FilePath/Path $_[1]... list of (A
 # make a path, or list of paths, absolute given the directory specified by the first path
 # passed into the function which the other paths passed into the function are assumed to be
 # relative to
-	return undef unless $_[0]=~m-^\\-o;
+	return undef unless $_[0]=~m-^\/-o;
 	my ($Path,@List)=@_;
 	my $BasePath=&Path_Split("Path",$Path);
 	undef $Path;
@@ -244,14 +244,14 @@ sub Path_MakeAbs ($@) {	#args: $_[0] Start Abs FilePath/Path $_[1]... list of (A
 			$p=&Path_Strip($BasePath.$p);
 			next;
 		}
-		if ($p=~m-^[^\.\\]-o) {
+		if ($p=~m-^[^\.\/]-o) {
 			$p=$BasePath.$p;
 			next;
 		}
-		if ($p=~m-^\\-o) {
+		if ($p=~m-^\/-o) {
 			next;
 		}
-		if ($p=~m-^\.\\(.*)$-o) {
+		if ($p=~m-^\.\/(.*)$-o) {
 			$p=&Path_Strip($BasePath.$1);
 			next;
 		}
@@ -261,20 +261,20 @@ sub Path_MakeAbs ($@) {	#args: $_[0] Start Abs FilePath/Path $_[1]... list of (A
 }
 
 sub Path_MakeEAbs ($@) {	#args: $_[0] Start EPOCPath Abs FilePath/Path $_[1]... list of (Abs/Rel FilePath/Path)
-# Variant of MakAbs which also maps "+\\" to "${EPOCPath}"
-	return undef unless $_[0]=~m-^\\-o;
+# Variant of MakAbs which also maps "+\/" to "${EPOCPath}"
+	return undef unless $_[0]=~m-^\/-o;
 	my ($EPOCPath,$Path,@List)=@_;
 	my $BasePath=&Path_Split("Path",$Path);
 	undef $Path;
 	my $p;
 	foreach $p (@List) {
 #regression hack
-		if ($p=~m-^\\epoc32\\(.*)$-io) {	# hack - special case for existing \\epoc32 references
+		if ($p=~m-^\/epoc32\/(.*)$-io) {	# hack - special case for existing \/epoc32 references
 			$p=$EPOCPath.$1;
 			next;
 		}
 #regression hack end
-		if ($p=~m-\+\\(.*)$-o) {
+		if ($p=~m-\+\/(.*)$-o) {
 			$p=$EPOCPath.$1;
 			next;
 		}
@@ -282,14 +282,14 @@ sub Path_MakeEAbs ($@) {	#args: $_[0] Start EPOCPath Abs FilePath/Path $_[1]...
 			$p=&Path_Strip($BasePath.$p);
 			next;
 		}
-		if ($p=~m-^[^\.\\]-o) {
+		if ($p=~m-^[^\.\/]-o) {
 			$p=$BasePath.$p;
 			next;
 		}
-		if ($p=~m-^\\-o) {
+		if ($p=~m-^\/-o) {
 			next;
 		}
-		if ($p=~m-^\.\\(.*)$-o) {
+		if ($p=~m-^\.\/(.*)$-o) {
 			$p=&Path_Strip($BasePath.$1);
 			next;
 		}
@@ -299,11 +299,11 @@ sub Path_MakeEAbs ($@) {	#args: $_[0] Start EPOCPath Abs FilePath/Path $_[1]...
 }
 
 sub Path_Chop (@) {
-# remove the terminating backslash from a path, or list of paths, if there is one
+# remove the terminating slash from a path, or list of paths, if there is one
 	my @List=@_;
 	my $Path;
 	foreach $Path (@List) {
-		$Path=~s-^(.*)\\$-$1-o;
+		$Path=~s-^(.*)\/$-$1-o;
 	}
 	return wantarray ? @List : $List[0];
 }
@@ -313,7 +313,7 @@ sub Path_Quote ($) {
 	my @List=@_;
 	my $Path;
 	foreach $Path (@List) {
-		$Path=~s- -\\ -go;
+		$Path=~s- -\/ -go;
 	}
 	return wantarray ? @List : $List[0];
 }
@@ -321,12 +321,12 @@ sub Path_Quote ($) {
 
 BEGIN {
 # get the current working directory
-	$WorkPath=uc cwd;
-	$WorkPath=~s-/-\\-go; # separator from Perl 5.005_02+ is forward slash
+	$WorkPath=cwd;
+	$WorkPath=~s-/-\/-go; # separator from Perl 5.005_02+ is forward slash
 	$WorkPath=~s/^(.:)//o;    # remove drive letter
 	$Drive=$1;
-	$WorkPath=~s-^(.*[^\\])$-$1\\-o;        # ensure workpath ends with a backslash
-	@WorkPathList=&Path_Dirs(uc $WorkPath);
+	$WorkPath=~s-^(.*[^\/])$-$1\/-o;        # ensure workpath ends with a backslash
+	@WorkPathList=&Path_Dirs($WorkPath);
 }
 
 1;
diff --git a/perllib/args.pm b/perllib/args.pm
index c89d992..a546c77 100644
--- a/perllib/args.pm
+++ b/perllib/args.pm
@@ -685,7 +685,7 @@ sub AddArgsSpec($$$$$$)
 		}
 
     # add the given ArgSpec to the SpecArray under the name of the argument
-    $self->_iSpecArray->{$aName}= New CArgsSpec($aName, $aDefault, $aPattern, $aExclusions, $aMandatory, $aRepeatable);
+    $self->_iSpecArray->{$aName}= CArgsSpec->New($aName, $aDefault, $aPattern, $aExclusions, $aMandatory, $aRepeatable);
     }
 
 ################################################################################
diff --git a/perllib/devtools.pm b/perllib/devtools.pm
index dab30c1..ba90cab 100644
--- a/perllib/devtools.pm
+++ b/perllib/devtools.pm
@@ -251,7 +251,7 @@ sub ExtractFileName($)
 	{
 	my($fileName)=@_;
 
-	$fileName =~ s/.*[\\:]([^\\:]*$)/$1/;
+	$fileName =~ s/.*[\/:]([^\/:]*$)/$1/;
 
 	return $fileName;
 	}
@@ -309,7 +309,7 @@ sub ExtractPath($)
 	{
 	my($path)=@_;
 
-	$path =~ /(.*[\\:])[^\\:]*$/;
+	$path =~ /(.*[\/:])[^\/:]*$/;
 	$path=$1;
 
 	return $path;
diff --git a/perllib/params.pm b/perllib/params.pm
index 238a710..afee060 100644
--- a/perllib/params.pm
+++ b/perllib/params.pm
@@ -51,7 +51,7 @@ sub New
     bless $self, $class;
 
     # create a log object for this object
-    $self->_iLog(New CLog());
+    $self->_iLog(CLog->New());
 
     $self->_iParamsArray({});
     
@@ -111,7 +111,7 @@ sub AddParamItem($$$)
     if(!$self->Exists($aName))
 		{
 		# it has not been added create the ParamsEntry
-		my $paramsEntry = New CParamsEntry();
+		my $paramsEntry = CParamsEntry->New();
 		$self->_iParamsArray->{$aName} = $paramsEntry;
 		}
 
@@ -160,7 +160,7 @@ sub _ParamsEntry($)
     my $self = shift;
     my($aName) = @_;
 
-    my $result = New CParamsEntry();
+    my $result = CParamsEntry->New();
 
     #check that this parameter Entry exists
     if($self->Exists($aName))
@@ -192,7 +192,7 @@ sub ParamItem($$)
     my($aName, $aIndex) = @_;
 
     # make a new paramItem to use if there is not one in existance
-    my $result = New CParamItem(undef,undef,undef,New CParamsEntry());
+    my $result = CParamItem->New(undef,undef,undef,CParamsEntry->New());
     my $index = 0;
 
     # if an index is given take the Param Item with this index
@@ -390,7 +390,7 @@ sub New()
     bless $self, $class;
 
     # create a log object for this object
-    $self->_iLog(New CLog());
+    $self->_iLog(CLog->New());
 
     $self->_iParamItems([]);
     $self->_iDefaultParamItem(undef);
@@ -458,12 +458,12 @@ sub AddParamItem
     # check if the parameter item is the default
     if($aDefault)
 		{
-		$self->_iDefaultParamItem(New CParamItem($aName,$aValue,$aDefault,$self));
+		$self->_iDefaultParamItem(CParamItem->New($aName,$aValue,$aDefault,$self));
 		}
     else
 		{
 		#add the paramItem
-		push(@{$self->_iParamItems},New CParamItem($aName,$aValue,$aDefault,$self));
+		push(@{$self->_iParamItems},CParamItem->New($aName,$aValue,$aDefault,$self));
 		}
     }
 
@@ -717,7 +717,7 @@ sub New($$$$)
     bless $self, $class;
 
     # create a log object for this object
-    $self->_iLog(New CLog());
+    $self->_iLog(CLog->New());
 
     $self->_iName($aName);
     $self->_iValue($aValue);
@@ -1021,13 +1021,13 @@ sub TEST
     # argument spec to the array
     $self->_iLog->Log("Test 1 create a paramItem");
 
-    my $obj1 = New CParamItem("TestPara1", "Default value", 1, undef);
+    my $obj1 = CParamItem->New("TestPara1", "Default value", 1, undef);
 
     $self->_iLog->Log("Print the default value for this ParamItem (should be Default value)");
     $self->_iLog->Log("Default vlaue is ".$obj1->DefaultValue());
 
     $self->_iLog->Log("Test 2 create a non default paramitem");
-    $obj1 = New CParamItem("TestPara1", "Value", 0, undef);
+    $obj1 = CParamItem->New("TestPara1", "Value", 0, undef);
 
     $self->_iLog->Log("Print the default value for this ParamItem (should be undef)");
     $self->_iLog->Log("Default value is ".$obj1->DefaultValue());
diff --git a/perllib/xml/dom.pm b/perllib/xml/dom.pm
index de0b52d..d10f40c 100644
--- a/perllib/xml/dom.pm
+++ b/perllib/xml/dom.pm
@@ -50,7 +50,7 @@ use vars qw( $VERSION @ISA @EXPORT
 	     %DefaultEntities %DecodeDefaultEntity
 	   );
 use Carp;
-use XML::RegExp;
+use xml::regexp;
 
 BEGIN
 {
@@ -191,9 +191,16 @@ sub encodeText
     my ($str, $default) = @_;
     return undef unless defined $str;
     
-    $str =~ s/([\xC0-\xDF].|[\xE0-\xEF]..|[\xF0-\xFF]...)|([$default])|(]]>)/
-	defined($1) ? XmlUtf8Decode ($1) : 
-	defined ($2) ? $DecodeDefaultEntity{$2} : "]]&gt;" /egs;
+    if ($] >= 5.006) {
+      $str =~ s/([$default])|(]]>)/
+        defined ($1) ? $DecodeDefaultEntity{$1} : "]]&gt;" /egs;
+      $str =~ s/([^\x00-\x7F])/'&#' . ord($1) . ';'/gse;
+    }
+    else {
+      $str =~ s/([\xC0-\xDF].|[\xE0-\xEF]..|[\xF0-\xFF]...)|([$default])|(]]>)/
+        defined($1) ? XmlUtf8Decode ($1) :
+        defined ($2) ? $DecodeDefaultEntity{$2} : "]]&gt;" /egs;
+    }
 
 #?? could there be references that should not be expanded?
 # e.g. should not replace &#nn; &#xAF; and &abc;
diff --git a/petran b/petran
new file mode 100644
index 0000000..53108ab
--- /dev/null
+++ b/petran
@@ -0,0 +1,12 @@
+#! /bin/bash
+#
+# petran - bash frontend for petran.exe, part of GnuPoc project
+#
+# (c) 2001-2006 Alfred E. Heggestad
+#
+#    This program is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License version 2 as
+#    published by the Free Software Foundation.
+#
+
+wine $EPOCROOT/epoc32/tools/petran.exe "$@"
diff --git a/pfsdump b/pfsdump
new file mode 100644
index 0000000..e0f25e6
--- /dev/null
+++ b/pfsdump
@@ -0,0 +1,17 @@
+#!/bin/sh
+#
+# pfsdump - bash frontend for pfsdump.exe, part of GnuPoc project
+#
+# PFS = Permanent File Store
+#
+# (c) 2001-2006 Alfred E. Heggestad
+#
+#    This program is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License version 2 as
+#    published by the Free Software Foundation.
+#
+
+PGM=`basename $0`
+echo "executing $PGM.exe"
+ROOT=$EPOCROOT/epoc32/tools
+wine $ROOT/$PGM.exe "$@"
diff --git a/prepfile.pm b/prepfile.pm
index f2edaa6..70bcf92 100644
--- a/prepfile.pm
+++ b/prepfile.pm
@@ -7,7 +7,7 @@
 # module for preprocessing makmake-style project files
 
 
-package Prepfile;
+package prepfile;
 
 require Exporter;
 @ISA=qw(Exporter);
@@ -17,8 +17,8 @@ require Exporter;
 );
 
 
-use Checkgcc;
-use Pathutl;
+use checkgcc;
+use pathutl;
 
 my %Mode=(
 	Verbose=>0,
@@ -42,9 +42,9 @@ sub Prepfile_ProcessL ($$;$@) {
 	die "\nERROR: Project File \"$FILE\" not found\n" unless -e $FILE;
 
 	my @CppCall;
-	push @CppCall, 'CPP.EXE -undef -nostdinc -+ ';
+	push @CppCall, 'arm-epoc-pe-cpp -undef -nostdinc -+ ';
 
-	push @CppCall, join '',	"-I ",&Path_RltToWork("$ENV{EPOCROOT}epoc32\\include"),
+	push @CppCall, join '',	"-I ",&Path_RltToWork("$ENV{EPOCROOT}epoc32\/include"),
 							" -I .",
 							" -I ",&Path_Split('Path',&Path_RltToWork($FILE));
 
@@ -63,12 +63,15 @@ sub Prepfile_ProcessL ($$;$@) {
 	
 	# all macros made upper case and suppress user-expansion of macros for nefarious purposes
 
+	# gnupoc: platform macro
+	push @CppCall, "-D __SERIES60__=__SERIES60__";
+
 	push @CppCall, join '',"\"",&Path_RltToWork($FILE),"\"";
 	if ($Mode{'Verbose'}) {
 		print "@CppCall\n";
 	}
 	my $CPPPIPE;
-	open CPPPIPE,"@CppCall |" or die "ERROR: Can't invoke CPP.EXE\n";
+	open CPPPIPE,"@CppCall |" or die "ERROR: Can't invoke CPP\n";
 
 	# read the processed output
 	#--------------------------
@@ -85,14 +88,13 @@ sub Prepfile_ProcessL ($$;$@) {
 
 		my @Tmp=();
 
-	    # Process the file information lines that cpp inserts.
+	        # Process the file information lines that cpp inserts.
 		# (note that we don't currently do anything with the
 		# number cpp sometimes puts out after the filename -
 		# it's something to do with inclusion nesting levels)
 		if (/^# (\d+) "(.*)"( \d+)?/o) {
 			$LineNum = scalar $1;
 			my $CurFile=$2;
-			$CurFile=~s-\\\\-\\-go;
 			$CurFile=&Path_AbsToWork($CurFile);
 			@Tmp=('#', $CurFile);
 			push @{$ArrayRef}, [ @Tmp ];
@@ -124,8 +126,8 @@ sub Prepfile_ProcessL ($$;$@) {
 		}
 	}
 
-	close CPPPIPE or die $! ? "ERROR: Error closing CPP.EXE pipe ($!)\n\t@CppCall\n"
-				: "ERROR: CPP.EXE returned non-zero exit status ($?)\n\t@CppCall\n";
+	close CPPPIPE or die $! ? "ERROR: Error closing CPP pipe ($!)\n\t@CppCall\n"
+				: "ERROR: CPP returned non-zero exit status ($?)\n\t@CppCall\n";
 }
 
 1;
diff --git a/rcomp b/rcomp
new file mode 100644
index 0000000..345a4ce
--- /dev/null
+++ b/rcomp
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# rcomp - bash frontend for rcomp.exe, part of GnuPoc project
+#
+# (c) 2001 Alfred E. Heggestad
+#
+#    This program is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License version 2 as
+#    published by the Free Software Foundation.
+#
+
+PGM=`basename $0`
+echo "executing $PGM.exe"
+ROOT=$EPOCROOT/epoc32/tools
+wine $ROOT/$PGM.exe "$@"
diff --git a/rtf2ptml b/rtf2ptml
new file mode 100644
index 0000000..fa2b4bf
--- /dev/null
+++ b/rtf2ptml
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# rtf2ptml - bash frontend for rtf2ptml.exe, part of GnuPoc project
+#
+# (c) 2001 Alfred E. Heggestad
+#
+#    This program is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License version 2 as
+#    published by the Free Software Foundation.
+#
+
+PGM=`basename $0`
+echo "executing $PGM.exe"
+ROOT=$EPOCROOT/epoc32/tools
+wine $ROOT/$PGM.exe "$@"
diff --git a/scanlog.pl b/scanlog.pl
index 360e643..9e7a5f4 100644
--- a/scanlog.pl
+++ b/scanlog.pl
@@ -12,7 +12,7 @@ use FindBin;		# for FindBin::Bin
 # Add the directory contain this perl script into the path to find modules
 use lib $FindBin::Bin;
 
-use Scanlog;
+use scanlog;
 
 my $line;
 my $phase;
diff --git a/setupcomms b/setupcomms
new file mode 100644
index 0000000..7e0d917
--- /dev/null
+++ b/setupcomms
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# setupcomms - bash interface for setupcomms.pl, part of GnuPoc project
+#
+# (c) 2002 Alfred E. Heggestad
+#
+#    This program is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License version 2 as
+#    published by the Free Software Foundation.
+#
+
+perl -S setupcomms.pl "$@"
diff --git a/trgtype.pm b/trgtype.pm
index 6f7f43c..a0202e8 100644
--- a/trgtype.pm
+++ b/trgtype.pm
@@ -10,7 +10,7 @@
 # Look at the existing types for an appropriate example
 #
 
-package Trgtype;
+package trgtype;
 
 require Exporter;
 @ISA=qw(Exporter);
@@ -19,7 +19,7 @@ require Exporter;
 	Trg_List
 );
 
-use Genutl;
+use genutl;
 
 my %Types=(
 	ANI=>{
@@ -87,11 +87,11 @@ my %Types=(
 		Basic=>'IMPLIB',
 	},
 	KDLL=>{
-		FirstLib=>'EDEV.LIB',
+		FirstLib=>'edev.lib',
 		Kernel=>1,
 	},
 	KEXT=>{
-		FirstLib=>'EEXT.LIB',
+		FirstLib=>'eext.lib',
 		Kernel=>1,
 	},
 	KLIB=>{
@@ -99,7 +99,7 @@ my %Types=(
 		Kernel=>1,
 	},
 	LDD=>{
-		FirstLib=>'EDEV.LIB',
+		FirstLib=>'edev.lib',
 		Kernel=>1,
 		'Exports'=>{
 			MARM=>['CreateLogicalDevice__Fv'],
@@ -115,7 +115,7 @@ my %Types=(
 			MARM=>['ImplementationGroupProxy__FRi'],
 			WINS=>['?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z'],
 		},
-		Path=>'System\Libs\Plugins',
+		Path=>'system/libs/plugins',
 		UID2=>'0x10009D8D',
 	},
 	MDA=>{
@@ -137,7 +137,7 @@ my %Types=(
 			MARM=>['NotifierArray__Fv'],
 			WINS=>['?NotifierArray@@YAPAV?$CArrayPtr@VMEikSrvNotifierBase@@@@XZ'],
 		},
-		Path=>'System\Notifiers',
+		Path=>'system/notifiers',
 		UID2=>'0x10005522',
 	},
 	NOTIFIER2=>{
@@ -145,7 +145,7 @@ my %Types=(
 			MARM=>['NotifierArray__Fv'],
 			WINS=>['?NotifierArray@@YAPAV?$CArrayPtr@VMEikSrvNotifierBase2@@@@XZ'],
 		},
-		Path=>'System\Notifiers',
+		Path=>'system/notifiers',
 		UID2=>'0x101fdfae',
 	},
 	TEXTNOTIFIER2=>{
@@ -153,7 +153,7 @@ my %Types=(
 			MARM=>['NotifierArray__Fv'],
 			WINS=>['?NotifierArray@@YAPAV?$CArrayPtr@VMNotifierBase2@@@@XZ'],
 		},
-		Path=>'System\Notifiers',
+		Path=>'system/notifiers',
 		UID2=>'0x101fe38b',
 	},
 	OPX=>{
@@ -164,7 +164,7 @@ my %Types=(
 		UID2=>'0x10003a7b',
 	},
 	PDD=>{
-		FirstLib=>'EDEV.LIB',
+		FirstLib=>'edev.lib',
 		Kernel=>1,
 		'Exports'=>{
 			MARM=>['CreatePhysicalDevice__Fv'],
@@ -190,7 +190,7 @@ my %Types=(
 		'Exports'=>{
 			MARM=>['VariantInitialise__Fv'],
 		},
-		FirstLib=>'EVAR.LIB',
+		FirstLib=>'evar.lib',
 		Kernel=>1,
 	},
 	WLOG=>{
@@ -270,7 +270,7 @@ sub Trg_GetL ($$$) {
 		# apply terminating backslash
 		$TrgHash{Path}=~s-^(.*[^\\])$-$1\\-o;
 		# apply Z drive
-		$TrgHash{Path}="Z\\$TrgHash{Path}";
+		$TrgHash{Path}="z/$TrgHash{Path}";
 	}
 
 	unless ($TrgHash{UID2}) {
diff --git a/winutl.pm b/winutl.pm
index c2fb901..3f05f32 100644
--- a/winutl.pm
+++ b/winutl.pm
@@ -6,7 +6,7 @@
 
 # this package does various ancillary things for windows modules
 
-package Winutl;
+package winutl;
 
 my $BaseAddress='';
 my @Win32LibList=();
@@ -48,7 +48,7 @@ sub Winutl_DoMmp ($$) {
 	my $Plat=&main::Plat;
 	if ($Plat ne "WINSCW") {
 #	check that we're using VC6 SP3
-		open PIPE, "LINK.EXE |" or die "ERROR: Can't invoke LINK.EXE\n";
+		open PIPE, "wine LINK.EXE |" or die "ERROR: Can't invoke LINK.EXE\n";
 		my $DoneCheck=0;
 		while (<PIPE>) {
 			unless ($DoneCheck) {
@@ -138,7 +138,7 @@ sub Winutl_DoMmp ($$) {
 		my $UidText=join(
 			"\n",
 			'// Makmake-generated uid source file',
-			'#include <E32STD.H>',
+			'#include <e32std.h>',
 			'#pragma data_seg(".E32_UID")',
 			'__WINS_UID('
 		);
@@ -150,7 +150,7 @@ sub Winutl_DoMmp ($$) {
 		$UidText.="#pragma data_seg()\n";
 # tools hack
 		unless (&main::Plat eq 'TOOLS' || &main::Plat eq 'CWTOOLS') {
-			&main::AddSrc("$MakeFilePath$BaseTrg.UID.CPP", $UidText);
+			&main::AddSrc("$MakeFilePath$BaseTrg.uid.cpp", $UidText);
 		};
 # tools hack end
 	}
