ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/BuildFile.pm
(Generate patch)

Comparing COMP/SCRAM/src/BuildFile.pm (file contents):
Revision 1.20 by williamc, Thu Apr 8 12:55:49 1999 UTC vs.
Revision 1.21 by williamc, Tue Apr 13 17:30:19 1999 UTC

# Line 8 | Line 8 | BEGIN {
8   use ToolBox;
9   $buildfile="BuildFile";
10   $toolbox=ToolBox->new();
11 + $Arch=1;
12 + push @ARCHBLOCK, $Arch;
13   }
14  
15   #Parse the BuildFile
# Line 32 | Line 34 | sub ParseBuildFile {
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);
# Line 51 | Line 56 | sub ParseBuildFile {
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=@_;
# Line 159 | Line 182 | sub External_StartTag {
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  
# Line 206 | Line 231 | sub Use_start {
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          }
213        print GNUmakefile "local__$$hashref{name}=true\n";
239   }
240  
241   sub CheckBuildFile {
# Line 265 | Line 290 | sub setBlockClassPath {
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 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines