108 |
|
return $switch; |
109 |
|
} |
110 |
|
|
111 |
+ |
sub GenerateMakefile { |
112 |
+ |
my $self=shift; |
113 |
+ |
my $infile=shift; |
114 |
+ |
my $outfile=shift; |
115 |
+ |
|
116 |
+ |
$self->{switch}=$self->_initswitcher(); |
117 |
+ |
$self->{switch}->filetoparse($infile); |
118 |
+ |
|
119 |
+ |
# open a temporary gnumakefile to store output. |
120 |
+ |
my $fh=FileHandle->new(); |
121 |
+ |
open ( $fh, ">$outfile") or die "Unable to open $outfile for output ". |
122 |
+ |
"$!\n"; |
123 |
+ |
@{$self->{filehandlestack}}=($fh); |
124 |
+ |
|
125 |
+ |
# -- make an alias |
126 |
+ |
*GNUmakefile=$fh; |
127 |
+ |
if ( -e $ENV{LatestBuildFile} ) { |
128 |
+ |
print GNUmakefile "include $ENV{LatestBuildFile}\n"; |
129 |
+ |
} |
130 |
+ |
$ENV{LatestBuildFile}=$outfile; |
131 |
+ |
$self->{switch}->parse("makebuild"); # sort out supported tags |
132 |
+ |
close GNUmakefile; |
133 |
+ |
} |
134 |
+ |
|
135 |
|
sub ParseBuildFile { |
136 |
|
my $self=shift; |
137 |
|
my $base=shift; |