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

Comparing COMP/SCRAM/src/BuildSetup.pm (file contents):
Revision 1.1 by williamc, Mon Mar 1 10:37:53 1999 UTC vs.
Revision 1.5.2.10 by williamc, Tue Oct 12 16:47:13 1999 UTC

# Line 1 | Line 1
1 #!/usr/local/bin/perl5 -I/afs/cern.ch/user/w/williamc/public/ConfigMan/toolbox/objects/schema1
2 #
3 # Wrapper around the perl objects for system calling
4 #
5
1   package BuildSetup;
2 + require 5.001;
3   require Exporter;
4   @ISA=qw(Exporter);
5   @EXPORT=qw(BuildSetup);
6   use Interface;
7   use BuildFile;
8 < use AddDir;
8 > use Utilities::AddDir;
9  
10   sub BuildSetup {
11   my $THISDIR=shift;
# Line 19 | Line 15 | $Class="";
15  
16   # Create working directory
17   chdir $ENV{LOCALTOP};
18 < adddir($ENV{INTwork}."/".$THISDIR);
18 > AddDir::adddir($ENV{INTwork}."/".$THISDIR);
19  
20   GetClass($THISDIR);
21 < print "Class = $Class\n";
21 > #print "Class = $Class\n";
22 > #print "ClassDir = $ClassDir\n";
23   if ( grep /none/i , @BuildFile::groups) {
24          print "Nothing to be done - empty group\n";
25          exit
# Line 65 | Line 62 | if ( $DefaultBuildFile eq "" ) {
62   }
63  
64   $ENV{ClassDir}=$ClassDir;
65 + $ENV{Class}=$Class;
66   $ENV{DefaultBuildFile}=$DefaultBuildFile;
67  
68   chdir $fullworkdir || die "Unable to enter working directory $!";
69  
70 + # Set up some other useful variables fo the Build
71 + # list of directories available
72 + opendir IDR, "$ENV{LOCALTOP}/$THISDIR";
73 + @allfiles= grep !/^\.\.?$/, readdir IDR;
74 + foreach $file ( @allfiles ) {
75 +   if ( -d "$ENV{LOCALTOP}/$THISDIR/$file" ) { # only add if its a directory
76 +        $ENV{SCRAM_AVAILDIRS}=$ENV{SCRAM_AVAILDIRS}." ".$file;
77 +   }
78 +   else {
79 +        $ENV{SCRAM_AVAILFILES}=$ENV{SCRAM_AVAILFILES}." ".$file;
80 +   }
81 + }
82 + $targetnumber=$#Targets;
83 + foreach $word ( @Targets ) {
84 +    if ( $word=~/.*=.*/ ) { # if we have an assignment it cant be a target
85 +         $targetnumber--;
86 +    }
87 +    else {
88 +        $ENV{"MAKETARGET_".$word}=$word;
89 +    }
90 + }
91 +
92   # If not specified default to the class name target
93 < if ( $#Targets == -1 ) {
94 <        $Targets[0]=$Class
93 > if ( $targetnumber == -1 ) {
94 >        push @Targets,$Class;
95   }
96 +
97   $ENV{DefaultMakefile}="$ENV{TOOL_HOME}/basics.mk";
98 < system("gmake","-j 1","-f","$ENV{DefaultMakefile}","-I$ENV{TOOL_HOME}",@Targets);
98 >
99 > $SCRAM_GROUPSDIR=$ENV{LOCALTOP}."/".$ENV{projconfigdir}."/groups.mk";
100 > if ( -f $SCRAM_GROUPSDIR ) {
101 >  $ENV{SCRAM_GROUPSDIR}=$SCRAM_GROUPSDIR;
102 > }
103 > # Set up scram configuration files
104 > system("gmake","--no-print-directory","-r","-s","-j 1","-f","$ENV{TOOL_HOME}/clientmakefile.mk","-I$ENV{TOOL_HOME}", "client");
105 >
106 > # The main build here
107 > system("gmake","--no-print-directory","-r","-f","$ENV{DefaultMakefile}","-I$ENV{TOOL_HOME}",@Targets);
108   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines