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.16 by williamc, Thu Apr 1 12:38: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 136 | Line 159 | sub Bin_start {
159          print GNUmakefile "$$hashref{name}.dep:$$hashref{file}\n";
160          print GNUmakefile "-include $$hashref{name}.dep\n";
161   #       print GNUmakefile "$$hashref{name}:$$hashref{file}\n";
162 <        print GNUmakefile "$$hashref{name}_d:$$hashref{name}_d.exe\n";
163 <        print GNUmakefile "\t\@mv $$hashref{name}_d.exe \$(binarystore)/".
164 <                        "$$hashref{name}\n";
165 <        print GNUmakefile "$$hashref{name}_Insure:$$hashref{name}_Insure.exe\n";
166 <        print GNUmakefile "\t\@mv $$hashref{name}_Insure.exe \$(binarystore)/".
167 <                        "$$hashref{name}_Insure\n";
168 <        print GNUmakefile "$$hashref{name}:$$hashref{name}.exe\n";
169 <        print GNUmakefile "\t\@mv $$hashref{name}.exe \$(binarystore)/".
170 <                        "$$hashref{name}\n";
171 <        print GNUmakefile "binfiles+=$filename\n";
172 <        print GNUmakefile "bintargets+=$$hashref{name} $$hashref{name}_d\n";
173 <        print GNUmakefile "#files+=$$hashref{file}\n";
174 <
162 > print GNUmakefile <<ENDTEXT;
163 > $$hashref{name}_d.exe:\$(libslocal_d)
164 > $$hashref{name}.exe:\$(libslocal)
165 > $$hashref{name}_Insure.exe:\$(libslocal_I)
166 > $$hashref{name}_d:$$hashref{name}_d.exe
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}_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
176 > ENDTEXT
177   }
178  
179   sub External_StartTag {
# Line 157 | 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 204 | 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          }
211        print GNUmakefile "local__$$hashref{name}=true\n";
239   }
240  
241   sub CheckBuildFile {
# Line 263 | 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