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.4 by williamc, Tue Sep 12 13:01:39 2000 UTC vs.
Revision 1.5 by williamc, Wed Sep 13 14:00:33 2000 UTC

# Line 23 | Line 23 | sub new {
23          bless $self, $class;
24          $self->{area}=shift;
25          $self->{toolbox}=$self->{area}->toolbox();
26 +        $self->{localtop}=$self->{area}->location();
27          $self->{Arch}=1;
28          push @{$self->{ARCHBLOCK}}, $self->{Arch};
29          return $self;
# Line 149 | Line 150 | sub ParseBuildFile {
150          $numbins=0;
151          $self->{envnum}=0;
152          $self->{envlevel}=0;
153 <        $self->{currentenv}="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/".
153 >        $self->{currentenv}="$self->{localtop}/$ENV{INTwork}/$self->{path}/".
154                                                                  "BuildFile.mk";
155          $self->{switch}=$self->_initswitcher();
156          $self->{switch}->filetoparse($fullfilename);
# Line 157 | Line 158 | sub ParseBuildFile {
158   #       $self->{switch}->{Strict_no_cr}='no';
159          #open a temporary gnumakefile to store output.
160          use Utilities::AddDir;
161 <        AddDir::adddir("$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}");
161 >        AddDir::adddir("$self->{localtop}/$ENV{INTwork}/$self->{path}");
162          my $fh=FileHandle->new();
163 <        open ( $fh, ">$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/BuildFile.mk"
163 >        open ( $fh, ">$self->{localtop}/$ENV{INTwork}/".$self->{path}."/BuildFile.mk"
164            ) or die 'Unable to open /$ENV{INTwork}/".$self->{path}."/BuildFile.mk $!\n';
165          @{$self->{filehandlestack}}=($fh);
166          # make an alias
# Line 168 | Line 169 | sub ParseBuildFile {
169            print GNUmakefile "include $ENV{LatestBuildFile}\n";
170          }
171   #       print "writing to :\n".
172 < #               "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/BuildFile.mk\n";
173 <        $ENV{LatestBuildFile}="$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/BuildFile.mk";
172 > #               "$self->{localtop}/$ENV{INTwork}/$self->{path}/BuildFile.mk\n";
173 >        $ENV{LatestBuildFile}="$self->{localtop}/$ENV{INTwork}/".$self->{path}."/BuildFile.mk";
174          $self->{switch}->parse("makebuild"); # sort out supported tags
175          if ( $numbins > 0 ) {
176           print GNUmakefile <<ENDTEXT;
# Line 343 | Line 344 | sub Build_start {
344              # -- create a new directory for each type
345              push @targets, $pattern;
346              my $dirname=$$hashref{'class'}."_".$type."_".$name;
347 <            my $here="$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/".$dirname;
347 >            my $here="$self->{localtop}/$ENV{INTwork}/".$self->{path}."/".$dirname;
348              my $makefile=$here."/BuildFile.mk";
349   #           AddDir::adddir($here);
350  
# Line 366 | 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+=$ENV{LOCALTOP}/".$self->{path}.
370 >            print $fh "\t echo VPATH+=$self->{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 432 | Line 433 | sub Bin_start {
433  
434          # Create a new directory for each binary target
435          my $dirname="bin_".$$hashref{name};
436 <        AddDir::adddir("$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/$dirname");
436 >        AddDir::adddir("$self->{localtop}/$ENV{INTwork}/".$self->{path}."/$dirname");
437          open (binGNUmakefile,
438 <           ">$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/$dirname/BuildFile.mk") or die           "Unable to make $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname/".
438 >           ">$self->{localtop}/$ENV{INTwork}/".$self->{path}."/$dirname/BuildFile.mk") or die           "Unable to make $self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname/".
439             "BuildFile.mk $!\n";
440  
441          # Create the link targets
# Line 450 | Line 451 | endif
451   ifndef BINMODE
452  
453   define stepdown_$$hashref{'name'}
454 < if [ -d "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
455 < cd $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname; \\
456 < \$(MAKE) BINMODE=true LatestBuildFile=$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\@; \\
454 > if [ -d "$self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
455 > cd $self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname; \\
456 > \$(MAKE) BINMODE=true LatestBuildFile=$self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\@; \\
457   fi
458   endef
459  
460   define stepdown2_$$hashref{'name'}
461 < if [ -d "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
462 < cd $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname; \\
463 < \$(MAKE) BINMODE=true LatestBuildFile=$ENV{LOCALTOP}/$ENV{INTwork}/$self{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\*; \\
461 > if [ -d "$self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
462 > cd $self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname; \\
463 > \$(MAKE) BINMODE=true LatestBuildFile=$self->{localtop}/$ENV{INTwork}/$self{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\*; \\
464   fi
465  
466   endef
# Line 483 | Line 484 | ENDTEXT
484  
485   # the binary specifics makefile
486          print binGNUmakefile "include ".$self->{currentenv}."\n";
487 <        print binGNUmakefile "VPATH+=$ENV{LOCALTOP}/$self{path}\n";
487 >        print binGNUmakefile "VPATH+=$self->{localtop}/$self{path}\n";
488  
489   # alias for bin_Insure
490          print binGNUmakefile <<ENDTEXT;
# Line 684 | Line 685 | sub CheckBuildFile {
685           my $ClassName="";
686           my $thisfile="$classdir/$buildfile";
687  
688 <         if ( -e $ENV{LOCALTOP}."/".$thisfile ) {
689 <            $DefaultBuildfile="$ENV{LOCALTOP}/$thisfile";
690 <            $self->ParseBuildFile($ENV{LOCALTOP}, $classdir, $buildfile);
688 >         if ( -e $self->{localtop}."/".$thisfile ) {
689 >            $DefaultBuildfile="$self->{localtop}/$thisfile";
690 >            $self->ParseBuildFile($self->{localtop}, $classdir, $buildfile);
691           }
692           elsif ( -e $ENV{RELEASETOP}."/".$thisfile ) {
693              $DefaultBuildfile="$ENV{RELEASETOP}/$thisfile";
# Line 890 | Line 891 | sub Environment_start {
891            $self->{envnum}++;
892  
893            # open a new Environment File
894 <          my $envfile="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/Env_".
894 >          my $envfile="$self->{localtop}/$ENV{INTwork}/$self->{path}/Env_".
895                  $self->{envnum}.".mk";
896            use FileHandle;
897            my $fh=FileHandle->new();
# Line 900 | Line 901 | sub Environment_start {
901  
902            # include the approprate environment file
903            if ( $self->{envlevel} == 0 ) {
904 <             print GNUmakefile "include $ENV{LOCALTOP}/$ENV{INTwork}/".
904 >             print GNUmakefile "include $self->{localtop}/$ENV{INTwork}/".
905                  $self->{path}."/BuildFile.mk\n";
906            }
907            else {
908 <             print GNUmakefile "include $ENV{LOCALTOP}/$ENV{INTwork}/".
908 >             print GNUmakefile "include $self->{localtop}/$ENV{INTwork}/".
909                  $self->{path}."/Env_".$self->{Envlevels}[$self->{envlevel}].".mk\n";
910            }
911            $self->{envlevel}++;
912            $self->{Envlevels}[$self->{envlevel}]=$self->{envnum};
913 <          $self->{currentenv}="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/Env_$self->{envnum}.mk";
913 >          $self->{currentenv}="$self->{localtop}/$ENV{INTwork}/$self->{path}/Env_$self->{envnum}.mk";
914          }
915   }
916  
# Line 929 | Line 930 | sub Environment_end {
930            close $fd;
931            *GNUmakefile=$self->{filehandlestack}[$#{$self->{filehandlestack}}];
932            if ( $self->{envlevel} < 1 ) {
933 <            $self->{currentenv}="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/".
933 >            $self->{currentenv}="$self->{localtop}/$ENV{INTwork}/$self->{path}/".
934                          "BuildFile.mk";
935            }
936            else {
937              $self->{currentenv}=
938 <             "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/Env_".
938 >             $self->{localtop}."/$ENV{INTwork}/$self->{path}/Env_".
939                  $self->{Envlevels}[$self->{envlevel}];
940            }
941          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines