35 opendir(IN
, "../src/$dir") || die "ERROR: DIR \"$dir\"";
36 my @files = grep { /\.h/ } readdir(IN
);
40 foreach $file (@files)
42 open (INFILE
, "../src/$dir/$file") || die "ERROR: File \"../$dir/$file\"";
43 my @filelines = <INFILE
>;
47 for (my $i=0; $i<=$#filelines; $i++)
49 if ($filelines[$i] =~ /pragma once/)
57 my $incline = "__INCLUDE_".$file."_INCLUDE__";
62 $filelines[$index] = "#if !defined($incline)\n#define $incline\n";
63 push @filelines, "\n#endif // $incline\n";
65 open(OUTFILE
, ">../src/$dir/$file") || die "ERROR: Out $file";
66 print OUTFILE
@filelines;