8 |
|
use ToolBox; |
9 |
|
$buildfile="BuildFile"; |
10 |
|
$toolbox=ToolBox->new(); |
11 |
+ |
$Arch=1; |
12 |
+ |
push @ARCHBLOCK, $Arch; |
13 |
|
} |
14 |
|
|
15 |
|
#Parse the BuildFile |
34 |
|
'Bin' => 'none', |
35 |
|
'Bin_StartTag' => \&Bin_start, |
36 |
|
'ClassPath' => \&OutToMakefile, |
37 |
< |
'ClassPath_StartTag' => \&setBlockClassPath |
37 |
> |
'ClassPath_StartTag' => \&setBlockClassPath, |
38 |
> |
'lib' => 'none', |
39 |
> |
'lib_StartTag' => \&lib_start, |
40 |
> |
'lib_EndTag' => 'none' |
41 |
|
}; |
42 |
|
use Utilities::Switcher; |
43 |
|
$switch=Switcher->new($SupportedTags, $fullfilename); |
56 |
|
close GNUmakefile; |
57 |
|
} |
58 |
|
|
59 |
+ |
sub ParseBuildFile_Export { |
60 |
+ |
my $filename=shift; |
61 |
+ |
use Tool; |
62 |
+ |
# This hash defines which Document Elements we can use |
63 |
+ |
my $SupportedTags={ |
64 |
+ |
'none' => 'none', |
65 |
+ |
'export' => \&OutToMakefile, |
66 |
+ |
'export_StartTag' => \&export_start, |
67 |
+ |
'export_EndTag' => \&export_end, |
68 |
+ |
'lib_StartTag' => \&lib_start_export, |
69 |
+ |
'lib' => 'none' |
70 |
+ |
}; |
71 |
+ |
use Utilities::Switcher; |
72 |
+ |
$switchex=Switcher->new($SupportedTags, $filename); |
73 |
+ |
$switchex->{Strict_no_cr}='no'; |
74 |
+ |
$switchex->parse(); # sort out supported tags |
75 |
+ |
} |
76 |
+ |
|
77 |
|
sub initialterms() { |
78 |
|
my $name=shift; |
79 |
|
my @string=@_; |
167 |
|
\@mv $$hashref{name}_d.exe \$(binarystore)/$$hashref{name} |
168 |
|
$$hashref{name}_Insure:$$hashref{name}_Insure.exe |
169 |
|
\@mv $$hashref{name}_Insure.exe \$(binarystore)/$$hashref{name}_Insure |
170 |
< |
$$hashref{name}:$$hashref{name}.exe |
170 |
> |
$$hashref{name}:$$hashref{name}_d.exe |
171 |
> |
\@mv $$hashref{name}_d.exe \$(binarystore)/$$hashref{name} |
172 |
> |
$$hashref{name}_o:$$hashref{name}_o.exe |
173 |
|
\@mv $$hashref{name}.exe \$(binarystore)/$$hashref{name} |
174 |
|
binfiles+=$filename |
175 |
|
bintargets+=$$hashref{name} $$hashref{name}_d $$hashref{name}_Insure |
182 |
|
my $hashref; |
183 |
|
|
184 |
|
$hashref=$switch->SetupValueHash(\@vars); |
185 |
+ |
if ( $Arch ) { |
186 |
|
$$hashref{'ref'}=~tr[A-Z][a-z]; |
187 |
|
print GNUmakefile $$hashref{'ref'}; |
188 |
|
if ( defined $$hashref{'version'} ) { |
189 |
|
print GNUmakefile "_V_".$$hashref{'version'}; |
190 |
|
} |
191 |
|
print GNUmakefile "=true\n"; |
192 |
+ |
} |
193 |
|
|
194 |
|
} |
195 |
|
|
231 |
|
|
232 |
|
$hashref=$switch->SetupValueHash(\@vars); |
233 |
|
$switch->checkparam($hashref, $name, "name"); |
234 |
< |
if ( $filename=checkfile("$ENV{INTsrc}/$$hashref{name}/BuildFile") |
235 |
< |
ne "" ) { |
236 |
< |
print GNUmakefile "ReqDependencies += $filename\n"; |
234 |
> |
$filename=SCRAMUtils::checkfile( |
235 |
> |
"$ENV{INTsrc}/$$hashref{name}/BuildFile"); |
236 |
> |
if ( $filename ne "" ) { |
237 |
> |
ParseBuildFile_Export( $filename ); |
238 |
|
} |
211 |
– |
print GNUmakefile "local__$$hashref{name}=true\n"; |
239 |
|
} |
240 |
|
|
241 |
|
sub CheckBuildFile { |
290 |
|
$BlockClassPath=$BlockClassPath.":".$$hashref{path}; |
291 |
|
_CutBlock($$hashref{path}); |
292 |
|
} |
293 |
+ |
|
294 |
+ |
sub export_start { |
295 |
+ |
#Set up a toolfile object |
296 |
+ |
$exporttool=Tool->new(); |
297 |
+ |
} |
298 |
+ |
|
299 |
+ |
sub export_end { |
300 |
+ |
#Write toolfile object to disk |
301 |
+ |
$exporttool->envtomake(\*GNUmakefile); |
302 |
+ |
} |
303 |
+ |
|
304 |
+ |
# |
305 |
+ |
# Export Mode Lib Tag |
306 |
+ |
# |
307 |
+ |
sub lib_start_export { |
308 |
+ |
my $name=shift; |
309 |
+ |
my @vars=@_; |
310 |
+ |
my $hashref; |
311 |
+ |
|
312 |
+ |
$hashref=$switchex->SetupValueHash( \@vars ); |
313 |
+ |
$switchex->checkparam($hashref, $name, 'name'); |
314 |
+ |
if ( $Arch ) { |
315 |
+ |
if ( $switchex->context('export') ) { |
316 |
+ |
#If export mode then add this env to the export tool |
317 |
+ |
$exporttool->addenv('lib',$$hashref{name}); |
318 |
+ |
} |
319 |
+ |
} |
320 |
+ |
} |
321 |
+ |
|
322 |
+ |
# |
323 |
+ |
# Standard lib tag |
324 |
+ |
# |
325 |
+ |
sub lib_start { |
326 |
+ |
my $name=shift; |
327 |
+ |
my @vars=@_; |
328 |
+ |
my $hashref; |
329 |
+ |
|
330 |
+ |
$hashref=$switch->SetupValueHash( \@vars ); |
331 |
+ |
$switch->checkparam($hashref, $name, 'name'); |
332 |
+ |
if ( $Arch ) { |
333 |
+ |
print GNUmakefile "lib+=$$hashref{name}\n"; |
334 |
+ |
} |
335 |
+ |
} |