sbsv1_os/e32toolp/group/setupprj.bat
branchRCL_3
changeset 73 22bdd8a90cc4
parent 18 99082257a271
child 76 2b4ec55c802e
equal deleted inserted replaced
62:7416fe50a180 73:22bdd8a90cc4
   114 
   114 
   115 opendir CONFIGDIR, "..\\platform" or die "ERROR: Can't open dir \"..\\platform\"\n";
   115 opendir CONFIGDIR, "..\\platform" or die "ERROR: Can't open dir \"..\\platform\"\n";
   116 @ConfigFiles = grep /\.(mk|make)/i, readdir CONFIGDIR;
   116 @ConfigFiles = grep /\.(mk|make)/i, readdir CONFIGDIR;
   117 
   117 
   118 closedir CONFIGDIR;
   118 closedir CONFIGDIR;
   119 
   119 my @Docs ;
   120 opendir SUBDIR, "..\\Docs" or die "ERROR: Can't open dir \"..\\Docs\"\n";
   120 if(-d "..\\Docs") {
   121 my @Docs = map lc $_, readdir SUBDIR;
   121 	opendir SUBDIR, "..\\Docs" or die "ERROR: Can't open dir \"..\\Docs\"\n";
   122 @Docs = grep /^[^\.].+\.(rtf|doc|changes|txt|html|htm)$/o, @Docs;
   122 	@Docs = map lc $_, readdir SUBDIR;
   123 	
   123 	@Docs = grep /^[^\.].+\.(rtf|doc|changes|txt|html|htm)$/o, @Docs;	
   124 closedir SUBDIR;	
   124 	closedir SUBDIR;	
       
   125 }
   125 
   126 
   126 open TEMPLATEFILESUBDIR, "\"dir \/s \/b \/a-d ..\\..\\..\\toolsandutils\\buildsystem\\extension\" |";
   127 open TEMPLATEFILESUBDIR, "\"dir \/s \/b \/a-d ..\\..\\..\\toolsandutils\\buildsystem\\extension\" |";
   127 my @TemplateFiles=();
   128 my @TemplateFiles=();
   128 my %TemplateDirs;
   129 my %TemplateDirs;
   129 while (<TEMPLATEFILESUBDIR>)
   130 while (<TEMPLATEFILESUBDIR>)
   130 	{
   131 	{
   131 	next if ($_ !~ /\.(mk|meta)$/i);	
   132 	next if ($_ !~ /\.(mk|meta|flm|xml)$/i);	
   132 	$_ =~ s/^.*\\buildsystem\\extension\\//i;
   133 	$_ =~ s/^.*\\buildsystem\\extension\\//i;
   133 	chomp $_;
   134 	chomp $_;
   134 	push @TemplateFiles, $_;
   135 	push @TemplateFiles, $_;
   135 	$_ =~ /^(.*\\)/o;
   136 	$_ =~ /^(.*\\)/o;
   136 	my $path = $1;
   137 	my $path = $1;
   238  	"$BinFilePath\\$_ :\n",
   239  	"$BinFilePath\\$_ :\n",
   239  	"\t\@perl -w ..\\genutil\\emkdir.pl $BinFilePath\\$_\n", 
   240  	"\t\@perl -w ..\\genutil\\emkdir.pl $BinFilePath\\$_\n", 
   240  	"\n"
   241  	"\n"
   241  	);
   242  	);
   242 }
   243 }
   243 
   244 if(scalar @Docs) {
       
   245 	&Output(
       
   246 	"$DocsPath :\n",
       
   247 	"\t\@perl -w ..\\genutil\\emkdir.pl $DocsPath\n", 
       
   248 	"\n"
       
   249 	);
       
   250 }
       
   251 else {
       
   252 	$DocsPath = ""; # suppresses $DocsPath as a dependency in the main rules
       
   253 }
   244 &Output(
   254 &Output(
   245 	"$ShellFilePath :\n",
   255 	"$ShellFilePath :\n",
   246 	"\t\@perl -w ..\\genutil\\emkdir.pl $ShellFilePath\n", 
   256 	"\t\@perl -w ..\\genutil\\emkdir.pl $ShellFilePath\n", 
   247 	"\n",
   257 	"\n",
   248 	"$EPOCToolsConfigFilePath :\n",
   258 	"$EPOCToolsConfigFilePath :\n",
   249 	"\t\@perl -w ..\\genutil\\emkdir.pl $EPOCToolsConfigFilePath\n", 
   259 	"\t\@perl -w ..\\genutil\\emkdir.pl $EPOCToolsConfigFilePath\n", 
   250 	"\n",
       
   251 	"$DocsPath :\n",
       
   252 	"\t\@perl -w ..\\genutil\\emkdir.pl $DocsPath\n", 
       
   253 	"\n",
   260 	"\n",
   254 	"\n",
   261 	"\n",
   255 	"deb : $EPOCToolsPath $EPOCToolsConfigFilePath $DocsPath $TemplateFilePath $ShellFilePath "
   262 	"deb : $EPOCToolsPath $EPOCToolsConfigFilePath $DocsPath $TemplateFilePath $ShellFilePath "
   256 );
   263 );
   257 
   264 
   500 open MRPFILE,"<$MRPFILE" or die "\nERROR: Can't read MRP file \"$MRPFILE\"\n";
   507 open MRPFILE,"<$MRPFILE" or die "\nERROR: Can't read MRP file \"$MRPFILE\"\n";
   501 my $OldMRPText = "";
   508 my $OldMRPText = "";
   502 sysread MRPFILE, $OldMRPText, 100000;	# assumes MRP file is less than 100,000 bytes
   509 sysread MRPFILE, $OldMRPText, 100000;	# assumes MRP file is less than 100,000 bytes
   503 close MRPFILE or die "\nERROR: Can't close MRP file \"$MRPFILE\"\n";
   510 close MRPFILE or die "\nERROR: Can't close MRP file \"$MRPFILE\"\n";
   504 
   511 
   505 if ($OldMRPText ne $NewMRPText) {
   512 if ( lc($OldMRPText) ne lc($NewMRPText)) {
   506 	print "REMARK: MRP file \"$MRPFILE\" differs from setupprj.bat generated content\n";
   513 	print "REMARK: MRP file \"$MRPFILE\" differs from setupprj.bat generated content\n";
   507 	print "Creating suggested new MRP file \"$MRPFILE.new\"\n";
   514 	print "Creating suggested new MRP file \"$MRPFILE.new\"\n";
   508 	open MRPFILE,">$MRPFILE.new" or die "\nERROR: Can't open or create MRP file \"$MRPFILE.new\"\n";
   515 	open MRPFILE,">$MRPFILE.new" or die "\nERROR: Can't open or create MRP file \"$MRPFILE.new\"\n";
   509 	print MRPFILE $NewMRPText;
   516 	print MRPFILE $NewMRPText;
   510 	close MRPFILE or die "\nERROR: Can't close MRP file \"$MRPFILE.new\"\n";
   517 	close MRPFILE or die "\nERROR: Can't close MRP file \"$MRPFILE.new\"\n";