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.19 by williamc, Tue Apr 6 07:50:31 1999 UTC vs.
Revision 1.22 by williamc, Wed Apr 14 13:18:41 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 +                'Use' => \&OutToMakefile,
65 +                'Use_StartTag' => \&Use_start,
66 +                'External' => \&OutToMakefile,
67 +                'External_StartTag' => \&External_StartTag,
68 +                'none' => 'none',
69 +                'export' => \&OutToMakefile,
70 +                'export_StartTag' => \&export_start,
71 +                'export_EndTag' => \&export_end,
72 +                'lib_StartTag' => \&lib_start_export,
73 +                'lib' => 'none'
74 +        };
75 +        use Utilities::Switcher;
76 +        $switchex=Switcher->new($SupportedTags, $filename);
77 +        $switchex->{Strict_no_cr}='no';
78 +        push @switchstack, $switchex;
79 +        $switchex->parse(); # sort out supported tags
80 +        pop @switchstack;
81 +        $switchex=$switchstack[$#switchstack]; # Make sure we can Use multiply
82 + }
83 +
84   sub initialterms() {
85          my $name=shift;
86          my @string=@_;
# Line 144 | Line 174 | $$hashref{name}_d:$$hashref{name}_d.exe
174          \@mv $$hashref{name}_d.exe \$(binarystore)/$$hashref{name}
175   $$hashref{name}_Insure:$$hashref{name}_Insure.exe
176          \@mv $$hashref{name}_Insure.exe \$(binarystore)/$$hashref{name}_Insure
177 < $$hashref{name}:$$hashref{name}.exe
177 > $$hashref{name}:$$hashref{name}_d.exe
178 >        \@mv $$hashref{name}_d.exe \$(binarystore)/$$hashref{name}
179 > $$hashref{name}_o:$$hashref{name}_o.exe
180          \@mv $$hashref{name}.exe \$(binarystore)/$$hashref{name}
181   binfiles+=$filename
182   bintargets+=$$hashref{name} $$hashref{name}_d $$hashref{name}_Insure
# Line 157 | Line 189 | sub External_StartTag {
189          my $hashref;
190          
191          $hashref=$switch->SetupValueHash(\@vars);
192 +        if ( $Arch ) {
193          $$hashref{'ref'}=~tr[A-Z][a-z];
194          print GNUmakefile $$hashref{'ref'};
195          if ( defined $$hashref{'version'} ) {
196                  print GNUmakefile "_V_".$$hashref{'version'};
197          }
198          print GNUmakefile "=true\n";
199 +        }
200          
201   }      
202  
# Line 204 | Line 238 | sub Use_start {
238          
239          $hashref=$switch->SetupValueHash(\@vars);
240          $switch->checkparam($hashref, $name, "name");
241 <        if ( $filename=checkfile("$ENV{INTsrc}/$$hashref{name}/BuildFile")
242 <                                                 ne "" ) {
243 <          print GNUmakefile "ReqDependencies += $filename\n";
241 >        $filename=SCRAMUtils::checkfile(
242 >                "$ENV{INTsrc}/$$hashref{name}/BuildFile");
243 >        if ( $filename ne "" ) {
244 >          ParseBuildFile_Export( $filename );
245          }
211        print GNUmakefile "local__$$hashref{name}=true\n";
246   }
247  
248   sub CheckBuildFile {
# Line 263 | Line 297 | sub setBlockClassPath {
297          $BlockClassPath=$BlockClassPath.":".$$hashref{path};
298          _CutBlock($$hashref{path});
299   }
300 +
301 + sub export_start {
302 + #Set up a toolfile object
303 +        $exporttool=Tool->new();
304 + }
305 +
306 + sub export_end {
307 + #Write toolfile object to disk
308 +        $exporttool->envtomake(\*GNUmakefile);
309 + }
310 +
311 + #
312 + # Export Mode Lib Tag
313 + #
314 + sub lib_start_export {
315 +        my $name=shift;
316 +        my @vars=@_;
317 +        my $hashref;
318 +
319 +        $hashref=$switchex->SetupValueHash( \@vars );
320 +        $switchex->checkparam($hashref, $name, 'name');
321 +        if ( $Arch ) {
322 +         if ( $switchex->context('export') ) {
323 +                #If export mode then add this env to the export tool
324 +                $exporttool->addenv('lib',$$hashref{name});
325 +         }
326 +        }
327 + }
328 +
329 + #
330 + # Standard lib tag
331 + #
332 + sub lib_start {
333 +        my $name=shift;
334 +        my @vars=@_;
335 +        my $hashref;
336 +
337 +        $hashref=$switch->SetupValueHash( \@vars );
338 +        $switch->checkparam($hashref, $name, 'name');
339 +        if ( $Arch ) {
340 +           print GNUmakefile "lib+=$$hashref{name}\n";
341 +        }
342 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines