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 f4707a4..e3e7116 100644
--- a/abld.pl
+++ b/abld.pl
@@ -1,3 +1,5 @@
+#!/usr/bin/perl -w
+#
 # ABLD.PL
 #
 # Copyright (c) 1997-2006 Symbian Software Ltd.  All rights reserved.
@@ -14,13 +16,12 @@ 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 CheckSource;
+use e32env;
+use checksource;
 
 # command data structure
 my %Commands=(
@@ -70,7 +71,7 @@ my %Commands=(
 	FREEZE=>{
 		program=>1,
 		remove=>1,
-		function=>'Freezes exported functions in a .DEF file',
+		function=>'Freezes exported functions in a .def file',
 	},
 	HELP=>{
 		noplatform=>1,
@@ -79,7 +80,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,
@@ -147,10 +148,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";
 	}
@@ -158,12 +159,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.
@@ -286,12 +287,12 @@ 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;
 				}
 				if ($Plat =~ /(.*)EDG$/) {
 				    my $SubPlat = $1;
-				    if (grep(/^$SubPlat$/, ('ALL', @Platform::Plats))) {
+				    if (grep(/^$SubPlat$/, ('ALL', @platform::Plats))) {
 					last COMPARAM1;
 				    }
 				}
@@ -307,8 +308,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';
@@ -352,8 +353,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;
@@ -383,13 +384,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";
@@ -438,7 +439,7 @@ chdir($BldInfDir) or die "ABLD ERROR: Can't CD to \"$BldInfDir\"\n";
 	my @Plats;
 	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{MWSym2Libraries});
 			@Plats=grep !/WINS$/o, @Plats unless (defined $ENV{MSDevDir});
@@ -460,8 +461,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;
@@ -473,7 +475,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}};
 			}
 		}
 	}
@@ -526,15 +528,18 @@ 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 {checksource}) {
 			unless ($Options{what} or $Options{check}) {
-				push @Calls, "make -r $KeepgoingFlag -f \"${PrjBldDir}EXPORT$Test.make\" $Command$VerboseMacro$KeepgoingMacro";
+#				my $Command2 = uc $Command;
+#				my $lc_command = lc $Command;
+				my $Command2 = $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;
@@ -545,7 +550,7 @@ chdir($BldInfDir) or die "ABLD ERROR: Can't CD to \"$BldInfDir\"\n";
 	COMMAND: foreach $Command (@Commands) {
 
 		if ($Options {checksource} && $Command eq "TARGET") {
-			push @Calls, "make -r -f \"".$PrjBldDir."EXPORT.make\" CHECKSOURCE";
+			push @Calls, "make -r -f \"".$PrjBldDir."export.make\" CHECKSOURCE";
 		}
 
 		my $Plat;
@@ -575,7 +580,8 @@ chdir($BldInfDir) or die "ABLD ERROR: Can't CD to \"$BldInfDir\"\n";
 
 			# You get CHECKSOURCE_GENERIC "for free" if no component is specified in the call
 			if ($Options {checksource} && $Command eq "TARGET" && $Program) {
-					push @Calls, "make -r -f \"$PrjBldDir$Plat$Test.make\" CHECKSOURCE_GENERIC";
+					my $lcplat = lc $Plat;
+					push @Calls, "make -r -f \"$PrjBldDir$lcplat$Test.make\" CHECKSOURCE_GENERIC";
 			}
 
 			my $LoopBld;
@@ -586,7 +592,8 @@ chdir($BldInfDir) or die "ABLD ERROR: Can't CD to \"$BldInfDir\"\n";
 				}
 				if ($Options {checksource}) {
 					if ($Command eq "TARGET") {
-						push @Calls, "make -r -f \"$PrjBldDir$Plat$Test.make\" CHECKSOURCE$Program$CFG";
+						my $lcplat = lc $Plat;
+						push @Calls, "make -r -f \"$PrjBldDir$lcplat$Test.make\" CHECKSOURCE$Program$CFG";
 					}
 					next;
 				}
@@ -594,12 +601,12 @@ 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;
 							}
 						}
@@ -610,7 +617,8 @@ chdir($BldInfDir) or die "ABLD ERROR: Can't CD to \"$BldInfDir\"\n";
                         $AbldFlagsMacroTmp=$AbldFlagsMacro;
 					}
 
-                    push @Calls, "make -r $KeepgoingFlag -f \"$PrjBldDir$Plat$Test.make\" $Command$Program$CFG$Source$VerboseMacro$KeepgoingMacro$RemoveMacro$NoDependencyMacro$AbldFlagsMacroTmp";					
+					my $lcplat = lc $Plat;
+					push @Calls, "make -r $KeepgoingFlag -f \"$PrjBldDir$lcplat$Test.make\" $Command$Program$CFG$Source$VerboseMacro$KeepgoingMacro$RemoveMacro$NoDependencyMacro$AbldFlagsMacroTmp";					
 					next;
 				}
 
@@ -619,21 +627,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";
 			}
 		}
 	}
@@ -704,7 +713,7 @@ ENDHERESTRING
 
 	print
 		"project platforms:\n",
-		"   @Platform::Plats\n"
+		"   @platform::Plats\n"
 	;
 	exit 1;
 }
@@ -734,7 +743,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..5d2ae14
--- /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-none-symbianelf-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/armutl.pm b/armutl.pm
index f3b694d..e735a21 100644
--- a/armutl.pm
+++ b/armutl.pm
@@ -6,7 +6,7 @@
 
 # this package does various ancillary things for armedg modules
 
-package Armutl;
+package armutl;
 
 require Exporter;
 @ISA=qw(Exporter);
@@ -47,7 +47,7 @@ sub InitVersionInfo (){
 		return $ENV{ARMV5VER};
 	} 
 	else{
-		open ARMCCPIPE, "armcc 2>&1 |";
+		open ARMCCPIPE, "armcc 2>&1 |" or return "";
 		# Read all output from armcc into array
 		my @lines=<ARMCCPIPE>;
 		chomp @lines;
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 bd4ba9e..31a278d 100644
--- a/bldmake.pl
+++ b/bldmake.pl
@@ -1,3 +1,5 @@
+#!/usr/bin/perl -w
+#
 # BLDMAKE.PL
 #
 # Copyright (c) 1997-2006 Symbian Software Ltd.  All rights reserved.
@@ -19,22 +21,21 @@ 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 .= "/";
 }
 sub ExportDirs ($);
 
 use lib $PerlLibPath;
-use E32env;
-use E32Plat;
-use Modload;
-use Output;
-use Pathutl;
-use E32Variant;
-use Armutl;
-use BPABIutl;
+use e32env;
+use e32plat;
+use modload;
+use output;
+use pathutl;
+use e32variant;
+use armutl;
+use bpabiutl;
 use wrappermakefile;
-use CheckSource;
+use checksource;
 use File::Path; # for rmtree
 
 my %Options;
@@ -110,7 +111,7 @@ sub ExportDirs ($);
 			);
 		}
 		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;
@@ -125,24 +126,24 @@ sub ExportDirs ($);
 	}
 
 
-#	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 = pop @Dirs;
 	if (lc($Module) eq 'group') {
@@ -162,18 +163,18 @@ sub ExportDirs ($);
 		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{EPOCDataPath});
+		$e32env::Data{EPOCIncPath}, $e32env::Data{EPOCPath}, $e32env::Data{EPOCDataPath});
 
 #       Add Customizations
 	my @additions;
@@ -246,7 +247,7 @@ if (0) {
 
 	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};
@@ -256,20 +257,20 @@ if (0) {
 	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;
 	
 	if ($Options{v} and $CLPlat ne 'ALL'){
-		print "Reading \"${BldInfPath}BLD.INF\" for $CLPlat \n";
+		print "Reading \"${BldInfPath}bld.inf\" for $CLPlat \n";
 	}
 
 	foreach $Plat (@RealPlats) {
 		if ($Options{v}) {
 			if ($CLPlat eq 'ALL') {
-				print "Reading \"${BldInfPath}BLD.INF\" for $Plat\n";
+				print "Reading \"${BldInfPath}bld.inf\" for $Plat\n";
 			}
 		}
 		my (@PlatData, @PlatTestData);
@@ -299,43 +300,45 @@ if (0) {
 			}
 		}
 
-#		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 my $copyofPlat (@DoPlats) {  # Do not use $_ here !!
 			if ($Options{v}) {
-				print "Creating \"$OutDir$copyofPlat.MAKE\"\n";
+				my $tmp = lc $copyofPlat;
+				print "Creating \"$OutDir$tmp.make\"\n";
 			}
 			my $realplat = $Real{$copyofPlat};
-			&CreatePlatMak($OutDir, $E32env::Data{BldPath}, $AllPlatData{$realplat}, $copyofPlat, $realplat, $RomDir, $Module, $BldInfPath, \@Exports, '');
+			&CreatePlatMak($OutDir, $e32env::Data{BldPath}, $AllPlatData{$realplat}, $copyofPlat, $realplat, $RomDir, $Module, $BldInfPath, \@Exports, '');
 		}
 		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, \@TestExports, 'TEST');
+			&CreatePlatMak($OutDir, $e32env::Data{BldPath}, $AllPlatTestData{$Real{$_}}, $_, $Real{$_}, $RomDir, $Module, $BldInfPath, \@TestExports, 'TEST');
 		}
 
 #		create the platform test batch files
@@ -349,7 +352,7 @@ if (0) {
 #		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
 			    ;
 		}
@@ -369,7 +372,7 @@ if (0) {
 
 sub Usage () {
 
-	eval { &Load_ModuleL('E32TPVER'); };
+	eval { &Load_ModuleL('e32tpver'); };
 	&FatalError($@) if $@;
 
 	print
@@ -381,7 +384,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",
@@ -398,7 +401,7 @@ sub ShowBldInfSyntax () {
 
 	print <<ENDHERE1;
 
-BLD.INF - Syntax
+bld.inf - Syntax
 
 /* Use C++ comments if required */
 // (Curly braces denote optional arguments)
@@ -420,7 +423,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>] {<qualifiers>}
@@ -457,7 +460,7 @@ sub ParseBldInf ($$$$$) {
 	my ($PlatsRef, $ExportsRef, $TestExportsRef, $BldInfPath, $EPOCIncPath, $EPOCPath, $EPOCDataPath)=@_;
 
 	my @Prj2D;
-	eval { &Prepfile_ProcessL(\@Prj2D, "${BldInfPath}BLD.INF",$variantMacroHRHFile); };
+	eval { &Prepfile_ProcessL(\@Prj2D, "${BldInfPath}bld.inf",$variantMacroHRHFile); };
 	&FatalError($@) if $@;
 	
 	my @SupportedPlats=&Plat_List();
@@ -472,10 +475,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;
@@ -504,13 +508,13 @@ sub ParseBldInf ($$$$$) {
 			unshift @$Line, $_;
 			my $Candidate;
 			CANDLOOP: foreach $Candidate (@$Line) {
-				$Candidate=uc $Candidate;
+				$Candidate=lc $Candidate;
 #				ignore old WINC target
-				if ($Candidate eq 'WINC') {
+				if ($Candidate eq 'winc') {
 					next CANDLOOP;
 				}
 #				expand DEFAULT
-				if ($Candidate eq 'DEFAULT') {
+				if ($Candidate eq 'default') {
 					$DefaultPlatsUsed=1;
 					my $Default;
 					foreach $Default (@DefaultPlats) {
@@ -522,7 +526,7 @@ sub ParseBldInf ($$$$$) {
 					next CANDLOOP;
 				}
 #				expand BASEDEFAULT
-				if ($Candidate eq 'BASEDEFAULT') {
+				if ($Candidate eq 'basedefault') {
 					$DefaultPlatsUsed=1;
 					my $Default;
 					foreach $Default (@BaseDefaultPlats) {
@@ -550,7 +554,7 @@ sub ParseBldInf ($$$$$) {
 						push @Plats, 'CWTOOLS';
 						}
 #				check platform is supported
-				unless (grep /^$Candidate$/, @SupportedPlats) {
+				unless (grep /^$Candidate$/i, @SupportedPlats) {
 					WarnOrDie(\@PrjFileDie, "$CurFile($LineNum) : Unsupported platform $Candidate specified\n");
 					next CANDLOOP;
 				}
@@ -561,7 +565,7 @@ sub ParseBldInf ($$$$$) {
 				}
 #				add the platform
 				unless ($PlatformCheck{$Candidate}) {
-					push @Plats, $Candidate;
+					push @Plats, uc $Candidate;
 					my $SubPlat = sprintf("%sEDG", $Candidate);
 					push @Plats, $SubPlat 
 					    if (grep /^$SubPlat$/, @SupportedPlats);
@@ -597,10 +601,11 @@ sub ParseBldInf ($$$$$) {
 			if (@$Line) {
 #				get the destination file if it's specified
 				$Releasable=shift @$Line;
+				$Releasable=~s/\\/\//g;      # force to forward slash
 				CheckSource_CaseAndDelimiter($CurFile, $Releasable, $LineNum, %CheckSourceEXPORTSWarnings);
 				$Releasable = &Path_Norm ($Releasable);
-				$emReleasable=ucfirst $Releasable;
-				if ($emReleasable=~/^([A-Z]):(\\.*)$/)  {
+				$emReleasable=$Releasable;
+				if ($emReleasable=~/^([A-Z]):(\/.*)$/i)  {
 				  	$emReleasable=~s/://;
 					$Releasable=$EPOCDataPath.$emReleasable;
 				}
@@ -664,7 +669,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;
@@ -721,18 +726,18 @@ 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 $@;
 
 	my %dummy;
-	$CheckSourceBldInfIncludeValidation{$Plat} = CheckSource_Includes("${BldInfPath}BLD.INF", %dummy, $variantMacroHRHFile, @{$Plat{MmpMacros}});
+	$CheckSourceBldInfIncludeValidation{$Plat} = CheckSource_Includes("${BldInfPath}bld.inf", %dummy, $variantMacroHRHFile, @{$Plat{MmpMacros}});
 	
 #	process the raw data
 	my $IsExtensionBlock =0;
@@ -741,7 +746,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;
@@ -755,13 +760,11 @@ sub ParseBldInfPlat ($$$$) {
 
 		$CurFile = &Path_Norm ($CurFile);
 		
-#		upper-case all the data here, but record original source case
-#		in a hash so that it can be recalled for CheckSource purposes
+#		don't upper-case any data here
 
 		my %originalSourceCase;
    		foreach (@$Line) {
- 			$originalSourceCase{uc $_} = $_;  # needed for extension template makefile MACROs 
-   			$_=uc $_;
+ 			$originalSourceCase{$_} = $_;  # needed for extension template makefile MACROs 
    		}
 
 		$_=shift @$Line;
@@ -769,8 +772,8 @@ sub ParseBldInfPlat ($$$$) {
 #		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;
 		}
 
@@ -811,7 +814,7 @@ sub ParseBldInfPlat ($$$$) {
 					&FatalError("$CurFile($LineNum) : No 'start' corresponding to this 'end' in Extension Template section\n"); 
 				}
 				$IsExtensionBlock =0;
-				my $OutDir=Path_Chop($E32env::Data{BldPath}).$BldInfPath;
+				my $OutDir=Path_Chop($e32env::Data{BldPath}).$BldInfPath;
 #				Generate wrapper makefile for this platform.
 				eval { &Load_ModuleL('WrapperMakefile'); };
 					&FatalError($@) if $@;
@@ -824,21 +827,21 @@ sub ParseBldInfPlat ($$$$) {
 			}
 		}
 
-#		check for MMP sections and get the .MMP file details
+#		check for MMP sections 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;
 				$_=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', $_);
@@ -850,7 +853,7 @@ sub ParseBldInfPlat ($$$$) {
 #			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', $_);
 			my $MmpFile= $Data{Path}.$Data{Base};
    
@@ -861,6 +864,8 @@ sub ParseBldInfPlat ($$$$) {
    			}
   			$Check{$MmpFile}="$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");
@@ -871,6 +876,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;
@@ -883,11 +889,11 @@ sub ParseBldInfPlat ($$$$) {
 					  next;
 					}
 
-					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) {
@@ -909,7 +915,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";
 				}
 			}
 		}		
@@ -930,7 +936,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;
@@ -965,12 +971,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",
@@ -1041,8 +1049,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 ($) {
@@ -1113,10 +1121,9 @@ sub GetArchiveExportList($) {
 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",
@@ -1147,7 +1154,7 @@ sub CreateExportMak ($$$) {
 	else {
 		&Output(
 			" \n",
-			"\t\@echo Nothing to do\n"
+#			"\t\@echo Nothing to do\n"
 		);
 	}
 	&Output(
@@ -1201,7 +1208,7 @@ sub CreateExportMak ($$$) {
 			my $src=&Path_Quote($$ref{Source});
 			&Output(
 				"$dst : $src\n",
-					"\tcopy \"\$?\" \"\$\@\"\n",
+					"\tcp \"\$?\" \"\$\@\"\n",
 				"\n"
 			);
 		}
@@ -1258,9 +1265,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"
 		);
 	}
 
@@ -1465,7 +1472,7 @@ sub CreatePlatMak ($$$$$$$$$) {
 		$Test='';
 	}
 	else {
-		$Test='TEST';
+		$Test='test';
 	}
 
 	my $Ref;
@@ -1480,11 +1487,9 @@ sub CreatePlatMak ($$$$$$$$$) {
 	} 
 
 
-	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";
 
 # The BPABI top level makefiles should include the compiler configuration files
 	if (grep /^$Plat$/i, @BPABIPlats) {
@@ -1496,18 +1501,11 @@ sub CreatePlatMak ($$$$$$$$$) {
 		);
 	}
 
-	if ($ENV{'PATH'} !~ m/[a-zA-z]{1}:{1}.[^;]*epoc32\\gcc\\bin/i) {	
-		&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"
-			);
-	}
-
 	&Output(		
-		"\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",
@@ -1576,7 +1574,7 @@ sub CreatePlatMak ($$$$$$$$$) {
 	if ($whatcount==0 and !$eDrive) {
 		&Output(
 			"\n",
-			"\t\@rem do nothing\n" 
+#			"\t\@rem do nothing\n" 
 		);
 	}
 
@@ -1587,7 +1585,7 @@ sub CreatePlatMak ($$$$$$$$$) {
 	);
 	my $CheckSource=' CHECKSOURCE_GENERIC';
 	foreach $Ref (@$DataRef) {
-		$CheckSource.=" CHECKSOURCE$$Ref{Base}" if ($$Ref{Ext} eq ".MMP");
+		$CheckSource.=" CHECKSOURCE$$Ref{Base}" if ($$Ref{Ext} eq ".mmp");
 	}
 	&Output(
 		"$CheckSource\n"
@@ -1624,7 +1622,7 @@ sub CreatePlatMak ($$$$$$$$$) {
 	else {
 		&Output(
 			"\n",
-			"\t\@echo Nothing to do\n"
+#			"\t\@echo Nothing to do\n"
 		);
 	}
 	&Output(
@@ -1693,8 +1691,8 @@ sub CreatePlatMak ($$$$$$$$$) {
 
 #		standard commands
 		unless ($$Ref{Makefile}) {
-			my $MakefilePath=join('', &Path_Chop($E32MakePath), $BldInfPath, $$Ref{Base}, "\\", $RealPlat, "\\");
-			my $RealMakefile="-f \"$MakefilePath$$Ref{Base}.$RealPlat\"";
+			my $MakefilePath=join('', &Path_Chop($E32MakePath), $BldInfPath, $$Ref{Base}, "/", lc $RealPlat, "/");
+			my $RealMakefile="-f \"$MakefilePath$$Ref{Base}." . lc $RealPlat . "\"";
 			my $MakefileBase="$MakefilePath$$Ref{Base}";		
 
 			if($Plat eq 'VS6' || $Plat eq 'VS2003')
@@ -1720,7 +1718,7 @@ sub CreatePlatMak ($$$$$$$$$) {
 			}
 			if ($RealPlat=~/^(WINS|WINSCW|WINC)$/o) {
 				&Output(
-					" \\\n\t\"$MakefileBase.UID.CPP\""	# BUG: actually uses $BaseTrg, not mmp file name
+					" \\\n\t\"$MakefileBase.uid.cpp\""	# BUG: actually uses $BaseTrg, not mmp file name
 				);
 			}
 			
@@ -1754,7 +1752,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(CLEANALL)) {
@@ -1821,16 +1819,31 @@ 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 MAKE=extmake";
 			}
-			$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}));
+			my $epocbld = join('', &Path_Chop(&Path_UpToRoot($$Ref{Path})), &Path_Chop($E32MakePath), $BldInfPath, $$Ref{Base}, "/", lc $RealPlat);
+			my $to_bldinf = join('', &Path_Chop(&Path_UpToRoot($$Ref{Path})), $ChopBldInfPath);
+			$makefile =~ s/\//\\\\/g;
+			$to_root =~ s/\//\\\\/g;
+			$epocbld =~ s/\//\\\\/g;
+			$to_bldinf =~ s/\//\\\\/g;
+			$MakefileCall.=" -f \"$makefile\" TO_ROOT=";
+			$MakefileCall.=$to_root;
 			$MakefileCall.=" EPOCBLD=";
-			$MakefileCall.=join('', &Path_Chop(&Path_UpToRoot($$Ref{Path})), &Path_Chop($E32MakePath), $BldInfPath, $$Ref{Base}, "\\", $RealPlat);
+			$MakefileCall.=$epocbld;
 			$MakefileCall.=" TO_BLDINF=";
-			$MakefileCall.=join('', &Path_Chop(&Path_UpToRoot($$Ref{Path})), $ChopBldInfPath);
+			$MakefileCall.=$to_bldinf;
 			if ($$Ref{ExtensionRoot}) {
-				$MakefileCall.=" EXTENSION_ROOT=".&Path_Chop($$Ref{ExtensionRoot});
+				my $extroot = &Path_Chop($$Ref{ExtensionRoot});
+				$extroot =~ s/\//\\\\/g;
+				$MakefileCall.=" EXTENSION_ROOT=".$extroot;
 			}
 			if ($$Ref{BuildAsARM}) {
 			  $MakefileCall.=" BUILD_AS_ARM=1";
@@ -1908,8 +1921,9 @@ sub CreatePlatMak ($$$$$$$$$) {
 		}
 
 	}
-	
-	&WriteOutFileL("$BatchPath$Plat$Test.MAKE");
+
+	$Plat = lc $Plat;
+	&WriteOutFileL("$BatchPath$Plat$Test.make");
 }
 
 sub CreatePlatBatches ($$$) {
@@ -1950,7 +1964,7 @@ sub CreatePlatBatches ($$$) {
 sub WriteOutFileL ($$) { # takes batch file and boolean read-only flag
 	my ($BATFILE, $ReadOnly)=@_;
 
-	$BATFILE=~ s/\//\\/g;  # convert unix slashes from wrappermakefile.pm
+	$BATFILE=~ s/\\/\//g;  # convert unix slashes from wrappermakefile.pm
 
 	eval { &Path_MakePathL($BATFILE); };
 	&FatalError($@) if $@;
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/bpabiutl.pm b/bpabiutl.pm
index 498500b..bcd7c13 100644
--- a/bpabiutl.pm
+++ b/bpabiutl.pm
@@ -6,7 +6,7 @@
 
 # This package  does various ancillary things for BPABI (Base Platform ABI) platforms
 
-package BPABIutl;
+package bpabiutl;
 
 require Exporter;
 @ISA=qw(Exporter);
@@ -22,17 +22,17 @@ sub BPABIutl_Plat_List {
 
 # Identify the BPABI platforms to be supported based on the compiler configuration files
 # present in the location specified by the environment variable "SYMBIAN_COMPILATION_CONFIG_DIR"
-# and in the directory $EPOCROOT\epoc32\tools\compilation_config
+# and in the directory $EPOCROOT/epoc32/tools/compilation_config
 
 	my @CompilerConfigPath;
 
 	if (exists($ENV{'SYMBIAN_COMPILATION_CONFIG_DIR'})) 
 	{
 		my $Path = $ENV{SYMBIAN_COMPILATION_CONFIG_DIR};
-		@CompilerConfigPath = split(/;/, $Path);
+		@CompilerConfigPath = split(/:/, $Path);
 	}
 
-	push @CompilerConfigPath, "$ENV{EPOCROOT}epoc32\\tools\\compilation_config\\";
+	push @CompilerConfigPath, "$ENV{EPOCROOT}epoc32/tools/compilation_config/";
 
 	my $ConfigDir;
 	my @BPABIPlats;
@@ -48,9 +48,9 @@ sub BPABIutl_Plat_List {
 # with the suffix '.mk' removed
 			$Plat =~ s/\.mk//;
 			unless (grep /$Plat$/i, @BPABIPlats) {
-				$Plat = uc $Plat;
-				push @BPABIPlats, $Plat;
-				$ConfigPath{$Plat} = "$ConfigDir\\$Plat.mk";
+				$Plat = lc $Plat;
+				push @BPABIPlats, uc $Plat;
+				$ConfigPath{$Plat} = "$ConfigDir/$Plat.mk";
 			}
 		}
 	}
@@ -66,7 +66,8 @@ sub BPABIutl_Config_Path($) {
 	    # Running for first time so initialise ConfigPath
 	    BPABIutl_Plat_List();
 	}
-	return "$ConfigPath{$plat}";
+	my $lc_plat = lc $plat;
+	return "$ConfigPath{$lc_plat}";
 }
 
 # routine to extract a set of variables from the compilation configuration
@@ -76,7 +77,7 @@ sub BPABIutl_Get_Config_Variables
 {
     my ($plat) = @_;
     my $configfile = BPABIutl_Config_Path($plat);
-    my $extractvars = "$ENV{EPOCROOT}epoc32\\tools\\compilation_config\\extractvars.make";
+    my $extractvars = "$ENV{EPOCROOT}epoc32/tools/compilation_config/extractvars.make";
     my $command = "make CONFIG_FILE=$configfile -s -f $extractvars" ;
     my $result = `$command`;
     my %vars;
diff --git a/checkgcc.pm b/checkgcc.pm
index e3ace58..2309267 100644
--- a/checkgcc.pm
+++ b/checkgcc.pm
@@ -1,3 +1,5 @@
+#!/usr/bin/perl -w
+#
 # CHECKGCC.PM
 #
 # Copyright (c) 1997-2004 Symbian Ltd.  All rights reserved.
@@ -6,25 +8,24 @@
 
 # module for checking gcc is set up correctly
 
-package CheckGcc;
+package checkgcc;
 
-use Preprocessor;
+use preprocessor;
 
 
 sub CheckGcc_Default()
 {
- 	# die if CPP.EXE (or whatever) in a dodgy place in the path
-	my @Paths=split ';', $ENV{Path};
+ 	# die if CPP (or whatever) 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-none-symbianelf-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/checksource.pl b/checksource.pl
index bd8b588..9b2871e 100644
--- a/checksource.pl
+++ b/checksource.pl
@@ -9,10 +9,10 @@ use FindBin;
 use Cwd;
 use Getopt::Long;
 use lib $FindBin::Bin;
-use CheckSource;
-use Pathutl;
+use checksource;
+use pathutl;
 
-my $preprocessCall = "cpp.exe -w -undef -nostdinc -+ -dI";
+my $preprocessCall = "arm-none-symbianelf-cpp -w -undef -nostdinc -x c++ -dI";
 
 
 my $preprocess = 0;
diff --git a/checksource.pm b/checksource.pm
index 9b8c844..4795ae8 100644
--- a/checksource.pm
+++ b/checksource.pm
@@ -6,7 +6,7 @@
 # Routines involved in checking that source matches Symbian's filename policy
 
 
-package CheckSource;
+package checksource;
 
 require Exporter;
 @ISA=qw(Exporter);
@@ -18,7 +18,7 @@ require Exporter;
 );
 
 use Cwd;
-use Pathutl;
+use pathutl;
 
 my $warningTitle = "Incorrect ";
 my $warningPrefix = "\@echo ";
@@ -35,7 +35,7 @@ sub CheckSource_CaseAndDelimiter($$$\%;$)
 
 	return "." if (!$case && !$delimiter);
 
-	$sourceFile =~ s/\//\\/g;
+	$sourceFile =~ s/\\/\//g;
 	$sourceFile =~ s/^[a-zA-Z]{1}://;
 	$sourceFile = &Path_Strip ($sourceFile);
 
@@ -89,9 +89,9 @@ sub CheckSource_Includes ($\%$\@;\@;\@)
 
 		if ($macro =~ /__ARMCC_2_2__/)
 			{
-			$platformPreInclude = $ENV{EPOCROOT}."epoc32\\include\\rvct2_2\\rvct2_2.h";
+			$platformPreInclude = $ENV{EPOCROOT}."epoc32/include/rvct2_2/rvct2_2.h";
 
-			if (($sourceFile =~ /BASE\\E32\\compsupp\\/i) && $ENV{RVCT22INC})
+			if (($sourceFile =~ /base\/e32\/compsupp\//i) && $ENV{RVCT22INC})
 				{					
 				# Need some way to deal with ARMINC from the front-end...
 				my $rvctIncDir = $ENV{RVCT22INC};
@@ -100,10 +100,10 @@ sub CheckSource_Includes ($\%$\@;\@;\@)
 			}
 		elsif ($macro =~ /__GCCE__/)
 			{
-			$platformPreInclude = $ENV{EPOCROOT}."epoc32\\include\\GCCE\\GCCE.h";
+			$platformPreInclude = $ENV{EPOCROOT}."epoc32/include/gcce//gcce.h";
 
-			my $GCCEinstall = Cl_bpabi::GCCInstallPath();
-			push @systemIncludes, "\"\\\"$GCCEinstall\\..\\lib\\gcc\\arm-none-symbianelf\\3.4.3\\include\\\"\"";
+			my $GCCEinstall = cl_bpabi::GCCInstallPath();
+			push @systemIncludes, "\"/\"$GCCEinstall/../lib/gcc/arm-none-symbianelf/3.4.3/include/\"\"";
 			}
 # Unsupported, at least for now...
 #
@@ -112,9 +112,9 @@ sub CheckSource_Includes ($\%$\@;\@;\@)
 #			my $CWInstall = $ENV{MWCSYM2INCLUDES};
 #			$CWInstall =~ s/^\+//;
 #			$CWInstall =~ s/\;$//;
-#			push @systemIncludes, "\"\\\"$CWInstall\\Win32-x86 Support\\Headers\\Win32 SDK\\\"\"";
-#			push @systemIncludes, "\"\\\"$CWInstall\\MSL\\MSL_CPP\\MSL_Common\\include\\\"\"";
-#			push @systemIncludes, "\"\\\"$CWInstall\\MSL\\MSL_C\\MSL_Common\\include\\\"\"";
+#			push @systemIncludes, "\"/\"$CWInstall/Win32-x86 Support/Headers/Win32 SDK/\"\"";
+#			push @systemIncludes, "\"/\"$CWInstall/MSL/MSL_CPP/MSL_Common/include/\"\"";
+#			push @systemIncludes, "\"/\"$CWInstall/MSL/MSL_C/MSL_Common/include/\"\"";
 #			}
 		}
 
@@ -130,12 +130,12 @@ sub CheckSource_Includes ($\%$\@;\@;\@)
 
 	foreach my $include (@userIncludes, @systemIncludes)
 		{
-		$include =~ s/\\$//;
+		$include =~ s/\/$//;
 		$include = getDrive().$include if (($include !~ /^[a-zA-Z]:/) && ($include !~ /^\"/));
 		$call .= "-I $include ";
 		}
 
-	$sourceFile =~ s/\//\\/g;
+	$sourceFile =~ s/\\/\//g;
 	$sourceFile = &Path_Strip ($sourceFile);
 	$sourceFile = getDrive().$sourceFile;
 
@@ -156,7 +156,7 @@ sub CheckSource_ExportedFileIncludes ($$\%)
 	# Exclude exported files as appropriate
 	if ($destinationFile)
 		{
-		my $epoc32Include = quotemeta ($ENV{EPOCROOT})."epoc32\\\\include";
+		my $epoc32Include = quotemeta ($ENV{EPOCROOT})."epoc32/include";
 		return if ($destinationFile !~ /^$epoc32Include/i);
 		return if ($destinationFile =~ /\.def$/i);
 		}
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_arm.pm b/cl_arm.pm
index e088473..2ecb9c8 100644
--- a/cl_arm.pm
+++ b/cl_arm.pm
@@ -4,7 +4,7 @@
 #
 
 
-package Cl_arm;
+package cl_arm;
 
 my $ToolPrefix='';
 my %PlatOpt=(
@@ -59,10 +59,10 @@ require Exporter;
 );
 
 use Cwd;
-use Armutl;
+use armutl;
 use cl_generic;
-use E32env;
-use Genutl;
+use e32env;
+use genutl;
 
 use constant NOCOMPRESSIONMETHOD => 0;
 use constant INFLATECOMPRESSIONMETHOD => 1;
@@ -110,7 +110,7 @@ sub PMPlatProcessMmp (@) {
 	@ArmLibList = &Armutl_ArmLibList;
 	$ArmRT = &Armutl_ArmRT;
 	my @AsmFileList = &Armutl_AsmFileList;
-	foreach (@AsmFileList) { $AsmFiles{ucfirst lc $_} = 1; }
+	foreach (@AsmFileList) { $AsmFiles{$_} = 1; }
 }
 
 sub SysTrg () {
@@ -255,7 +255,7 @@ sub PMStartBldList($) {
 	my $DefFile=&main::DefFile;
 	my $EPOCPath=&main::EPOCPath;
 	my $LinkAs=&main::LinkAs;
-	my $LibPath=&main::LibPath.'LIB\\';
+	my $LibPath=&main::LibPath.'lib/';
 	my @MacroList=&main::MacroList();
 	push @MacroList, "__SUPPORT_CPP_EXCEPTIONS__";
 	
@@ -331,16 +331,14 @@ sub PMStartBldList($) {
 	if ($Makecmd eq "nmake") {
 		&main::Output(
 			"\n",
-			"PATH=",&main::Path_Drive,$EPOCPath,"gcc\\bin;\$(PATH)\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",
+			"PATH:=",&main::Path_Drive,$EPOCPath,"gcc/bin:\$(PATH)\n",
 			"\n"
 		);
 	}
@@ -435,7 +433,7 @@ sub PMStartBldList($) {
 		if ($BasicTrgType !~ /IMPLIB/io) {
 			&main::Output (
 				" \\\n\t",
-				&Generic_Quote("\$(EPOCTRG$_)\\$Trg")
+				&Generic_Quote("\$(EPOCTRG$_)/$Trg")
 			);
 		}
 
@@ -470,12 +468,12 @@ sub PMStartBldList($) {
 		unless (&main::ExportUnfrozen) {
 			if (-e $DefFile) { # effectively "if project frozen ..."
 				&main::Output(
-					" ", &Generic_Quote("\$(EPOCLIB)\\LIB\\$PrimaryExportLibrary.lib"),
+					" ", &Generic_Quote("\$(EPOCLIB)/lib/$PrimaryExportLibrary.lib"),
 				);
 				# if elf2e32.exe(postlinker) exists, then generate .dso along with .lib
 				if ($IsExistELF2E32EXE) {
 					&main::Output(
-						" ", &Generic_Quote("\$(EPOCLIB)\\LIB\\$PrimaryExportLibrary.dso"), "\n"
+						" ", &Generic_Quote("\$(EPOCLIB)/lib/$PrimaryExportLibrary.dso"), "\n"
 					);
 				}
 				else {
@@ -492,49 +490,49 @@ sub PMStartBldList($) {
 		} else {
 			&main::Output(
 				"\n",
-				"\t\@echo Not attempting to create \"\$(EPOCLIB)\\LIB\\$PrimaryExportLibrary.lib\"\n",
+				"\t\@echo Not attempting to create \"\$(EPOCLIB)/lib/$PrimaryExportLibrary.lib\"\n",
 				"\t\@echo from frozen .DEF file, since EXPORTUNFROZEN specified.\n"
 			);
 		}
 
 		my $theDefFile = $DefFile;
-		$theDefFile = "\$(EPOCBLD)\\$BaseTrg.def" unless (-e $DefFile);
+		$theDefFile = "\$(EPOCBLD)/$BaseTrg.def" unless (-e $DefFile);
 		&main::Output(
 			"\n",
 			"\n",
 			"# REAL TARGET - LIBRARY\n",
 			"\n",
-			&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExportLibrary.lib"), " : ",
+			&Generic_Quote("\$(EPOCLIB)/lib/$ExportLibrary.lib"), " : ",
 			&Generic_Quote($DefFile), "\n",
-				"\tperl -S prepdef.pl ", &Generic_Quote($DefFile), " \"\$(EPOCBLD)\\$ExportLibrary.prep.def\"\n",
-				"\tdef2dll.bat --path=\$(EPOCLIB)\\LIB \\\n\t\t--bldpath=\$(EPOCBLD) \\\n\t\t--import=$ExportLibrary \\\n",
-			"\t\t--deffile=\"\$(EPOCBLD)\\$ExportLibrary.prep.def\" \\\n\t\t--linkAs=$LinkAs \\\n\t\t$InterWorking\n",
+				"\tperl -S prepdef.pl ", &Generic_Quote($DefFile), " \"\$(EPOCBLD)/$ExportLibrary.prep.def\"\n",
+				"\tdef2dll --path=\$(EPOCLIB)/lib \\\n\t\t--bldpath=\$(EPOCBLD) \\\n\t\t--import=$ExportLibrary \\\n",
+			"\t\t--deffile=\"\$(EPOCBLD)/$ExportLibrary.prep.def\" \\\n\t\t--linkAs=$LinkAs \\\n\t\t$InterWorking\n",
 			"\n",
 		 );
 		if ($ExtraExportLibrary) {
 			&main::Output(
 				"\n",
-				&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExtraExportLibrary.lib"), " : ",
-				&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExportLibrary.lib"), "\n",
-				"\tcopy \$< \$@\n"
+				&Generic_Quote("\$(EPOCLIB)/lib/$ExtraExportLibrary.lib"), " : ",
+				&Generic_Quote("\$(EPOCLIB)/lib/$ExportLibrary.lib"), "\n",
+				"\tcp \$< \$@\n"
 			);
 		}
 		#if elf2e32.exe(postlinker) exists, then generate .dso(which will be used by ABIV2 platforms)
 		if ($IsExistELF2E32EXE) {
 			&main::Output(
 				"\n",
-				&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExportLibrary.dso"), " : ",
+				&Generic_Quote("\$(EPOCLIB)/lib/$ExportLibrary.dso"), " : ",
 				&Generic_Quote($DefFile), "\n",
-					"\telf2e32 --definput=\"\$(EPOCBLD)\\$ExportLibrary.prep.def\" --dso=",
-					&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExportLibrary.dso"),
+					"\telf2e32 --definput=\"\$(EPOCBLD)/$ExportLibrary.prep.def\" --dso=",
+					&Generic_Quote("\$(EPOCLIB)/lib/$ExportLibrary.dso"),
 					" --linkas=$LinkAs\n"
 			);
 			if ($ExtraExportLibrary) {
 				&main::Output(
 					"\n",
-					&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExtraExportLibrary.dso"), " : ",
-					&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExportLibrary.dso"), "\n",
-					"\tcopy \$< \$@\n"
+					&Generic_Quote("\$(EPOCLIB)/lib/$ExtraExportLibrary.dso"), " : ",
+					&Generic_Quote("\$(EPOCLIB)/lib/$ExportLibrary.dso"), "\n",
+					"\tcp \$< \$@\n"
 				);
 			}		
 		}		
@@ -571,7 +569,7 @@ sub PMStartBldList($) {
 	if ($DefFile and $BasicTrgType!~/^IMPLIB$/io) {
 # 	    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
-	    &main::Output( "\tperl -S efreeze.pl \$(EFREEZE_ALLOW_REMOVE) \"$DefFile\" \"\$(EPOCBLD)\\$ExportLibrary.def\" \n" );
+	    &main::Output( "\tperl -S efreeze.pl \$(EFREEZE_ALLOW_REMOVE) \"$DefFile\" \"\$(EPOCBLD)/$ExportLibrary.def\" \n" );
 	}
 	&main::Output(
 		"\n",
@@ -579,11 +577,11 @@ sub PMStartBldList($) {
 	);
 	if ($DefFile and !$NoExportLibrary) {
 		&main::Output(
-			"\t-\$(ERASE) \"\$(EPOCLIB)\\LIB\\$ExportLibrary.lib\"\n"
+			"\t-\$(ERASE) \"\$(EPOCLIB)/lib/$ExportLibrary.lib\"\n"
 		);
 		if ($ExtraExportLibrary) {
 			&main::Output(
-				"\t-\$(ERASE) \"\$(EPOCLIB)\\LIB\\$ExtraExportLibrary.lib\"\n"
+				"\t-\$(ERASE) \"\$(EPOCLIB)/lib/$ExtraExportLibrary.lib\"\n"
 			);
 		}
 	}
@@ -680,7 +678,6 @@ sub PMBld {
 		$ExtraExportLibrary = $ExportLibrary;
 		$ExtraExportLibrary =~ s/\{(\d|a|b|c|d|e|f){8}\}//i;
 	}	
-	my $objectsViaFile;
 
     my $linkerDebugOpt = "";
     if(&main::DebugSwitchUsed() ){
@@ -774,26 +771,26 @@ sub PMBld {
 			# Temporary Workaround for RVCT2.1 static libs problem with RVCT2.2 builds
 			&main::Output(
 				" \\\n\t",
-				&Generic_Quote("\$(EPOCSTATLINK$Bld)\\EDLLSTUB$RVCTVersion.lib")
+				&Generic_Quote("\$(EPOCSTATLINK$Bld)/edllstub$RVCTVersion.lib")
 			);
 		}
 		else {
 			&main::Output(
 				" \\\n\t",
-				&Generic_Quote("\$(EPOCSTATLINK$Bld)\\EDLLSTUB.lib")
+				&Generic_Quote("\$(EPOCSTATLINK$Bld)/edllstub.lib")
 			);
 		}
 	}
 	    
-        PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\\\$\(EPOCSTATLINK$Bld\)\\\\\$_\"\)", @StatLibList);
-        PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\\\$\(EPOCLIB\)\\\\LIB\\\\\$_\"\)", @LibList);
+        PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\\\$\(EPOCSTATLINK$Bld\)/\$_\"\)", @StatLibList);
+        PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\\\$\(EPOCLIB\)/lib/\$_\"\)", @LibList);
         
         my $StaticRTLib = $RVCT20 ? "usrt20" : "usrt${RVCTVersion}" ;
         # use ksrt for system code and usrt for user ARM code
         $StaticRTLib = "ksrt${RVCTVersion}" if ($SystemTrg);
         &main::Output(
 	        " \\\n\t",
-		&Generic_Quote("\$(EPOCSTATLINK$Bld)\\$StaticRTLib\.lib")
+		&Generic_Quote("\$(EPOCSTATLINK$Bld)/$StaticRTLib\.lib")
 		) unless ($Trg =~ /(U|K)SRT/i || ($BasicTrgType=~/^LIB$/o));
 
 	unless ($ArmRT || ($BasicTrgType=~/^LIB$/o)) {
@@ -803,7 +800,7 @@ sub PMBld {
 			foreach (@RTLibList) {
 				&main::Output(
 					" \\\n\t",
-					&Generic_Quote("\$(EPOCLIB)\\LIB\\$_")
+					&Generic_Quote("\$(EPOCLIB)/lib/$_")
 				) unless ($_ =~ /$TargLib/i);
 			}
 	    }
@@ -817,8 +814,8 @@ sub PMBld {
 	&main::Output(
 		"VTBLEXPORTS$Bld="
 	);
-        my $vtobj = quotemeta("(VtblExports.o)");
-        PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\\\$\(EPOCLIB\)\\\\LIB\\\\\$_$vtobj\"\)", @LibList);
+        my $vtobj = quotemeta("\\(VtblExports.o\\)");
+        PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\\\$\(EPOCLIB\)/lib/\$_$vtobj\"\)", @LibList);
 	&main::Output(
 		"\n",
 		"\n"
@@ -843,7 +840,7 @@ sub PMBld {
 
 	        &main::Output(
 		        " \\\n\t",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o")
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.o")
 		      );
 
 #	Only add if not already added from @StringTables
@@ -869,13 +866,13 @@ sub PMBld {
 
         if ($BasicTrgType=~/^LIB$/o) {
 	        &main::Output(
-		      &Generic_Quote("\$(EPOCTRG$Bld)\\$Trg"),
+		      &Generic_Quote("\$(EPOCTRG$Bld)/$Trg"),
 		      " : \$(OBJECTS$Bld)"
 		);
         } else {
 	        &main::Output(
-		      &Generic_Quote("\$(EPOCTRG$Bld)\\$Trg"), " : ",
-		      &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseTrg.in")
+		      &Generic_Quote("\$(EPOCTRG$Bld)/$Trg"), " : ",
+		      &Generic_Quote("\$(EPOCBLD$Bld)/$BaseTrg.in")
 	        );
         }
 
@@ -886,7 +883,7 @@ sub PMBld {
 	}
 	if ($BasicTrgType=~/^(EXE|DLL)$/o) {
 		&main::Output(
-			" ", &Generic_Quote("\$(EPOCSTATLINK$Bld)\\$FirstLib")
+			" ", &Generic_Quote("\$(EPOCSTATLINK$Bld)/$FirstLib")
 		);
 	}
 	&main::Output(
@@ -896,23 +893,23 @@ sub PMBld {
 #	generate an export object from the ordered .DEF file
         if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/o || $TrgType=~/^EXEDLL$/o) {
 #       	make the .exp file a dependency for targets that have exports		
-		&main::Output(" ", &Generic_Quote("\$(EPOCBLD$Bld)\\$ExportLibrary.exp"), "\n");
+		&main::Output(" ", &Generic_Quote("\$(EPOCBLD$Bld)/$ExportLibrary.exp"), "\n");
 		if (&main::ExportUnfrozen) {
 		    &main::Output(
-			"\tdef2dll.bat --path=\$(EPOCBLD$Bld) \\\n\t\t--bldpath=\$(EPOCBLD) \\\n\t\t--export=$ExportLibrary \\\n\t\t--import=$ExportLibrary\\\n",
-			"\t\t--deffile=\$(EPOCBLD)\\$ExportLibrary.def \\\n\t\t--linkAs=$LinkAs \\\n\t\t$InterWorking\n"
+			"\tdef2dll --path=\$(EPOCBLD$Bld) \\\n\t\t--bldpath=\$(EPOCBLD) \\\n\t\t--export=$ExportLibrary \\\n\t\t--import=$ExportLibrary\\\n",
+			"\t\t--deffile=\$(EPOCBLD)/$ExportLibrary.def \\\n\t\t--linkAs=$LinkAs \\\n\t\t$InterWorking\n"
 		    );
 		    &main::Output(
 		        "\n",
-		        "\tcopy \$(EPOCBLD$Bld)\\$ExportLibrary.lib ",
-		        "\$(EPOCLIB)\\LIB\\$ExportLibrary.lib",
+		        "\tcp \$(EPOCBLD$Bld)/$ExportLibrary.lib ",
+		        "\$(EPOCLIB)/lib/$ExportLibrary.lib",
 		        "\n"
 		    );
 		    if ($ExtraExportLibrary) {
 			&main::Output(
 			    "\n",
-			    "\tcopy \$(EPOCLIB)\\LIB\\$ExportLibrary.lib ",
-			    "\$(EPOCLIB)\\LIB\\$ExtraExportLibrary.lib",
+			    "\tcp \$(EPOCLIB)/lib/$ExportLibrary.lib ",
+			    "\$(EPOCLIB)/lib/$ExtraExportLibrary.lib",
 			    "\n"
 			);
 		    }			    
@@ -920,14 +917,14 @@ sub PMBld {
 		    if ($IsExistELF2E32EXE) {
 			    &main::Output(
 				    "\n",
-				    "\telf2e32 --definput=\"\$(EPOCBLD)\\$ExportLibrary.def\" --dso=",
-				    "\$(EPOCLIB)\\LIB\\$ExportLibrary.dso --linkas=$LinkAs\n"
+				    "\telf2e32 --definput=\"\$(EPOCBLD)/$ExportLibrary.def\" --dso=",
+				    "\$(EPOCLIB)/lib/$ExportLibrary.dso --linkas=$LinkAs\n"
 			    );
 			    if ($ExtraExportLibrary) {
 				    &main::Output(
 					    "\n",
-					    "\tcopy \$(EPOCLIB)\\LIB\\$ExportLibrary.dso ",
-					    "\$(EPOCLIB)\\LIB\\$ExtraExportLibrary.dso",
+					    "\tcp \$(EPOCLIB)/lib/$ExportLibrary.dso ",
+					    "\$(EPOCLIB)/lib/$ExtraExportLibrary.dso",
 					    "\n"
 				    );
 			    }		
@@ -940,7 +937,7 @@ sub PMBld {
 #       get rid of any -symbols produced .map file
         if ($BasicTrgType=~/^(DLL|EXE)/o) {
 	        &main::Output(
-			"\t-\$(ERASE) \"\$(EPOCTRG$Bld)\\$Trg.map\" \n"
+			"\t-\$(ERASE) \"\$(EPOCTRG$Bld)/$Trg.map\" \n"
 		);	
 	}
 
@@ -986,8 +983,8 @@ sub PMBld {
 		            $ObjFile = "V_ENTRY_.o";
 	            }
 	            &main::Output(
-				    "\t\t${oP}entry _E32Dll \$(EPOCSTATLINK$Bld)\\$FirstLib($ObjFile) \\\n",
-				    "\t\t\$(EPOCBLD$Bld)\\$ExportLibrary.exp \\\n"
+				    "\t\t${oP}entry _E32Dll \$(EPOCSTATLINK$Bld)/$FirstLib\\($ObjFile\\) \\\n",
+				    "\t\t\$(EPOCBLD$Bld)/$ExportLibrary.exp \\\n"
 				);
 	        } elsif ($BasicTrgType=~/^EXE$/o || $TrgType=~/^EXEXP$/o) {
 			    # get the right object file for the entry point
@@ -1002,31 +999,31 @@ sub PMBld {
 					} 
 				} 
 			    
-			    &main::Output( "\t\t${oP}entry _E32Startup \$(EPOCSTATLINK$Bld)\\$FirstLib($ObjFile) \\\n" );
+			    &main::Output( "\t\t${oP}entry _E32Startup \$(EPOCSTATLINK$Bld)/$FirstLib\\($ObjFile\\) \\\n" );
 			    if ($TrgType=~/^EXEXP$/o || $TrgType=~/^EXEDLL$/o) {
-					&main::Output( "\t\t\$(EPOCBLD$Bld)\\$ExportLibrary.exp \\\n" );
+					&main::Output( "\t\t\$(EPOCBLD$Bld)/$ExportLibrary.exp \\\n" );
 			    }
 			}
 	        &main::Output(
-		        "\t\t-o \"\$(EPOCBLD$Bld)\\$Trg\" \\\n",
-		        "\t\t${oP}symbols ${oP}list \"\$(EPOCTRG$Bld)\\$Trg.map\" \\\n",
-				"\t\t\$(EPOCBLD$Bld)\\$BaseTrg.in \\\n"
+		        "\t\t-o \"\$(EPOCBLD$Bld)/$Trg\" \\\n",
+		        "\t\t${oP}symbols ${oP}list \"\$(EPOCTRG$Bld)/$Trg.map\" \\\n",
+				"\t\t\$(EPOCBLD$Bld)/$BaseTrg.in \\\n"
 			);
 	        &main::Output(
-		        "\t\t\$(LIBS$Bld) \\\n",
+		        "\t\t\$(addsuffix ',\$(addprefix ',\$(LIBS$Bld))) \\\n",
 				"\t\t\$(VTBLEXPORTS$Bld) \$(USERLDFLAGS) \n"
 			);
 
 	        if(&main::DebugSwitchUsed() ){
 				if(&main::SymbolicDebugEnabled() ) {
 				&main::Output(
-					"\tcopy \"\$(EPOCBLD$Bld)\\$Trg\" \"\$(EPOCTRG$Bld)\\$BaseTrg.sym\"\n"
+					"\tcp \"\$(EPOCBLD$Bld)/$Trg\" \"\$(EPOCTRG$Bld)/$BaseTrg.sym\"\n"
 					);
 				}
 			}
 	        elsif ($Bld=~/^UDEB$/o) {
 	               &main::Output(
-			       "\tcopy \"\$(EPOCBLD$Bld)\\$Trg\" \"\$(EPOCTRG$Bld)\\$BaseTrg.sym\"\n"
+			       "\tcp \"\$(EPOCBLD$Bld)/$Trg\" \"\$(EPOCTRG$Bld)/$BaseTrg.sym\"\n"
 		       );
 	        }
 		
@@ -1132,7 +1129,7 @@ sub PMBld {
 			"\\\n\t\t"
 		);
 		&main::Output(
-			" \"\$(EPOCBLD$Bld)\\$Trg\""
+			" \"\$(EPOCBLD$Bld)/$Trg\""
 		);
 		&main::Output(
 			"\\\n\t\t"
@@ -1147,7 +1144,7 @@ sub PMBld {
          }
          elsif ($BasicTrgType=~/^LIB$/o) {
 	        &main::Output(
-		        "\tarmar ${oP}create \$(EPOCSTATLINK$Bld)\\$Trg ${oP}via $objectsViaFile\n"
+		        "\tarmar ${oP}create \$(EPOCSTATLINK$Bld)/$Trg ${oP}via $objectsViaFile\n"
 		);
          }
 
@@ -1159,7 +1156,7 @@ sub PMBld {
     #------------
 	 
     &main::Output(
-		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseTrg.in"), ": \$(OBJECTS$Bld)\n",
+		&Generic_Quote("\$(EPOCBLD$Bld)/$BaseTrg.in"), ": \$(OBJECTS$Bld)\n",
  	    "\t$Link $linkerDebugOpt ${oP}partial \\\n",
 	    "\t\t-o \$\@ \\\n",
 	    "\t\t${oP}via $objectsViaFile\n\n",
@@ -1172,7 +1169,7 @@ sub PMBld {
 	    # TARGET *.EXP
 	    #------------
 	    &main::Output(
-		    &Generic_Quote("\$(EPOCBLD$Bld)\\$ExportLibrary.exp"), ": \$(EPOCBLD$Bld)\\$BaseTrg.in"
+		    &Generic_Quote("\$(EPOCBLD$Bld)/$ExportLibrary.exp"), ": \$(EPOCBLD$Bld)/$BaseTrg.in"
 	    );
 
 # if project is frozen, makedef (and hence the .exp file) are dependent upon it
@@ -1183,9 +1180,9 @@ sub PMBld {
 		}
 
 	    &main::Output(
-		"\n\tperl -S elf2inf.pl -o \$(EPOCBLD$Bld)\\$ExportLibrary.inf \\\n", 
+		"\n\tperl -S elf2inf.pl -o \$(EPOCBLD$Bld)/$ExportLibrary.inf \\\n", 
 		"\t\t\$\<",
-		"\n\tperl -S makedef.pl $AbsentSubst -Inf \$(EPOCBLD$Bld)\\$ExportLibrary.inf \\\n"
+		"\n\tperl -S makedef.pl $AbsentSubst -Inf \$(EPOCBLD$Bld)/$ExportLibrary.inf \\\n"
 	    );
     	if (!$DefFile || $NoExportLibrary) {    			
     		&main::Output( "\t\t-ignore_unfrozen_noncallable \\\n" );
@@ -1207,12 +1204,12 @@ sub PMBld {
 		    $Num++;
 	    }
 	    
-	    my $theDefFile = "\$(EPOCBLD)\\$ExportLibrary.def";
+	    my $theDefFile = "\$(EPOCBLD)/$ExportLibrary.def";
 	    $theDefFile = $DefFile if (-e $DefFile && !&main::ExportUnfrozen);
 	    &main::Output(
-		"\t\t\"\$(EPOCBLD)\\$ExportLibrary.def\"\n",
-		"\tcopy \$(EPOCBLD)\\$ExportLibrary.def \$(EPOCBLD$Bld)\\$ExportLibrary.def\n",
-		"\tdef2dll.bat $AbsentSubst \\\n\t\t--path=\$(EPOCBLD$Bld) \\\n\t\t--bldpath=\$(EPOCBLD) \\\n\t\t--export=$ExportLibrary \\\n",
+		"\t\t\"\$(EPOCBLD)/$ExportLibrary.def\"\n",
+		"\tcp \$(EPOCBLD)/$ExportLibrary.def \$(EPOCBLD$Bld)/$ExportLibrary.def\n",
+		"\tdef2dll $AbsentSubst \\\n\t\t--path=\$(EPOCBLD$Bld) \\\n\t\t--bldpath=\$(EPOCBLD) \\\n\t\t--export=$ExportLibrary \\\n",
 		"\t\t--deffile=$theDefFile \\\n\t\t--linkAs=$LinkAs \\\n\t\t$InterWorking\n"
 	    );
     }
@@ -1341,12 +1338,12 @@ sub PMSrcDepend {
 
 	foreach (@BldList) {
 		&main::Output(
-			&Generic_Quote("\$(EPOCBLD$_)\\$BaseSrc.pre"), " ",
-			&Generic_Quote("\$(EPOCBLD$_)\\$BaseObj.cpp"), " ",
+			&Generic_Quote("\$(EPOCBLD$_)/$BaseSrc.pre"), " ",
+			&Generic_Quote("\$(EPOCBLD$_)/$BaseObj.cpp"), " ",
 		) if $cia;
 		&main::Output(
-			&Generic_Quote("\$(EPOCBLD$_)\\$BaseSrc.lis"), " ",
-			&Generic_Quote("\$(EPOCBLD$_)\\$BaseObj.o"), " \\\n",
+			&Generic_Quote("\$(EPOCBLD$_)/$BaseSrc.lis"), " ",
+			&Generic_Quote("\$(EPOCBLD$_)/$BaseObj.o"), " \\\n",
 		);
 	}
 	&main::Output(
@@ -1375,12 +1372,12 @@ sub PMSrcBldDepend {
 	}
 
 	&main::Output(
-		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.pre"), " ",
-		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseObj.cpp"), " ",
+		&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.pre"), " ",
+		&Generic_Quote("\$(EPOCBLD$Bld)/$BaseObj.cpp"), " ",
 	) if $cia;
 	&main::Output(
-		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), " ",
-		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseObj.o"), " :",
+		&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.lis"), " ",
+		&Generic_Quote("\$(EPOCBLD$Bld)/$BaseObj.o"), " :",
 	);
         PrintList("\' \\\n\t\'\.\&Generic_Quote\(\$_\)", @DepList);
 	&main::Output(
@@ -1407,11 +1404,11 @@ sub PMPrefixFile
 { 
     my $IncPath = &main::EPOCIncPath;
     
-    return quoted_path(&Generic_Quote("$IncPath"."RVCT${RVCTVersion}\\RVCT${RVCTVersion}.H"));
+    return quoted_path(&Generic_Quote("$IncPath"."rvct${RVCTVersion}/rvct${RVCTVersion}.h"));
 }
 
 
-my $preinclude =   "--preinclude \$(EPOCINC)\\RVCT${RVCTVersion}\\RVCT${RVCTVersion}.h";
+my $preinclude =   "--preinclude \$(EPOCINC)/rvct${RVCTVersion}/rvct${RVCTVersion}.h";
 
 sub SelectLangOptions {
 	my ($Ext) = @_;
@@ -1442,10 +1439,9 @@ sub PMEndSrcBld {
 	my $ABI=&main::ABI;
 	my $BaseSrc=&main::BaseSrc;
 	my $Bld=&main::Bld;
-	my $Src=lc &main::Src;	
+	my $Src=&main::Src;	
 	my $SrcPath=&main::Path_Chop(&main::SrcPath);
 	my $Ext = &main::Path_Split('Ext', $Src);	
-	$Src = ucfirst $Src if ($Ext !~ /\.(cpp|c)$/);		
 	my $LangOptions = &SelectLangOptions($Ext);
 	# support for auto 'translated' ASM 
 	my $AsmFilep = $AsmFiles{$Src};
@@ -1455,44 +1451,44 @@ sub PMEndSrcBld {
 	if ($AsmFilep || $Ext =~ /cia/i) {
 		&main::Output(
 # compile the translated, preprocessed source
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.o"), " : ",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), "\n",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc\_.o"), " : ",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc\_.cpp"), "\n",
 			"\t\@echo $Src\n",
-			"\t\$(ARMCC$Bld) $lfboption$LangOptions -J $SrcPath \$(INCDIR) -o \$\@ \$(EPOCBLD$Bld)\\$BaseSrc\_.cpp\n",
+			"\t\$(ARMCC$Bld) $lfboption$LangOptions -J $SrcPath \$(INCDIR) -o \$\@ \$(EPOCBLD$Bld)/$BaseSrc\_.cpp\n",
 			"\n",
 # rule to translate the preprocessed source
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), " : ",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.pre"), "\n",
-			"\ttranasm.bat -n -s -o=\$\@ \$(EPOCBLD$Bld)\\$BaseSrc.pre\n",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc\_.cpp"), " : ",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.pre"), "\n",
+			"\ttranasm -n -s -o=\$\@ \$(EPOCBLD$Bld)/$BaseSrc.pre\n",
 			"\n",
 # rule to preprocess the source
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.pre"), " : ",
-			&Generic_Quote("$SrcPath\\$Src"), "\n",
-			"\t\$(ARMCC$Bld) -E $preinclude $LangOptions -J $SrcPath \$(INCDIR) $SrcPath\\$Src -o \$\@ \n",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.pre"), " : ",
+			&Generic_Quote("$SrcPath/$Src"), "\n",
+			"\t\$(ARMCC$Bld) -E $preinclude $LangOptions -J $SrcPath \$(INCDIR) $SrcPath/$Src -o \$\@ \n",
 # generate an assembly listing target too
-			"LISTING$Bld$BaseSrc\_ : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.lis"), "\n",
-			"\t", &Generic_CopyAction("$SrcPath\\$BaseSrc\_.$ABI.lst"),
+			"LISTING$Bld$BaseSrc\_ : ", &Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc\_.lis"), "\n",
+			"\t", &Generic_CopyAction("$SrcPath/$BaseSrc\_.$ABI.lst"),
 			"\n",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.lis"), " : ",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), "\n",
-			"\t\$(ARMCC$Bld) $LangOptions -S -J $SrcPath \$(INCDIR) -o \$\@ \$(EPOCBLD$Bld)\\$BaseSrc\_.cpp\n",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc\_.lis"), " : ",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc\_.cpp"), "\n",
+			"\t\$(ARMCC$Bld) $LangOptions -S -J $SrcPath \$(INCDIR) -o \$\@ \$(EPOCBLD$Bld)/$BaseSrc\_.cpp\n",
 			"\n"
 			);
 	} else {
 
 		&main::Output(
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o"), " : ",
-			&Generic_Quote("$SrcPath\\$Src"), "\n",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.o"), " : ",
+			&Generic_Quote("$SrcPath/$Src"), "\n",
 			"\t\@echo $Src\n",
-			"\t\$(ARMCC$Bld) $lfboption$LangOptions -J $SrcPath \$(INCDIR) -o \$\@ $SrcPath\\$Src\n",
+			"\t\$(ARMCC$Bld) $lfboption$LangOptions -J $SrcPath \$(INCDIR) -o \$\@ $SrcPath/$Src\n",
 			"\n",
 # generate an assembly listing target too
-			"LISTING$Bld$BaseSrc : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), "\n",
-			"\t", &Generic_CopyAction("$SrcPath\\$BaseSrc.$ABI.lst"),
+			"LISTING$Bld$BaseSrc : ", &Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.lis"), "\n",
+			"\t", &Generic_CopyAction("$SrcPath/$BaseSrc.$ABI.lst"),
 			"\n",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), " : ",
-			&Generic_Quote("$SrcPath\\$Src"), "\n",
-			"\t\$(ARMCC$Bld) $LangOptions -S -J $SrcPath \$(INCDIR) -o \$\@ $SrcPath\\$Src \n",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.lis"), " : ",
+			&Generic_Quote("$SrcPath/$Src"), "\n",
+			"\t\$(ARMCC$Bld) $LangOptions -S -J $SrcPath \$(INCDIR) -o \$\@ $SrcPath/$Src \n",
 			"\n"
 			);
 	}
@@ -1504,7 +1500,7 @@ sub MultiFileEndSrcBld {
 	my $BaseSrc=&main::BaseSrc;
 	my $Bld=&main::Bld;
         my $KeyFile = &main::Src;
-	my $Src=ucfirst lc $KeyFile;
+	my $Src=$KeyFile;
 	my $SrcPath=&main::Path_Chop(&main::SrcPath);
 	my $Ext = &main::Path_Split('Ext', $Src);
 	my $LangOptions = &SelectLangOptions($Ext);
@@ -1521,12 +1517,12 @@ sub MultiFileEndSrcBld {
 # compile the translated, preprocessed source
 		       &main::Output( "OBJECTS$MFVarN = ");
 		       foreach my $obj (@{$CompilationGroups{$KeyFile}{Objects}}) {
-			       &main::Output( &Generic_Quote("\\\n\t\$(EPOCBLD$Bld)\\$obj"), " "); 
+			       &main::Output( &Generic_Quote("\\\n\t\$(EPOCBLD$Bld)/$obj"), " "); 
 		       }
        		       &main::Output( "\n\n");
 		       &main::Output( "SOURCES$MFVarN = ");
 		       foreach my $src (@{$CompilationGroups{$KeyFile}{Sources}}) {
-			       &main::Output( &Generic_Quote("\\\n\t\$(EPOCBLD$Bld)\\$src", " "));
+			       &main::Output( &Generic_Quote("\\\n\t\$(EPOCBLD$Bld)/$src", " "));
 		       }
        		       &main::Output( "\n\n");
 		       &main::Output( "\$(OBJECTS$MFVarN) : \$(SOURCES$MFVarN) \n");
@@ -1541,21 +1537,21 @@ sub MultiFileEndSrcBld {
 		}
 		&main::Output(
 # rule to translate the preprocessed source
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), " : ",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.pre"), "\n",
-			"\ttranasm.bat -n -s -o=\$\@ \$(EPOCBLD$Bld)\\$BaseSrc.pre\n",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc\_.cpp"), " : ",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.pre"), "\n",
+			"\ttranasm -n -s -o=\$\@ \$(EPOCBLD$Bld)/$BaseSrc.pre\n",
 			"\n",
 # rule to preprocess the source
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.pre"), " : ",
-			&Generic_Quote("$SrcPath\\$Src"), "\n",
-			"\t\$(ARMCC$Bld) -E $preinclude $LangOptions -J $SrcPath \$(INCDIR) $SrcPath\\$Src -o \$\@ \n",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.pre"), " : ",
+			&Generic_Quote("$SrcPath/$Src"), "\n",
+			"\t\$(ARMCC$Bld) -E $preinclude $LangOptions -J $SrcPath \$(INCDIR) $SrcPath/$Src -o \$\@ \n",
 # generate an assembly listing target too
-			"LISTING$Bld$BaseSrc\_ : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.lis"), "\n",
-			"\t", &Generic_CopyAction("$SrcPath\\$BaseSrc\_.$ABI.lst"),
+			"LISTING$Bld$BaseSrc\_ : ", &Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc\_.lis"), "\n",
+			"\t", &Generic_CopyAction("$SrcPath/$BaseSrc\_.$ABI.lst"),
 			"\n",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.lis"), " : ",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), "\n",
-			"\t\$(ARMCC$Bld) $LangOptions -S -J $SrcPath \$(INCDIR) -o \$\@ \$(EPOCBLD$Bld)\\$BaseSrc\_.cpp\n",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc\_.lis"), " : ",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc\_.cpp"), "\n",
+			"\t\$(ARMCC$Bld) $LangOptions -S -J $SrcPath \$(INCDIR) -o \$\@ \$(EPOCBLD$Bld)/$BaseSrc\_.cpp\n",
 			"\n"
 			);
 	} else {
@@ -1567,7 +1563,7 @@ sub MultiFileEndSrcBld {
 #                      compile the source
 		       &main::Output( "OBJECTS$MFVarN = ");
 		       foreach my $obj (@{$CompilationGroups{$KeyFile}{Objects}}) {
-			       &main::Output( &Generic_Quote("\\\n\t\$(EPOCBLD$Bld)\\$obj"), " "); 
+			       &main::Output( &Generic_Quote("\\\n\t\$(EPOCBLD$Bld)/$obj"), " "); 
 		       }
        		       &main::Output( "\n\n");
 		       &main::Output( "SOURCES$MFVarN = ");
@@ -1587,12 +1583,12 @@ sub MultiFileEndSrcBld {
 		}
 #		generate an assembly listing target too
 		&main::Output(
-			"LISTING$Bld$BaseSrc : ", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), "\n",
-			"\t", &Generic_CopyAction("$SrcPath\\$BaseSrc.$ABI.lst"),
+			"LISTING$Bld$BaseSrc : ", &Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.lis"), "\n",
+			"\t", &Generic_CopyAction("$SrcPath/$BaseSrc.$ABI.lst"),
 			"\n",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), " : ",
-			&Generic_Quote("$SrcPath\\$Src"), "\n",
-			"\t\$(ARMCC$Bld) $LangOptions -S -J $SrcPath \$(INCDIR) -o \$\@ $SrcPath\\$Src \n",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.lis"), " : ",
+			&Generic_Quote("$SrcPath/$Src"), "\n",
+			"\t\$(ARMCC$Bld) $LangOptions -S -J $SrcPath \$(INCDIR) -o \$\@ $SrcPath/$Src \n",
 			"\n"
 			);
 	}
diff --git a/cl_bpabi.pm b/cl_bpabi.pm
index 671c9b7..9ddb923 100644
--- a/cl_bpabi.pm
+++ b/cl_bpabi.pm
@@ -4,7 +4,7 @@
 #
 
 # This package contains routines to handle Base Platform ABI (BPABI) Platforms.
-package Cl_bpabi;
+package cl_bpabi;
 
 my $commonOptions;
 my $thumbOptions;
@@ -67,8 +67,8 @@ require Exporter;
 use Cwd;
 
 # Armutl package does various ancillary things for armedg modules
-use Armutl;
-use BPABIutl;
+use armutl;
+use bpabiutl;
 
 # This is the RVCT Version information required by Armutl package
 my $RVCTMajorVersion;
@@ -81,14 +81,14 @@ use cl_generic;
 
 # E32env package contains information for makmake and associated e32tools perl programs
 # within the Epoc32 Environment
-use E32env;
+use e32env;
 
 # Genutl package contains utility subroutines for MAKMAKE and associated scripts
-use Genutl;
+use genutl;
 
 # Modload package is the runtime module-loading routine for loading e32tools modules into
 # 'main' module
-use Modload;
+use modload;
 
 sub PMHelp_Mmp {
 	my $Plat=&main::Plat;
@@ -118,7 +118,7 @@ sub PMPlatProcessMmp (@) {
 	@ToolChainLibList = &GetLibList;
 	$TargetRT = &IsTargetRT;
 	my @AsmFileList = &GetToolChainAsmFileList;
-	foreach (@AsmFileList) { $AsmFiles{ucfirst lc $_} = 1; }
+	foreach (@AsmFileList) { $AsmFiles{$_} = 1; }
 }
 
 my $preinclude;
@@ -136,13 +136,13 @@ sub PMStartBldList($) {
 	my $DefFile=&main::DefFile;
 	my $EPOCPath=&main::EPOCPath;
 	my $LinkAs=&main::LinkAs;
-	my $LibPath=&main::LibPath.'LIB\\';
+	my $LibPath=&main::LibPath.'lib/';
 	my @MacroList=&main::MacroList();
 	push @MacroList, "__SUPPORT_CPP_EXCEPTIONS__";
 
 	my $myStatLinkPath;
-	$myStatLinkPath = "$E32env::Data{LinkPath}";
-	$myStatLinkPath .= "ARMV5";
+	$myStatLinkPath = "$e32env::Data{LinkPath}";
+	$myStatLinkPath .= lc "ARMV5";
 	&main::SetStatLinkPath($myStatLinkPath);
 
 	my $VariantFile=&ChangeSlash(&main::VariantFile);
@@ -188,23 +188,6 @@ sub PMStartBldList($) {
 	&Generic_Header(0,$Makecmd, 1);	# define standard things using absolute paths and request that a make function
 									# is provided to provide optional conversion of absolute paths to Unix slashes
 
-	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"
-		);
-	}
-
 	if ($BasicTrgType=~/^(DLL|EXE)/o)
 	{
 
@@ -225,13 +208,12 @@ sub PMStartBldList($) {
 
 		my $libpath = &GCCLibPath;
 		my $gccinstallpath = &GCCInstallPath;
-		$gccinstallpath .= "\\\.\.";
 			&main::Output(
 				"ifndef CC_INSTALL_PATH\n",
- 				"\tCC_INSTALL_PATH=",$gccinstallpath,"\n",
+ 				"    CC_INSTALL_PATH=",$gccinstallpath,"\n",
 				"\nendif\n",
- 				"\tGCC_LIB_PATH=",$libpath,"\n",
-				"\tSTATIC_LIBS = \$(STATIC_LIBS_PATH)\"\$(CC_INSTALL_PATH)\\arm-none-symbianelf\\lib\" \$(STATIC_LIBS_PATH)\"\$(GCC_LIB_PATH)\"",
+ 				"    GCC_LIB_PATH=",$libpath,"\n",
+				"    STATIC_LIBS = \$(STATIC_LIBS_PATH)\"\$(CC_INSTALL_PATH)/arm-none-symbianelf/lib\" \$(STATIC_LIBS_PATH)\"\$(GCC_LIB_PATH)\"",
 				"\n"
 			);
 
@@ -241,11 +223,11 @@ sub PMStartBldList($) {
 		# when the MAP option is supplied
 		&main::Output(
 			"ifdef LINKER_SYMBOLS_MAP_OPTION\n",
-			"\tUREL_MAP_FILE=\"\$(EPOCTRGUREL)\\$Trg.map\"\n",
-			"\tUDEB_MAP_FILE=\"\$(EPOCTRGUDEB)\\$Trg.map\"\n",
+			"    UREL_MAP_FILE=\"\$(EPOCTRGUREL)/$Trg.map\"\n",
+			"    UDEB_MAP_FILE=\"\$(EPOCTRGUDEB)/$Trg.map\"\n",
 			"else\n",
-			"\tUREL_MAP_FILE=\n",
-			"\tUDEB_MAP_FILE=\n",
+			"    UREL_MAP_FILE=\n",
+			"    UDEB_MAP_FILE=\n",
 			"endif\n\n"
 		);
 
@@ -471,7 +453,7 @@ sub PMStartBldList($) {
 		if ($BasicTrgType !~ /IMPLIB/io) {
 			&main::Output (
 				" \\\n\t",
-				&Generic_Quote("\$(EPOCTRG$_)\\$Trg")
+				&Generic_Quote("\$(EPOCTRG$_)/$Trg")
 			);
 		}
 
@@ -506,7 +488,7 @@ sub PMStartBldList($) {
 		unless (&main::ExportUnfrozen) {
 			if (-e $DefFile) { # effectively "if project frozen ..."
 				&main::Output(
-					" ", &Generic_Quote("\$(EPOCLIB)\\LIB\\$PrimaryExportLibrary.dso"), "\n"
+					" ", &Generic_Quote("\$(EPOCLIB)/lib/$PrimaryExportLibrary.dso"), "\n"
 				);
 			}
 			else {
@@ -519,32 +501,34 @@ sub PMStartBldList($) {
 		} else {
 			&main::Output(
 				"\n",
-				"\t\@echo Not attempting to create \"\$(EPOCLIB)\\LIB\\$PrimaryExportLibrary.dso\"\n",
+				"\t\@echo Not attempting to create \"\$(EPOCLIB)/lib/$PrimaryExportLibrary.dso\"\n",
 				"\t\@echo from frozen .DEF file, since EXPORTUNFROZEN specified.\n"
 			);
 		}
 
 		my $theDefFile = $DefFile;
-		$theDefFile = "\$(EPOCBLD)\\$BaseTrg.def" unless (-e $DefFile);
+		$theDefFile = "\$(EPOCBLD)/$BaseTrg.def" unless (-e $DefFile);
+		my $dsoname = &Generic_Quote("\$(EPOCLIB)/lib/$ExportLibrary.dso");
+		$dsoname =~ s/\//\\\\/g; # elf2e32 strips leading directories when storing the dsoname, but only knows about backslashes. The $(EPOCLIB) part still has forward slashes, but this seems to be enough
 		&main::Output(
 			"\n",
 			"\n",
 			"# REAL TARGET - LIBRARY\n",
 			"\n",
-			&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExportLibrary.dso"), " : ",
+			&Generic_Quote("\$(EPOCLIB)/lib/$ExportLibrary.dso"), " : ",
 			&Generic_Quote($DefFile), "\n",
-				"\tcopy ", &Generic_Quote($DefFile), " \"\$(EPOCBLD)\\$ExportLibrary.prep.def\"\n",
-				"\telf2e32 --definput=\"\$(EPOCBLD)\\$ExportLibrary.prep.def\" --dso=",
-				&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExportLibrary.dso"),
+				"\tcp ", &Generic_Quote($DefFile), " \"\$(EPOCBLD)/$ExportLibrary.prep.def\"\n",
+				"\telf2e32 --definput=\"\$(EPOCBLD)/$ExportLibrary.prep.def\" --dso=",
+				$dsoname,
 				" --linkas=$LinkAs\n",
 			"\n"
 		 );
 		if ($ExtraExportLibrary) {
 			&main::Output(
 				"\n",
-				&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExtraExportLibrary.dso"), " : ",
-				&Generic_Quote("\$(EPOCLIB)\\LIB\\$ExportLibrary.dso"), "\n",
-				"\tcopy \$< \$@\n"
+				&Generic_Quote("\$(EPOCLIB)/lib/$ExtraExportLibrary.dso"), " : ",
+				&Generic_Quote("\$(EPOCLIB)/lib/$ExportLibrary.dso"), "\n",
+				"\tcp \$< \$@\n"
 			);
 		}
 	}
@@ -580,7 +564,7 @@ sub PMStartBldList($) {
 	if ($DefFile and $BasicTrgType!~/^IMPLIB$/io) {
 # 	    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
-	    &main::Output( "\tperl -S efreeze.pl \$(EFREEZE_ALLOW_REMOVE) \"$DefFile\" \"\$(EPOCBLD)\\$ExportLibrary.def\" \n" );
+	    &main::Output( "\tperl -S efreeze.pl \$(EFREEZE_ALLOW_REMOVE) \"$DefFile\" \"\$(EPOCBLD)/$ExportLibrary.def\" \n" );
 	}
 	&main::Output(
 		"\n",
@@ -588,11 +572,11 @@ sub PMStartBldList($) {
 	);
 	if ($DefFile and !$NoExportLibrary) {
 		&main::Output(
-			"\t-\$(ERASE) \"\$(EPOCLIB)\\LIB\\$ExportLibrary.dso\"\n"
+			"\t-\$(ERASE) \"\$(EPOCLIB)/lib/$ExportLibrary.dso\"\n"
 		);
 		if ($ExtraExportLibrary) {
 			&main::Output(
-				"\t-\$(ERASE) \"\$(EPOCLIB)\\LIB\\$ExtraExportLibrary.dso\"\n"
+				"\t-\$(ERASE) \"\$(EPOCLIB)/lib/$ExtraExportLibrary.dso\"\n"
 			);
 		}
 	}
@@ -716,7 +700,7 @@ 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")
 		);
 	}
 
@@ -727,13 +711,13 @@ sub PMBld {
 		unshift @StatLibList, "$StaticRTLib\.lib" unless ($Trg =~ /(U|K)SRT/i || ($BasicTrgType=~/^LIB$/o));
 
         my $Plat =  uc(&main::Plat);
-        &main::Output(" \\\n\t-\(") if (@StatLibList && ($Plat eq  "GCCE"));
-        PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\\\$\(EPOCSTATLINK$Bld\)\\\\\$_\"\)", @StatLibList);
-        &main::Output(" \\\n\t-\)") if (@StatLibList && ($Plat eq  "GCCE"));
+        &main::Output(" \\\n\t-\\\(") if (@StatLibList && ($Plat eq  "GCCE"));
+        PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\\\$\(EPOCSTATLINK$Bld\)/\$_\"\)", @StatLibList);
+        &main::Output(" \\\n\t-\\\)") if (@StatLibList && ($Plat eq  "GCCE"));
 
 
         my @ImportLibList = ImportLibraryList(@LibList);
-		PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\\\$\(EPOCLIB\)\\\\LIB\\\\\$_\"\)", @ImportLibList);
+		PrintList("\' \\\n\t\'\.\&Generic_Quote\(\"\\\$\(EPOCLIB\)/lib/\$_\"\)", @ImportLibList);
 
 
 	unless ($ArmRT || ($BasicTrgType=~/^LIB$/o)) {
@@ -743,7 +727,7 @@ sub PMBld {
 			foreach (@RTLibList) {
 				&main::Output(
 					" \\\n\t",
-					&Generic_Quote("\$(EPOCLIB)\\LIB\\$_")
+					&Generic_Quote("\$(EPOCLIB)/lib/$_")
 				) unless ($_ =~ /$TargLib/i);
 			}
 	    }
@@ -776,7 +760,7 @@ sub PMBld {
 
 	        &main::Output(
 		        " \\\n\t",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o")
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.o")
 		      );
 
 		    $objectFiles .= &main::BldPath.$BaseSrc.".o\n";
@@ -787,7 +771,7 @@ sub PMBld {
 	);
 
            &main::Output(
-		     &Generic_Quote("\$(EPOCTRG$Bld)\\$Trg"),
+		     &Generic_Quote("\$(EPOCTRG$Bld)/$Trg"),
 		     " : \$(OBJECTS$Bld)"
 		);
 
@@ -798,7 +782,7 @@ sub PMBld {
 	}
 #	if ($BasicTrgType=~/^(EXE|DLL)$/o) {
 #		&main::Output(
-#			" ", &Generic_Quote("\$(EPOCSTATLINK$Bld)\\$FirstLib")
+#			" ", &Generic_Quote("\$(EPOCSTATLINK$Bld)/$FirstLib")
 #		);
 #	}
 #	&main::Output(
@@ -808,7 +792,7 @@ sub PMBld {
 	my $IsCustomDll = IsCustomDllUseCase($Trg);
 	if($IsCustomDll eq 1)
 	{
-		&main::Output( "\t\$(EPOCBLD$Bld)\\$ExportLibrary.exp " );
+		&main::Output( "\t\$(EPOCBLD$Bld)/$ExportLibrary.exp " );
 	}
 
     &main::Output("\n");
@@ -817,7 +801,7 @@ sub PMBld {
 #       get rid of any -symbols produced .map file
         if ($BasicTrgType=~/^(DLL|EXE)/o) {
 	        &main::Output(
-			"\t-\$(ERASE) \"\$(EPOCTRG$Bld)\\$Trg.map\" \n"
+			"\t-\$(ERASE) \"\$(EPOCTRG$Bld)/$Trg.map\" \n"
 		);
 		}
 
@@ -895,7 +879,7 @@ sub PMBld {
 	            }
 
 	            &main::Output(
-					" \$(EPOCSTATLINK$Bld)\\$FirstLib",
+					" \$(EPOCSTATLINK$Bld)/$FirstLib",
 					"$ObjFile",
 					" \\\n"
 				);
@@ -907,14 +891,14 @@ sub PMBld {
 			    }
 
 			    &main::Output(
-				" \$(EPOCSTATLINK$Bld)\\$FirstLib",
+				" \$(EPOCSTATLINK$Bld)/$FirstLib",
 				"$ObjFile",
 				" \\\n"
 					);
 			}
 
 	        &main::Output(
-		        "\t\t\$(LINKER_OUTPUT_OPTION) \"\$(EPOCBLD$Bld)\\$Trg\" \\\n",
+		        "\t\t\$(LINKER_OUTPUT_OPTION) \"\$(EPOCBLD$Bld)/$Trg\" \\\n",
 #				"\t\t\$(OBJECTS$Bld) \\\n"
 			);
 
@@ -929,7 +913,7 @@ sub PMBld {
 
 			if($IsCustomDll eq 1)
 			{
-				&main::Output( "\t\t\$(EPOCBLD$Bld)\\$ExportLibrary.exp \\\n" );
+				&main::Output( "\t\t\$(EPOCBLD$Bld)/$ExportLibrary.exp \\\n" );
 			}
 
 	        &main::Output(
@@ -940,18 +924,18 @@ sub PMBld {
 	        if(&main::DebugSwitchUsed() ){
 				if(&main::SymbolicDebugEnabled() ) {
 				&main::Output(
-					"\tcopy \"\$(EPOCBLD$Bld)\\$Trg\" \"\$(EPOCTRG$Bld)\\$BaseTrg.sym\"\n"
+					"\tcp \"\$(EPOCBLD$Bld)/$Trg\" \"\$(EPOCTRG$Bld)/$BaseTrg.sym\"\n"
 					);
 				}
 			}
 	        elsif ($Bld=~/^U?DEB$/o) {
 	               &main::Output(
-			       "\tcopy \"\$(EPOCBLD$Bld)\\$Trg\" \"\$(EPOCTRG$Bld)\\$BaseTrg.sym\"\n"
+			       "\tcp \"\$(EPOCBLD$Bld)/$Trg\" \"\$(EPOCTRG$Bld)/$BaseTrg.sym\"\n"
 		       );
 	        }
 		if (-e $DefFile) {
 			&main::Output(
-				"\tcopy ", &Generic_Quote($DefFile), " \"\$(EPOCBLD)\\$ExportLibrary.prep.def\"\n",
+				"\tcp ", &Generic_Quote($DefFile), " \"\$(EPOCBLD)/$ExportLibrary.prep.def\"\n",
 			);
 		}
 
@@ -1054,16 +1038,18 @@ sub PMBld {
 		if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/o || $TrgType=~/^EXEDLL$/o) {
 			if (-e $DefFile) {
 				&main::Output(
-					' --definput=',"\"\$(EPOCBLD)\\$ExportLibrary.prep.def\""
+					' --definput=',"\"\$(EPOCBLD)/$ExportLibrary.prep.def\""
 					);
 			}
+			my $dsoname = &Generic_Quote("\$(EPOCBLD$Bld)/$ExportLibrary.dso");
+			$dsoname =~ s/\//\\\\/g; # elf2e32 strips leading directories when storing the dsoname, but only knows about backslashes. The $(EPOCLIB) part still has forward slashes, but this seems to be enough
 			&main::Output(
 				' --dso=',
-				&Generic_Quote("\$(EPOCBLD$Bld)\\$ExportLibrary.dso")
+				$dsoname
 				);
 			&main::Output(
 				' --defoutput=',
-				&Generic_Quote("\$(EPOCBLD$Bld)\\$ExportLibrary.def")
+				&Generic_Quote("\$(EPOCBLD$Bld)/$ExportLibrary.def")
 				);
 				if(&main::ExportUnfrozen) {
 					&main::Output( ' --unfrozen ');
@@ -1071,7 +1057,7 @@ sub PMBld {
 			}
 		#the input elf file - as the last arg
 		&main::Output(
-			" --elfinput=","\"\$(EPOCBLD$Bld)\\$Trg\"",
+			" --elfinput=","\"\$(EPOCBLD$Bld)/$Trg\"",
 			" --linkas=$LinkAs"
 			);
 		if (&main::CompressTarget)
@@ -1104,7 +1090,7 @@ sub PMBld {
 		    }
 		
 		&main::Output(
- 		" --libpath=", "\"\$(EPOCLIB)\\LIB\""
+ 		" --libpath=", "\"\$(EPOCLIB)/lib\""
  		);
 
 		if($BasicTrgType=~/^DLL/ && $TrgType!~/^DLL/){
@@ -1130,7 +1116,7 @@ sub PMBld {
 	        &main::Output(
 			"\t\$(AR) ",
 				" \$(ARCHIVER_CREATE_OPTION) ",
-				" \$(EPOCSTATLINK$Bld)\\$Trg \$(OBJECTS$Bld)\n"
+				" \$(EPOCSTATLINK$Bld)/$Trg \$(OBJECTS$Bld)\n"
 			);
          }
 
@@ -1140,20 +1126,20 @@ sub PMBld {
 
 	if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/o || $TrgType=~/^EXEDLL$/o) {
 		&main::Output(
-			"\tcopy ", " \"\$(EPOCBLD$Bld)\\$ExportLibrary.def\"", " \"\$(EPOCBLD)\\$ExportLibrary.def\"\n"
+			"\tcp ", " \"\$(EPOCBLD$Bld)/$ExportLibrary.def\"", " \"\$(EPOCBLD)/$ExportLibrary.def\"\n"
 			);
 		if  (&main::ExportUnfrozen) {
 		    &main::Output(
 			          "\n",
-				  "\tcopy \$(EPOCBLD$Bld)\\$ExportLibrary.dso ",
-				  "\$(EPOCLIB)\\LIB\\$ExportLibrary.dso",
+				  "\tcp \$(EPOCBLD$Bld)/$ExportLibrary.dso ",
+				  "\$(EPOCLIB)/lib/$ExportLibrary.dso",
 				  "\n"
 				 );
 
 		    &main::Output(
 			          "\n",
-				  "\tcopy \$(EPOCBLD$Bld)\\$ExportLibrary.dso ",
-				  "\$(EPOCLIB)\\LIB\\$ExtraExportLibrary.dso",
+				  "\tcp \$(EPOCBLD$Bld)/$ExportLibrary.dso ",
+				  "\$(EPOCLIB)/lib/$ExtraExportLibrary.dso",
 				  "\n"
 				 ) if ($ExtraExportLibrary);
 
@@ -1163,17 +1149,17 @@ sub PMBld {
 	if($IsCustomDll eq 1)
 	{
 		&main::Output(
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$ExportLibrary.exp"), ": $DefFile\n");
+			&Generic_Quote("\$(EPOCBLD$Bld)/$ExportLibrary.exp"), ": $DefFile\n");
 
-	    my $theDefFile = "\$(EPOCBLD)\\$ExportLibrary.def";
+	    my $theDefFile = "\$(EPOCBLD)/$ExportLibrary.def";
 	    $theDefFile = $DefFile if (-e $DefFile && !&main::ExportUnfrozen);
 	    my $theAssembler = " \$(ASM) ";
 	    &main::Output(
-		"\telf2e32  \\\n\t\t--definput=$theDefFile \\\n\t\t--dump=a \\\n\t\t--output=\$(EPOCBLD)\\$ExportLibrary.s \n",
-		"\t$theAssembler \\\n\t\t \$(ASM_OUTPUT_OPTION) \$(EPOCBLD$Bld)\\$ExportLibrary.exp  \$(EPOCBLD)\\$ExportLibrary.s\n\n"
+		"\telf2e32  \\\n\t\t--definput=$theDefFile \\\n\t\t--dump=a \\\n\t\t--output=\$(EPOCBLD)/$ExportLibrary.s \n",
+		"\t$theAssembler \\\n\t\t \$(ASM_OUTPUT_OPTION) \$(EPOCBLD$Bld)/$ExportLibrary.exp  \$(EPOCBLD)/$ExportLibrary.s\n\n"
 	    );
 		&main::Output(
-			"\t-\$(ERASE) \"\$(EPOCBLD)\\$ExportLibrary.s\"\n\n"
+			"\t-\$(ERASE) \"\$(EPOCBLD)/$ExportLibrary.s\"\n\n"
 		);
 	}
 
@@ -1304,16 +1290,16 @@ sub PMSrcDepend {
 		if ($tranasm)
 		{
 			&main::Output(
-				&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.pre"), " ",
+				&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.pre"), " ",
 			) if $cia;
 		}
 
 		&main::Output(
-			&Generic_Quote("\$(EPOCBLD$_)\\$BaseObj.cpp"), " ",
+			&Generic_Quote("\$(EPOCBLD$_)/$BaseObj.cpp"), " ",
 		) if $cia;
 		&main::Output(
-			&Generic_Quote("\$(EPOCBLD$_)\\$BaseSrc.lis"), " ",
-			&Generic_Quote("\$(EPOCBLD$_)\\$BaseObj.o"), " \\\n",
+			&Generic_Quote("\$(EPOCBLD$_)/$BaseSrc.lis"), " ",
+			&Generic_Quote("\$(EPOCBLD$_)/$BaseObj.o"), " \\\n",
 		);
 	}
 	&main::Output(
@@ -1362,17 +1348,17 @@ sub PMSrcBldDepend {
 	if ($tranasm)
 	{
 		&main::Output(
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.pre"), " ",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.pre"), " ",
 		) if $cia;
 	}
 
 	&main::Output(
-		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseObj.cpp"), " ",
+		&Generic_Quote("\$(EPOCBLD$Bld)/$BaseObj.cpp"), " ",
 	) if $cia;
 
 	&main::Output(
-		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), " ",
-		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseObj.o"), " :",
+		&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.lis"), " ",
+		&Generic_Quote("\$(EPOCBLD$Bld)/$BaseObj.o"), " :",
 	);
 
 	my $prefix_file=getConfigVariable('PREFIXFILE');
@@ -1402,7 +1388,7 @@ sub quoted_path
 {
     my $curdrive="";
     my ($arg) = @_;
-    return "\"$arg\"" if ($arg !~ /^\\[^\\]/);	# not an absolute path
+    return "\"$arg\"" if ($arg !~ /^\/[^\/]/);	# not an absolute path
 
 		$curdrive=$1 if (cwd =~ /^(.:)/);
     return "\"$curdrive$arg\"";
@@ -1426,7 +1412,7 @@ sub PMEndSrcBld {
 	my $ABI=&main::ABI;
 	my $BaseSrc=&main::BaseSrc;
 	my $Bld=&main::Bld;
-	my $Src=lc &main::Src;
+	my $Src=&main::Src;
 	my $SrcPath=&main::SrcPath;
 	my $Ext = &main::Path_Split('Ext', $Src);
 	$Src = ucfirst $Src if ($Ext !~ /\.(cpp|c)$/);
@@ -1442,10 +1428,10 @@ sub PMEndSrcBld {
 	if ($AsmFilep || $Ext =~ /cia/i) {
 		&main::Output(
 # compile the translated, preprocessed source
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.o"), " : ",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), "\n",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc\_.o"), " : ",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc\_.cpp"), "\n",
 			"\t\@echo $Src\n",
-			"\t\$(CC$Bld) $lfboption $LangOptions ", "\$(INCLUDE_OPTION)"," \$(call absolutePaths,(\$ChopSrcPath \$(INCDIR) \$(OUTPUT_OPTION) \$\@ \$(EPOCBLD$Bld)\\$BaseSrc\_.cpp)\n",
+			"\t\$(CC$Bld) $lfboption $LangOptions ", "\$(INCLUDE_OPTION)"," \$(call absolutePaths,(\$ChopSrcPath \$(INCDIR) \$(OUTPUT_OPTION) \$\@ \$(EPOCBLD$Bld)/$BaseSrc\_.cpp)\n",
 			"\n"
 			);
 # rule to translate the preprocessed source
@@ -1453,59 +1439,59 @@ sub PMEndSrcBld {
 			if ($tranasm)
 			{
 		&main::Output(
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), " : ",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.pre"), "\n",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc\_.cpp"), " : ",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.pre"), "\n",
 
-				"\t\$(TRANASM) \$(TRANASM_FLAGS) \$(TRANASM_OUTPUT_OPTION)\$\@ \$(TRANASM_INPUT_OPTION)\$(EPOCBLD$Bld)\\$BaseSrc.pre\n",
-#			"\ttranasm -n -s -o=\$\@ \$(EPOCBLD$Bld)\\$BaseSrc.pre\n",
+				"\t\$(TRANASM) \$(TRANASM_FLAGS) \$(TRANASM_OUTPUT_OPTION)\$\@ \$(TRANASM_INPUT_OPTION)\$(EPOCBLD$Bld)/$BaseSrc.pre\n",
+#			"\ttranasm -n -s -o=\$\@ \$(EPOCBLD$Bld)/$BaseSrc.pre\n",
 			"\n"
 			);
 # rule to preprocess the source
 		&main::Output(
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.pre"), " : ",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.pre"), " : ",
 			&Generic_Quote("$SrcPath$Src"), "\n",
-			"\t\$(CC$Bld) \$(PREPROCESSOR_OPTION) $preinclude $LangOptions ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,(\$ChopSrcPath \$(INCDIR) $ChopSrcPath\\$Src \$(OUTPUT_OPTION) \$\@) \n",
+			"\t\$(CC$Bld) \$(PREPROCESSOR_OPTION) $preinclude $LangOptions ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,(\$ChopSrcPath \$(INCDIR) $ChopSrcPath/$Src \$(OUTPUT_OPTION) \$\@) \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\_.$ABI.lst"),
 			"\n",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.lis"), " : ",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), "\n",
-			"\t\$(CC$Bld) $LangOptions ", "\$(ASSEMBLER_LISTING_OPTION) ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR) \$(OUTPUT_OPTION) \$\@ \$(EPOCBLD$Bld)\\$BaseSrc\_.cpp)\n",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc\_.lis"), " : ",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc\_.cpp"), "\n",
+			"\t\$(CC$Bld) $LangOptions ", "\$(ASSEMBLER_LISTING_OPTION) ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR) \$(OUTPUT_OPTION) \$\@ \$(EPOCBLD$Bld)/$BaseSrc\_.cpp)\n",
 			"\n"
 			);
 			}
 			else
 			{
 			&main::Output(
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), " : ",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc\_.cpp"), " : ",
 			&Generic_Quote("$SrcPath$Src"), "\n",
-			"\t\$(CC$Bld) \$(PREPROCESSOR_OPTION) $preinclude $LangOptions ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR) $ChopSrcPath\\$Src \$(OUTPUT_OPTION) \$\@) \n",
+			"\t\$(CC$Bld) \$(PREPROCESSOR_OPTION) $preinclude $LangOptions ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR) $ChopSrcPath/$Src \$(OUTPUT_OPTION) \$\@) \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\_.$ABI.lst"),
 			"\n",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.lis"), " : ",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), "\n",
-			"\t\$(CC$Bld) $LangOptions ", "\$(ASSEMBLER_LISTING_OPTION) ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR) \$(OUTPUT_OPTION) \$\@ \$(EPOCBLD$Bld)\\$BaseSrc\_.cpp)\n",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc\_.lis"), " : ",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc\_.cpp"), "\n",
+			"\t\$(CC$Bld) $LangOptions ", "\$(ASSEMBLER_LISTING_OPTION) ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR) \$(OUTPUT_OPTION) \$\@ \$(EPOCBLD$Bld)/$BaseSrc\_.cpp)\n",
 			"\n"
 			);
 			}
 	} else {
 
 		&main::Output(
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o"), " : ",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.o"), " : ",
 			&Generic_Quote("$SrcPath$Src"), "\n",
 			"\t\@echo $Src\n",
-			"\t\$(CC$Bld) $lfboption $LangOptions ", "\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR) \$(OUTPUT_OPTION) \$\@ $ChopSrcPath\\$Src)\n",
+			"\t\$(CC$Bld) $lfboption $LangOptions ", "\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR) \$(OUTPUT_OPTION) \$\@ $ChopSrcPath/$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.$ABI.lst"),
 			"\n",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), " : ",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.lis"), " : ",
 			&Generic_Quote("$SrcPath$Src"), "\n",
-			"\t\$(CC$Bld) $LangOptions ","\$(ASSEMBLER_LISTING_OPTION) ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR) \$(OUTPUT_OPTION) \$\@ $ChopSrcPath\\$Src) \n",
+			"\t\$(CC$Bld) $LangOptions ","\$(ASSEMBLER_LISTING_OPTION) ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR) \$(OUTPUT_OPTION) \$\@ $ChopSrcPath/$Src) \n",
 			"\n"
 			);
 	}
@@ -1517,7 +1503,7 @@ sub MultiFileEndSrcBld {
 	my $BaseSrc=&main::BaseSrc;
 	my $Bld=&main::Bld;
         my $KeyFile = &main::Src;
-	my $Src=ucfirst lc $KeyFile;
+	my $Src=$KeyFile;
 	my $SrcPath=&main::SrcPath;
 	my $Ext = &main::Path_Split('Ext', $Src);
 #	my $LangOptions = &main::SelectLangOptions($Ext);
@@ -1536,12 +1522,12 @@ sub MultiFileEndSrcBld {
 # compile the translated, preprocessed source
 		       &main::Output( "OBJECTS$MFVarN = ");
 		       foreach my $obj (@{$CompilationGroups{$KeyFile}{Objects}}) {
-			       &main::Output( &Generic_Quote("\\\n\t\$(EPOCBLD$Bld)\\$obj"), " ");
+			       &main::Output( &Generic_Quote("\\\n\t\$(EPOCBLD$Bld)/$obj"), " ");
 		       }
        		       &main::Output( "\n\n");
 		       &main::Output( "SOURCES$MFVarN = ");
 		       foreach my $src (@{$CompilationGroups{$KeyFile}{Sources}}) {
-			       &main::Output( &Generic_Quote("\\\n\t\$(EPOCBLD$Bld)\\$src", " "));
+			       &main::Output( &Generic_Quote("\\\n\t\$(EPOCBLD$Bld)/$src", " "));
 		       }
        		       &main::Output( "\n\n");
 		       &main::Output( "\$(OBJECTS$MFVarN) : \$(SOURCES$MFVarN) \n");
@@ -1556,21 +1542,21 @@ sub MultiFileEndSrcBld {
 		}
 		&main::Output(
 # rule to translate the preprocessed source
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), " : ",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.pre"), "\n",
-			"\ttranasm -n -s -o=\$\@ \$(EPOCBLD$Bld)\\$BaseSrc.pre\n",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc\_.cpp"), " : ",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.pre"), "\n",
+			"\ttranasm -n -s -o=\$\@ \$(EPOCBLD$Bld)/$BaseSrc.pre\n",
 			"\n",
 # rule to preprocess the source
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.pre"), " : ",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.pre"), " : ",
 			&Generic_Quote("$SrcPath$Src"), "\n",
-			"\t\$(CC$Bld) \$(PREPROCESSOR_OPTION) $preinclude $LangOptions ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR)) $ChopSrcPath\\$Src \$(OUTPUT_OPTION) \$\@ \n",
+			"\t\$(CC$Bld) \$(PREPROCESSOR_OPTION) $preinclude $LangOptions ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR)) $ChopSrcPath/$Src \$(OUTPUT_OPTION) \$\@ \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\_.$ABI.lst"),
 			"\n",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.lis"), " : ",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.cpp"), "\n",
-			"\t\$(CC$Bld) $LangOptions ", "\$(ASSEMBLER_LISTING_OPTION) ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR)) \$(OUTPUT_OPTION) \$\@ \$(EPOCBLD$Bld)\\$BaseSrc\_.cpp\n",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc\_.lis"), " : ",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc\_.cpp"), "\n",
+			"\t\$(CC$Bld) $LangOptions ", "\$(ASSEMBLER_LISTING_OPTION) ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR)) \$(OUTPUT_OPTION) \$\@ \$(EPOCBLD$Bld)/$BaseSrc\_.cpp\n",
 			"\n"
 			);
 	} else {
@@ -1582,7 +1568,7 @@ sub MultiFileEndSrcBld {
 #                      compile the source
 		       &main::Output( "OBJECTS$MFVarN = ");
 		       foreach my $obj (@{$CompilationGroups{$KeyFile}{Objects}}) {
-			       &main::Output( &Generic_Quote("\\\n\t\$(EPOCBLD$Bld)\\$obj"), " ");
+			       &main::Output( &Generic_Quote("\\\n\t\$(EPOCBLD$Bld)/$obj"), " ");
 		       }
        		       &main::Output( "\n\n");
 		       &main::Output( "SOURCES$MFVarN = ");
@@ -1602,12 +1588,12 @@ sub MultiFileEndSrcBld {
 		}
 #		generate an assembly listing target too
 		&main::Output(
-			"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.$ABI.lst"),
 			"\n",
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.lis"), " : ",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.lis"), " : ",
 			&Generic_Quote("$SrcPath$Src"), "\n",
-			"\t\$(CC$Bld) $LangOptions ","\$(ASSEMBLER_LISTING_OPTION) ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR)) \$(OUTPUT_OPTION) \$\@ $ChopSrcPath\\$Src \n",
+			"\t\$(CC$Bld) $LangOptions ","\$(ASSEMBLER_LISTING_OPTION) ","\$(INCLUDE_OPTION)"," \$(call absolutePaths,$ChopSrcPath \$(INCDIR)) \$(OUTPUT_OPTION) \$\@ $ChopSrcPath/$Src \n",
 			"\n"
 			);
 	}
@@ -1746,12 +1732,11 @@ sub GCCInstallPath {
 	while(<PIPE>)
 	{
 		$gccInstallPath = $_;
-		$gccInstallPath =~ s/\//\\/g;
 	}
 	close PIPE;
 
 #	Extract the path till the occurence of bin directory.
-	my @Installpath = split(/\\\.\./, $gccInstallPath);
+	my @Installpath = split(/\/lib\/gcc/, $gccInstallPath);
 
 	return $Installpath[0];
 }
@@ -1763,12 +1748,11 @@ sub GCCLibPath {
 	while(<PIPE>)
 	{
 		$gccLibPath = $_;
-		$gccLibPath =~ s/\//\\/g;
 	}
 	close PIPE;
 
 #	Extract the path till the occurence of libgcc.a directory.
-	my @libpath = split(/\\libgcc.a/, $gccLibPath);
+	my @libpath = split(/\/libgcc.a/, $gccLibPath);
 
 	return $libpath[0];
 }
@@ -1862,7 +1846,7 @@ sub GetToolChainIncDir {
 	if($Plat eq "GCCE")
 	{
 		my @includePath = &GCCLibPath;
-		return "$includePath[0]\\include";
+		return "$includePath[0]/include";
 	}
 	else
 	{
diff --git a/cl_codewarrior.pm b/cl_codewarrior.pm
index a20934d..9f871e5 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=();
@@ -40,9 +40,9 @@ require Exporter;
 	PMEndSrcList
 );
 
-use Winutl;
+use winutl;
 use cl_generic;
-use E32Variant;
+use e32variant;
 
 sub RoundUp1k($) {
 	# Accept C hexadecimal number (0xNNN).  Convert argument to Kb
@@ -141,7 +141,7 @@ sub PMStartBldList($) {
 	my $TrgDir="";
 	my $AifTrgDir="";
 	if (&Generic_Definition("TRGDIR") ne "") {
-		$TrgDir="\$(TRGDIR)\\";
+		$TrgDir="\$(TRGDIR)/";
 		$AifTrgDir=$TrgDir;
 	}
 
@@ -172,7 +172,7 @@ sub PMStartBldList($) {
 			" \\\n -i \"$_\""
 		);
 	}
-	use Pathutl;
+	use pathutl;
 	if($VariantFile){
 	    my $variantFilePath = Path_Split('Path',$VariantFile);
 	    $VariantFile  = Path_Split('FILE',$VariantFile);
@@ -234,7 +234,7 @@ sub PMStartBldList($) {
 
 	foreach (@BldList) {
 		&main::Output(
-			"CW$_ = $MWCC"
+			"CW$_ = wine $MWCC"
 		);
 		if (/DEB$/o) {
 			&main::Output(
@@ -277,12 +277,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")
 				);
 			}
 		}
@@ -309,7 +309,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",
@@ -321,7 +321,7 @@ sub PMStartBldList($) {
 		my $ResourceRef;
 		foreach $ResourceRef (@$ResourceStructRef) {
 			if(! defined $$ResourceRef{Hdronly}) {
-				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
@@ -333,7 +333,7 @@ sub PMStartBldList($) {
 
 		my $AifRef;
 		foreach $AifRef (@$AifStructRef) {
-			my $file="\$(EPOCTRG$_)\\$AifTrgDir$$AifRef{Trg}";
+			my $file="\$(EPOCTRG$_)/$AifTrgDir$$AifRef{Trg}";
 			&Generic_MakeWorkFile($makework,$file);
 			&main::Output(
 				" \\\n",
@@ -370,26 +370,26 @@ 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",
-					"\tperl -S prepdef.pl ",&Generic_Quote($DefFile)," \"\$(EPOCBLD)\\$ExportLibrary.prep.def\"\n",
-					"\t$MWLD \"\$(EPOCBLD)\\$ExportLibrary.prep.def\" -importlib -o \$\@",
+					"\tperl -S prepdef.pl ",&Generic_Quote($DefFile)," \"\$(EPOCBLD)/$ExportLibrary.prep.def\"\n",
+					"\twine $MWLD \"\$(EPOCBLD)/$ExportLibrary.prep.def\" -importlib -o \$\@",
 					" -addcommand \"out:$LibLinkAs\" -warnings off",
 					"\n"
 				);
 			} 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"
 				);
 			}
 		} 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"
 			);
 		}
@@ -402,7 +402,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 \$(EFREEZE_ALLOW_REMOVE) \"$DefFile\" \"\$(EPOCBLD)\\$ExportLibrary.def\" \n"
+			"\tperl -S efreeze.pl \$(EFREEZE_ALLOW_REMOVE) \"$DefFile\" \"\$(EPOCBLD)/$ExportLibrary.def\" \n"
 		);
 	}
 	&main::Output(
@@ -411,13 +411,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;
 }
@@ -445,7 +445,7 @@ sub PMBld {
 	my $TrgPath=&main::TrgPath;
 	my $TrgType=&main::TrgType;
 
-	$uidfile = "$BaseTrg.UID";
+	$uidfile = "$BaseTrg.uid";
 
 	if ($Bld =~ /DEB/) {
 		@LibList=&main::DebugLibList;
@@ -458,12 +458,12 @@ sub PMBld {
 	my $BLDTRGPATH = "";
 	my $AIFBLDTRGPATH = "";
 	if ($TrgPath) {
-		$BLDTRGPATH = "\$(TRGDIR)\\";	    # handles TARGETPATH
+		$BLDTRGPATH = "\$(TRGDIR)/";	    # handles TARGETPATH
 		$AIFBLDTRGPATH = $BLDTRGPATH;
 		&Winutl_AdjustTargetPath(\$BLDTRGPATH);
 	}
-	$BLDTRGPATH = "\$(EPOCTRG$Bld)\\".$BLDTRGPATH;
-	$AIFBLDTRGPATH = "\$(EPOCTRG$Bld)\\".$AIFBLDTRGPATH;
+	$BLDTRGPATH = "\$(EPOCTRG$Bld)/".$BLDTRGPATH;
+	$AIFBLDTRGPATH = "\$(EPOCTRG$Bld)/".$AIFBLDTRGPATH;
 
 	# REAL TARGETS
 	#-------------
@@ -484,17 +484,17 @@ 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) {
 				if(! defined $$ResourceRef{Hdronly}) {
-					push @releaseables,"\$(EPOCTRG$Bld)\\$$ResourceRef{Trg}";
+					push @releaseables,"\$(EPOCTRG$Bld)/$$ResourceRef{Trg}";
 				}
 			}
 			my $AifRef;
@@ -503,7 +503,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?
@@ -549,7 +549,7 @@ sub PMBld {
 		my $BaseSrc = &main::Path_Split('Base', $_);
 		my $Ext = &main::Path_Split('Ext', $_);
 		$BaseSrc.='_' if (lc($Ext) eq '.cia');
-		$BaseSrc =~ s/\.UID/_UID_/i if ($BaseSrc eq $uidfile);
+		$BaseSrc =~ s/\.uid/_uid_/i if ($BaseSrc eq $uidfile);
 		
    		&main::Output(
 			" \\\n\tLISTING$Bld$BaseSrc"
@@ -565,12 +565,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(
@@ -592,14 +592,14 @@ sub PMBld {
 		$BaseSrc.='_' if (lc($Ext) eq '.cia');
    		&main::Output(
 			" \\\n",
-			"\t", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o")
+			"\t", &Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.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) {
@@ -607,7 +607,7 @@ sub PMBld {
 		# CodeWarrior IDE projects.
 		&main::Output(
 			" \\\n",
-			"\t", &Generic_Quote("\$(EPOCBLD$Bld)\\$BaseTrg"."_UID_.o")
+			"\t", &Generic_Quote("\$(EPOCBLD$Bld)/$BaseTrg"."_uid_.o")
 		);
 	}
 	&main::Output(
@@ -629,14 +629,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
 		);
@@ -705,11 +705,11 @@ sub PMBld {
 		}
 		&main::Output(
 			"STAGE1_LINK_FLAGS$Bld= \$(COMMON_LINK_FLAGS$Bld) \$(LIBS$Bld) \\\n\t",
-			" -o \"\$(EPOCBLD$Bld)\\$Trg\"", 
+			" -o \"\$(EPOCBLD$Bld)/$Trg\"", 
 			' -export dllexport',
 			" $Include",
 			' -nocompactimportlib', 
-			" -implib \"\$(EPOCBLD$Bld)\\$ExportLibrary.lib\"",
+			" -implib \"\$(EPOCBLD$Bld)/$ExportLibrary.lib\"",
 			" -addcommand \"out:$Trg\" -warnings off",
 			"\n",
 		);
@@ -731,11 +731,11 @@ sub PMBld {
 	}
 	if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/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"
 			);
 		}
@@ -767,7 +767,7 @@ sub PMBld {
 # tools hack
 		unless (&main::Plat eq 'TOOLS') {
 			&main::Output(
-				" ", &Generic_Quote("\$(EPOCSTATLINK$Bld)\\$FirstLib")
+				" ", &Generic_Quote("\$(EPOCSTATLINK$Bld)/$FirstLib")
 			);
 		}
 	}
@@ -780,21 +780,21 @@ sub PMBld {
 #	Link by name first time round for dlls
 	if ($BasicTrgType=~/^DLL$/o || $TrgType=~/^EXEXP$/o) {
 		&main::Output(
-			"\t$MWLD \$(STAGE1_LINK_FLAGS$Bld) -l \$(EPOCBLD$Bld) -search \$(notdir \$(LINK_OBJS$Bld))\n",
-			"\t\$(ERASE) \"\$(EPOCBLD$Bld)\\$Trg\"\n",
+			"\twine $MWLD \$(STAGE1_LINK_FLAGS$Bld) -l \$(EPOCBLD$Bld) -search \$(notdir \$(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 $AbsentSubst -Inffile \"\$(EPOCBLD$Bld)\\$ExportLibrary.inf\""
+			"\tperl -S makedef.pl $AbsentSubst -Inffile \"\$(EPOCBLD$Bld)/$ExportLibrary.inf\""
 		);
 		if (SysTrg()) {
     			&main::Output( "\t\t-SystemTargetType \\\n" );
@@ -815,15 +815,15 @@ sub PMBld {
 			$Ordinal++;
 		}
 		&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(
@@ -845,7 +845,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(),
 		);
@@ -875,7 +875,7 @@ sub PMBitMapBld {
 
 	my $ChopTrgPath="";
 	if ($$BitMapRef{TrgPath}) {
-		$ChopTrgPath.="\\$$BitMapRef{TrgPath}";
+		$ChopTrgPath.="/$$BitMapRef{TrgPath}";
 		chop $ChopTrgPath;
 	}
 
@@ -884,7 +884,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"
@@ -906,7 +906,7 @@ sub PMResrcBld {
 		if(! defined $$ResourceRef{Hdronly})
 		{
 			&main::Output(
-				&Generic_Quote("\$(EPOCTRG$Bld)\\$$ResourceRef{Trg}"), " : ", 
+				&Generic_Quote("\$(EPOCTRG$Bld)/$$ResourceRef{Trg}"), " : ", 
 				&Generic_Quote("$$ResourceRef{GenericTrg}"), "\n",
 				"\t", &Generic_CopyAction(),
 				"\n"
@@ -924,7 +924,7 @@ sub PMAifBld {
 	my $AifRef=&main::AifRef;
 	my $TrgDir="";
 	if (&Generic_Definition("TRGDIR") ne "") {
-		$TrgDir="\\\$(TRGDIR)";
+		$TrgDir="/\$(TRGDIR)";
 	}
 
 	my @BldList=&main::BldList;
@@ -932,7 +932,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"
@@ -954,13 +954,13 @@ sub PMSrcDepend {
 	my @BldList=&main::BldList;	
 	my @DepList=&main::DepList;
 	my $BaseSrc=&main::BaseSrc;
-	$BaseSrc =~ s/\.UID/_UID_/i if ($BaseSrc eq $uidfile);
+	$BaseSrc =~ s/\.uid/_uid_/i if ($BaseSrc eq $uidfile);
 
 	return if (@DepList == 0);
 
 	foreach (@BldList) {
 		&main::Output(
-			&Generic_Quote("\$(EPOCBLD$_)\\$BaseSrc.o"), " \\\n",
+			&Generic_Quote("\$(EPOCBLD$_)/$BaseSrc.o"), " \\\n",
 		);
 	}
 	&main::Output(
@@ -981,12 +981,12 @@ sub PMSrcBldDepend {
 	my $Bld=&main::Bld;
 	my @DepList=&main::DepList;
 	my $BaseSrc=&main::BaseSrc;
-	$BaseSrc =~ s/\.UID/_UID_/i if ($BaseSrc eq $uidfile);
+	$BaseSrc =~ s/\.uid/_uid_/i if ($BaseSrc eq $uidfile);
 
 	return if (@DepList == 0);
 
 	&main::Output(
-		&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o"), " :",
+		&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.o"), " :",
 	);
 	foreach (@DepList) {
 		&main::Output(
@@ -1001,7 +1001,7 @@ sub PMSrcBldDepend {
 
 sub PMEndSrcBld {
 	my $BaseSrc=&main::BaseSrc;
-	$BaseSrc =~ s/\.UID/_UID_/i if ($BaseSrc eq $uidfile);
+	$BaseSrc =~ s/\.uid/_uid_/i if ($BaseSrc eq $uidfile);
 	my $Bld=&main::Bld;
 	my $Plat=&main::Plat;
 	my $Src=&main::Src;
@@ -1011,25 +1011,25 @@ sub PMEndSrcBld {
 
 	if ($Cia) {
 		&main::Output(
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc\_.o"), " : ",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc\_.o"), " : ",
 			&Generic_Quote("$SrcPath$Src"), "\n",
 			"\techo $Src\n",
 			"\t\$(CW$Bld) -lang c++ -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\_.$Plat.lst"),
 			"\n"
 		);
 	} else {
 		&main::Output(
-			&Generic_Quote("\$(EPOCBLD$Bld)\\$BaseSrc.o"), " : ",
+			&Generic_Quote("\$(EPOCBLD$Bld)/$BaseSrc.o"), " : ",
 			&Generic_Quote("$SrcPath$Src"), "\n",
 			"\techo $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.$Plat.lst"),
 			"\n"
 		);
@@ -1056,7 +1056,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"
 	);
@@ -1085,7 +1085,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_generic.pm b/cl_generic.pm
index 7e5f661..f0f2cb6 100644
--- a/cl_generic.pm
+++ b/cl_generic.pm
@@ -29,8 +29,8 @@ require Exporter;
 
 use File::Basename;
 use lockit_info;
-use CheckSource;
-use E32Variant;
+use checksource;
+use e32variant;
 
 my $SavedBldPath;
 my $MakefileType=0;	# 0=NMAKE, 1=MAKE
@@ -41,10 +41,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
 
@@ -89,10 +89,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 - EPOC SDK for GNU/Linux\n",
+		"#\n",
+		     );
+	&main::Output(
 		"\n",
 		'# CWD ',             &main::Path_WorkPath, "\n",
 		'# MMPFile ',         &main::MmpFile,       "\n",
@@ -141,15 +146,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");
 	}
 	
 	my $gccxml;
@@ -295,7 +301,6 @@ sub Generic_Definition ($) {
 my %MkDirs;
 sub Generic_MkDir ($) {
 	my $dir=&main::Path_Chop(&expandDefines($_[0]));
-	$dir = lc $dir;
 	$MkDirs{$dir}=1;
 	return $dir;
 }
@@ -336,7 +341,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 
@@ -475,8 +480,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");
@@ -484,7 +489,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;
@@ -499,13 +504,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;
 		}
@@ -516,7 +521,7 @@ sub Generic_Releaseables {
 	foreach $ResourceRef (@$ResourceStructRef) {
 		if(defined $$ResourceRef{Hdronly})
 			{
-				my $rsg="\$(EPOCINC)\\$$ResourceRef{BaseTrg}.RSG";
+				my $rsg="\$(EPOCINC)\/$$ResourceRef{BaseTrg}.RSG";
 				$$ResourceRef{GenericTrg}=$rsg;	# record for later
 
 				&Generic_MakeWorkDir('GENERIC_MAKEWORK',$EPOCIncPath);
@@ -524,12 +529,12 @@ sub Generic_Releaseables {
 			}
 		else
 			{
-				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;
 				}
@@ -542,7 +547,7 @@ sub Generic_Releaseables {
 	{
 		if(defined $stringtable->{ExportPath})
 		{
-			$Files{$stringtable->{ExportPath}."\\".$stringtable->{BaseTrg}.".h"} = 1;
+			$Files{$stringtable->{ExportPath}."/".$stringtable->{BaseTrg}.".h"} = 1;
 		}
 	}
 
@@ -644,7 +649,7 @@ sub Generic_ResrcBld {
 	my $AbsSrc;
 	my $AbsSrcPath;
 	
-	my $ResrcHdr=join '', &main::EPOCIncPath(), $BaseResrc, '.RSG';
+	my $ResrcHdr=join '', &main::EPOCIncPath(), $BaseResrc, '.rsg';
 	my $AbsResrcHdr;
 	my $PlatName=&main::PlatName;
 
@@ -666,8 +671,8 @@ sub Generic_ResrcBld {
 	my $HeaderOption = "";
 	my $HeaderCopyCmd = "";
 	if ($$ResourceRef{Hdr} || $$ResourceRef{Hdronly}) {
-		$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";
 		print "$HeaderCopyCmd";
 	}
 	if (! $$ResourceRef{Hdronly}) {
@@ -707,8 +712,9 @@ sub Generic_ResrcBld {
 			" -I \"$_\""
 		);
 	}
+	my $uclang = uc $$ResourceRef{Lang};
 	&main::Output(
-		" -DLANGUAGE_$$ResourceRef{Lang} -u \"$AbsSrc\" ",
+		" -DLANGUAGE_$uclang -u \"$AbsSrc\" ",
 		" $Uidsarg ",
 		"$RscOption $HeaderOption -t\"$SavedBldPath\""
 	);
@@ -727,7 +733,7 @@ sub Generic_ResrcBld {
 
 
 	my @macros;
-	push @macros, "LANGUAGE_$$ResourceRef{Lang}", "_UNICODE";
+	push @macros, "LANGUAGE_$uclang", "_UNICODE";
 	my @userIncludes = &main::Path_Chop(&main::Path_AbsToWork(&main::UserIncPaths));
 	unshift (@userIncludes, $AbsSrcPath);	
 	my @systemIncludes = &main::Path_Chop(&main::Path_AbsToWork(&main::SysIncPaths));
diff --git a/cl_tools.pm b/cl_tools.pm
index 7cb63fc..d97968c 100644
--- a/cl_tools.pm
+++ b/cl_tools.pm
@@ -243,7 +243,7 @@ sub PMStartBldList($) {
 		"\n",
 		"CLEANLIBRARY :\n"
 	);
-	&Generic_MakeWorkDir('MAKEWORKLIBRARY',"${LibPath}UDEB");
+	&Generic_MakeWorkDir('MAKEWORKLIBRARY',"${LibPath}udeb");
 
 	&Generic_Releaseables;
 }
diff --git a/compilation_config/armv5_abiv2.mk b/compilation_config/armv5_abiv2.mk
index af3aa35..db12d29 100644
--- a/compilation_config/armv5_abiv2.mk
+++ b/compilation_config/armv5_abiv2.mk
@@ -144,7 +144,7 @@ EXTRA_CC_OPTION=
 #---------------------
 
 # Prefix Header File passed to the preprocessor
-PREFIXFILE=$(EPOCROOT)EPOC32\INCLUDE\RVCT2_2\RVCT2_2.h
+PREFIXFILE=$(EPOCROOT)epoc32/include/rvct2_2/rvct2_2.h
 
 # For .cpp Source files
 CPP_LANG_OPTION=--cpp
@@ -187,7 +187,7 @@ INCLUDE_OPTION=-J
 
 # Preinclude file for that compiler that contains all the compiler specific definitions
 # required by the Symbian OS source code.
-PREINCLUDE_OPTION=--preinclude $(EPOCROOT)EPOC32\INCLUDE\RVCT2_2\RVCT2_2.h
+PREINCLUDE_OPTION=--preinclude $(EPOCROOT)epoc32/include/rvct2_2/rvct2_2.h
 
 # Option to control the search for the header files. For example, if we do not want to do a search in the
 # standard include directory of C++, then can restrict it by providing the appropriate option.
@@ -298,10 +298,10 @@ EXTRA_LD_OPTION=--datacompressor=off
 LINKER_ENTRY_OPTION=--entry
 
 # Symbol used to denote the Start of the gouped archives.
-START_GROUP_SYMBOL=(
+START_GROUP_SYMBOL=\(
 
 # Symbol used to denote the End of the gouped archives.
-END_GROUP_SYMBOL=)
+END_GROUP_SYMBOL=\)
 
 #-------------------------	
 # Library Specific Options
diff --git a/compilation_config/gcce.mk b/compilation_config/gcce.mk
index 28c4161..48e5a4c 100644
--- a/compilation_config/gcce.mk
+++ b/compilation_config/gcce.mk
@@ -144,7 +144,7 @@ EXTRA_CC_OPTION=
 #---------------------
 
 # Prefix Header File passed to the preprocessor
-PREFIXFILE=$(EPOCROOT)EPOC32\INCLUDE\GCCE\GCCE.h
+PREFIXFILE=$(EPOCROOT)epoc32/include/gcce/gcce.h
 
 # For .cpp Source files
 CPP_LANG_OPTION=-x c++
@@ -187,7 +187,7 @@ INCLUDE_OPTION=-I
 
 # Preinclude file for that compiler that contains all the compiler specific definitions
 # required by the Symbian OS source code.
-PREINCLUDE_OPTION=-include $(EPOCROOT)EPOC32/INCLUDE/GCCE/GCCE.h
+PREINCLUDE_OPTION=-include $(EPOCROOT)epoc32/include/gcce/gcce.h
 
 # Option to control the search for the header files. For example, if we do not want to do a search in the
 # standard include directory of C++, then can restrict it by providing the appropriate option.
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/def2dll b/def2dll
new file mode 100755
index 0000000..706c7c3
--- /dev/null
+++ b/def2dll
@@ -0,0 +1,4 @@
+#!/bin/sh
+DIR=`dirname $0`
+TOOL=`basename $0`
+perl $DIR/$TOOL.bat "$@"
diff --git a/def2dll.bat b/def2dll.bat
index ec06b21..bbb8bd6 100644
--- a/def2dll.bat
+++ b/def2dll.bat
@@ -1,5 +1,3 @@
-@goto invoke
-
 #!perl
 #line 5
 
@@ -20,13 +18,12 @@ 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 Armutl;
+use defutl;
+use armutl;
 
 my %opts = ();
 
@@ -114,8 +111,8 @@ sub genExpFile ($$$)
     my $numkeys = keys %symbolIndexMap;
     my $failed = 0;
 
-    open EXPFILE, ">$bldpath\\$expFile.s" or
-		die "Error: can't create $bldpath\\$expFile.s\n";
+    open EXPFILE, ">$bldpath/$expFile.s" or
+		die "Error: can't create $bldpath/$expFile.s\n";
 
     print EXPFILE "\tEXPORT __DLL_Export_Table__\n\n";
     print EXPFILE "\tEXPORT |DLL\#\#ExportTable|\n\n";
@@ -167,9 +164,9 @@ sub genExpFile ($$$)
     print EXPFILE "\tEND";
     close EXPFILE;
 
-    $failed = system "armasm $floatingpointmodel $interworking -o $path\\$expFile.exp $bldpath\\$expFile.s";
-    unlink ("$bldpath\\$expFile.s") unless $failed;
-    die "Error: cant create $path\\$expFile.exp\n" if $failed;
+    $failed = system "armasm $floatingpointmodel $interworking -o $path/$expFile.exp $bldpath/$expFile.s";
+    unlink ("$bldpath/$expFile.s") unless $failed;
+    die "Error: cant create $path/$expFile.exp\n" if $failed;
 }
 
 my %DataSymbols = ();
@@ -179,8 +176,8 @@ sub genVtblExportFile($$)
     my ($bldpath, $dllName) = @_;
     my $FileName = "VtblExports";
 
-    open VTBLFILE, ">$bldpath\\$FileName.s" or
-		die "Error: can't create $bldpath\\$FileName.s\n";
+    open VTBLFILE, ">$bldpath/$FileName.s" or
+		die "Error: can't create $bldpath/$FileName.s\n";
 
     print VTBLFILE "\tAREA |.directive|, NOALLOC, READONLY, ALIGN=2\n";
     printf VTBLFILE "\tDCB \"\#\<SYMEDIT\>\#\\n\"\n";
@@ -196,17 +193,17 @@ sub genVtblExportFile($$)
     print VTBLFILE "\tEND";
     close VTBLFILE;
 
-    my $failed = system "armasm $floatingpointmodel $interworking -o $bldpath\\$FileName.o $bldpath\\$FileName.s";
-    unlink ("$bldpath\\$FileName.s");
-    die "Error: cant create $bldpath\\$FileName.o\n" if $failed;
-    push @objectFiles, "$bldpath\\$FileName.o";
+    my $failed = system "armasm $floatingpointmodel $interworking -o $bldpath/$FileName.o $bldpath/$FileName.s";
+    unlink ("$bldpath/$FileName.s");
+    die "Error: cant create $bldpath/$FileName.o\n" if $failed;
+    push @objectFiles, "$bldpath/$FileName.o";
 }
 
 sub genLibFile ($$$$)
 {
     my ($path, $bldpath, $libFile, $dllName) = @_;
-    my $tempFileName = "$bldpath\\$compName";
-    my $viaFileName = sprintf("$bldpath\\_t%x_via_.txt", time);
+    my $tempFileName = "$bldpath/$compName";
+    my $viaFileName = sprintf("$bldpath/_t%x_via_.txt", time);
     my $keyz = keys %symbolIndexMap;
     my $failed = 0;
     my $key;
@@ -235,7 +232,7 @@ sub genLibFile ($$$$)
     open VIAFILE, ">$viaFileName" or
 		die "Error: can't create VIA fie $viaFileName\n";
 
-    print VIAFILE "${oP}create \"$path\\$libFile\"\n";
+    print VIAFILE "${oP}create \"$path/$libFile\"\n";
     my $objectFile;
     foreach $objectFile (@objectFiles) {
 		print VIAFILE "\"$objectFile\"\n";
@@ -245,24 +242,6 @@ sub genLibFile ($$$$)
     $failed = system( "armar ${oP}via $viaFileName");
     push @objectFiles, $viaFileName;
     unlink @objectFiles;
-    die "Error: can't create $path\\$libFile\n" if $failed;
+    die "Error: can't create $path/$libFile\n" if $failed;
 }
 
-__END__
-
-# Tell emacs that this is a perl script even 'though it has a .bat extension
-# Local Variables:
-# mode:perl
-# tab-width:4
-# End:
-
-:invoke
-@perl -x -S def2dll.bat %*
-
-
-
-
-
-
-
-
diff --git a/defutl.pm b/defutl.pm
index 0f2bc1e..ccdc134 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 f6c1f01..4cce4a0 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,39 +14,28 @@ 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/library/";
+	$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/";
 	
 	$Data{SecurePlatform} = 1;
 }
diff --git a/e32plat.pm b/e32plat.pm
index e3d73a8..a07f73e 100644
--- a/e32plat.pm
+++ b/e32plat.pm
@@ -1,3 +1,5 @@
+#!/usr/bin/perl -w
+#
 # E32PLAT.PM
 #
 # Copyright (c) 1997-2005 Symbian Ltd.  All rights reserved.
@@ -9,7 +11,7 @@
 #
 # all data is uppercase
 
-package E32Plat;
+package e32plat;
 
 require Exporter;
 @ISA=qw(Exporter);
@@ -24,9 +26,9 @@ require Exporter;
 	Plat_Customizes
 );
 
-use Winutl;
-use Armutl;
-use BPABIutl;
+use winutl;
+use armutl;
+use bpabiutl;
 
 my %Mode=(
 	Verbose=>0
@@ -40,7 +42,8 @@ sub Plat_SetVerbose () {
 my %BldLists=(
 	EPOC32=>['UREL','UDEB'],
 	WINS=>['UDEB','UREL'],
-	TOOLS=>['DEB','REL']
+	TOOLS=>['DEB','REL'],
+	linux=>['UDEB','UREL']
 );
 
 my %BldMacros=(
@@ -136,7 +139,7 @@ my %Plat=(
 		Compiler=>'VC32',
 		CPU=>'WINS',
 		MakeMod=>'Cl_win',
-		MakeCmd=>'nmake',
+		MakeCmd=>'make',
 		OS=>'WINS',
 	},
 	VC6=>{
@@ -190,7 +193,7 @@ my %Plat=(
 		ASSP=>'MARM',
 		ASSPABI=>'',
 		Generic=>1,
-		MakeMod=>'Cl_arm',
+		MakeMod=>'cl_arm',
 		Compiler=>'ARMCC',
 		DefFile=>'EABI',
 		EABI=>1,
@@ -200,7 +203,7 @@ my %Plat=(
 		ASSP=>'MARM',
 		ASSPABI=>'',
 		Generic=>1,
-		MakeMod=>'Cl_arm',
+		MakeMod=>'cl_arm',
 		Compiler=>'ARMCC',
 		DefFile=>'EABI',
 		EABI=>1,
@@ -210,7 +213,7 @@ my %Plat=(
 		ASSP=>'MARM',
 		ASSPABI=>'',
 		Generic=>1,
-		MakeMod=>'Cl_bpabi',
+		MakeMod=>'cl_bpabi',
 		DefFile=>'EABI',
 		EABI=>1,
 	},
@@ -284,7 +287,7 @@ sub Init_BSFs($) {
 
 	my $BSF;
 	foreach $BSF (@BSFs) {
-		my $File=$Path.$BSF.'.bsf';
+		my $File=$Path . lc $BSF . '.bsf';
 #		check whether the assp is already defined
 		if (defined %{$Plat{$BSF}}) {
 			warn(
@@ -310,6 +313,7 @@ sub Init_BSFs($) {
             }
             my $custom;
             while ($custom = <FILE>) {
+                	$custom =~ s/\r$//; # skip trailing cr
                 	#skip blank lines and comments
 			delete $Plat{$BSF};
                 	last unless ($custom =~ /^$|^\#/);
@@ -364,7 +368,15 @@ 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;
 
 	my @ASSPs;
@@ -376,7 +388,7 @@ sub Plat_Init ($) { # takes path to ASSP modules
 
 			next;
 		}
-		push @ASSPs, $_;
+		push @ASSPs, lc $_;
 	}
 
 #	open each module in turn, and add it to the array
@@ -408,6 +420,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";
@@ -456,7 +470,8 @@ 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}) {
@@ -502,7 +517,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};
@@ -615,6 +630,8 @@ sub Plat_AssocIDE ($$) {
 #	return the IDE associated with a "Real" platform if there is one
 	my ($Candidate, $AssocIDEs)=@_;
 
+	$Candidate = uc $Candidate;
+
 	unless (defined $Plat{$Candidate}) {
 		die "ERROR: Platform \"$Candidate\" not supported\n";
 	}
diff --git a/e32tpver.pm b/e32tpver.pm
index 0c95491..ca5dc24 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 40a467a..d9c4f86 100644
--- a/e32variant.pm
+++ b/e32variant.pm
@@ -2,7 +2,7 @@
 #
 # Copyright (c) 2004-2006 Symbian Software Ltd.  All rights reserved.
 #
-package E32Variant;
+package e32variant;
 
 require Exporter;
 
@@ -10,7 +10,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}
@@ -20,7 +20,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
@@ -29,16 +29,16 @@ my $toolspath;
 
 #if epocroot is not set figure it out
 if(!$epocroot){
-    $epocroot = $PerlBinPath . "\\..\\..\\" ; #infer epocroot
+    $epocroot = $PerlBinPath . "/../../" ; #infer epocroot
     $toolspath = $PerlBinPath;
 }else{
-    $toolspath = $epocroot . "epoc32\\tools\\";
+    $toolspath = $epocroot . "epoc32/tools/";
 }
 
 $epocroot=~s/^(.:)//io;    # remove drive letter
 $epocroot=&Path_Strip($epocroot); # collapse
 
-my $cfgFile =  $toolspath . "variant\\variant.cfg"; # default location
+my $cfgFile =  $toolspath . "variant/variant.cfg"; # default location
 $cfgFile =~ /^(.:)/i; # match the drive
 my $MacroHRHLocation_Drive = lc($1); # save the drive 
 
@@ -49,13 +49,15 @@ sub Variant_GetMacroHRHFile{
 	while (<FILE>) {
 	    # strip comments
 	    s/^([^#]*)#.*$/$1/o;
+	    s/\r$//;
 	    # skip blank lines
 	    if (/^\s*$/o) {
 		next;
 	    }
 	    # get the hrh file
 	    if($_ =~ /\.hrh/xi){
-		$file = $_; 
+		$file = lc $_; # gnupoc has all files in lowercase
+		$file =~ s/\\/\//g;
 		last;
 	    }
 	}
@@ -65,18 +67,15 @@ sub Variant_GetMacroHRHFile{
 	$file=~s/^(.:)//io;    # remove drive letter
 	my $paths_drive = lc($1);
 
-	$file = Path_MakeEAbs($epocroot."EPOC32\\", $epocroot, $file); # assume relative to EPOCROOT
+	$file = Path_MakeEAbs($epocroot."epoc32/", $epocroot, $file); # assume relative to EPOCROOT
 
 	if($paths_drive){
-	    die "\nERROR: Variant file specified in $cfgFile is not on the same drive as \\epoc32\\\n" 
+	    die "\nERROR: Variant file specified in $cfgFile is not on the same drive as /epoc32/\n" 
 		unless ($paths_drive eq $MacroHRHLocation_Drive);
 	}
 	if(!(-e $file)) {
 	    die "\nERROR: $cfgFile specifies $file which doesn't exist!\n";
 	}
-
-	# make sure it is in dos syntax
-	$file=~ s/\//\\/g;
     }
     return $file;
 }
diff --git a/efreeze.pl b/efreeze.pl
index 2603728..55545a6 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/elf2e32 b/elf2e32
new file mode 100644
index 0000000..2720be0
--- /dev/null
+++ b/elf2e32
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# elf2e32 - bash frontend for elf2e32.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/elftran b/elftran
new file mode 100755
index 0000000..9d5dc27
--- /dev/null
+++ b/elftran
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# elftran - bash frontend for elftran.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`
+# Workaround for Qt createpackage.pl and patch_capabilities.pl, which call
+# $epocroot/epoc32/tools/$PGM explicitly instead of just "$PGM" using the
+# path. Try to use a proper native version, if available.
+if [ "`which $PGM`" != "$0" ] && [ -x "`which $PGM`" ]; then
+	exec $PGM "$@"
+else
+	echo "executing $PGM.exe"
+	ROOT=$EPOCROOT/epoc32/tools
+	wine $ROOT/$PGM.exe "$@"
+fi
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..1e293fa 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
@@ -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 9b1ede8..4d6de32 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,12 +20,11 @@ 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 Preprocessor;
+use e32variant;         # for variant specific macros
+use pathutl;
+use preprocessor;
 
 sub print_usage
 	{
@@ -39,9 +40,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 
@@ -108,7 +109,7 @@ while (@ARGV)
 		next;
 		}
 
-	if ($arg =~ /^-t(.*)\\?$/)
+	if ($arg =~ /^-t(.*)\/?$/)
 		{
 		$tmpdir =$1;
 		next;
@@ -151,8 +152,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)
@@ -176,7 +177,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);
@@ -187,7 +188,6 @@ system($cpp_spec);
 my $cpp_status = $?;
 die "* cpp failed\n" if ($cpp_status != 0);
 
-
 #-------------------------------------------------------
 # Copy source to epoc32\localisation
 #
@@ -209,7 +209,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);
@@ -230,15 +231,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)
 		{
@@ -248,23 +253,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);
@@ -279,8 +284,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);
@@ -301,17 +306,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)
@@ -319,10 +324,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));
@@ -330,15 +335,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");
@@ -346,23 +351,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;
 
 #-------------------------------------------------------
@@ -372,7 +377,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 e595e30..c2c8934 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 d6ac155..eb8a452 100644
--- a/epocrc.pl
+++ b/epocrc.pl
@@ -1,3 +1,5 @@
+#!/usr/bin/perl -w
+#
 # epocrc.pl
 #
 # Copyright (c) 2000-2006 Symbian Ltd.  All rights reserved.
@@ -17,13 +19,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 lockit_info;
-use E32Variant;         # for variant specific macros
-use Pathutl;
-use Preprocessor;
+use e32variant;         # for variant specific macros
+use pathutl;
+use preprocessor;
 
 sub print_usage
 	{
@@ -169,7 +170,7 @@ while (@ARGV)
 		}
 	if ($arg =~ /^-t(.*)\\?$/)
 		{
-		$tmpdir ="$1\\";
+		$tmpdir ="$1\/";
 		next;
 		}
 	if ($arg =~ /^-l(.*)$/)
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 d6712c0..3e12c54 100644
--- a/eshell.pl
+++ b/eshell.pl
@@ -1,3 +1,4 @@
+#!/usr/bin/perl -w
 #
 # Eshell Launcher
 #
@@ -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" .
@@ -109,7 +110,7 @@ sub launchEshell
 			"must end with a backslash.\n";
 			
     # 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
@@ -131,11 +132,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 a21af37..9cc9ead 100644
--- a/fixupsym.pl
+++ b/fixupsym.pl
@@ -406,7 +406,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/genstubs b/genstubs
new file mode 100755
index 0000000..4fbcc15
--- /dev/null
+++ b/genstubs
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# genstubs - bash frontend for genstubs.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/genutl.pm b/genutl.pm
index 4d93e9e..0890fed 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/getexports b/getexports
new file mode 100755
index 0000000..b62f197
--- /dev/null
+++ b/getexports
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# getexports - bash frontend for getexports.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/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_cw.pm b/ide_cw.pm
index d4edd94..684a95b 100644
--- a/ide_cw.pm
+++ b/ide_cw.pm
@@ -1261,7 +1261,7 @@ sub PMBld() {
 		$UidText.=")\n";
 		$UidText.="#pragma data_seg()\n";
 
-		$UIDFile = $BaseTrg.'_UID_.cpp';
+		$UIDFile = $BaseTrg.'_uid_.cpp';
 		&main::CreateExtraFile("${ExtraFilesPath}$UIDFile", $UidText);
 		}
 
diff --git a/lockit_info.pm b/lockit_info.pm
index fb1a110..f97c41f 100644
--- a/lockit_info.pm
+++ b/lockit_info.pm
@@ -22,7 +22,7 @@ require Exporter;
 	Close_InfoFile
 );
 
-use Pathutl;
+use pathutl;
 my $epocroot;
 my $epocPath;
 
@@ -30,15 +30,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";
 	}
 
 
@@ -48,14 +48,14 @@ sub Lockit_SrcFile()
 	my ($ResrcFile, $RppFile,$Resrc_Options, $FileType, $Bitmaps, $RscTarget)= @_;
 	$RscTarget=Path_Split('File', $RscTarget);
 	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 ""))
@@ -67,12 +67,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");
 		}
 	}
 
@@ -80,17 +80,17 @@ sub Lockit_SrcFile()
 	{
 		Open_InfoFile($ResrcFile);
 
-		WriteTo_Info ( "\n\\$Tgtdir\\$RscTarget :" );
+		WriteTo_Info ( "\n/$Tgtdir/$RscTarget :" );
 
 		if($FileType =~ /RSC/i && $RppFile ne "") {
 			WriteTo_Info (
-				 " $ResrcFile.RPP"
+				 " $ResrcFile.rpp"
 			)
 		}
 
 		elsif ($RppFile ne "") {
 			WriteTo_Info (
-				 " $ResrcFile.TEXT $ResrcFile.STRUCT"
+				 " $ResrcFile.text $ResrcFile.struct"
 			)
 		}
 
@@ -99,12 +99,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"
 				);
 			}
 		}
@@ -118,7 +118,6 @@ sub Lockit_SrcFile()
 sub Copy_Files ()
 	{
 	my ($SourceName, $TargetName) = @_;
-
 	copy($SourceName, $TargetName);
 	}
 
@@ -127,9 +126,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;
 	}
@@ -139,7 +138,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";
 	}
 
 
@@ -158,7 +157,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; } 
 		}
@@ -171,28 +170,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;
 	}
@@ -206,19 +206,19 @@ sub Lockit_Releasables
 	my $Resrc = basename($ResrcFile);
 	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 6d47319..015256e 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(
@@ -23,9 +23,9 @@ require Exporter;
 	Deps_SetPrefixFile
 );
 
-use Checkgcc;
-use Pathutl;
-use Preprocessor;
+use checkgcc;
+use pathutl;
+use preprocessor;
 
 
 my $ChopSysDecoyPath;
@@ -58,7 +58,7 @@ BEGIN {	# NB don't initialise essential items to be provided later by calling mo
 	# Use random number to ensure DecoyPath is unique (ish)
 	srand();
 	my $randnum=int(rand(100));
-	$SysDecoyPath=&Path_WorkPath."TEMPMAKSYSDECOY$randnum\\";
+	$SysDecoyPath=&Path_WorkPath."TEMPMAKSYSDECOY$randnum/";
 	$S_SysDecoyPath=quotemeta($SysDecoyPath);
 	$ChopSysDecoyPath=&Path_Chop($SysDecoyPath);
 }
@@ -72,7 +72,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;
@@ -97,7 +97,7 @@ sub Deps_SetSysIncPaths (@) {	# takes list abs paths
 	@SysFlags=&Path_PrefixWithDriveAndQuote(@SysFlags);
 	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
@@ -118,6 +118,7 @@ sub Deps_SetPlatMacros (@) {
 	my $Flag;
 	foreach $Flag (@PlatMacros) {
 		$Flag=~s/^(.*)$/-D$1/o;
+		$Flag = uc $Flag; # force uppercase for macros
 	}
 }
 
@@ -164,6 +165,8 @@ sub Deps_GenDependsL ($@) {	# takes abs source filepath and list of Build Macros
 	my $CPPCommand;
  	my $exe = &PreprocessorToUseExe();
 	$CPPCommand = "$exe -undef -M -MG -nostdinc $PrefixFileOption -I ".&Path_PrefixWithDriveAndQuote($ChopSrcPath)." @UserFlags -I- -I ".&Path_PrefixWithDriveAndQuote($ChopSysDecoyPath)." @SysFlags @PlatMacros @BldMacros $ProductVariantFlag ".&Path_PrefixWithDriveAndQuote($Src);
+	# Fix for Open C headers + winscw
+	$CPPCommand .= " -D__option\\\(x\\\)=0";
 
 	if ($Mode{'Verbose'}) {
 		print "$CPPCommand\n"
@@ -185,13 +188,13 @@ sub Deps_GenDependsL ($@) {	# takes abs source filepath and list of Build Macros
 		# avoid the target of the rule by requiring whitespace in front of each element
 		while (/\s(\S+)/go) {
 			my $dep = $1;
+			next if $dep eq "/stdarg.h"; # Open C header + winscw bug workaround
 			$dep =~ s/;/ /go;	# spaces were turned into semicolon, so convert back again here
-			$dep =~ s-/-\\-go;	# replace forward slashes with backward slashes
 			$dep =~ s/^.\://;
 			push @RTWDepList,$dep;
 		}
 	}
-	close CPPPIPE or die "ERROR: $exe.EXE failure\n";
+	close CPPPIPE or die "ERROR: $exe failure\n";
 
 	# drop the first dependent, which is the source file itself
 	shift @RTWDepList;
@@ -247,12 +250,12 @@ sub TestDepends (@) { # takes source list of absolute dependencies - called by G
 	my $Path;
 	my $File;
 	DEPLOOP: foreach $Dep (@DepList) { # system dependencies not found
-		$Path=&Path_Split('Path', lc $Dep);
+		$Path=&Path_Split('Path', $Dep);
 		if ($Dep=~/^$S_SysDecoyPath(.*)$/o) { # allow things like "#include <sys\stats.h>"
 # 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)$/oi) {
+			if ($File=~/\.(rsg|mbg)$/oi) {
 				push @GoodList, "$EPOCIncPath$File";
 				next DEPLOOP;
 			}
@@ -280,7 +283,7 @@ sub TestDepends (@) { # takes source list of absolute dependencies - called by G
 # preprocessor lists any missing user headers as existing in the current directory,
 # and, if no userinclude paths are specified,
 # searches to path containing the source file for user headers by default
-		if ($Path eq lc &Path_WorkPath) { # possible missing user headers
+		if ($Path eq &Path_WorkPath) { # possible missing user headers
 			$File=&Path_Split('File',$Dep);
 			# does the userinclude path contain the current working directory?
 			my $LoopPath;
@@ -297,6 +300,11 @@ sub TestDepends (@) { # takes source list of absolute dependencies - called by G
 					next DEPLOOP;
 				}
 			}
+			# allow generated headers here too, since -MG doesn't behave the same in CSL GCC 3.4 as in the bundled 2.9-psion-98r2 cpp
+			if ($File=~/\.(rsg|mbg)$/oi) {
+				push @GoodList, "$EPOCIncPath$File";
+				next DEPLOOP;
+			}
 			push @BadUserList, $File;	# file not found in specified userinclude path, bad
 			next DEPLOOP;
 		}
@@ -323,7 +331,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 85b696c..376d938 100644
--- a/makedef.pl
+++ b/makedef.pl
@@ -21,13 +21,12 @@ my $InternalEntryPoint;
 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;
 
 my %Options;	# command line option information
@@ -221,6 +220,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
 	        my $Data=0;
 			my $SymbolSize=0;
 		$LineNum++;
@@ -270,6 +270,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";
@@ -281,6 +282,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..d16d37b
--- /dev/null
+++ b/makekeys
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# makekeys - bash frontend for makekeys.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..f8bee9d
--- /dev/null
+++ b/makesis
@@ -0,0 +1,22 @@
+#!/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`
+# Workaround for Qt createpackage.pl and patch_capabilities.pl, which call
+# $epocroot/epoc32/tools/$PGM explicitly instead of just "$PGM" using the
+# path. Try to use a proper native version, if available.
+if [ "`which $PGM`" != "$0" ] && [ -x "`which $PGM`" ]; then
+	exec $PGM "$@"
+else
+	echo "executing $PGM.exe"
+	ROOT=$EPOCROOT/epoc32/tools
+	wine $ROOT/$PGM.exe "$@"
+fi
diff --git a/makhelp.pm b/makhelp.pm
index 49b9713..42dbb3f 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",
@@ -88,7 +88,7 @@ ASSPEXPORTS
 ASSPLIBRARY            [ASSP_libraries]
 CAPABILITY             [NONE | list of {-}CAPABILITY_NAME]
 DEFFILE                [{path}{deffile} (default -
-                          \[project]\B[platform]\[target basename].DEF)
+                          \[project]B[platform]\[target basename].DEF)
                         If the path ends in \~\ the ~ is replace by B[platform] ]
 DOCUMENT               [sourcepath-relative_documents]
 EPOCALLOWDLLDATA
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 cf4e2ac..2dc8415 100644
--- a/makmake.pl
+++ b/makmake.pl
@@ -1,3 +1,5 @@
+#!/usr/bin/perl -w
+#
 # MAKMAKE.PL
 #
 # Copyright (c) 1997-2006 Symbian Software Ltd.  All rights reserved.
@@ -23,19 +25,18 @@ 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 CheckSource;
+use e32env;
+use e32plat;
+use e32variant;
+use genutl;
+use modload;
+use pathutl;
+use trgtype;
+use checksource;
 
 # THE MAIN PROGRAM SECTION
 ##########################
@@ -65,7 +66,7 @@ my $DebugSwitch=undef;
 	$Options{makemakefile}='1' unless ($Options{mmp} || $Options{plat});
 
 	if ($Options{mmp} or $Options{plat}) {
-		eval { &Load_ModuleL('MAKHELP'); };
+		eval { &Load_ModuleL('makhelp'); };
 		die $@ if $@;
 	}
 
@@ -115,17 +116,17 @@ my $DebugSwitch=undef;
 	$MMPFILE=pop @ARGV;
 	die "ERROR: Can't specify MMP file on a different drive\n" if $MMPFILE=~/^\w:\\/o;
 	if ($MMPFILE!~/.MMP$/io) {
-		$MMPFILE.='.MMP';
+		$MMPFILE.='.mmp';
 	}
 	$MMPFILE=&Path_AbsToWork($MMPFILE);
 
-	eval { &Load_ModuleL('Mmp'); };
+	eval { &Load_ModuleL('mmp'); };
 	die $@ if $@;
 	if ($Options{v}) {
 		&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});
 	}
 	
 	if ($Options{debug}) {
@@ -206,10 +207,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};
 	}
 }
 
@@ -317,7 +318,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;
@@ -326,7 +327,7 @@ my $ResrcIsSys;
 		&Deps_SetUserHdrsOnly;
 	}
 
-	if ($Options{nd} || $ENV{SYMBIANBUILD_DEPENDENCYOFF} == 1) {
+	if ($Options{nd} || ($ENV{SYMBIANBUILD_DEPENDENCYOFF} && $ENV{SYMBIANBUILD_DEPENDENCYOFF} == 1)) {
 		&Deps_SetNoDependencies
 	}
 
@@ -371,7 +372,8 @@ my $ResrcIsSys;
 		if ($Options{v}) {
 			print "Resource: \"$$CurResourceRef{Trg}\"\n";
 		}
-		eval { @CurDepList=&Deps_GenDependsL($$CurResourceRef{Source}, ("LANGUAGE_$$CurResourceRef{Lang}")); };
+		my $uclang = uc $$CurResourceRef{Lang};
+		eval { @CurDepList=&Deps_GenDependsL($$CurResourceRef{Source}, ("LANGUAGE_$uclang")); };
 		die $@ if $@;
 		&PMResrcBld if defined &PMResrcBld;
 		undef @CurDepList;
@@ -389,11 +391,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;
@@ -566,16 +566,16 @@ my $ResrcIsSys;
 				}
 #				$RomFileType='primary[MAGIC]' if $Trg eq 'EKERN.EXE';
 #				$RomFileType='secondary[MAGIC]' if $Trg eq 'EFILE.EXE';
-				my $RomPath="sys\\bin\\";
+				my $RomPath="sys/bin/";
 				if ($$ref{Path}) {
 					$RomPath=$$ref{Path};
 				}
 				elsif ($TrgType{Path}) {
 					$RomPath=$TrgType{Path};
-					$RomPath=~s-Z\\(.*)-$1-o;
+					$RomPath=~s-z\/(.*)-$1-oi;
 				}
 #				elsif ($TrgType{Name} =~ /EXE(|XP)/o) {
-#					$RomPath="Test\\";
+#					$RomPath="Test/";
 #				}
 				my $RomFile=$LinkAsBase;
 				if ($$ref{File}) {
@@ -598,7 +598,7 @@ my $ResrcIsSys;
 				
 				$ABIDir = '##KMAIN##' if ($KHash1{lc $TrgType{Name}});
 				$ABIDir = '##KMAIN##' if ($KHash2{lc $RomFileType});
-				my $IbyTextFrom="$RomFileType=$E32env::Data{RelPath}$ABIDir\\##BUILD##\\$Trg";
+				my $IbyTextFrom="$RomFileType=$e32env::Data{RelPath}$ABIDir/##BUILD##/$Trg";
 				my $IbyTextTo="$RomPath$RomFile";
 				my $Spaces= 60>length($IbyTextFrom) ? 60-length($IbyTextFrom) : 1; 
 #				&Output("\t\@echo \"", $IbyTextFrom, ' 'x$Spaces, "$IbyTextTo $RomDecorations\"\n");
@@ -608,7 +608,7 @@ my $ResrcIsSys;
 				my $ABIDir = '##MAIN##';
 				$ABIDir = '##KMAIN##' if ($KHash1{lc $TrgType{Name}});
 				my $RomFileType='data';
-				my $RomPath="sys\\bin\\";
+				my $RomPath="sys/bin/";
 				if ($$ref{Path}) {
 					$RomPath=$$ref{Path};
 				}
@@ -617,7 +617,7 @@ my $ResrcIsSys;
 					$RomFile=$$ref{File};
 				}
 				my $RomDecorations='attrib=r';
-				my $IbyTextFrom="$RomFileType=$E32env::Data{RelPath}$ABIDir\\##BUILD##\\$Trg";
+				my $IbyTextFrom="$RomFileType=$e32env::Data{RelPath}$ABIDir/##BUILD##/$Trg";
 				my $IbyTextTo="$RomPath$RomFile";
 				my $Spaces= 60>length($IbyTextFrom) ? 60-length($IbyTextFrom) : 1; 
 #				&Output("\t\@echo \"", $IbyTextFrom, ' 'x$Spaces, "$IbyTextTo $RomDecorations\"\n");
@@ -688,7 +688,7 @@ sub getEABIDef() {
     # set package to ignore warnings about missing .def file. 
     &Mmp_SetIgnoreMissingDef;
     
-    eval { &Mmp_ProcessL($E32env::Data{EPOCPath}, $MMPFILE, \%Plat); };
+    eval { &Mmp_ProcessL($e32env::Data{EPOCPath}, $MMPFILE, \%Plat); };
 	return $@ if $@;
 	my %EABIDef=%{&Mmp_Def};
 	
@@ -726,7 +726,7 @@ sub SetVarsFromMmp ($) {
 	&Mmp_SetIgnoreMissingDef;
 	}
 
-	eval { &Mmp_ProcessL($E32env::Data{EPOCPath}, $MMPFILE, \%Plat); };
+	eval { &Mmp_ProcessL($e32env::Data{EPOCPath}, $MMPFILE, \%Plat); };
 	return $@ if $@;
 
 	%WarningLevel=&Mmp_WarningLevel;
@@ -799,14 +799,13 @@ 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
 	my $BldInfPath=cwd;
-	$BldInfPath=~s-/-\\-go;						# separator from Perl 5.005_02+ is forward slash
 	$BldInfPath=~s/^(.:)//o;					# remove drive letter
-	$BldInfPath=~s-^(.*[^\\])$-$1\\-o;			# ensure workpath ends with a backslash
-	$Path{Bld}=join('', &Path_Chop($E32env::Data{BldPath}), $BldInfPath, &Path_Split('Base',$MMPFILE), "\\$Plat{Real}\\");
+	$BldInfPath=~s-^(.*[^\/])$-$1\/-o;			# ensure workpath ends with a backslash
+	$Path{Bld}=join('', &Path_Chop($e32env::Data{BldPath}), $BldInfPath, &Path_Split('Base',$MMPFILE), "/", lc $Plat{Real}, "/");
 
 }
 
@@ -819,30 +818,30 @@ sub InitLinkPaths() {
 	my $UnderlyingABI=$ABI;
 	$UnderlyingABI=&PMUnderlyingABI($ABI) if defined &PMUnderlyingABI;
 
-	$Path{Lib}="$E32env::Data{LinkPath}";
+	$Path{Lib}="$e32env::Data{LinkPath}";
 	unless ($ASSPExports) {
-		$Path{Lib}.="$UnderlyingABI\\";
+		$Path{Lib}.= lc "$UnderlyingABI/";
 	} 
 	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}$UnderlyingABI\\";
+	$Path{Link}="$e32env::Data{LinkPath}" . lc $UnderlyingABI . "/";
 
 #	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}" . lc $Plat{Real} . "/";
 	}
 	else {
 		$Path{Rel}=$Path{StatLink}; # static libraries can't #define the __SINGLE__ macro
@@ -917,10 +916,10 @@ sub ASSPLinkPath () {
 	if ($CurBld) {
 #regression hack
 		if ($Plat{OS} eq 'EPOC32') {
-			$Path.="UREL\\";
+			$Path.="urel/";
 		}
 		else {
-			$Path.="UDEB\\";
+			$Path.="udeb/";
 		}
 #regression hack end
 	}
@@ -980,7 +979,8 @@ sub BldList () {
 sub BldPath () {
 	my $Path=$Path{"Bld"};
 	if ($CurBld) {
-		$Path.="$CurBld\\";
+		$CurBld = lc $CurBld;
+		$Path.="$CurBld\/";
 	}
 	$Path;
 }
@@ -997,7 +997,7 @@ sub DataLinkAddress () {
 	$DataLinkAddress;
 }
 sub DataPath () {
-	$E32env::Data{DataPath};
+	$e32env::Data{DataPath};
 }
 sub DebugLibList () {
 	@DebugLibList;
@@ -1026,22 +1026,22 @@ 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 EPOCSecurePlatform () {
-	$E32env::Data{SecurePlatform};
+	$e32env::Data{SecurePlatform};
 }
 sub EPOCToolsPath () {
-	$E32env::Data{EPOCToolsPath};
+	$e32env::Data{EPOCToolsPath};
 }
 sub Exports () {
 	@{$TrgType{Exports}{$Plat{"DefFile"}}};
@@ -1070,13 +1070,13 @@ sub LibPath () {
 	if ($CurBld) {
 #regression hack
 		if ($Plat{DefFile} eq 'EABI') {
-			$Path.="LIB\\";
+			$Path.="lib/";
 		}
 		elsif ($Plat{OS} eq 'EPOC32') {
-			$Path.="UREL\\";
+			$Path.="urel/";
 		}
 		else {
-			$Path.="UDEB\\";
+			$Path.="udeb/";
 		}
 #regression hack end
 	}
@@ -1100,13 +1100,13 @@ sub LinkPath () {
 	if ($CurBld) {
 #regression hack
 		if ($Plat{DefFile} eq 'EABI') {
-			$Path.="LIB\\";
+			$Path.="lib/";
 		}
 		elsif ($Plat{OS} eq 'EPOC32') {
-			$Path.="UREL\\";
+			$Path.="urel/";
 		}
 		else {
-			$Path.="UDEB\\";
+			$Path.="udeb/";
 		}
 #regression hack end
 	}
@@ -1159,7 +1159,8 @@ sub ProcessPriority () {
 sub RelPath () {
 	my $Path=$Path{Rel};
 	if ($CurBld) {
-		$Path.="$CurBld\\";
+		$CurBld = lc $CurBld;
+		$Path.="$CurBld\/";
 	}
 	$Path;
 }
@@ -1177,7 +1178,7 @@ sub	SetStdIncPaths (@) {
 	@StdIncPaths=();
 	my $Path;
 	foreach $Path (@_) {
-		$Path=~s-^(.*[^\\])$-$1\\-o if defined($Path);
+		$Path=~s-^(.*[^\/])$-$1\/-o if defined($Path);
 		push @StdIncPaths, $Path;	# only place drive letters may appear, up to modules to handle
 	}
 }
@@ -1204,7 +1205,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 d5d7f1c..854b77c 100644
--- a/maksym.pl
+++ b/maksym.pl
@@ -325,7 +325,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 f5ba285..ea2eae2 100644
--- a/memtrace.pl
+++ b/memtrace.pl
@@ -237,7 +237,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/mifconv b/mifconv
new file mode 100644
index 0000000..3a93ef1
--- /dev/null
+++ b/mifconv
@@ -0,0 +1,34 @@
+#!/usr/bin/env perl
+#
+# mifconv - perl frontend for mifconv.exe, part of GnuPoc project
+#
+# Copyright (C) 2010 Thomas Zander <t.zander@nokia.com>
+#
+#    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.
+#
+
+# call wine mifconv.exe
+# convert all slashes in the arguments to be backslashes, except for
+# slashes starting options.
+
+my $epocroot = $ENV{"EPOCROOT"};
+$epocroot =~ s/\\/\//g;
+$command = "wine ". $epocroot . "/epoc32/tools/mifconv.exe";
+
+for my $arg (@ARGV) {
+    my $isOption = $arg=~/^\/[HEPTBSVFAC1-8].*/i;
+    $isOption = 0 if -e $arg; # If this is an existing file name, don't treat it as an option.
+    $arg=~s/\//\\\\/g; # replace all
+    if ($isOption) {
+        $arg=~s/^\\\\/\//; # replace first backslashes back to a slash
+    }
+    $command="$command \"$arg\"";
+}
+
+# mifconv in S60 3rd FP1 seems to try to call svgtbinencode.exe if EPOCROOT
+# is set, and this doesn't seem to work in wine (tested on 0.9.15)
+delete $ENV{"EPOCROOT"};
+
+system ($command);
diff --git a/mmp.pm b/mmp.pm
index 1dda839..99a7021 100644
--- a/mmp.pm
+++ b/mmp.pm
@@ -1,3 +1,5 @@
+#!/usr/bin/perl -w
+#
 # MMP.PM
 #
 # Copyright (c) Symbian Software Ltd 1997-2005.  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);
@@ -27,7 +29,7 @@ require Exporter;
 	Mmp_Capability
 	Mmp_CapabilityFlags
 	Mmp_DataLinkAddress
-	Mmp_DebugLibList 
+	Mmp_DebugLibList
 	Mmp_Def
 	Mmp_DocHash
 	Mmp_ExportUnfrozen
@@ -48,7 +50,7 @@ require Exporter;
 	Mmp_RomTargets
 	Mmp_SourceStruct 
 	Mmp_StackSize
-	Mmp_StatLibList 
+	Mmp_StatLibList
 	Mmp_SysIncPaths
 	Mmp_Trg
 	Mmp_TrgType
@@ -72,11 +74,11 @@ require Exporter;
 );
 
 
-use Genutl;
-use Prepfile;
-use Pathutl;
-use Trgtype;
-use CheckSource;
+use genutl;
+use prepfile;
+use pathutl;
+use trgtype;
+use checksource;
 use Cwd;
 
 my %ProcessPriorityNames = (
@@ -304,11 +306,9 @@ sub Mmp_ProcessL ($$) {
 	}
 
 	my $current = cwd;
-	$current =~ s/\//\\/g;
-	$current =~ s/^[a-zA-Z]://;
 	
 	my @checkSourceIncludes;
-	push @checkSourceIncludes, "$ENV{EPOCROOT}epoc32\\include";
+	push @checkSourceIncludes, "$ENV{EPOCROOT}epoc32/include";
 	push @checkSourceIncludes, $current;
 	push @checkSourceIncludes, Path_Split('Path',$MMPFILE);
 
@@ -342,7 +342,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';
 
@@ -360,7 +360,7 @@ sub Mmp_ProcessL ($$) {
 		
 		$_=uc $_;
 		if ($PlatTxtSwitch) {
-			if (/^END$/o) {
+			if (/^END$/oi) {
 				$PlatTxtSwitch=0;
 				next LINE;
 			}
@@ -368,7 +368,7 @@ sub Mmp_ProcessL ($$) {
 			next LINE;
 		}
 		if ($OtherPlatSwitch) {
-			if (/^END$/o) {
+			if (/^END$/oi) {
 				$OtherPlatSwitch=0;
 				next LINE;
 			}
@@ -376,15 +376,15 @@ 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";
 					}
 				}
@@ -393,8 +393,8 @@ sub Mmp_ProcessL ($$) {
 					CheckSource_CaseAndDelimiter($CurFile, $_, $LineNum, %CheckSourceCommands);
 					$_ = &Path_Norm($_);
 					
-					$_=lc $_;	# bmconv generates a header with case-sensitive enums
 					my $bitmap = "$CurBitMapSrcPath$_";
+					$bitmap=~s/\\/\//g;      # force to forward slash
 					push @{$CurBitMap{Source}}, { # sources must be kept in order
 						Src=>$bitmap,
 						ClDepth=>shift @ClDepths	# take next color depth from the list
@@ -405,29 +405,30 @@ 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/\\/\//g;      # force to forward slash
 				CheckSource_CaseAndDelimiter($CurFile, $CurBitMapSrcPath, $LineNum, %CheckSourceCommands);
 				$CurBitMapSrcPath = &Path_Norm($CurBitMapSrcPath);
 				
-				$CurBitMapSrcPath=~s-^(.*[^\\])$-$1\\-o;   # ensure path ends with a backslash
+				$CurBitMapSrcPath=~s-^(.*[^\/])$-$1\/-o;   # ensure path ends with a slash
 				$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;
@@ -440,7 +441,7 @@ sub Mmp_ProcessL ($$) {
 			}
 
 
-			if (/^TARGETPATH$/o) {
+			if (/^TARGETPATH$/oi) {
 				if ($CurBitMap{TrgPath}) {
 					push @MmpWarn, "$CurFile($LineNum) : Bitmap TARGETPATH already specified\n";
 					next LINE;
@@ -449,12 +450,13 @@ sub Mmp_ProcessL ($$) {
 					push @MmpDie, "$CurFile($LineNum) : No path specified with Bitmap keyword TARGETPATH\n";
 					next LINE;
 				}
+				$CurBitMap{TrgPath}=~s/\\/\//g;              # force to forward slash
 				CheckSource_CaseAndDelimiter($CurFile, $CurBitMap{TrgPath}, $LineNum, %CheckSourceCommands);
 				$CurBitMap{TrgPath} = &Path_Norm($CurBitMap{TrgPath});
 
-				$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-^\/(.*)$-$1-o;        # remove leading slash, if any
+				$CurBitMap{TrgPath}=~s-^(.*[^\/])$-$1\/-o;   # ensure path ends with a slash
+				$CurBitMap{TrgPath}="z/$CurBitMap{TrgPath}";
 				if (@$Line) {
 					push @MmpWarn, "$CurFile($LineNum) : Too many arguments for Bitmap keyword TARGETPATH\n";
 				}
@@ -465,7 +467,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;
@@ -473,7 +475,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;
@@ -488,7 +490,7 @@ sub Mmp_ProcessL ($$) {
 				}
 				next LINE;
 			}
-			if (/^HEADERONLY$/o) {
+			if (/^HEADERONLY$/oi) {
 				if ($CurResource{Hdronly}) {
 					push @MmpWarn, "$CurFile($LineNum) : Resource HEADERONLY already specified at line $CurResource{Hdr}\n";
 					next LINE;
@@ -504,7 +506,7 @@ sub Mmp_ProcessL ($$) {
 				next LINE;
 			}
 
-			if (/^LANG$/o) {
+			if (/^LANG$/oi) {
 				if (@$Line) {
 					my $Candidate;
 					foreach $Candidate (@$Line) {
@@ -512,7 +514,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;
@@ -520,7 +522,7 @@ sub Mmp_ProcessL ($$) {
 				push @MmpWarn, "$CurFile($LineNum) : No Languages specified for keyword LANG\n";
 				next LINE;
 			}
-			if (/^TARGET$/o) {
+			if (/^TARGET$/oi) {
 				if ($CurResource{BaseTrg}) {
 					push @MmpWarn, "$CurFile($LineNum) : Resource TARGET already specified\n";
 					next LINE;
@@ -538,7 +540,7 @@ sub Mmp_ProcessL ($$) {
 				}
 				next LINE;
 			}
-			if (/^TARGETPATH$/o) {
+			if (/^TARGETPATH$/oi) {
 				if ($CurResource{TrgPath}) {
 					push @MmpWarn, "$CurFile($LineNum) : Resource TARGETPATH already specified\n";
 					next LINE;
@@ -547,18 +549,19 @@ sub Mmp_ProcessL ($$) {
 					push @MmpDie, "$CurFile($LineNum) : No path specified with Resource keyword TARGETPATH\n";
 					next LINE;
 				}
+				$CurResource{TrgPath}=~s/\\/\//g;              # force to forward slash
 				CheckSource_CaseAndDelimiter($CurFile, $CurResource{TrgPath}, $LineNum, %CheckSourceCommands);
 				$CurResource{TrgPath} = &Path_Norm($CurResource{TrgPath});
 				
-				$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-^\/(.*)$-$1-o;        # remove leading backslash, if any
+				$CurResource{TrgPath}=~s-^(.*[^\/])$-$1\/-o;   # ensure path ends with a backslash
+				$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";
@@ -584,13 +587,13 @@ sub Mmp_ProcessL ($$) {
 		# ----------- handle body of START STRINGTABLE ... END -------------
 		if(%CurStringTable)
 		{	
-			if (/^END$/o) {
+			if (/^END$/oi) {
 				my %stringtable = %CurStringTable;
 				push @StringTableStruct, \%stringtable;
 				undef %CurStringTable;
 				next LINE;
 			}
-			if (/^EXPORTPATH/o) {
+			if (/^EXPORTPATH/oi) {
 				if (scalar @$Line != 1) {
 					push @MmpDie, "$CurFile($LineNum) : Wrong number of arguments for EXPORTPATH\n";
 				} 
@@ -598,14 +601,15 @@ sub Mmp_ProcessL ($$) {
 					push @MmpDie, "$CurFile($LineNum) : Redefinition of EXPORTPATH\n";
 				}
 				else {
-				    my $src=shift @$Line;
+					my $src=shift @$Line;
+					$src=~s/\\/\//g;      # force to forward slash
 					CheckSource_CaseAndDelimiter($CurFile, $src, $LineNum, %CheckSourceCommands);
 					$src = &Path_Norm($src); 
 					$CurStringTable{ExportPath} = $src;					
 				}
 				next LINE;
 			}
-			if (/^HEADERONLY$/o) {
+			if (/^HEADERONLY$/oi) {
 				if ($CurStringTable{Hdronly}) {
 					push @MmpWarn, "$CurFile($LineNum) : Stringtable HEADERONLY already specified\n";
 					next LINE;
@@ -618,7 +622,7 @@ sub Mmp_ProcessL ($$) {
 			}
 		}
 		# ----------- handle top-level MMP file -------------------	
-		if (/^START$/) {
+		if (/^START$/i) {
 			unless ($_=uc shift @$Line) {
 				push @MmpWarn, "$CurFile($LineNum) : No Argument specified for START block\n";
 				next LINE;
@@ -629,11 +633,12 @@ 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";
 				}
@@ -642,12 +647,13 @@ sub Mmp_ProcessL ($$) {
 				$CurBitMap{Trg} = &Path_Norm($CurBitMap{Trg});
 				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
 					CheckSource_CaseAndDelimiter($CurFile, $src, $LineNum, %CheckSourceCommands);
 					$src = &Path_Norm($src);
 				    
@@ -657,15 +663,16 @@ sub Mmp_ProcessL ($$) {
 				
 				next LINE;
 			}
-			if ($_ eq 'STRINGTABLE') {
+			if (uc $_ eq 'STRINGTABLE') {
 				if (scalar @$Line != 1) {
 					push @MmpWarn, "$CurFile($LineNum) : Wrong number of arguments for START STRINGTABLE clause\n";
 				} 
 				else {
-				    my $Candidate = shift @$Line;
+					my $Candidate = shift @$Line;
+					$Candidate=~s/\\/\//g;      # force to forward slash
 					CheckSource_CaseAndDelimiter($CurFile, $Candidate, $LineNum, %CheckSourceCommands);
 					$Candidate = &Path_Norm($Candidate); 
-					$Candidate =~ s/^\\//;	# remove leading \, if any	
+					$Candidate =~ s/^\///;	# remove leading /, if any	
 					$CurStringTable{BaseTrg}=&Path_Split('Base',$Candidate);
 					my $path=&Path_Split('Path',$Candidate);
 					if($path){
@@ -683,15 +690,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";
@@ -713,7 +723,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
@@ -726,21 +737,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) {
@@ -763,7 +774,7 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : No Libraries specified for keyword ASSPLIBRARY\n";
 			next LINE;
 		}
-		if (/^CAPABILITY$/o) {
+		if (/^CAPABILITY$/oi) {
 			if (defined($Capability)) {
 				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine CAPABILITY\n";
 				next LINE;
@@ -814,7 +825,7 @@ sub Mmp_ProcessL ($$) {
 			}
 			next LINE;
 		}
-		if (/^DEBUGLIBRARY$/o) {
+		if (/^DEBUGLIBRARY$/oi) {
 			if (@$Line) {
 				my $Candidate;
 				foreach $Candidate (@$Line) {
@@ -837,7 +848,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;
@@ -847,6 +858,7 @@ sub Mmp_ProcessL ($$) {
 				push @MmpWarn, "$CurFile($LineNum) : No file specified for keyword DEFFILE\n";
 				next LINE;
 			}
+			$_=~s/\\/\//g;      # force to forward slash
 
 			CheckSource_CaseAndDelimiter($CurFile, $_, $LineNum, %CheckSourceCommands);
 			$_ = &Path_Norm($_);
@@ -862,10 +874,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
 					CheckSource_CaseAndDelimiter($CurFile, $Candidate, $LineNum, %CheckSourceCommands);
 					$Candidate = &Path_Norm($Candidate);
 					
@@ -885,28 +898,28 @@ 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 (/^ALWAYS_BUILD_AS_ARM$/o) {
+		if (/^ALWAYS_BUILD_AS_ARM$/oi) {
 			if (@$Line) {
 				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
 			}
 			$BuildAsARM=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) {
@@ -918,14 +931,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) {
@@ -948,7 +961,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;
@@ -964,7 +977,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) {
@@ -977,7 +990,7 @@ 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";
 			}
@@ -985,7 +998,7 @@ sub Mmp_ProcessL ($$) {
             $CompressTargetMethod=INFLATECOMPRESSIONMETHOD;
 			next LINE;
 		}
-		if (/^NOCOMPRESSTARGET$/o) {
+		if (/^NOCOMPRESSTARGET$/oi) {
 			if (@$Line) {
 				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
 			}
@@ -993,7 +1006,7 @@ sub Mmp_ProcessL ($$) {
             $CompressTargetMethod=NOCOMPRESSIONMETHOD;
 			next LINE;
 		}
-        if (/^INFLATECOMPRESSTARGET$/o) {
+		if (/^INFLATECOMPRESSTARGET$/oi) {
 			if (@$Line) {
 				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
 			}
@@ -1001,7 +1014,7 @@ sub Mmp_ProcessL ($$) {
 			$CompressTargetMethod=INFLATECOMPRESSIONMETHOD;
 			next LINE;
 		}
-		if (/^BYTEPAIRCOMPRESSTARGET$/o) {
+		if (/^BYTEPAIRCOMPRESSTARGET$/oi) {
 			if (@$Line) {
 				push @MmpWarn, "$CurFile($LineNum) : Keyword $_ takes no arguments\n";
 			}
@@ -1009,14 +1022,14 @@ sub Mmp_ProcessL ($$) {
 			$CompressTargetMethod=BYTEPAIRCOMPRESSIONMETHOD;
 			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;
@@ -1030,7 +1043,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) {
@@ -1038,7 +1051,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;
@@ -1046,7 +1059,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) {
@@ -1070,7 +1083,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;
@@ -1081,7 +1094,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;
@@ -1099,7 +1112,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;
@@ -1107,13 +1120,13 @@ sub Mmp_ProcessL ($$) {
 			$NoExportLibrary = 1;
 			next LINE;
 		}
-		if (/^MACRO$/o) {
+		if (/^MACRO$/oi) {
 			if (@$Line) {
 				my $Candidate;
 				foreach $Candidate (@$Line) {
 					if ($CheckMacro{$Candidate}) {
 						push @MmpWarn, "$CurFile($LineNum) : Duplicate Macro \"$Candidate\" at line $CheckMacro{$Candidate}\n";
-						next; 
+						next;
 					}
 					push @Macros, $Candidate;
 					$CheckMacro{$Candidate}="$CurFile($LineNum)";
@@ -1122,7 +1135,7 @@ sub Mmp_ProcessL ($$) {
 			}
 			next LINE; 
 		}
-		if (/^NOSTRICTDEF$/o) {
+		if (/^NOSTRICTDEF$/oi) {
 			if ($NoStrictDef) {
 				push @MmpWarn, "$CurFile($LineNum) : NOSTRICTDEF already set\n";
 				next LINE;
@@ -1133,7 +1146,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;
@@ -1157,10 +1170,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
 					CheckSource_CaseAndDelimiter($CurFile, $Candidate, $LineNum, %CheckSourceCommands);
 					$Candidate = &Path_Norm($Candidate);
 					
@@ -1188,7 +1202,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;
@@ -1213,14 +1227,15 @@ sub Mmp_ProcessL ($$) {
 			}
 			next LINE;
 		}
-		if (/^SOURCE$/o) {
+		if (/^SOURCE$/oi) {
 			if (@$Line) {
 				my $Candidate;
 				foreach $Candidate (@$Line) {
+					$Candidate =~ s/\\/\//g;      # force to forward slash
 					CheckSource_CaseAndDelimiter($CurFile, $Candidate, $LineNum, %CheckSourceCommands);
 					$Candidate = &Path_Norm($Candidate);
 					
-					$Candidate =~ s/^\\//;	# remove leading \, if any	
+					$Candidate =~ s/^\///;	# remove leading \, if any	
 					$CurSource{BaseTrg}=&Path_Split('Base',$Candidate);
 					my $path=&Path_Split('Path',$Candidate);
 					if($path){
@@ -1241,12 +1256,14 @@ 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/\\/\//g;      # force to forward slash
+
 				CheckSource_CaseAndDelimiter($CurFile, $CurSrcPath, $LineNum, %CheckSourceCommands);				
 				$CurSrcPath = &Path_Norm($CurSrcPath);
 				
-				$CurSrcPath=~s-^(.*[^\\])$-$1\\-o;	# in case no terminating backslash
+				$CurSrcPath=~s-^(.*[^\/])$-$1\/-o;	# in case no terminating slash
 				$CurSrcPath=&Path_MakeEAbs($EPOCPath,$CurFile,$CurSrcPath);
 				if (-d &Path_Chop($CurSrcPath)) {
 					next LINE;
@@ -1257,7 +1274,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) {
@@ -1277,7 +1294,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;
@@ -1288,14 +1305,15 @@ sub Mmp_ProcessL ($$) {
 			$MmpFlag{StrictDepend}=1;
 			next LINE;
 		}
-		if (/^SYSTEMINCLUDE$/o){
+		if (/^SYSTEMINCLUDE$/oi){
 			if (@$Line) {
 				my $Candidate;
 				foreach $Candidate (@$Line) {
+					$Candidate=~s/\\/\//g;      # force to forward slash
 					CheckSource_CaseAndDelimiter($CurFile, $Candidate, $LineNum, %CheckSourceCommands);
 					$Candidate = &Path_Norm($Candidate);
 					
-					$Candidate=~s-^(.*[^\\])$-$1\\-o;   # ensure path ends with a backslash
+					$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";
@@ -1313,10 +1331,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
 					CheckSource_CaseAndDelimiter($CurFile, $Candidate, $LineNum, %CheckSourceCommands);
 					$Candidate = &Path_Norm($Candidate);
 					
@@ -1332,7 +1351,7 @@ sub Mmp_ProcessL ($$) {
 					$CurResource{BaseTrg}=&Path_Split('Base',$Candidate);
 					$CurResource{Source}=$source;
 					$CurResource{Hdr}="$CurFile($LineNum)";
-					$CurResource{TrgPath}="Z\\System\\Data\\";	# needs to match e32env.pm
+					$CurResource{TrgPath}="z/system/data/";	# needs to match e32env.pm
 					my %Resource=%CurResource;
 					undef %CurResource;
 					push @ResourceStruct, \%Resource;
@@ -1345,7 +1364,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;
@@ -1358,7 +1377,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;
@@ -1367,19 +1386,20 @@ sub Mmp_ProcessL ($$) {
 				push @MmpWarn, "$CurFile($LineNum) : No Path specified for keyword TARGETPATH\n";
 				next LINE;
 			}
+			$TrgPath=~s/\\/\//g;              # force to forward slash
 
 			CheckSource_CaseAndDelimiter($CurFile, $TrgPath, $LineNum, %CheckSourceCommands);
 			$TrgPath = &Path_Norm($TrgPath);
 			
-			$TrgPath=~s-^\\(.*)$-$1-o;
-			$TrgPath=~s-^(.*[^\\])$-$1\\-o;
-			$TrgPath="Z\\$TrgPath";
+			$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;
@@ -1394,7 +1414,7 @@ sub Mmp_ProcessL ($$) {
 			}
 			next LINE;
 		}
-		if (/^UID$/o) {
+		if (/^UID$/oi) {
 			if (@$Line) {
 				foreach (@$Line) {
 					if ($#UidList>=1) {
@@ -1414,7 +1434,7 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : No Uids specified for keyword UID\n";
 			next LINE;
 		}
-		if (/^SECUREID$/o) {
+		if (/^SECUREID$/oi) {
 			if ($SecureId) {
 				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine SECUREID\n";
 				next LINE;
@@ -1433,7 +1453,7 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : Missing argument for keyword SECUREID\n";
 			next LINE;
 		}
-		if (/^VENDORID$/o) {
+		if (/^VENDORID$/oi) {
 			if (defined($VendorId)) {
 				push @MmpWarn, "$CurFile($LineNum) : Attempt to redefine VENDORID\n";
 				next LINE;
@@ -1452,14 +1472,15 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : Missing argument for keyword VENDORID\n";
 			next LINE;
 		}
-		if (/^USERINCLUDE$/o) {
+		if (/^USERINCLUDE$/oi) {
 			if (@$Line) {
 				my $Candidate;
 				foreach $Candidate (@$Line) {
+					$Candidate=~s/\\/\//g;      # force to forward slash
 					CheckSource_CaseAndDelimiter($CurFile, $Candidate, $LineNum, %CheckSourceCommands);
 					$Candidate = &Path_Norm($Candidate);
 					
-					$Candidate=~s-^(.*[^\\])$-$1\\-o;   # ensure path ends with a backslash
+					$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";
@@ -1477,14 +1498,14 @@ 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";
 			}
 			$SrcDbg=1;
 			next LINE;
 		}
-		if (/^VERSION$/o) {
+		if (/^VERSION$/oi) {
 			if (%Version) {
 				push @MmpDie, "$CurFile($LineNum) : Attempt to redefine VERSION\n";
 				next LINE;
@@ -1575,11 +1596,11 @@ sub Mmp_ProcessL ($$) {
 			push @MmpWarn, "$CurFile($LineNum) : ARMFPU must specify either SOFTVFP or VFPV2 as an argument\n";
 			next LINE;
 		}
-		if( /^PAGED$/o) {
+		if( /^PAGED$/oi) {
 			$PagingTargetMode = PAGED;
 			next LINE;
 			}
-		if( /^UNPAGED$/o) {
+		if( /^UNPAGED$/oi) {
 			$PagingTargetMode = UNPAGED;
 			next LINE;
 			}
@@ -1667,7 +1688,7 @@ sub Mmp_ProcessL ($$) {
 	}
 
 	# check for languages
-	@LangList=('SC') unless @LangList;
+	@LangList=('sc') unless @LangList;
 
   if (&main::EPOCSecurePlatform() && !defined($Capability) &&
     (($TrgType{Basic} eq "DLL") || (uc($TrgType) eq "EXEXP")))
@@ -1718,7 +1739,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;
 		}
 	}
@@ -1855,7 +1876,7 @@ sub Mmp_ProcessL ($$) {
 #	Get the EPOC entrypoint static library
 	unless ($FirstLib) {
 		unless ($TrgType{FirstLib}) {
-			$FirstLib="E$TrgType{Basic}.LIB";
+			$FirstLib= lc "E$TrgType{Basic}.lib";
 		}
 		else {
 			$FirstLib=$TrgType{FirstLib};
@@ -1903,7 +1924,7 @@ sub Mmp_ProcessL ($$) {
 	# apply the default .DEF filename, and
 	# check as far as possible that the project is frozen
 	if ($TrgType{NeedDeffile} or $CheckDef) {
-		unless ($Def{Path} and $Def{Path} !~ /\\\~\\$/) {
+		unless ($Def{Path} and $Def{Path} !~ /\/\~\/$/) {
 			my $augment;
 			if ($ASSPExports) {
 			    if ($$Plat_ref{DefFile} =~ /^\s*EABI\s*/i ) {
@@ -1918,17 +1939,18 @@ sub Mmp_ProcessL ($$) {
 					$augment = "B$$Plat_ref{DefFile}";
 			    }
 			}
-			if ($Def{Path} =~ /\\\~\\$/) {
-				$Def{Path} =~ s/\\\~\\$/\\$augment\\/;
+			$augment = lc $augment;
+			if ($Def{Path} =~ /\/\~\/$/) {
+				$Def{Path} =~ s/\/\~\/$/\/$augment\//;
 			} else {
-				$Def{Path}=&Path_Strip(&Path_Split('Path',$MMPFILE)."..\\$augment\\");
+				$Def{Path}=&Path_Strip(&Path_Split('Path',$MMPFILE)."../$augment/");
 			}
 		}
 		unless ($Def{Base}) {
 			$Def{Base} = &Path_Split('Base',$LinkAsBase);
 		}
 		unless ($Def{Ext}) {
-			$Def{Ext}='.DEF';
+			$Def{Ext}='.def';
 		}
 #		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
@@ -1936,7 +1958,7 @@ sub Mmp_ProcessL ($$) {
 		if (!$emulator && $Version{explicit}) {
 			$Def{Base} .= &Genutl_VersionToFileAugment(%Version);
 		} elsif (!$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 1be3ef8..cf1feb3 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);
@@ -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($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,15 +244,15 @@ 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=&Path_Strip($BasePath.$p);
 			next;
 		}
-		if ($p=~m-^\\-o) {
+		if ($p=~m-^\/-o) {
 			$p=&Path_Strip($p);
 			next;
 		}
-		if ($p=~m-^\.\\(.*)$-o) {
+		if ($p=~m-^\.\/(.*)$-o) {
 			$p=&Path_Strip($BasePath.$1);
 			next;
 		}
@@ -262,20 +262,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;
 		}
@@ -283,14 +283,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;
 		}
@@ -300,11 +300,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];
 }
@@ -314,7 +314,7 @@ sub Path_Quote ($) {
 	my @List=@_;
 	my $Path;
 	foreach $Path (@List) {
-		$Path=~s- -\\ -go if (defined($Path));
+		$Path=~s- -\/ -go if (defined($Path));
 	}
 	return wantarray ? @List : $List[0];
 }
@@ -322,7 +322,7 @@ sub Path_Quote ($) {
 sub Path_Norm ($) {
 # Normalise source specified paths for processing
 	my ($Path) = @_;
-	$Path =~ s/\//\\/g;
+	$Path =~ s/\\/\//g;
 	return $Path;
 }
 
@@ -333,9 +333,11 @@ sub Path_PrefixWithDriveAndQuote ($) {
 	my $Path;
 	my $Drive=$1 if (cwd =~ /^(.:)/); 
 
-	foreach $Path (@List) {
-		next if ($Path !~ /^\\/);
-		$Path=$Drive.$Path;
+	if ($Drive) {
+		foreach $Path (@List) {
+			next if ($Path !~ /^\//);
+			$Path=$Drive.$Path;
+		}
 	}
 
 	foreach $Path (@List) {
@@ -350,10 +352,10 @@ sub Path_PrefixWithDriveAndQuote ($) {
 BEGIN {
 # get the current working directory
 	$WorkPath=cwd;
-	$WorkPath=~s-/-\\-go; # separator from Perl 5.005_02+ is forward slash
+	$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
+	$WorkPath=~s-^(.*[^\/])$-$1\/-o;        # ensure workpath ends with a backslash
 	@WorkPathList=&Path_Dirs($WorkPath);
 }
 
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/prepdef.pl b/prepdef.pl
index b443f0e..d723392 100644
--- a/prepdef.pl
+++ b/prepdef.pl
@@ -14,14 +14,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/prepfile.pm b/prepfile.pm
index 4bfc157..9d562a1 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,9 +17,9 @@ require Exporter;
 );
 
 
-use Checkgcc;
-use Pathutl;
-use Preprocessor;
+use checkgcc;
+use pathutl;
+use preprocessor;
 
 my %Mode=(
 	Verbose=>0,
@@ -43,11 +43,11 @@ sub Prepfile_ProcessL ($$;$@) {
 	die "\nERROR: Project File \"$FILE\" not found\n" unless -e $FILE;
 
 	my $exe = &PreprocessorToUseExe();
- 	my $cpp = "$exe.EXE -undef -nostdinc -+ ";
+ 	my $cpp = "$exe -undef -nostdinc -x c++ ";
 	my @CppCall;
  	push @CppCall, $cpp;
 
-	push @CppCall, join '',	"-I ",&Path_PrefixWithDriveAndQuote("$ENV{EPOCROOT}epoc32\\include"),
+	push @CppCall, join '',	"-I ",&Path_PrefixWithDriveAndQuote("$ENV{EPOCROOT}epoc32/include"),
 							" -I .",
 							" -I ",&Path_PrefixWithDriveAndQuote(&Path_Split('Path',$FILE));
 
@@ -65,12 +65,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, &Path_PrefixWithDriveAndQuote($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
 	#--------------------------
@@ -87,20 +90,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=~s-\\\/-\\-go;
-			$CurFile=~s-\/\\-\\-go;
-			$CurFile=~s-\/\/-\\-go;
-			$CurFile=~s-\/-\\-go;
-			$CurFile=~s-(.:)--go;
-
 			$CurFile=&Path_AbsToWork($CurFile);
 			@Tmp=('#', $CurFile);
 			push @{$ArrayRef}, [ @Tmp ];
@@ -112,7 +108,7 @@ sub Prepfile_ProcessL ($$;$@) {
 		# get rid of the space that cpp puts in most of the time after macro expansion (CPP help doesn't say exactly when!)
 		# don't upper case everything until you've done this.
 		foreach $Macro (@Macros) {
-			s/_____$Macro /$Macro/g;
+			#s/_____$Macro /$Macro/g;
 			s/_____$Macro/$Macro/g;
 		}
 		while (/("([^"\t\n\r\f]+)"|([^ "\t\n\r\f]+))/go) {
diff --git a/preprocessor.pm b/preprocessor.pm
index 944b4b7..fd9b15e 100644
--- a/preprocessor.pm
+++ b/preprocessor.pm
@@ -7,7 +7,7 @@
 # Used to allow us to access and manipulate other pre processors
 #
 
-package Preprocessor;
+package preprocessor;
 
 require Exporter;
 @ISA=qw(Exporter);
@@ -54,7 +54,7 @@ sub PreprocessorToUseExe()
     
     if ( ($env eq "DEFAULT") )
     {
-        return "cpp";
+        return "arm-none-symbianelf-cpp";
     }
     elsif ( $env eq "MINGW_NO_CYGWIN" )
     {
@@ -89,4 +89,4 @@ sub PreprocessorToUsePath()
 }
 
 
-1;
\ No newline at end of file
+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 73dce80..c06b0c6 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 $iSlurp;
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/signsis b/signsis
new file mode 100644
index 0000000..2944624
--- /dev/null
+++ b/signsis
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# signsis - bash frontend for signsis.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`
+# Workaround for Qt createpackage.pl and patch_capabilities.pl, which call
+# $epocroot/epoc32/tools/$PGM explicitly instead of just "$PGM" using the
+# path. Try to use a proper native version, if available.
+if [ "`which $PGM`" != "$0" ] && [ -x "`which $PGM`" ]; then
+	exec $PGM "$@"
+else
+	echo "executing $PGM.exe"
+	ROOT=$EPOCROOT/epoc32/tools
+	wine $ROOT/$PGM.exe "$@"
+fi
diff --git a/tranasm b/tranasm
new file mode 100755
index 0000000..706c7c3
--- /dev/null
+++ b/tranasm
@@ -0,0 +1,4 @@
+#!/bin/sh
+DIR=`dirname $0`
+TOOL=`basename $0`
+perl $DIR/$TOOL.bat "$@"
diff --git a/tranasm.bat b/tranasm.bat
index a158fda..db616d9 100644
--- a/tranasm.bat
+++ b/tranasm.bat
@@ -1,5 +1,3 @@
-@goto invoke
-
 #!perl
 #line 5
 
@@ -17,8 +15,7 @@ my $Pwd = cwd;
 my $incroot = "\\";
 if ($Pwd =~ /.\:(.*)$/) {
 	$incroot = $1;
-	$incroot =~ s/\//\\/go;
-	$incroot = "$incroot"."\\";
+	$incroot = "$incroot"."/";
 }
 
 my $commentToken = "//";
@@ -108,7 +105,7 @@ sub Unmangle ($)
 		if ($mangledSymbols{$str}) {
 			my $sfile = $sourcefile;
 			$sfile =~ s/\"//go;
-			$sfile =~ s/\\\\/\\/go;
+			$sfile =~ s/\\\\/\//go;
 			push @unmangledSymbols, "$incroot$sfile $l: Symbol = $str : Result = $res : Filt = \?\?\? : @IncFiles"
 			}
 		return $res;
@@ -123,7 +120,7 @@ sub UnmangleX ($)
 
 	my $sfile = $sourcefile;
 	$sfile =~ s/\"//go;
-	$sfile =~ s/\\\\/\\/go;
+	$sfile =~ s/\\\\/\//go;
 
 	# nasty hack to recognize non-c++ derived symbols/labels
 	if ($str =~ /^\s*(__.*)\s*$/) {
@@ -1179,8 +1176,8 @@ sub trackSourceLine($)
 				$seenIncFiles{$sourcefile} = 1;
 				my $incfile = "$sourcefile";
 				$incfile =~ s/\"//go;
-				$incfile =~ s/\\\\/\\/go;
-				$incfile = "$incroot"."$incfile" unless ($incfile =~ /^\\/);
+				$incfile =~ s/\\\\/\//go;
+				$incfile = "$incroot"."$incfile" unless ($incfile =~ /^\//);
 				push @IncFiles, $incfile;
 			}
 		}
@@ -1403,13 +1400,3 @@ EOT
 	exit 1;
 }
 
-__END__
-
-# Tell emacs that this is a perl script even 'though it has a .bat extension
-# Local Variables:
-# mode:perl
-# tab-width:4
-# End:
-
-:invoke
-@perl -x -S tranasm.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/trgtype.pm b/trgtype.pm
index 7edb528..f772ff8 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=>{
@@ -86,12 +86,12 @@ my %Types=(
 		Basic=>'IMPLIB',
 	},	
 	KDLL=>{
-		FirstLib=>'EKLL.LIB',
+		FirstLib=>'ekll.lib',
 #		Kernel=>1,
 		System=>1,
 	},
 	KEXT=>{
-		FirstLib=>'EEXT.LIB',
+		FirstLib=>'eext.lib',
 #		Kernel=>1,
 		System=>1,
 	},
@@ -101,7 +101,7 @@ my %Types=(
 		System=>1,
 	},
 	LDD=>{
-		FirstLib=>'EDEV.LIB',
+		FirstLib=>'edev.lib',
 #		Kernel=>1,
 		System=>1,
 		'Exports'=>{
@@ -122,7 +122,7 @@ my %Types=(
 			WINS=>['?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z'],
 			X86=>['?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z'],
 		},
-		Path=>'System\Libs\Plugins',
+		Path=>'system/libs/plugins',
 		UID2=>'0x10009D8D',
 		Deprecated=>"Convert to PLUGIN (ECOM)",
 	},
@@ -133,7 +133,7 @@ my %Types=(
 			WINS=>['?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z'],
 			X86=>['?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z'],
 		},
-		ResourcePath=>'Resource\Plugins',
+		ResourcePath=>'resource/plugins',
 		UID2=>'0x10009D8D',
 	},
 	MDA=>{
@@ -172,7 +172,7 @@ my %Types=(
 			WINS=>['?NotifierArray@@YAPAV?$CArrayPtr@VMEikSrvNotifierBase@@@@XZ'],
 			X86=>['?NotifierArray@@YAPAV?$CArrayPtr@VMEikSrvNotifierBase@@@@XZ'],
 		},
-		Path=>'System\Notifiers',
+		Path=>'system/notifiers',
 		UID2=>'0x10005522',
 		Deprecated=>"Convert to PLUGIN (ECOM)",
 	},
@@ -183,7 +183,7 @@ my %Types=(
 			WINS=>['?NotifierArray@@YAPAV?$CArrayPtr@VMEikSrvNotifierBase2@@@@XZ'],
 			X86=>['?NotifierArray@@YAPAV?$CArrayPtr@VMEikSrvNotifierBase2@@@@XZ'],
 		},
-		Path=>'System\Notifiers',
+		Path=>'system/notifiers',
 		UID2=>'0x101fdfae',
 		Deprecated=>"Convert to PLUGIN (ECOM)",
 	},
@@ -194,13 +194,13 @@ my %Types=(
 			WINS=>['?NotifierArray@@YAPAV?$CArrayPtr@VMNotifierBase2@@@@XZ'],
 			X86=>['?NotifierArray@@YAPAV?$CArrayPtr@VMNotifierBase2@@@@XZ'],
 		},
-		Path=>'System\Notifiers',
+		Path=>'system/notifiers',
 		UID2=>'0x101fe38b',
 		# Not deprecated - the Text Window Server will have AllFiles, 
 		# so it can continue scanning for binaries
 	},
 	PDD=>{
-		FirstLib=>'EDEV.LIB',
+		FirstLib=>'edev.lib',
 #		Kernel=>1,
 		System=>1,
 		'Exports'=>{
@@ -219,7 +219,7 @@ my %Types=(
 			X86=>['?NewPrinterDeviceL@@YAPAVCPrinterDevice@@XZ'],
 		},
 		UID2=>'0x10003b1c',
-		ResourcePath=>'Resource\Printers',
+		ResourcePath=>'resource/printers',
 	},
 	VAR=>{
 		'Exports'=>{
@@ -227,7 +227,7 @@ my %Types=(
 			EABI=>['_Z17VariantInitialisev'],
 			X86=>['?VariantInitialise@@YAPAVAsic@@XZ'],
 		},
-		FirstLib=>'EVAR.LIB',
+		FirstLib=>'evar.lib',
 #		Kernel=>1,
 		System=>1,
 	},
@@ -324,9 +324,9 @@ sub Trg_GetL ($$$) {
 	}
 	else {
 		# apply terminating backslash
-		$TrgHash{Path}=~s-^(.*[^\\])$-$1\\-o;
+		$TrgHash{Path}=~s-^(.*[^\/])$-$1\/-o;
 		# apply Z drive
-		$TrgHash{Path}="Z\\$TrgHash{Path}";
+		$TrgHash{Path}="z/$TrgHash{Path}";
 	}
 
 	unless ($TrgHash{ResourcePath}) {
@@ -334,7 +334,7 @@ sub Trg_GetL ($$$) {
 	}
 	else {
 		# apply terminating backslash & Z drive
-		$TrgHash{ResourcePath}=~s-^(.*[^\\])$-Z\\$1\\-o;
+		$TrgHash{ResourcePath}=~s-^(.*[^\/])$-z\/$1\/-o;
 	}
 
 	unless ($TrgHash{UID2}) {
diff --git a/winutl.pm b/winutl.pm
index 42cb140..5f01b78 100644
--- a/winutl.pm
+++ b/winutl.pm
@@ -7,7 +7,7 @@
 
 # this package does various ancillary things for windows modules
 
-package Winutl;
+package winutl;
 
 my $BaseAddress='';
 my @Win32LibList=();
@@ -37,8 +37,8 @@ require Exporter;
 	Winutl_MSVCSubVer
 );
 
-use Genutl;
-use E32Variant;
+use genutl;
+use e32variant;
 
 sub Winutl_Help_Mmp {
 # provide the help text for START <windows platforms> END blocks
@@ -208,7 +208,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
 	}
@@ -264,7 +264,7 @@ sub Winutl_AdjustTargetPath () {
 }
 
 sub Winutl_MSVCVer () {
-	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) {
diff --git a/wrappermakefile.pm b/wrappermakefile.pm
index 2e52955..fd11554 100644
--- a/wrappermakefile.pm
+++ b/wrappermakefile.pm
@@ -11,7 +11,7 @@ require Exporter;
 	GenerateWrapper
 );
 
-use Output;
+use output;
 
 my (@ExtensionUsedBefore);
 my $ExtTemplatesPath="$ENV{EPOCROOT}epoc32/tools/makefile_templates/";
@@ -132,4 +132,4 @@ sub ReadMetaFile($$$) {
 	return %MetaData;
 }
 
-1;
\ No newline at end of file
+1;
