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.2 by williamc, Mon Aug 28 08:23:08 2000 UTC vs.
Revision 1.11 by williamc, Thu Nov 2 15:24:09 2000 UTC

# Line 2 | Line 2
2   #
3   # Interface
4   # ---------
5 < # new(toolbox)
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
12 + # buildfile()   : get/set BuildFile location
13 + # makefile()    : get the generated makefile
14  
15   package BuildSystem::BuildFile;
16   use ActiveDoc::SimpleDoc;
# Line 21 | Line 25 | sub new {
25          my $class=shift;
26          my $self={};
27          bless $self, $class;
28 <        $self->{toolbox}=shift;
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;
43   }
44  
45 + sub buildfile {
46 +        my $self=shift;
47 +        if ( @_ ) {
48 +          $self->{buildfile}=shift;
49 +        }
50 +        return $self->{buildfile};
51 + }
52 +
53 + sub makefile {
54 +        my $self=shift;
55 +        if ( @_ ) {
56 +          $self->{makefile}=shift;
57 +        }
58 +        return $self->{makefile};
59 + }
60 +
61 + sub BlockParse {
62 +        my $self=shift;
63 +        $self->{block}=shift;
64 +
65 +        # -- set up the block parse
66 +        my $switch=$self->_initswitcher();
67 +        my $parse="block";
68 +        $switch->newparse($parse);
69 +        $switch->addignoretags($parse);
70 +        $switch->addtag($parse,"BuildParam", \&BuildBlock_start, $self);
71 +        $switch->filetoparse($self->buildfile());
72 +
73 +        # -- parse away
74 +        $self->{switch}=$switch;
75 +        $switch->parse("block");
76 + }
77 +
78 + sub Parsetofh {
79 +        my $self=shift;
80 +        my $fh=shift;
81 +        $self->{buildblock}=shift;
82 +
83 +        # -- set up for parse
84 +        @{$self->{filehandlestack}}=($fh);
85 +        $self->{switch}->filetoparse($self->buildfile());
86 +        *GNUmakefile=$fh;
87 +
88 +        # -- generate makefile
89 +        $self->{switch}->parse("makebuild"); # sort out supported tags
90 +
91 +        # -- Clean up
92 +        close GNUmakefile;
93 + }
94 +
95   sub ignore {
96          my $self=shift;
97          return (defined $self->{ignore})?$self->{ignore}:0;
# Line 39 | Line 104 | sub _initswitcher {
104          $switch->newparse($parse);
105          $switch->addignoretags($parse);
106          $self->_commontags($switch,$parse);
107 <        $switch->addtag($parse,"Build", \&Build_start, $self);
107 >        #$switch->addtag($parse,"Build", \&Build_start, $self);
108          $switch->addtag($parse,"none",
109                                          \&OutToMakefile,$self,
110                                          \&OutToMakefile, $self,
# Line 48 | Line 113 | sub _initswitcher {
113                                          \&Bin_start,$self,
114                                          \&OutToScreen, $self,
115                                          "", $self);
116 +        $switch->addtag($parse,"ProductStore",
117 +                                        \&Store_start,$self,
118 +                                        "", $self,
119 +                                        "", $self);
120          $switch->addtag($parse,"LibType",
121                                          \&LibType_Start,$self,
122                                          \&LibType_text, $self,
# Line 107 | Line 176 | sub _commontags {
176          return $switch;
177   }
178  
179 + sub GenerateMakefile {
180 +        my $self=shift;
181 +        my $infile=shift;
182 +        my $outfile=shift;
183 +
184 +        $self->{switch}=$self->_initswitcher();
185 +        $self->{switch}->filetoparse($infile);
186 +
187 +        # open a temporary gnumakefile to store output.
188 +        my $fh=FileHandle->new();
189 +        open ( $fh, ">$outfile") or die "Unable to open $outfile for output ".
190 +                                                                "$!\n";
191 +        @{$self->{filehandlestack}}=($fh);
192 +
193 +        #  -- make an alias
194 +        *GNUmakefile=$fh;
195 +        if ( -e $ENV{LatestBuildFile} ) {
196 +          print GNUmakefile "include $ENV{LatestBuildFile}\n";
197 +        }
198 +        $self->{switch}->parse("makebuild"); # sort out supported tags
199 +        close GNUmakefile;
200 +        return $outfile;
201 + }
202 +
203   sub ParseBuildFile {
204          my $self=shift;
205          my $base=shift;
# Line 124 | Line 217 | sub ParseBuildFile {
217          $numbins=0;
218          $self->{envnum}=0;
219          $self->{envlevel}=0;
220 <        $self->{currentenv}="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/".
220 >        $self->{makefile}="$self->{localtop}/$ENV{INTwork}/$self->{path}/".
221                                                                  "BuildFile.mk";
222 +        $self->{currentenv}=$self->{makefile};
223          $self->{switch}=$self->_initswitcher();
224          $self->{switch}->filetoparse($fullfilename);
225  
226   #       $self->{switch}->{Strict_no_cr}='no';
227          #open a temporary gnumakefile to store output.
228          use Utilities::AddDir;
229 <        AddDir::adddir("$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}");
230 <        my $fh=FileHandle->new();
231 <        open ( $fh, ">$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/BuildFile.mk"
232 <          ) or die 'Unable to open /$ENV{INTwork}/".$self->{path}."/BuildFile.mk $!\n';
233 <        @{$self->{filehandlestack}}=($fh);
234 <        # make an alias
235 <        *GNUmakefile=$fh;
236 <        if ( -e $ENV{LatestBuildFile} ) {
237 <          print GNUmakefile "include $ENV{LatestBuildFile}\n";
144 <        }
145 < #       print "writing to :\n".
146 < #               "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/BuildFile.mk\n";
147 <        $ENV{LatestBuildFile}="$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/BuildFile.mk";
148 <        $self->{switch}->parse("makebuild"); # sort out supported tags
149 <        if ( $numbins > 0 ) {
150 <         print GNUmakefile <<ENDTEXT;
151 < ifndef BINMODE
152 < help::
153 < \t\@echo Generic Binary targets
154 < \t\@echo ----------------------
155 < endif
156 < ENDTEXT
157 <         foreach $target ( keys %$targettypes ) {
158 <         print GNUmakefile <<ENDTEXT;
159 < ifndef BINMODE
160 < help::
161 < \t\@echo $target
162 < endif
163 < ENDTEXT
164 <         }
229 >        AddDir::adddir("$self->{localtop}/$ENV{INTwork}/$self->{path}");
230 >        $ENV{LatestBuildFile}=$self->GenerateMakefile($fullfilename,
231 >         $self->{localtop}."/".$ENV{INTwork}."/".$self->{path}."/BuildFile.mk");
232 > }
233 >
234 > sub classname {
235 >        my $self=shift;
236 >        if ( @_ ) {
237 >          $self->{classname}=shift;
238          }
239 <        close GNUmakefile;
239 >        return $self->{classname};
240   }
241  
242   sub ParseBuildFile_Export {
243          my $self=shift;
244          my $filename=shift;
245 <        my $bf=BuildSystem::BuildFile->new($self->{toolbox});
245 >        my $bf=BuildSystem::BuildFile->new($self->{area});
246          if ( defined $self->{remoteproject} ) {
247             $bf->{remoteproject}=$self->{remoteproject};
248          }
# Line 245 | Line 318 | sub Class_StartTag {
318          
319          if ( $self->{Arch} ) {
320           if ( defined $$hashref{'type'} ) {
321 <                $ClassName=$$hashref{'type'};
321 >                $self->classname($$hashref{'type'});
322           }
323          }
324   }
# Line 263 | Line 336 | sub IncludePath_Start {
336   }
337  
338   #
339 + # --- <Build class=> tag
340 + #
341 +
342 + #
343 + # Parameter collection
344 + #
345 + sub BuildBlock_start {
346 +        my $self=shift;
347 +        my $name=shift;
348 +        my $hashref=shift;
349 +
350 +
351 +        my $blockobjid=$self->__blockobjid($hashref);
352 +
353 +        if ( $self->{Arch} ) {
354 +
355 +           # -- get any objects that match
356 +           my $inheritobj=$self->{block}->getobj($blockobjid);
357 +
358 +           # -- create an object with inherited properties
359 +           my $obj;
360 +           if ( ! defined $inheritobj ) {
361 +               # -- check we have a lookup for the class type
362 +               my $mapper=$self->_toolmapper();
363 +               if ( ! $mapper->exists($$hashref{'class'}) ) {
364 +                 $self->{switch}->parseerror("Unknown class : ".
365 +                                                        $$hashref{'class'});
366 +               }
367 +               $obj=BuildSystem::BuildClass->new();
368 +           }
369 +           else {
370 +               # -- inherit the properties from class with the same id class
371 +               $obj=$inheritobj->child();
372 +           }
373 +
374 +           # -- add changes from our tag
375 +           $obj->paramupdate($hashref);
376 +
377 +           # -- store the new object in the block
378 +           $self->{block}->setobj($obj,$blockobjid);
379 +        }
380 + }
381 +
382 + sub BuilderClass_buildmakefile {
383 +        my $self=shift;
384 +        my $name=shift;
385 +        my $hashref=shift;
386 +
387 +        my $blockobjid=$self->__blockobjid($hashref);
388 +
389 +        if ( $self->{Arch} ) {
390 +           # -- get the matching block object
391 +           my $blockobj=$self->{buildblock}->getobj($blockobjid);
392 +
393 +           # -- top level buildfile
394 +           my $fh=$self->{filehandlestack}[0];
395 +
396 +           # -- var initialisation
397 +           my @deftypes=();
398 +           my $buildname="";
399 +           my @types=$self->_toolmapper()->types($$hashref{'class'});
400 +
401 +           # -- error checking
402 +           if ( ! defined $blockobj->param("default") ) {
403 +             $self->error("No default build parameter defined for ".
404 +                $$hashref{'class'}." ".$$hashref{'id'});
405 +           }
406 +           if ( ! defined $blockobj->param("name") ) {
407 +             $self->error("\"name\" parameter defined for ".
408 +                $$hashref{'class'}." ".$$hashref{'id'});
409 +           }
410 +
411 +
412 +           foreach $param ( $blockobj->paramlist() ) {
413 +             # -- check for params that need special handling
414 +             if ( $param eq "default" ) {
415 +                @deftypes=split /,/, $param;  
416 +             }
417 +             elsif ( $param eq "name" ) {
418 +                $buildname=$blockobj->param($param);
419 +             }
420 +             else {
421 +                # -- simple transfer of block object parameters to makefile
422 +                print $fh $param.":=".$blockobj->param($param)."\n";
423 +             }
424 +           }
425 +          
426 +           # -- construct the targets in the top makefile
427 +           $self->_generatedefaulttargets($fh,$$hashref{'class'},@deftypes);
428 +           $self->_generatetypetargets($fh,$$hashref{'class'},$buildname,@types);
429 +        }
430 + }
431 +
432 + sub _blockobjid {
433 +        my $self=shift;
434 +        my $hashref=shift;
435 +
436 +        $self->{switch}->checktag($name,$hashref,'class');
437 +        $self->{switch}->checktag($name,$hashref,'id');
438 +        my $blockobjid="bc_".$$hashref{'class'},"_".$$hashref{'id'};
439 +
440 +        return $blockobjid;
441 + }
442 +
443 + sub _generatedefaulttargets {
444 +        my $self=shift;
445 +        my $fh=shift;
446 +        my $class=shift;
447 +
448 +        my @deftypes=shift;
449 +
450 +        print $fh "# -- Default type targets\n";
451 +        foreach $dtype ( @deftypes ) {
452 +            print $fh $class."::".$class."_".$dtype."\n";
453 +        }
454 +        print $fh "\n";
455 + }
456 +
457 + sub _generatetypetargets {
458 +        my $self=shift;
459 +        my $fh=shift;
460 +        my $class=shift;
461 +        my $name=shift;
462 +
463 +        my @types=shift;
464 +
465 +        print $fh "# -- Generic type targets\n";
466 +        foreach $type ( @types ) {
467 +            my $pattern=$class."_".$type;
468 +            my $dirname=$class."_".$type."_".$name;
469 +            my $makefile=$here."/BuildFile.mk";
470 +
471 +            # -- map to generic name for each type
472 +            print $fh "# ------ $pattern rules ---------------\n";
473 +            print $fh $class."_".$type."::".$class.
474 +                                                        "_".$type."_$name\n\n";
475 +
476 +            print $fh "# -- Link Targets to $type directories\n";
477 +            print $fh "$dirname: make_$dirname\n";
478 +            print $fh "\t\@cd $here; \\\n";
479 +            print $fh "\t\$(MAKE) LatestBuildFile=$makefile _BuildLink_=1".
480 +                        " workdir=$here ".
481 +                        " -f \$(TOOL_HOME)/basics.mk datestamp \$\@; \n\n";
482 +
483 +            # -- write target to make makefile for each directory
484 +            print $fh "# -- Build target directories\n";
485 +            print $fh "make_$dirname:\n";
486 +            print $fh "\tif [ ! -e \"$makefile\" ]; then \\\n";
487 +            print $fh "\t if [ ! -d \"$here\" ]; then \\\n";
488 +            print $fh "\t  mkdir $here; \\\n";
489 +            print $fh "\t fi;\\\n";
490 +            print $fh "\t cd $dirname; \\\n";
491 +            print $fh "\t echo include ".$self->{currentenv}." > ".
492 +                                                        "$makefile; \\\n";
493 +            print $fh "\t echo VPATH+=$self->{localtop}/".$self->{path}.
494 +                                        " >> $makefile; \\\n";
495 +            print $fh "\t echo buildname=$name >> $makefile;\\\n";
496 +            print $fh "\t echo ".$dirname.":".$pattern." >> $makefile;\\\n";
497 +            if ( defined (my @file=$mapper->rulesfile($class)) ) {
498 +             foreach $f ( @file ) {
499 +              print $fh "\t echo -include $f >> $makefile; \\\n";
500 +             }
501 +            }
502 +            print $fh "\tfi\n";
503 +            print $fh "\n";
504 +
505 +            # -- cleaning targets
506 +            push @targets, "clean_$dirname";
507 +            print $fh "# -- cleaning targets\n";
508 +            print $fh "clean::clean_$dirname\n";
509 +            print $fh "clean_".$dirname."::\n";
510 +            print $fh "\t\@echo cleaning $dirname\n";
511 +            print $fh "\t\@if [ -d $here ]; then \\\n";
512 +            print $fh "\tcd $here; \\\n";
513 +            print $fh "\t\$(MAKE) LatestBuildFile=$makefile workdir=".
514 +                        $here." _BuildLink_=1 -f ".
515 +                        "\$(TOOL_HOME)/basics.mk clean; \\\n";
516 +            print $fh "\tfi\n\n";
517 +
518 +        }
519 +        print $fh "\n";
520 + }
521 +
522 + #
523   # generic build tag
524   #
525   sub Build_start {
# Line 271 | Line 528 | sub Build_start {
528          my $hashref=shift;
529  
530          $self->{switch}->checktag($name,$hashref,'class');
531 +        $self->{switch}->checktag($name,$hashref,'id');
532          if ( $self->{Arch} ) {
533  
534            # -- determine the build products name
# Line 297 | Line 555 | sub Build_start {
555  
556             # -- generate generic targets
557             print $fh "ifndef _BuildLink_\n";
558 <           print $fh "# -- Generic targets\n";
558 >           $self->_generatedefaulttargets($fh,$$hashref{'class'},@deftypes);
559 >
560             push @targets, $$hashref{'class'};
302           foreach $dtype ( @deftypes ) {
303            print $fh $$hashref{'class'}."::".$$hashref{'class'}."_".
304                                                                $dtype."\n";
305           }
306           print $fh "\n";
561  
562             # -- generate targets for each type
563             foreach $type ( @types ) {
# Line 318 | Line 572 | sub Build_start {
572              # -- create a new directory for each type
573              push @targets, $pattern;
574              my $dirname=$$hashref{'class'}."_".$type."_".$name;
575 <            my $here="$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/".$dirname;
575 >            my $here="$self->{localtop}/$ENV{INTwork}/".$self->{path}.
576 >                                                                "/".$dirname;
577              my $makefile=$here."/BuildFile.mk";
578   #           AddDir::adddir($here);
579  
# Line 341 | Line 596 | sub Build_start {
596              print $fh "\t cd $dirname; \\\n";
597              print $fh "\t echo include ".$self->{currentenv}." > ".
598                                                          "$makefile; \\\n";
599 <            print $fh "\t echo VPATH+=$ENV{LOCALTOP}/".$self->{path}.
599 >            print $fh "\t echo VPATH+=$self->{localtop}/".$self->{path}.
600                                          " >> $makefile; \\\n";
601              print $fh "\t echo buildname=$name >> $makefile;\\\n";
602              print $fh "\t echo ".$dirname.":".$pattern." >> $makefile;\\\n";
# Line 356 | Line 611 | sub Build_start {
611   #           print $typefile "\t\$(_quietbuild_)";
612   #           print $typefile $mapper->template($$hashref{'class'},$type)."\n";
613   #           print $typefile "\t\$(_quietstamp_)";
614 < #           print $typefile "$(SCRAMPERL) $(SCRAM_HOME)/src/scramdatestamp \$@.ds \$@ \$^\n";
614 > #           print $typefile "\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$@.ds \$@ \$^\n";
615  
616              # -- cleaning targets
617              push @targets, "clean_$dirname";
# Line 407 | Line 662 | sub Bin_start {
662  
663          # Create a new directory for each binary target
664          my $dirname="bin_".$$hashref{name};
665 <        AddDir::adddir("$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/$dirname");
665 >        AddDir::adddir("$self->{localtop}/$ENV{INTwork}/".$self->{path}."/$dirname");
666          open (binGNUmakefile,
667 <           ">$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/$dirname/BuildFile.mk") or die           "Unable to make $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname/".
667 >           ">$self->{localtop}/$ENV{INTwork}/".$self->{path}."/$dirname/BuildFile.mk") or die           "Unable to make $self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname/".
668             "BuildFile.mk $!\n";
669  
670          # Create the link targets
# Line 425 | Line 680 | endif
680   ifndef BINMODE
681  
682   define stepdown_$$hashref{'name'}
683 < if [ -d "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
684 < cd $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname; \\
685 < \$(MAKE) BINMODE=true LatestBuildFile=$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\@; \\
683 > if [ -d "$self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
684 > cd $self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname; \\
685 > \$(MAKE) BINMODE=true LatestBuildFile=$self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\@; \\
686   fi
687   endef
688  
689   define stepdown2_$$hashref{'name'}
690 < if [ -d "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
691 < cd $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname; \\
692 < \$(MAKE) BINMODE=true LatestBuildFile=$ENV{LOCALTOP}/$ENV{INTwork}/$self{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\*; \\
690 > if [ -d "$self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
691 > cd $self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname; \\
692 > \$(MAKE) BINMODE=true LatestBuildFile=$self->{localtop}/$ENV{INTwork}/$self{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\*; \\
693   fi
694  
695   endef
# Line 458 | Line 713 | ENDTEXT
713  
714   # the binary specifics makefile
715          print binGNUmakefile "include ".$self->{currentenv}."\n";
716 <        print binGNUmakefile "VPATH+=$ENV{LOCALTOP}/$self{path}\n";
716 >        print binGNUmakefile "VPATH+=".$self->{localtop}."/$self{path}\n";
717  
718   # alias for bin_Insure
719          print binGNUmakefile <<ENDTEXT;
# Line 514 | Line 769 | ENDTEXT
769          print binGNUmakefile "$$hashref{name}_Insure.exe:.psrc\n";
770          print binGNUmakefile "$$hashref{name}_d.exe:$objectname_d\n";
771          print binGNUmakefile "\t\$(CClinkCmdDebug)\n";
772 <        print binGNUmakefile "\t\@\$(SCRAMPERL) $(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
772 >        print binGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
773          print binGNUmakefile "$$hashref{name}_l_d.exe:$objectname_d\n";
774          print binGNUmakefile "\t\$(CClinkCmdDebugLocal)\n";
775 <        print binGNUmakefile "\t\@\$(SCRAMPERL) $(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
775 >        print binGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
776          print binGNUmakefile "$$hashref{name}_Insure.exe:$objectname_Insure\n";
777          print binGNUmakefile "\t\$(CClinkCmdInsure)\n";
778 <        print binGNUmakefile "\t\@\$(SCRAMPERL) $(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
778 >        print binGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
779          print binGNUmakefile "$$hashref{name}_o.exe:$objectname_o\n";
780          print binGNUmakefile "\t\$(CClinkCmd)\n";
781 <        print binGNUmakefile "\t\@\$(SCRAMPERL) $(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
781 >        print binGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
782          print binGNUmakefile "$$hashref{name}.dep:$$hashref{file}\n";
783          print binGNUmakefile "-include $$hashref{name}.dep\n";
784   print binGNUmakefile <<ENDTEXT;
# Line 653 | Line 908 | sub Use_start {
908          }
909   }
910  
656 sub CheckBuildFile {
657         my $self=shift;
658         my $classdir=shift;
659         my $ClassName="";
660         my $thisfile="$classdir/$buildfile";
661
662         if ( -e $ENV{LOCALTOP}."/".$thisfile ) {
663            $DefaultBuildfile="$ENV{LOCALTOP}/$thisfile";
664            $self->ParseBuildFile($ENV{LOCALTOP}, $classdir, $buildfile);
665         }
666         elsif ( -e $ENV{RELEASETOP}."/".$thisfile ) {
667            $DefaultBuildfile="$ENV{RELEASETOP}/$thisfile";
668            $self->ParseBuildFile($ENV{RELEASETOP}, $classdir, $buildfile);
669         }
670         return $ClassName;
671 }
672
911   # List association groups between <AssociateGroup> tags
912   # seperated by newlines or spaces
913   sub AssociateGroup {
# Line 865 | Line 1103 | sub Environment_start {
1103            $self->{envnum}++;
1104  
1105            # open a new Environment File
1106 <          my $envfile="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/Env_".
1106 >          my $envfile="$self->{localtop}/$ENV{INTwork}/$self->{path}/Env_".
1107                  $self->{envnum}.".mk";
1108            use FileHandle;
1109            my $fh=FileHandle->new();
# Line 875 | Line 1113 | sub Environment_start {
1113  
1114            # include the approprate environment file
1115            if ( $self->{envlevel} == 0 ) {
1116 <             print GNUmakefile "include $ENV{LOCALTOP}/$ENV{INTwork}/".
1116 >             print GNUmakefile "include $self->{localtop}/$ENV{INTwork}/".
1117                  $self->{path}."/BuildFile.mk\n";
1118            }
1119            else {
1120 <             print GNUmakefile "include $ENV{LOCALTOP}/$ENV{INTwork}/".
1120 >             print GNUmakefile "include $self->{localtop}/$ENV{INTwork}/".
1121                  $self->{path}."/Env_".$self->{Envlevels}[$self->{envlevel}].".mk\n";
1122            }
1123            $self->{envlevel}++;
1124            $self->{Envlevels}[$self->{envlevel}]=$self->{envnum};
1125 <          $self->{currentenv}="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/Env_$self->{envnum}.mk";
1125 >          $self->{currentenv}="$self->{localtop}/$ENV{INTwork}/$self->{path}/Env_$self->{envnum}.mk";
1126          }
1127   }
1128  
# Line 904 | Line 1142 | sub Environment_end {
1142            close $fd;
1143            *GNUmakefile=$self->{filehandlestack}[$#{$self->{filehandlestack}}];
1144            if ( $self->{envlevel} < 1 ) {
1145 <            $self->{currentenv}="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/".
1145 >            $self->{currentenv}="$self->{localtop}/$ENV{INTwork}/$self->{path}/".
1146                          "BuildFile.mk";
1147            }
1148            else {
1149              $self->{currentenv}=
1150 <             "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/Env_".
1150 >             $self->{localtop}."/$ENV{INTwork}/$self->{path}/Env_".
1151                  $self->{Envlevels}[$self->{envlevel}];
1152            }
1153          }
1154   }
1155 +
1156 + sub Store_start {
1157 +        my $self=shift;
1158 +        my $name=shift;
1159 +        my $hashref=shift;
1160 +
1161 +        if ( $self->{Arch} ) {
1162 +          $self->{switch}->checktag( $name, $hashref, 'name' );
1163 +
1164 +          # -- store creation
1165 +          my $dir=$$hashref{'name'};
1166 +          AddDir::adddir($self->{area}->location()."/".$dir);
1167 +          if ( exists $$hashref{'type'} ) {
1168 +            # -- architecture specific store
1169 +            if ( $$hashref{'type'}=~/^arch/i ) {
1170 +                $dir=$dir."/".$ENV{SCRAM_ARCH};
1171 +                AddDir::adddir($self->{area}->location()."/".$dir);
1172 +            }
1173 +            else {
1174 +                $self->parseerror("Unknown type in <$name> tag");
1175 +            }
1176 +          }
1177 +        
1178 +          # -- set make variables for the store
1179 +          print GNUmakefile "SCRAMSTORENAME_".$$hashref{'name'}.":=".$dir."\n";
1180 +          print GNUmakefile "SCRAMSTORE_".$$hashref{'name'}.":=".
1181 +                                        $self->{localtop}."/".$dir."\n";
1182 +          print GNUmakefile "VPATH+=".$self->{localtop}
1183 +                        ."/".$dir.":".$self->{releasetop}."/".$dir."\n";
1184 +        }
1185 + }
1186 +
1187 + sub DropDown {
1188 +        my $self=shift;
1189 +        my $name=shift;
1190 +        my $hashref=shift;
1191 +
1192 +        if ( $self->{Arch} ) {
1193 +          # - default values must always be specified
1194 +          $self->{switch}->checktag( $name, $hashref, 'defaults' );
1195 +          my @blockdirs=split /,/ , $$hashref{'defaults'};
1196 +          $self->{block}->defaultblocks(@blockdirs);
1197 +        }
1198 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines