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.7 by williamc, Tue Sep 19 10:09:29 2000 UTC vs.
Revision 1.9 by williamc, Fri Sep 29 10:32:18 2000 UTC

# Line 5 | Line 5
5   # new(ConfigArea)
6   # ParseBuildFile($base,$path,$file)
7   # ParseBuildFileExport(filename)
8 + # blockparse(Block) : perform a parse to modify the block
9   # BlockClassPath() : Return the class path
10   # ignore()      : return 1 if directory should be ignored 0 otherwise
11   # classname()   : get/set the associated class
# Line 27 | Line 28 | sub new {
28          $self->{area}=shift;
29          $self->{toolbox}=$self->{area}->toolbox();
30          $self->{localtop}=$self->{area}->location();
31 +        # -- set RELEASTOP
32 +        my $rarea=$self->{area}->linkarea();
33 +        if ( ! defined $rarea ) {
34 +          $self->{releasetop}=$self->{localtop};
35 +        }
36 +        else {
37 +          $self->{releasetop}=$rarea->location();
38 +        }
39 +        $self->{releasetop}=$self->{area}->location();
40          $self->{Arch}=1;
41          push @{$self->{ARCHBLOCK}}, $self->{Arch};
42          return $self;
# Line 48 | Line 58 | sub makefile {
58          return $self->{makefile};
59   }
60  
61 + sub blockparse {
62 +        my $self=shift;
63 +        $self->{block}=shift;
64 +
65 +        $self->{switch}=$self->_initswitcher();
66 +        $self->_initblockparse($self->{switch});
67 + }
68 +
69   sub ignore {
70          my $self=shift;
71          return (defined $self->{ignore})?$self->{ignore}:0;
# Line 60 | Line 78 | sub _initswitcher {
78          $switch->newparse($parse);
79          $switch->addignoretags($parse);
80          $self->_commontags($switch,$parse);
81 <        $switch->addtag($parse,"Build", \&Build_start, $self);
81 >        #$switch->addtag($parse,"Build", \&Build_start, $self);
82          $switch->addtag($parse,"none",
83                                          \&OutToMakefile,$self,
84                                          \&OutToMakefile, $self,
# Line 69 | Line 87 | sub _initswitcher {
87                                          \&Bin_start,$self,
88                                          \&OutToScreen, $self,
89                                          "", $self);
90 +        $switch->addtag($parse,"ProductStore",
91 +                                        \&Store_start,$self,
92 +                                        "", $self,
93 +                                        "", $self);
94          $switch->addtag($parse,"LibType",
95                                          \&LibType_Start,$self,
96                                          \&LibType_text, $self,
# Line 96 | Line 118 | sub _initswitcher {
118          return $switch;
119   }
120  
121 + sub _initblockparse {
122 +        my $self=shift;
123 +        my $switch=shift;
124 +
125 +        my $parse="block";
126 +        $switch->newparse($parse);
127 +        $switch->addignoretags($parse);
128 +        $switch->addtag($parse,"DropDown",
129 +                                        \&DropDown_start,$self,
130 +                                        "", $self,
131 +                                        "", $self);
132 +        $switch->addtag($parse,"Build", \&Build_start, $self);
133 + }
134 +
135   sub _commontags {
136          my $self=shift;
137          my $switch=shift;
# Line 147 | Line 183 | sub GenerateMakefile {
183          if ( -e $ENV{LatestBuildFile} ) {
184            print GNUmakefile "include $ENV{LatestBuildFile}\n";
185          }
150        $ENV{LatestBuildFile}=$outfile;
186          $self->{switch}->parse("makebuild"); # sort out supported tags
187          close GNUmakefile;
188 +        return $outfile;
189   }
190  
191   sub ParseBuildFile {
# Line 179 | Line 215 | sub ParseBuildFile {
215          #open a temporary gnumakefile to store output.
216          use Utilities::AddDir;
217          AddDir::adddir("$self->{localtop}/$ENV{INTwork}/$self->{path}");
218 <        $self->GenerateMakefile($fullfilename,
218 >        $ENV{LatestBuildFile}=$self->GenerateMakefile($fullfilename,
219            $self->{localtop}."/".$ENV{INTwork}."/".$self->{path}."/BuildFile.mk");
220   }
221  
# Line 296 | Line 332 | sub Build_start {
332          my $hashref=shift;
333  
334          $self->{switch}->checktag($name,$hashref,'class');
335 +        $self->{switch}->checktag($name,$hashref,'id');
336          if ( $self->{Arch} ) {
337  
338            # -- determine the build products name
# Line 483 | Line 520 | ENDTEXT
520  
521   # the binary specifics makefile
522          print binGNUmakefile "include ".$self->{currentenv}."\n";
523 <        print binGNUmakefile "VPATH+=$self->{localtop}/$self{path}\n";
523 >        print binGNUmakefile "VPATH+=".$self->{localtop}."/$self{path}\n";
524  
525   # alias for bin_Insure
526          print binGNUmakefile <<ENDTEXT;
# Line 922 | Line 959 | sub Environment_end {
959            }
960          }
961   }
962 +
963 + sub Store_start {
964 +        my $self=shift;
965 +        my $name=shift;
966 +        my $hashref=shift;
967 +
968 +        if ( $self->{Arch} ) {
969 +          $self->{switch}->checktag( $name, $hashref, 'name' );
970 +
971 +          # -- store creation
972 +          my $dir=$$hashref{'name'};
973 +          AddDir::adddir($self->{area}->location()."/".$dir);
974 +          if ( exists $$hashref{'type'} ) {
975 +            # -- architecture specific store
976 +            if ( $$hashref{'type'}=~/^arch/i ) {
977 +                $dir=$dir."/".$ENV{SCRAM_ARCH};
978 +                AddDir::adddir($self->{area}->location()."/".$dir);
979 +            }
980 +            else {
981 +                $self->parseerror("Unknown type in <$name> tag");
982 +            }
983 +          }
984 +        
985 +          # -- set make variables for the store
986 +          print GNUmakefile "SCRAMSTORENAME_".$$hashref{'name'}.":=".$dir."\n";
987 +          print GNUmakefile "SCRAMSTORE_".$$hashref{'name'}.":=".
988 +                                        $self->{localtop}."/".$dir."\n";
989 +          print GNUmakefile "VPATH+=".$self->{localtop}
990 +                        ."/".$dir.":".$self->{releasetop}."/".$dir."\n";
991 +        }
992 + }
993 +
994 + sub DropDown {
995 +        my $self=shift;
996 +        my $name=shift;
997 +        my $hashref=shift;
998 +
999 +        if ( $self->{Arch} ) {
1000 +          # - default values must always be specified
1001 +          $self->{switch}->checktag( $name, $hashref, 'defaults' );
1002 +          my @blockdirs=split /,/ , $$hashref{'defaults'};
1003 +          $self->{block}->defaultblocks(@blockdirs);
1004 +        }
1005 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines