sysdeftools/joinsysdef.pl
branchHighFidelityModel
changeset 414 f503e8553dd5
parent 413 9bcf6c827202
equal deleted inserted replaced
413:9bcf6c827202 414:f503e8553dd5
   772 	my $inc = '';
   772 	my $inc = '';
   773 	foreach my $i (@includes)
   773 	foreach my $i (@includes)
   774 		{
   774 		{
   775 		$inc.=" -I$i";
   775 		$inc.=" -I$i";
   776 		}
   776 		}
   777 	open(CPP,"cpp -dD$inc \"$file\" 2>&1 |");
   777 	my $CPP = $ENV{"SBS_HOME"} . "/win32/mingw/bin/cpp.exe";
       
   778 
       
   779 	$CPP =~ s/\\/\//g;
       
   780 
       
   781 	open(CPP,"$CPP -dD$inc \"$file\" 2>&1 |");
   778 	while(<CPP>)
   782 	while(<CPP>)
   779 		{
   783 		{
   780 		s/\s+$//;
   784 		s/\s+$//;
   781 		if(!/\S/){next} # skip blank lines
   785 		if(!/\S/){next} # skip blank lines
   782 		if(/^# [0-9]+ /) {next} # don't care about these
   786 		if(/^# [0-9]+ /) {next} # don't care about these
   789 			{ # normal define
   793 			{ # normal define
   790 			my $def = $1;
   794 			my $def = $1;
   791 			s/^\s+//;
   795 			s/^\s+//;
   792 			$defines{$1}=$_;
   796 			$defines{$1}=$_;
   793 			}
   797 			}
   794 		else {die "cannot process $_";}
   798 		else
       
   799 			{
       
   800 			die "cannot process $_";
       
   801 			}
   795 		}
   802 		}
   796 	close CPP;
   803 	close CPP;
   797 	$? && die "Call to cpp produced an error";
   804 	$? && die "Call to cpp produced an error";
   798 	}
   805 	}
   799 
   806