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.3 by williamc, Wed Sep 6 10:17:28 2000 UTC vs.
Revision 1.14 by sashby, Wed Nov 7 19:49:37 2001 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
# Line 21 | Line 21 | sub new {
21          my $class=shift;
22          my $self={};
23          bless $self, $class;
24 <        $self->{area}=shift;
25 <        $self->{toolbox}=$self->{area}->toolbox();
24 >        $self->{toolbox}=shift;
25          $self->{Arch}=1;
26          push @{$self->{ARCHBLOCK}}, $self->{Arch};
27          return $self;
# Line 49 | Line 48 | sub _initswitcher {
48                                          \&Bin_start,$self,
49                                          \&OutToScreen, $self,
50                                          "", $self);
51 +         $switch->addtag($parse,"ProductStore",
52 +                                        \&Store_start,$self,
53 +                                        "", $self,
54 +                                        "", $self);
55          $switch->addtag($parse,"LibType",
56                                          \&LibType_Start,$self,
57                                          \&LibType_text, $self,
# Line 121 | Line 124 | sub ParseBuildFile {
124           $fullfilename=$filename;
125          }
126          $self->{path}=$path;
124        #print "Processing $fullfilename\n";
127          $numbins=0;
128          $self->{envnum}=0;
129          $self->{envlevel}=0;
# Line 130 | Line 132 | sub ParseBuildFile {
132          $self->{switch}=$self->_initswitcher();
133          $self->{switch}->filetoparse($fullfilename);
134  
135 < #       $self->{switch}->{Strict_no_cr}='no';
134 <        #open a temporary gnumakefile to store output.
135 >        # open a temporary gnumakefile to store output.
136          use Utilities::AddDir;
137          AddDir::adddir("$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}");
138          my $fh=FileHandle->new();
139          open ( $fh, ">$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/BuildFile.mk"
140 <          ) or die 'Unable to open /$ENV{INTwork}/".$self->{path}."/BuildFile.mk $!\n';
140 >          ) or die "Unable to open /$ENV{INTwork}/".$self->{path}."/BuildFile.mk $!\n";
141          @{$self->{filehandlestack}}=($fh);
142          # make an alias
143          *GNUmakefile=$fh;
144          if ( -e $ENV{LatestBuildFile} ) {
145            print GNUmakefile "include $ENV{LatestBuildFile}\n";
146          }
147 < #       print "writing to :\n".
147 < #               "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/BuildFile.mk\n";
147 >
148          $ENV{LatestBuildFile}="$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/BuildFile.mk";
149          $self->{switch}->parse("makebuild"); # sort out supported tags
150          if ( $numbins > 0 ) {
# Line 170 | Line 170 | ENDTEXT
170   sub ParseBuildFile_Export {
171          my $self=shift;
172          my $filename=shift;
173 <        my $bf=BuildSystem::BuildFile->new($self->{area});
173 >        my $bf=BuildSystem::BuildFile->new($self->{toolbox});
174          if ( defined $self->{remoteproject} ) {
175             $bf->{remoteproject}=$self->{remoteproject};
176          }
# Line 199 | Line 199 | sub _parseexport {
199                                          \&export_end_export,$self);
200          $self->_commontags($switchex,"export");
201          $switchex->allowgroup("__export","export");
202 #       $switchex->{Strict_no_cr}='no';
202          $self->{switch}=$switchex;
203          $switchex->parse("export"); # sort out supported tags
204   }
# Line 281 | Line 280 | sub Build_start {
280            }
281            else {
282              $self->{switch}->parseerror("No name specified for build product");
284            #$name="\$(buildname)";
283            }
284  
285            # -- check we have a lookup for the class type
# Line 321 | Line 319 | sub Build_start {
319              my $dirname=$$hashref{'class'}."_".$type."_".$name;
320              my $here="$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/".$dirname;
321              my $makefile=$here."/BuildFile.mk";
324 #           AddDir::adddir($here);
322  
323              # -- create link targets to the directory
324              push @targets, $dirname;
# Line 353 | Line 350 | sub Build_start {
350              }
351              print $fh "\tfi\n";
352              print $fh "\n";
356 #           print $typefile "$name :\n";
357 #           print $typefile "\t\$(_quietbuild_)";
358 #           print $typefile $mapper->template($$hashref{'class'},$type)."\n";
359 #           print $typefile "\t\$(_quietstamp_)";
360 #           print $typefile "$(SCRAMPERL) $(SCRAM_HOME)/src/scramdatestamp \$@.ds \$@ \$^\n";
353  
354              # -- cleaning targets
355              push @targets, "clean_$dirname";
# Line 515 | Line 507 | ENDTEXT
507          print binGNUmakefile "$$hashref{name}_Insure.exe:.psrc\n";
508          print binGNUmakefile "$$hashref{name}_d.exe:$objectname_d\n";
509          print binGNUmakefile "\t\$(CClinkCmdDebug)\n";
510 <        print binGNUmakefile "\t\@\$(SCRAMPERL) $(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
510 >        print binGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
511          print binGNUmakefile "$$hashref{name}_l_d.exe:$objectname_d\n";
512          print binGNUmakefile "\t\$(CClinkCmdDebugLocal)\n";
513 <        print binGNUmakefile "\t\@\$(SCRAMPERL) $(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
513 >        print binGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
514          print binGNUmakefile "$$hashref{name}_Insure.exe:$objectname_Insure\n";
515          print binGNUmakefile "\t\$(CClinkCmdInsure)\n";
516 <        print binGNUmakefile "\t\@\$(SCRAMPERL) $(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
516 >        print binGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
517          print binGNUmakefile "$$hashref{name}_o.exe:$objectname_o\n";
518          print binGNUmakefile "\t\$(CClinkCmd)\n";
519 <        print binGNUmakefile "\t\@\$(SCRAMPERL) $(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
519 >        print binGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
520          print binGNUmakefile "$$hashref{name}.dep:$$hashref{file}\n";
521          print binGNUmakefile "-include $$hashref{name}.dep\n";
522   print binGNUmakefile <<ENDTEXT;
# Line 915 | Line 907 | sub Environment_end {
907            }
908          }
909   }
910 +
911 + sub Store_start {
912 +        my $self=shift;
913 +        my $name=shift;
914 +        my $hashref=shift;
915 +
916 +        if ( $self->{Arch} ) {
917 +          $self->{switch}->checktag( $name, $hashref, 'name' );
918 +
919 +          # -- store creation
920 +          my $dir=$$hashref{'name'};
921 +          AddDir::adddir($ENV{LOCALTOP}."/".$dir);
922 +          if ( exists $$hashref{'type'} ) {
923 +            # -- architecture specific store
924 +            if ( $$hashref{'type'}=~/^arch/i ) {
925 +                $dir=$dir."/".$ENV{SCRAM_ARCH};
926 +                AddDir::adddir($ENV{LOCALTOP}."/".$dir);
927 +            }
928 +            else {
929 +                $self->parseerror("Unknown type in <$name> tag");
930 +            }
931 +          }
932 +
933 +          # -- set make variables for the store
934 +          print GNUmakefile "SCRAMSTORENAME_".$$hashref{'name'}.":=".$dir."\n";
935 +          print GNUmakefile "SCRAMSTORE_".$$hashref{'name'}.":=".
936 +                                        $ENV{LOCALTOP}."/".$dir."\n";
937 +          print GNUmakefile "VPATH+=".$ENV{LOCALTOP}
938 +                        ."/".$dir.":".$ENV{RELEASETOP}."/".$dir."\n";
939 +        }
940 + }
941 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines