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

Comparing COMP/SCRAM/src/BuildSystem/BuildFile.pm (file contents):
Revision 1.6 by williamc, Fri Sep 15 11:18:21 2000 UTC vs.
Revision 1.17 by sashby, Tue May 14 10:21:19 2002 UTC

# Line 2 | Line 2
2   #
3   # Interface
4   # ---------
5 < # new(ConfigArea)
5 > # new(toolbox)
6   # ParseBuildFile($base,$path,$file)
7   # ParseBuildFileExport(filename)
8   # BlockClassPath() : Return the class path
9   # ignore()      : return 1 if directory should be ignored 0 otherwise
10 # classname()   : get/set the associated class
11 # buildfile()   : get/set BuildFile location
10  
11   package BuildSystem::BuildFile;
12 + use Utilities::Verbose;
13   use ActiveDoc::SimpleDoc;
14   use BuildSystem::ToolBox;
15   require 5.004;
16 + @ISA=qw(Utilities::Verbose);
17  
18   BEGIN {
19   $buildfile="BuildFile";
# Line 23 | Line 23 | sub new {
23          my $class=shift;
24          my $self={};
25          bless $self, $class;
26 <        $self->{area}=shift;
27 <        $self->{toolbox}=$self->{area}->toolbox();
28 <        $self->{localtop}=$self->{area}->location();
26 >        $self->{toolbox}=shift;
27          $self->{Arch}=1;
28          push @{$self->{ARCHBLOCK}}, $self->{Arch};
29          return $self;
30   }
31  
34 sub buildfile {
35        my $self=shift;
36        if ( @_ ) {
37          $self->{buildfile}=shift;
38        }
39        return $self->{buildfile};
40 }
41
32   sub ignore {
33          my $self=shift;
34 +        $self->verbose(">> ignore......<<");
35 +        
36          return (defined $self->{ignore})?$self->{ignore}:0;
37   }
38  
# Line 48 | Line 40 | sub _initswitcher {
40          my $self=shift;
41          my $switch=ActiveDoc::SimpleDoc->new();
42          my $parse="makebuild";
43 +        $self->verbose(">> _initswitcher: <<");
44          $switch->newparse($parse);
45          $switch->addignoretags($parse);
46          $self->_commontags($switch,$parse);
# Line 60 | Line 53 | sub _initswitcher {
53                                          \&Bin_start,$self,
54                                          \&OutToScreen, $self,
55                                          "", $self);
56 +         $switch->addtag($parse,"ProductStore",
57 +                                        \&Store_start,$self,
58 +                                        "", $self,
59 +                                        "", $self);
60          $switch->addtag($parse,"LibType",
61                                          \&LibType_Start,$self,
62                                          \&LibType_text, $self,
# Line 91 | Line 88 | sub _commontags {
88          my $self=shift;
89          my $switch=shift;
90          my $parse=shift;
91 <
91 >        
92 >        $self->verbose(">> _commontags: SW ".$switch." PARSE ".$parse." <<");
93 >        
94          $switch->grouptag("Export",$parse);
95          $switch->addtag($parse,"Use",\&Use_start,$self,
96                                                 \&OutToMakefile, $self,
# Line 119 | Line 118 | sub _commontags {
118          return $switch;
119   }
120  
122 sub GenerateMakefile {
123        my $self=shift;
124        my $infile=shift;
125        my $outfile=shift;
126
127        $self->{switch}=$self->_initswitcher();
128        $self->{switch}->filetoparse($infile);
129
130        # open a temporary gnumakefile to store output.
131        my $fh=FileHandle->new();
132        open ( $fh, ">$outfile") or die "Unable to open $outfile for output ".
133                                                                "$!\n";
134        @{$self->{filehandlestack}}=($fh);
135
136        #  -- make an alias
137        *GNUmakefile=$fh;
138        if ( -e $ENV{LatestBuildFile} ) {
139          print GNUmakefile "include $ENV{LatestBuildFile}\n";
140        }
141        $ENV{LatestBuildFile}=$outfile;
142        $self->{switch}->parse("makebuild"); # sort out supported tags
143        close GNUmakefile;
144 }
145
121   sub ParseBuildFile {
122          my $self=shift;
123          my $base=shift;
# Line 155 | Line 130 | sub ParseBuildFile {
130          else {
131           $fullfilename=$filename;
132          }
133 +
134 +        $self->verbose(">> ParseBuildFile: FN ".$fullfilename." <<");
135 +        
136          $self->{path}=$path;
159        #print "Processing $fullfilename\n";
137          $numbins=0;
138          $self->{envnum}=0;
139          $self->{envlevel}=0;
140 <        $self->{currentenv}="$self->{localtop}/$ENV{INTwork}/$self->{path}/".
140 >        $self->{currentenv}="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/".
141                                                                  "BuildFile.mk";
142          $self->{switch}=$self->_initswitcher();
143          $self->{switch}->filetoparse($fullfilename);
144  
145 < #       $self->{switch}->{Strict_no_cr}='no';
169 <        #open a temporary gnumakefile to store output.
145 >        # open a temporary gnumakefile to store output.
146          use Utilities::AddDir;
147 <        AddDir::adddir("$self->{localtop}/$ENV{INTwork}/$self->{path}");
147 >        AddDir::adddir("$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}");
148          my $fh=FileHandle->new();
149 <        open ( $fh, ">$self->{localtop}/$ENV{INTwork}/".$self->{path}."/BuildFile.mk"
150 <          ) or die 'Unable to open /$ENV{INTwork}/".$self->{path}."/BuildFile.mk $!\n';
149 >        open ( $fh, ">$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/BuildFile.mk"
150 >          ) or die "Unable to open /$ENV{INTwork}/".$self->{path}."/BuildFile.mk $!\n";
151          @{$self->{filehandlestack}}=($fh);
152          # make an alias
153          *GNUmakefile=$fh;
154          if ( -e $ENV{LatestBuildFile} ) {
155            print GNUmakefile "include $ENV{LatestBuildFile}\n";
156          }
157 < #       print "writing to :\n".
158 < #               "$self->{localtop}/$ENV{INTwork}/$self->{path}/BuildFile.mk\n";
183 <        $ENV{LatestBuildFile}="$self->{localtop}/$ENV{INTwork}/".$self->{path}."/BuildFile.mk";
157 >
158 >        $ENV{LatestBuildFile}="$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/BuildFile.mk";
159          $self->{switch}->parse("makebuild"); # sort out supported tags
160          if ( $numbins > 0 ) {
161           print GNUmakefile <<ENDTEXT;
# Line 202 | Line 177 | ENDTEXT
177          close GNUmakefile;
178   }
179  
205 sub classname {
206        my $self=shift;
207        if ( @_ ) {
208          $self->{classname}=shift;
209        }
210        return $self->{classname};
211 }
212
180   sub ParseBuildFile_Export {
181          my $self=shift;
182          my $filename=shift;
183 <        my $bf=BuildSystem::BuildFile->new($self->{area});
183 >
184 >        $self->verbose(">> ParseBuildFile_Export: FN ".$filename." <<");
185 >        
186 >        my $bf=BuildSystem::BuildFile->new($self->{toolbox});
187          if ( defined $self->{remoteproject} ) {
188             $bf->{remoteproject}=$self->{remoteproject};
189          }
# Line 224 | Line 194 | sub ParseBuildFile_Export {
194   sub _location {
195          my $self=shift;
196          use File::Basename;
197 <
197 >        $self->verbose(">> _location: <<");
198          return dirname($self->{switch}->filetoparse());
199   }
200  
201   sub _parseexport {
202          my $self=shift;
203          my $filename=shift;
204 <
204 >        $self->verbose(">> _parseexport: FN ".$filename." <<");
205 >        
206          my $switchex=ActiveDoc::SimpleDoc->new();
207          $switchex->filetoparse($filename);
208          $switchex->newparse("export");
# Line 242 | Line 213 | sub _parseexport {
213                                          \&export_end_export,$self);
214          $self->_commontags($switchex,"export");
215          $switchex->allowgroup("__export","export");
245 #       $switchex->{Strict_no_cr}='no';
216          $self->{switch}=$switchex;
217          $switchex->parse("export"); # sort out supported tags
218   }
# Line 250 | Line 220 | sub _parseexport {
220   sub _pushremoteproject {
221          my $self=shift;
222          my $path=shift;
223 +
224 +        $self->verbose(">> _pushremoteproject: PATH ".$path." <<");
225          
226          if ( defined $self->{remoteproject} ) {
227            push @{$self->{rpstack}}, $self->{remoteproject};
# Line 259 | Line 231 | sub _pushremoteproject {
231  
232   sub _popremoteproject {
233          my $self=shift;
234 +        $self->verbose(">> _popremoteproject:  <<");
235 +        
236          if ( $#{$self->{rpstack}} >=0 ) {
237            $self->{remoteproject}=pop @{$self->{rpstack}};
238          }
# Line 269 | Line 243 | sub _popremoteproject {
243  
244   sub _toolmapper {
245          my $self=shift;
246 +
247          if ( ! defined $self->{mapper} ) {
248             require BuildSystem::ToolMapper;
249             $self->{mapper}=BuildSystem::ToolMapper->new();
250          }
251 +        $self->verbose(">> _toolmapper: TM ".$self->{mapper}."<<");
252          return $self->{mapper};
253   }
254  
# Line 286 | Line 262 | sub Class_StartTag {
262          my $self=shift;
263          my $name=shift;
264          my $hashref=shift;
265 +
266 +        $self->verbose(">> Classs_StartTag: NM ".$name." <<");
267          
268          if ( $self->{Arch} ) {
269           if ( defined $$hashref{'type'} ) {
270 <                $self->classname($$hashref{'type'});
270 >                $ClassName=$$hashref{'type'};
271           }
272          }
273   }
274  
275 < sub IncludePath_Start {
276 <        my $self=shift;
277 <        my $name=shift;
278 <        my $hashref=shift;
279 <
280 <        $self->{switch}->checktag( $name, $hashref, 'path');
281 <        if ( $self->{Arch} ) {
282 <          print GNUmakefile "INCLUDE+=".$self->_location()."/".
283 <                                                $$hashref{'path'}."\n";
284 <        }
285 < }
275 > sub IncludePath_Start
276 >   {
277 >   my $self=shift;
278 >   my $name=shift;
279 >   my $hashref=shift;
280 >  
281 >   $self->verbose(">> IncludePath_Start: NM ".$name." <<");
282 >  
283 >   $self->{switch}->checktag( $name, $hashref, 'path');
284 >   if ( $self->{Arch} )
285 >      {
286 >      print GNUmakefile "INCLUDE:=\$(filter-out ".$self->_location()."/".$$hashref{'path'}.",\$(INCLUDE))","\n";
287 >      print GNUmakefile "INCLUDE+=".$self->_location()."/".$$hashref{'path'}."\n";
288 >      }
289 >   }
290  
291   #
292   # generic build tag
# Line 314 | Line 296 | sub Build_start {
296          my $name=shift;
297          my $hashref=shift;
298  
299 +        $self->verbose(">> Build_start: NM ".$name." <<");
300 +        
301          $self->{switch}->checktag($name,$hashref,'class');
302          if ( $self->{Arch} ) {
303  
# Line 324 | Line 308 | sub Build_start {
308            }
309            else {
310              $self->{switch}->parseerror("No name specified for build product");
327            #$name="\$(buildname)";
311            }
312  
313            # -- check we have a lookup for the class type
# Line 362 | Line 345 | sub Build_start {
345              # -- create a new directory for each type
346              push @targets, $pattern;
347              my $dirname=$$hashref{'class'}."_".$type."_".$name;
348 <            my $here="$self->{localtop}/$ENV{INTwork}/".$self->{path}."/".$dirname;
348 >            my $here="$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/".$dirname;
349              my $makefile=$here."/BuildFile.mk";
367 #           AddDir::adddir($here);
350  
351              # -- create link targets to the directory
352              push @targets, $dirname;
# Line 385 | Line 367 | sub Build_start {
367              print $fh "\t cd $dirname; \\\n";
368              print $fh "\t echo include ".$self->{currentenv}." > ".
369                                                          "$makefile; \\\n";
370 <            print $fh "\t echo VPATH+=$self->{localtop}/".$self->{path}.
370 >            print $fh "\t echo VPATH+=$ENV{LOCALTOP}/".$self->{path}.
371                                          " >> $makefile; \\\n";
372              print $fh "\t echo buildname=$name >> $makefile;\\\n";
373              print $fh "\t echo ".$dirname.":".$pattern." >> $makefile;\\\n";
# Line 396 | Line 378 | sub Build_start {
378              }
379              print $fh "\tfi\n";
380              print $fh "\n";
399 #           print $typefile "$name :\n";
400 #           print $typefile "\t\$(_quietbuild_)";
401 #           print $typefile $mapper->template($$hashref{'class'},$type)."\n";
402 #           print $typefile "\t\$(_quietstamp_)";
403 #           print $typefile "\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$@.ds \$@ \$^\n";
381  
382              # -- cleaning targets
383              push @targets, "clean_$dirname";
# Line 441 | Line 418 | sub Bin_start {
418          my $tool;
419          my $filename;
420          my $objectname;
421 +
422 +        $self->verbose(">>          <<");
423          
424          $self->{switch}->checktag($name,$hashref,'file');
425          if ( $self->{Arch} ) {
# Line 451 | Line 430 | sub Bin_start {
430  
431          # Create a new directory for each binary target
432          my $dirname="bin_".$$hashref{name};
433 <        AddDir::adddir("$self->{localtop}/$ENV{INTwork}/".$self->{path}."/$dirname");
433 >        AddDir::adddir("$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/$dirname");
434          open (binGNUmakefile,
435 <           ">$self->{localtop}/$ENV{INTwork}/".$self->{path}."/$dirname/BuildFile.mk") or die           "Unable to make $self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname/".
435 >           ">$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/$dirname/BuildFile.mk") or die           "Unable to make $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname/".
436             "BuildFile.mk $!\n";
437  
438          # Create the link targets
# Line 469 | Line 448 | endif
448   ifndef BINMODE
449  
450   define stepdown_$$hashref{'name'}
451 < if [ -d "$self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
452 < cd $self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname; \\
453 < \$(MAKE) BINMODE=true LatestBuildFile=$self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\@; \\
451 > if [ -d "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
452 > cd $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname; \\
453 > \$(MAKE) BINMODE=true LatestBuildFile=$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\@; \\
454   fi
455   endef
456  
457   define stepdown2_$$hashref{'name'}
458 < if [ -d "$self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
459 < cd $self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname; \\
460 < \$(MAKE) BINMODE=true LatestBuildFile=$self->{localtop}/$ENV{INTwork}/$self{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\*; \\
458 > if [ -d "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
459 > cd $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname; \\
460 > \$(MAKE) BINMODE=true LatestBuildFile=$ENV{LOCALTOP}/$ENV{INTwork}/$self{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\*; \\
461   fi
462  
463   endef
# Line 502 | Line 481 | ENDTEXT
481  
482   # the binary specifics makefile
483          print binGNUmakefile "include ".$self->{currentenv}."\n";
484 <        print binGNUmakefile "VPATH+=$self->{localtop}/$self{path}\n";
484 >        print binGNUmakefile "VPATH+=$ENV{LOCALTOP}/$self{path}\n";
485  
486   # alias for bin_Insure
487          print binGNUmakefile <<ENDTEXT;
# Line 603 | Line 582 | sub External_StartTag {
582          my $self=shift;
583          my $name=shift;
584          my $hashref=shift;
585 +
586 +        $self->verbose(">> External_StartTag: NM ".$name." <<");
587          
588          my $tool;
589          if ( $self->{Arch} ) {
# Line 656 | Line 637 | sub Group_start {
637          my $name=shift;
638          my $hashref=shift;
639          
640 +        $self->verbose(">> Group_start: NM ".$name." <<");
641 +        
642          $self->{switch}->checktag($name, $hashref, 'name');
643          if ( $self->{Arch} ) {
644          print GNUmakefile "GROUP_".$$hashref{'name'};
# Line 666 | Line 649 | sub Group_start {
649          }
650   }      
651  
652 < sub Use_start {
653 <        my $self=shift;
654 <        my $name=shift;
655 <        my $hashref=shift;
656 <        my $filename;
657 <        use Utilities::SCRAMUtils;
658 <        
659 <        $self->{switch}->checktag($name, $hashref, "name");
660 <        if ( $self->{Arch} ) {
661 <        if ( exists $$hashref{'group'} ) {
662 <          print GNUmakefile "GROUP_".$$hashref{'group'}."=true\n";
663 <        }
664 <        if ( ! defined $self->{remoteproject} ) {
665 <          $filename=SCRAMUtils::checkfile(
666 <                "/$ENV{INTsrc}/$$hashref{name}/BuildFile");
667 <        }
668 <        else {
669 <          $filename=$self->{remoteproject}."/$$hashref{name}/BuildFile";
670 <        print "trying $filename\n";
671 <          if ( ! -f $filename ) { $filename=""; };
672 <        }
673 <        if ( $filename ne "" ) {
674 <          $self->ParseBuildFile_Export( $filename );
675 <        }
676 <        else {
677 <           $self->{switch}->parseerror("Unable to detect Appropriate ".
678 <                "decription file for <$name name=".$$hashref{name}.">");
679 <        }
680 <        }
652 > sub Use_start
653 >   {
654 >   my $self=shift;
655 >   my $name=shift;
656 >   my $hashref=shift;
657 >   my $filename;
658 >   use Utilities::SCRAMUtils;
659 >
660 >   $self->verbose(">> Use_start: NM ".$name." <<");
661 >  
662 >   $self->{switch}->checktag($name, $hashref, "name");
663 >   if ( $self->{Arch} )
664 >      {
665 >      if ( exists $$hashref{'group'} )
666 >         {
667 >         print GNUmakefile "GROUP_".$$hashref{'group'}."=true\n";
668 >         }
669 >      if ( ! defined $self->{remoteproject} )
670 >         {
671 >         $filename=SCRAMUtils::checkfile("/$ENV{INTsrc}/$$hashref{name}/BuildFile");
672 >         }
673 >      else
674 >         {
675 >         $filename=$self->{remoteproject}."/$$hashref{name}/BuildFile";
676 >         print "Trying $filename\n";
677 >         if ( ! -f $filename ) { $filename=""; };
678 >         }
679 >      if ( $filename ne "" )
680 >         {
681 >         $self->ParseBuildFile_Export( $filename );
682 >         }
683 >      else
684 >         {
685 >         $self->{switch}->parseerror("Unable to detect Appropriate ".
686 >                                     "decription file for <$name name=".$$hashref{name}.">");
687 >         }
688 >      }
689 >   }
690 >
691 > sub CheckBuildFile {
692 >         my $self=shift;
693 >         my $classdir=shift;
694 >         my $ClassName="";
695 >         my $thisfile="$classdir/$buildfile";
696 >        
697 >         if ( -e $ENV{LOCALTOP}."/".$thisfile ) {
698 >            $DefaultBuildfile="$ENV{LOCALTOP}/$thisfile";
699 >            $self->ParseBuildFile($ENV{LOCALTOP}, $classdir, $buildfile);
700 >         }
701 >         elsif ( -e $ENV{RELEASETOP}."/".$thisfile ) {
702 >            $DefaultBuildfile="$ENV{RELEASETOP}/$thisfile";
703 >            $self->ParseBuildFile($ENV{RELEASETOP}, $classdir, $buildfile);
704 >         }
705 >         $self->verbose(">> CheckBuildFile: FN ".$thisfile." CN ".$ClassName." <<");
706 >         return $ClassName;
707   }
708  
709   # List association groups between <AssociateGroup> tags
# Line 705 | Line 714 | sub AssociateGroup {
714          my $string=shift;
715          my $word;
716  
717 +        $self->verbose(">> AssociateGroup: NM ".$name." ST ".$string." <<");
718 +        
719          if ( $self->{Arch} ) {
720          foreach $word ( (split /\s/, $string) ){
721                  chomp $word;
# Line 721 | Line 732 | sub Arch_Start {
732          my $name=shift;
733          my $hashref=shift;
734  
735 +        $self->verbose(">> Arch_Start: NM ".$name." <<");
736 +        
737          $self->{switch}->checktag($name, $hashref,'name');
738          ( ($ENV{SCRAM_ARCH}=~/$$hashref{name}.*/) )? ($self->{Arch}=1)
739                                                  : ($self->{Arch}=0);
# Line 730 | Line 743 | sub Arch_Start {
743   sub Arch_End {
744          my $self=shift;
745          my $name=shift;
746 +        
747 +        $self->verbose(">> Arch_End: NM ".$name." <<");
748  
749 <        pop @{$self->{ARCHBLOCK}};
749 >        pop @{$self->{ARCHBLOCK}};
750          $self->{Arch}=$self->{ARCHBLOCK}[$#{$self->{ARCHBLOCK}}];
751   }
752  
# Line 739 | Line 754 | sub Arch_End {
754   sub _CutBlock {
755      my $self=shift;
756      my $string= shift @_;
757 +
758 +    $self->verbose(">> _CutBlock: ST ".$string." <<");
759 +    
760      @BlockClassA = split /\//, $string;
761   }
762  
# Line 746 | Line 764 | sub OutToMakefile {
764          my $self=shift;
765          my $name=shift;
766          my @vars=@_;
767 +        
768 +        $self->verbose(">> OutToMakefile: <<");
769  
770          if ( $self->{Arch} ) {
771 +          $self->verbose(">> CONT: ".$#vars." lines <<");
772            print GNUmakefile @vars;
773          }
774   }
# Line 755 | Line 776 | sub OutToMakefile {
776   sub OutToScreen {
777          my $name=shift;
778          my @vars=@_;
779 <
779 >        
780          if ( $self->{Arch} ) {
781            print @vars;
782          }
# Line 765 | Line 786 | sub setBlockClassPath {
786          my $name=shift;
787          my $hashref=shift;
788  
789 +        $self->verbose(">> setBlockClassPath: NM ".$name." <<");
790 +        
791          $self->{switch}->checktag($name, $hashref, 'path');
792          $self->{BlockClassPath}=$self->{BlockClassPath}.":".$$hashref{path};
793          $self->_CutBlock($$hashref{path});
# Line 772 | Line 795 | sub setBlockClassPath {
795  
796   sub BlockClassPath {
797          my $self=shift;
798 +
799 +        $self->verbose(">> BlockClassPath: <<");
800 +
801          return $self->{BlockClassPath};
802   }
803  
# Line 780 | Line 806 | sub export_start_export {
806          my $name=shift;
807          my $hashref=shift;
808  
809 +        $self->verbose(">> export_start_export: NM ".$name." <<");
810 +        
811          $self->{switch}->opengroup("__export");
812   }
813  
# Line 788 | Line 816 | sub export_start {
816          my $name=shift;
817          my $hashref=shift;
818  
819 +        $self->verbose(">> export_start: NM ".$name." <<");
820 +        
821          $self->{switch}->opengroup("__export");
822          if ( exists $$hashref{autoexport} ) {
823            print GNUmakefile "scram_autoexport=".$$hashref{autoexport}."\n";
# Line 804 | Line 834 | sub export_start {
834  
835   sub export_end_export {
836          my $self=shift;
837 +        $self->verbose(">> export_end_export: <<");
838          $self->{switch}->closegroup("__export");
839   }
840  
841   sub export_end {
842          my $self=shift;
843 +        $self->verbose(">> export_end: <<");
844          $self->{switch}->closegroup("__export");
845          print GNUmakefile "endif\n";
846   }
# Line 816 | Line 848 | sub export_end {
848   #
849   # Standard lib tag
850   #
851 < sub lib_start {
852 <        my $self=shift;
853 <        my $name=shift;
854 <        my $hashref=shift;
855 <
856 <        $self->{switch}->checktag($name, $hashref, 'name');
857 <        if ( $self->{Arch} ) {
858 <           print GNUmakefile "lib+=$$hashref{name}\n";
859 <        }
860 < }
851 > sub lib_start
852 >   {
853 >   my $self=shift;
854 >   my $name=shift;
855 >   my $hashref=shift;
856 >  
857 >   $self->verbose(">> lib_start: NM ".$name." <<");
858 >  
859 >   $self->{switch}->checktag($name, $hashref, 'name');
860 >
861 >   if ( $self->{Arch} )
862 >      {
863 >      print GNUmakefile "lib+=$$hashref{name}\n";
864 >      }
865 >   }
866  
867   #
868   # libtype specification
# Line 834 | Line 871 | sub LibType_Start {
871          my $self=shift;
872          my $name=shift;
873          my $hashref=shift;
874 <
874 >        
875 >        $self->verbose(">> LibType_Start: NM ".$name." <<");
876 >        
877          if ( $self->{Arch} ) {
878          if ( defined $self->{libtype_conext} ) {
879            $self->{switch}->parseerror("<$name> tag cannot be specified".
# Line 867 | Line 906 | sub LibType_text {
906          my $self=shift;
907          my $name=shift;
908          my $string=shift;
909 +        $self->verbose(">> LibType_text: NM ".$name." <<");
910  
911 <        if ( $self->{Arch} ) {
911 >        if ( $self->{Arch} ) {
912            $string=~s/\n/ /g;
913            print GNUmakefile "libmsg::\n\t\@echo Library info: ";
914            print GNUmakefile $string;
# Line 880 | Line 920 | sub LibType_end {
920          my $self=shift;
921          my $name=shift;
922  
923 +        $self->verbose(">> LibType_end: NM ".$name." <<");
924 +
925          undef $self->{libtype_conext};
926   }
927  
# Line 888 | Line 930 | sub Environment_start {
930          my $name=shift;
931          my $hashref=shift;
932  
933 +        $self->verbose(">> Environment_start: NM ".$name." <<");
934 +        
935          if ( $self->{Arch} ) {
936            $self->{envnum}++;
937  
938            # open a new Environment File
939 <          my $envfile="$self->{localtop}/$ENV{INTwork}/$self->{path}/Env_".
939 >          my $envfile="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/Env_".
940                  $self->{envnum}.".mk";
941            use FileHandle;
942            my $fh=FileHandle->new();
# Line 902 | Line 946 | sub Environment_start {
946  
947            # include the approprate environment file
948            if ( $self->{envlevel} == 0 ) {
949 <             print GNUmakefile "include $self->{localtop}/$ENV{INTwork}/".
949 >             print GNUmakefile "include $ENV{LOCALTOP}/$ENV{INTwork}/".
950                  $self->{path}."/BuildFile.mk\n";
951            }
952            else {
953 <             print GNUmakefile "include $self->{localtop}/$ENV{INTwork}/".
953 >             print GNUmakefile "include $ENV{LOCALTOP}/$ENV{INTwork}/".
954                  $self->{path}."/Env_".$self->{Envlevels}[$self->{envlevel}].".mk\n";
955            }
956            $self->{envlevel}++;
957            $self->{Envlevels}[$self->{envlevel}]=$self->{envnum};
958 <          $self->{currentenv}="$self->{localtop}/$ENV{INTwork}/$self->{path}/Env_$self->{envnum}.mk";
958 >          $self->{currentenv}="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/Env_$self->{envnum}.mk";
959          }
960   }
961  
# Line 919 | Line 963 | sub Environment_end {
963          my $self=shift;
964          my $fd;
965  
966 +        $self->verbose(">> Environment_end: NM ".$name." <<");
967 +
968          if ( $self->{Arch} ) {
969            $self->{envlevel}--;
970            if ( $self->{envlevel} < 0 ) {
# Line 931 | Line 977 | sub Environment_end {
977            close $fd;
978            *GNUmakefile=$self->{filehandlestack}[$#{$self->{filehandlestack}}];
979            if ( $self->{envlevel} < 1 ) {
980 <            $self->{currentenv}="$self->{localtop}/$ENV{INTwork}/$self->{path}/".
980 >            $self->{currentenv}="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/".
981                          "BuildFile.mk";
982            }
983            else {
984              $self->{currentenv}=
985 <             $self->{localtop}."/$ENV{INTwork}/$self->{path}/Env_".
985 >             "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/Env_".
986                  $self->{Envlevels}[$self->{envlevel}];
987            }
988          }
989   }
990 +
991 + sub Store_start {
992 +        my $self=shift;
993 +        my $name=shift;
994 +        my $hashref=shift;
995 +
996 +        $self->verbose(">> Store_start: NM ".$name." <<");
997 +
998 +        if ( $self->{Arch} ) {
999 +          $self->{switch}->checktag( $name, $hashref, 'name' );
1000 +
1001 +          # -- store creation
1002 +          my $dir=$$hashref{'name'};
1003 +          AddDir::adddir($ENV{LOCALTOP}."/".$dir);
1004 +          if ( exists $$hashref{'type'} ) {
1005 +            # -- architecture specific store
1006 +            if ( $$hashref{'type'}=~/^arch/i ) {
1007 +                $dir=$dir."/".$ENV{SCRAM_ARCH};
1008 +                AddDir::adddir($ENV{LOCALTOP}."/".$dir);
1009 +            }
1010 +            else {
1011 +                $self->parseerror("Unknown type in <$name> tag");
1012 +            }
1013 +          }
1014 +
1015 +          # -- set make variables for the store
1016 +          print GNUmakefile "SCRAMSTORENAME_".$$hashref{'name'}.":=".$dir."\n";
1017 +          print GNUmakefile "SCRAMSTORE_".$$hashref{'name'}.":=".
1018 +                                        $ENV{LOCALTOP}."/".$dir."\n";
1019 +          print GNUmakefile "VPATH+=".$ENV{LOCALTOP}
1020 +                        ."/".$dir.":".$ENV{RELEASETOP}."/".$dir."\n";
1021 +        }
1022 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines