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

Comparing COMP/SCRAM/src/BuildSystem/BuildSetup.pm (file contents):
Revision 1.1.2.2 by williamc, Wed Apr 19 14:14:32 2000 UTC vs.
Revision 1.1.2.7.2.2.2.1.2.1 by williamc, Thu Oct 26 09:57:51 2000 UTC

# Line 2 | Line 2
2   #
3   # Interface
4   # ---------
5 < # new() : A new BuildSetup
5 > # new(toolbox) : A new BuildSetup
6   # BuildSetup(directory,targets) : prepare the ground for a build and build
7   # getclass(directory) : return (Class, ClassDir, BuildFileobject)
8   #                       associated with directory
# Line 20 | Line 20 | sub new {
20          my $class=shift;
21          my $self={};
22          bless $self,$class;
23 <        $self->init();
23 >        $self->{toolbox}=shift;
24 >        #$self->init();
25          return $self;
26   }
27  
28   sub init {
29          my $self=shift;
30 <        $self->{toolbox}=BuildSystem::ToolBox->new();
30 >        $self->{toolbox}=BuildSystem::ToolBox->new($ENV{LOCALTOP},
31 >                                                        $ENV{SCRAM_ARCH});
32   }
33  
34   sub _generateexternals {
# Line 35 | Line 37 | sub _generateexternals {
37  
38          # -- specifiy these files for dependency information
39          my $depfile=$ENV{projconfigdir}."/External_Dependencies";
40 <        my $clientfile="$ENV{LOCALTOP}/.SCRAM/$ENV{SCRAM_ARCH}/clientsettings";
41 <        my $clientreq="$ENV{LOCALTOP}/.SCRAM/$ENV{SCRAM_ARCH}/".
42 <                        "clientsettings_reqs";
40 >
41 >        # -- get list of dependent files
42 >        my $datadir=$ENV{LOCALTOP}."/.SCRAM/".$ENV{SCRAM_ARCH};
43 >        $fdir=FileHandle->new();
44 >        opendir $fdir, $datadir;
45 >        my @depfiles=grep !/^\.\.?$/, readdir $fdir;
46 >        undef $fdir;
47 >        for (my $i=0; $i<=$#depfiles; $i++ ) {
48 >           $depfiles[$i]=$datadir."/".$depfiles[$i];
49 >        }
50 >
51          # -- do we need to rebuild?
52 <        if ( SCRAMUtils::dated($outfile,$depfile, $clientfile,$clientreq) ) {
52 >        if ( SCRAMUtils::dated($outfile,@depfiles) ) {
53            print "Configuring Local Area\n";
54            # -- open output file
55            my $fout=FileHandle->new();
# Line 48 | Line 58 | sub _generateexternals {
58  
59            # -- print out tool/ version info
60            my ($tool,$toolobj,$f,$val,$version);
61 <          foreach $toolpair ( $self->{toolbox}->tools() ) {
62 <            $tool=$$toolpair[0];
53 <            $version=$$toolpair[1];
61 >          foreach $tool ( $self->{toolbox}->tools() ) {
62 >            $version=$self->{toolbox}->defaultversion($tool);
63              # default versions
64              print $fout "ifdef $tool\n".$tool."_V_".$version."=true\nendif\n";
65 <            $toolobj=$self->{toolbox}->gettool($tool,$version);
66 <            # -- externals
67 <            @deps=$toolobj->getfeature("_externals");
68 <            foreach $d ( @deps ) {
65 >            # -- set up the different version  -- externals
66 >            foreach $version ( $self->{toolbox}->versions($tool) ) {
67 >             $toolobj=$self->{toolbox}->gettool($tool,$version);
68 >             @deps=$toolobj->getfeature("_externals");
69 >             foreach $d ( @deps ) {
70 >              $d=~tr[A-Z][a-z];
71                print $fout "ifdef ".$tool."_V_".$version."\n $d=true\nendif\n";
72 <            }
73 <            # -- tool info
74 <            print $fout "ifdef ".$tool."_V_".$version."\n";
75 <            foreach $f ( $toolobj->features() ) {
72 >             }
73 >             # -- tool info
74 >             print $fout "ifdef ".$tool."_V_".$version."\n";
75 >             foreach $f ( $toolobj->features() ) {
76                foreach $val ( $toolobj->getfeature($f) ) {
77                  print $fout "\t".$f." += ".$val."\n";
78                }
79 +             }
80 +             print $fout "endif\n";
81              }
69            print $fout "endif\n";
82            }
83            # some addittional processing of specific vars
84            print $fout 'INCLUDEPATH+=$(addprefix -I,$(INCLUDE))'."\n";
# Line 114 | Line 126 | sub BuildSetup {
126      elsif ( -e $ENV{RELEASETOP}."/".$projectfile ) {
127        $ENV{projectfile}=$ENV{RELEASETOP}."/".$projectfile;
128      }
117    else {
118        print "Warning : Unable to find $projectfile\n";
119    }
129      if ( $DefaultBuildFile eq "" ) {
130        # Map Relevant makefile classmakefile directory
131        my $classmakefile=$ENV{projconfigdir}."/".$Class."_makefile.mk";
# Line 158 | Line 167 | sub BuildSetup {
167        if ( $word=~/.*=.*/ ) { # if we have an assignment it cant be a target
168           $targetnumber--;
169        }
170 +      elsif ( $word=~/^-/ ) {
171 +         $targetnumber--;
172 +      }
173        else {
174          $ENV{"MAKETARGET_".$word}=$word;
175        }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines