kernel/eka/rombuild/rom_sbs.pl
branchRCL_3
changeset 84 b379919d420f
parent 79 5e2688cee105
child 86 8e4dfe27c581
equal deleted inserted replaced
79:5e2688cee105 84:b379919d420f
   117 	}
   117 	}
   118 
   118 
   119 	my @path = split(/\\/, $cwd);
   119 	my @path = split(/\\/, $cwd);
   120 	shift(@path);
   120 	shift(@path);
   121 	$toroot = ('..\\') x @path;
   121 	$toroot = ('..\\') x @path;
       
   122 	$toroot =~ s/\\$//;
       
   123 	#e32path supposed to be = to "\sf\os"
   122 	$e32path = $fp0;
   124 	$e32path = $fp0;
   123 	$e32path =~ s/\\kernelhwsrv\\kernel\\eka\\rombuild\\rom\.pl$//i;
   125 	$e32path =~ s/\\kernelhwsrv\\kernel\\eka\\rombuild\\rom_sbs\.pl$//i;
   124 	$e32path =~ s/^[A-Za-z]://;
   126 	$e32path =~ s/^[A-Za-z]://;
   125 	$rombuildpath = $toroot."sf\\os\\kernelhwsrv\\kernel\\eka\\rombuild";
   127 	$rombuildpath = $toroot."\\sf\\os\\kernelhwsrv\\kernel\\eka\\rombuild";
   126 	$Epoc32Path = $toroot;
   128 	$Epoc32Path = $toroot;
   127 	$Epoc32Path =~ s/\\$//;
   129 	$Epoc32Path =~ s/\\$//;
   128 	$Epoc32Path .= $EpocRoot . "epoc32";
   130 	$Epoc32Path .= $EpocRoot . "epoc32";
   129 	$toolpath = "$Epoc32Path\\tools\\";
   131 	$toolpath = "$Epoc32Path\\tools\\";
   130 	push @INC, $toolpath;
   132 	push @INC, $toolpath;
   131 	$BasePath = $toroot . $e32path;
   133 	$BasePath = $toroot . $e32path."\\";
   132 }
   134 }
   133 
   135 
   134 use E32Plat;
   136 use E32Plat;
   135 {
   137 {
   136         Plat_Init($toolpath);
   138         Plat_Init($toolpath);
   235 open(X, "$skel") || die "Can't open type file $skel, $!";
   237 open(X, "$skel") || die "Can't open type file $skel, $!";
   236 open(OUT, "> rom1.tmp") || die "Can't open output file, $!";
   238 open(OUT, "> rom1.tmp") || die "Can't open output file, $!";
   237 
   239 
   238 # First output the ROM name
   240 # First output the ROM name
   239 print OUT "\nromname=$romname\n";
   241 print OUT "\nromname=$romname\n";
       
   242 # Go through the iby file passed as parameter of this script and replace flags by proper values before copying the line in rom1.tmp.
   240 while(<X>) {
   243 while(<X>) {
   241 	s/\#\#ASSP\#\#/$opts{'assp'}/;
   244 	s/\#\#ASSP\#\#/$opts{'assp'}/;
   242 	s/\#\#VARIANT\#\#/$opts{'variant'}/;
   245 	s/\#\#VARIANT\#\#/$opts{'variant'}/;
   243 	s/\#\#BUILD\#\#/$opts{'build'}/;
   246 	s/\#\#BUILD\#\#/$opts{'build'}/;
   244 	s/\#\#MAIN\#\#/$main/;
   247 	s/\#\#MAIN\#\#/$main/;
   563 
   566 
   564 EOT
   567 EOT
   565 }
   568 }
   566 
   569 
   567 sub cleanup($$$) {
   570 sub cleanup($$$) {
       
   571 print "What's going on!\n";
   568 	my ($in, $out, $k) = @_;
   572 	my ($in, $out, $k) = @_;
   569 	my ($line, $lastblank);
   573 	my ($line, $lastblank);
   570 
   574 
   571 	open(OUTPUT_FILE, "> $out") or die "Cannot open $out for output";
   575 	open(OUTPUT_FILE, "> $out") or die "Cannot open $out for output";
   572 	open(INPUT_FILE, "< $in") or die "Cannot open for $in input";
   576 	open(INPUT_FILE, "< $in") or die "Cannot open for $in input";
   591 			# Not blank
   595 			# Not blank
   592 			$lastblank=0;
   596 			$lastblank=0;
   593 			if ($k and $line=~/^\s*kerneltrace/i) {
   597 			if ($k and $line=~/^\s*kerneltrace/i) {
   594 				$line = "kerneltrace $k\n";
   598 				$line = "kerneltrace $k\n";
   595 			}
   599 			}
       
   600 			
       
   601 			# This next line is about converting all the / to \ to make sure that we are using the right format for the build generation	
       
   602 			$line =~ s/\//\\/g;
       
   603 			
   596 			print OUTPUT_FILE $line if !($line=~/^\s*REM\s+/i);
   604 			print OUTPUT_FILE $line if !($line=~/^\s*REM\s+/i);
   597 		}
   605 		}
   598 	}
   606 	}
   599 	close(INPUT_FILE);
   607 	close(INPUT_FILE);
   600 	close(OUTPUT_FILE);
   608 	close(OUTPUT_FILE);