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.10 by williamc, Sat Oct 14 17:29:05 2000 UTC vs.
Revision 1.18 by sashby, Tue May 14 14:27:13 2002 UTC

# Line 2 | Line 2
2   #
3   # Interface
4   # ---------
5 < # new(ConfigArea)
5 > # new(toolbox)
6   # ParseBuildFile($base,$path,$file)
7   # ParseBuildFileExport(filename)
8 # BlockParse(Block) : perform a parse to modify the block
8   # BlockClassPath() : Return the class path
9   # 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
10  
11   package BuildSystem::BuildFile;
12 + use Utilities::Verbose;
13   use ActiveDoc::SimpleDoc;
14   use BuildSystem::ToolBox;
15   require 5.004;
16 + @ISA=qw(Utilities::Verbose);
17  
18   BEGIN {
19   $buildfile="BuildFile";
# Line 25 | Line 23 | sub new {
23          my $class=shift;
24          my $self={};
25          bless $self, $class;
26 <        $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();
26 >        $self->{toolbox}=shift;
27          $self->{Arch}=1;
28          push @{$self->{ARCHBLOCK}}, $self->{Arch};
29          return $self;
30   }
31  
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
72        # -- parse away
73        $self->{switch}->parse("block");
74 }
75
76 sub Parsetofh {
77        my $self=shift;
78        my $fh=shift;
79        $self->{buildblock}=shift;
80
81        # -- set up for parse
82        @{$self->{filehandlestack}}=($fh);
83        $self->{switch}->filetoparse($self->buildfile());
84        *GNUmakefile=$fh;
85
86        # -- generate makefile
87        $self->{switch}->parse("makebuild"); # sort out supported tags
88
89        # -- Clean up
90        close GNUmakefile;
91 }
92
32   sub ignore {
33          my $self=shift;
34 +        $self->verbose(">> ignore......<<");
35 +        
36          return (defined $self->{ignore})?$self->{ignore}:0;
37   }
38  
# Line 99 | Line 40 | sub _initswitcher {
40          my $self=shift;
41          my $switch=ActiveDoc::SimpleDoc->new();
42          my $parse="makebuild";
43 +        $self->verbose(">> _initswitcher: <<");
44          $switch->newparse($parse);
45          $switch->addignoretags($parse);
46          $self->_commontags($switch,$parse);
47 <        #$switch->addtag($parse,"Build", \&Build_start, $self);
47 >        $switch->addtag($parse,"Build", \&Build_start, $self);
48          $switch->addtag($parse,"none",
49                                          \&OutToMakefile,$self,
50                                          \&OutToMakefile, $self,
# Line 111 | Line 53 | sub _initswitcher {
53                                          \&Bin_start,$self,
54                                          \&OutToScreen, $self,
55                                          "", $self);
56 <        $switch->addtag($parse,"ProductStore",
57 <                                        \&Store_start,$self,
58 <                                        "", $self,
56 >        $switch->addtag($parse,"Module",
57 >                                        \&Module_start,$self,
58 >                                        \&OutToScreen, $self,
59                                          "", $self);
60 +
61 +        $switch->addtag($parse,"ProductStore",
62 +                                        \&Store_start,$self,
63 +                                        "", $self,
64 +                                        "", $self);
65          $switch->addtag($parse,"LibType",
66                                          \&LibType_Start,$self,
67                                          \&LibType_text, $self,
# Line 146 | Line 93 | sub _commontags {
93          my $self=shift;
94          my $switch=shift;
95          my $parse=shift;
96 <
96 >        
97 >        $self->verbose(">> _commontags: SW ".$switch." PARSE ".$parse." <<");
98 >        
99          $switch->grouptag("Export",$parse);
100          $switch->addtag($parse,"Use",\&Use_start,$self,
101                                                 \&OutToMakefile, $self,
# Line 174 | Line 123 | sub _commontags {
123          return $switch;
124   }
125  
177 sub GenerateMakefile {
178        my $self=shift;
179        my $infile=shift;
180        my $outfile=shift;
181
182        $self->{switch}=$self->_initswitcher();
183        $self->{switch}->filetoparse($infile);
184
185        # open a temporary gnumakefile to store output.
186        my $fh=FileHandle->new();
187        open ( $fh, ">$outfile") or die "Unable to open $outfile for output ".
188                                                                "$!\n";
189        @{$self->{filehandlestack}}=($fh);
190
191        #  -- make an alias
192        *GNUmakefile=$fh;
193        if ( -e $ENV{LatestBuildFile} ) {
194          print GNUmakefile "include $ENV{LatestBuildFile}\n";
195        }
196        $self->{switch}->parse("makebuild"); # sort out supported tags
197        close GNUmakefile;
198        return $outfile;
199 }
200
126   sub ParseBuildFile {
127          my $self=shift;
128          my $base=shift;
# Line 210 | Line 135 | sub ParseBuildFile {
135          else {
136           $fullfilename=$filename;
137          }
138 +
139 +        $self->verbose(">> ParseBuildFile: FN ".$fullfilename." <<");
140 +        
141          $self->{path}=$path;
214        #print "Processing $fullfilename\n";
142          $numbins=0;
143          $self->{envnum}=0;
144          $self->{envlevel}=0;
145 <        $self->{makefile}="$self->{localtop}/$ENV{INTwork}/$self->{path}/".
145 >        $self->{currentenv}="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/".
146                                                                  "BuildFile.mk";
220        $self->{currentenv}=$self->{makefile};
147          $self->{switch}=$self->_initswitcher();
148          $self->{switch}->filetoparse($fullfilename);
149  
150 < #       $self->{switch}->{Strict_no_cr}='no';
225 <        #open a temporary gnumakefile to store output.
150 >        # open a temporary gnumakefile to store output.
151          use Utilities::AddDir;
152 <        AddDir::adddir("$self->{localtop}/$ENV{INTwork}/$self->{path}");
153 <        $ENV{LatestBuildFile}=$self->GenerateMakefile($fullfilename,
154 <         $self->{localtop}."/".$ENV{INTwork}."/".$self->{path}."/BuildFile.mk");
155 < }
152 >        AddDir::adddir("$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}");
153 >        my $fh=FileHandle->new();
154 >        open ( $fh, ">$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/BuildFile.mk"
155 >          ) or die "Unable to open /$ENV{INTwork}/".$self->{path}."/BuildFile.mk $!\n";
156 >        @{$self->{filehandlestack}}=($fh);
157 >        # make an alias
158 >        *GNUmakefile=$fh;
159 >        if ( -e $ENV{LatestBuildFile} ) {
160 >          print GNUmakefile "include $ENV{LatestBuildFile}\n";
161 >        }
162  
163 < sub classname {
164 <        my $self=shift;
165 <        if ( @_ ) {
166 <          $self->{classname}=shift;
163 >        $ENV{LatestBuildFile}="$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/BuildFile.mk";
164 >        $self->{switch}->parse("makebuild"); # sort out supported tags
165 >        if ( $numbins > 0 ) {
166 >         print GNUmakefile <<ENDTEXT;
167 > ifndef BINMODE
168 > help::
169 > \t\@echo Generic Binary targets
170 > \t\@echo ----------------------
171 > endif
172 > ENDTEXT
173 >         foreach $target ( keys %$targettypes ) {
174 >         print GNUmakefile <<ENDTEXT;
175 > ifndef BINMODE
176 > help::
177 > \t\@echo $target
178 > endif
179 > ENDTEXT
180 >         }
181          }
182 <        return $self->{classname};
182 >        close GNUmakefile;
183   }
184  
185   sub ParseBuildFile_Export {
186          my $self=shift;
187          my $filename=shift;
188 <        my $bf=BuildSystem::BuildFile->new($self->{area});
188 >
189 >        $self->verbose(">> ParseBuildFile_Export: FN ".$filename." <<");
190 >        
191 >        my $bf=BuildSystem::BuildFile->new($self->{toolbox});
192          if ( defined $self->{remoteproject} ) {
193             $bf->{remoteproject}=$self->{remoteproject};
194          }
# Line 251 | Line 199 | sub ParseBuildFile_Export {
199   sub _location {
200          my $self=shift;
201          use File::Basename;
202 <
202 >        $self->verbose(">> _location: <<");
203          return dirname($self->{switch}->filetoparse());
204   }
205  
206   sub _parseexport {
207          my $self=shift;
208          my $filename=shift;
209 <
209 >        $self->verbose(">> _parseexport: FN ".$filename." <<");
210 >        
211          my $switchex=ActiveDoc::SimpleDoc->new();
212          $switchex->filetoparse($filename);
213          $switchex->newparse("export");
# Line 269 | Line 218 | sub _parseexport {
218                                          \&export_end_export,$self);
219          $self->_commontags($switchex,"export");
220          $switchex->allowgroup("__export","export");
272 #       $switchex->{Strict_no_cr}='no';
221          $self->{switch}=$switchex;
222          $switchex->parse("export"); # sort out supported tags
223   }
# Line 277 | Line 225 | sub _parseexport {
225   sub _pushremoteproject {
226          my $self=shift;
227          my $path=shift;
228 +
229 +        $self->verbose(">> _pushremoteproject: PATH ".$path." <<");
230          
231          if ( defined $self->{remoteproject} ) {
232            push @{$self->{rpstack}}, $self->{remoteproject};
# Line 286 | Line 236 | sub _pushremoteproject {
236  
237   sub _popremoteproject {
238          my $self=shift;
239 +        $self->verbose(">> _popremoteproject:  <<");
240 +        
241          if ( $#{$self->{rpstack}} >=0 ) {
242            $self->{remoteproject}=pop @{$self->{rpstack}};
243          }
# Line 296 | Line 248 | sub _popremoteproject {
248  
249   sub _toolmapper {
250          my $self=shift;
251 +
252          if ( ! defined $self->{mapper} ) {
253             require BuildSystem::ToolMapper;
254             $self->{mapper}=BuildSystem::ToolMapper->new();
255          }
256 +        $self->verbose(">> _toolmapper: TM ".$self->{mapper}."<<");
257          return $self->{mapper};
258   }
259  
# Line 313 | Line 267 | sub Class_StartTag {
267          my $self=shift;
268          my $name=shift;
269          my $hashref=shift;
270 +
271 +        $self->verbose(">> Classs_StartTag: NM ".$name." <<");
272          
273          if ( $self->{Arch} ) {
274           if ( defined $$hashref{'type'} ) {
275 <                $self->classname($$hashref{'type'});
275 >                $ClassName=$$hashref{'type'};
276           }
277          }
278   }
279  
280 < sub IncludePath_Start {
281 <        my $self=shift;
282 <        my $name=shift;
283 <        my $hashref=shift;
284 <
285 <        $self->{switch}->checktag( $name, $hashref, 'path');
286 <        if ( $self->{Arch} ) {
287 <          print GNUmakefile "INCLUDE+=".$self->_location()."/".
288 <                                                $$hashref{'path'}."\n";
289 <        }
290 < }
291 <
292 < #
293 < # --- <Build class=> tag
294 < #
339 <
340 < #
341 < # Parameter collection
342 < #
343 < sub BuildBlock_start {
344 <        my $self=shift;
345 <        my $name=shift;
346 <        my $hashref=shift;
347 <
348 <
349 <        my $blockobjid=$self->__blockobjid($hashref);
350 <
351 <        if ( $self->{Arch} ) {
352 <
353 <            
354 <           # -- get any objects that match
355 <           my $inheritobj=$self->{block}->getobj($blockobjid);
356 <
357 <           # -- create an object with inherited properties
358 <           my $obj;
359 <           if ( ! defined $inheritobj ) {
360 <               # -- check we have a lookup for the class type
361 <               my $mapper=$self->_toolmapper();
362 <               if ( ! $mapper->exists($$hashref{'class'}) ) {
363 <                 $self->{switch}->parseerror("Unknown class : ".
364 <                                                        $$hashref{'class'});
365 <               }
366 <               $obj=BuildSystem::BuildClass->new();
367 <           }
368 <           else {
369 <               # -- inherit the properties from class with the same id class
370 <               $obj=$inheritobj->child();
371 <           }
372 <
373 <           # -- add changes from our tag
374 <           $obj->paramupdate($hashref);
375 <
376 <           # -- store the new object in the block
377 <           $self->{block}->setobj($obj,$blockobjid);
378 <        }
379 < }
380 <
381 < sub BuilderClass_buildmakefile {
382 <        my $self=shift;
383 <        my $name=shift;
384 <        my $hashref=shift;
385 <
386 <        my $blockobjid=$self->__blockobjid($hashref);
387 <
388 <        if ( $self->{Arch} ) {
389 <           # -- get the matching block object
390 <           my $blockobj=$self->{buildblock}->getobj($blockobjid);
391 <
392 <           # -- top level buildfile
393 <           my $fh=$self->{filehandlestack}[0];
394 <
395 <           # -- var initialisation
396 <           my @deftypes=();
397 <           my $buildname="";
398 <           my @types=$self->_toolmapper()->types($$hashref{'class'});
399 <
400 <           # -- error checking
401 <           if ( ! defined $blockobj->param("default") ) {
402 <             $self->error("No default build parameter defined for ".
403 <                $$hashref{'class'}." ".$$hashref{'id'});
404 <           }
405 <           if ( ! defined $blockobj->param("name") ) {
406 <             $self->error("\"name\" parameter defined for ".
407 <                $$hashref{'class'}." ".$$hashref{'id'});
408 <           }
409 <
410 <
411 <           foreach $param ( $blockobj->paramlist() ) {
412 <             # -- check for params that need special handling
413 <             if ( $param eq "default" ) {
414 <                @deftypes=split /,/, $param;  
415 <             }
416 <             elsif ( $param eq "name" ) {
417 <                $buildname=$blockobj->param($param);
418 <             }
419 <             else {
420 <                # -- simple transfer of block object parameters to makefile
421 <                print $fh $param.":=".$blockobj->param($param)."\n";
422 <             }
423 <           }
424 <          
425 <           # -- construct the targets in the top makefile
426 <           $self->_generatedefaulttargets($fh,$$hashref{'class'},@deftypes);
427 <           $self->_generatetypetargets($fh,$$hashref{'class'},$buildname,@types);
428 <
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 < }
280 > sub IncludePath_Start
281 >   {
282 >   my $self=shift;
283 >   my $name=shift;
284 >   my $hashref=shift;
285 >  
286 >   $self->verbose(">> IncludePath_Start: NM ".$name." <<");
287 >  
288 >   $self->{switch}->checktag( $name, $hashref, 'path');
289 >   if ( $self->{Arch} )
290 >      {
291 >      print GNUmakefile "INCLUDE:=\$(filter-out ".$self->_location()."/".$$hashref{'path'}.",\$(INCLUDE))","\n";
292 >      print GNUmakefile "INCLUDE+=".$self->_location()."/".$$hashref{'path'}."\n";
293 >      }
294 >   }
295  
296   #
297   # generic build tag
# Line 527 | Line 301 | sub Build_start {
301          my $name=shift;
302          my $hashref=shift;
303  
304 +        $self->verbose(">> Build_start: NM ".$name." <<");
305 +        
306          $self->{switch}->checktag($name,$hashref,'class');
531        $self->{switch}->checktag($name,$hashref,'id');
307          if ( $self->{Arch} ) {
308  
309            # -- determine the build products name
# Line 538 | Line 313 | sub Build_start {
313            }
314            else {
315              $self->{switch}->parseerror("No name specified for build product");
541            #$name="\$(buildname)";
316            }
317  
318            # -- check we have a lookup for the class type
# Line 555 | Line 329 | sub Build_start {
329  
330             # -- generate generic targets
331             print $fh "ifndef _BuildLink_\n";
332 <           $self->_generatedefaulttargets($fh,$$hashref{'class'},@deftypes);
559 <
332 >           print $fh "# -- Generic targets\n";
333             push @targets, $$hashref{'class'};
334 +           foreach $dtype ( @deftypes ) {
335 +            print $fh $$hashref{'class'}."::".$$hashref{'class'}."_".
336 +                                                                $dtype."\n";
337 +           }
338 +           print $fh "\n";
339  
340             # -- generate targets for each type
341             foreach $type ( @types ) {
# Line 572 | Line 350 | sub Build_start {
350              # -- create a new directory for each type
351              push @targets, $pattern;
352              my $dirname=$$hashref{'class'}."_".$type."_".$name;
353 <            my $here="$self->{localtop}/$ENV{INTwork}/".$self->{path}.
576 <                                                                "/".$dirname;
353 >            my $here="$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/".$dirname;
354              my $makefile=$here."/BuildFile.mk";
578 #           AddDir::adddir($here);
355  
356              # -- create link targets to the directory
357              push @targets, $dirname;
# Line 596 | Line 372 | sub Build_start {
372              print $fh "\t cd $dirname; \\\n";
373              print $fh "\t echo include ".$self->{currentenv}." > ".
374                                                          "$makefile; \\\n";
375 <            print $fh "\t echo VPATH+=$self->{localtop}/".$self->{path}.
375 >            print $fh "\t echo VPATH+=$ENV{LOCALTOP}/".$self->{path}.
376                                          " >> $makefile; \\\n";
377              print $fh "\t echo buildname=$name >> $makefile;\\\n";
378              print $fh "\t echo ".$dirname.":".$pattern." >> $makefile;\\\n";
# Line 607 | Line 383 | sub Build_start {
383              }
384              print $fh "\tfi\n";
385              print $fh "\n";
610 #           print $typefile "$name :\n";
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";
386  
387              # -- cleaning targets
388              push @targets, "clean_$dirname";
# Line 652 | Line 423 | sub Bin_start {
423          my $tool;
424          my $filename;
425          my $objectname;
426 +
427 +        $self->verbose(">>          <<");
428          
429          $self->{switch}->checktag($name,$hashref,'file');
430          if ( $self->{Arch} ) {
# Line 662 | Line 435 | sub Bin_start {
435  
436          # Create a new directory for each binary target
437          my $dirname="bin_".$$hashref{name};
438 <        AddDir::adddir("$self->{localtop}/$ENV{INTwork}/".$self->{path}."/$dirname");
438 >        AddDir::adddir("$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/$dirname");
439          open (binGNUmakefile,
440 <           ">$self->{localtop}/$ENV{INTwork}/".$self->{path}."/$dirname/BuildFile.mk") or die           "Unable to make $self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname/".
440 >           ">$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/$dirname/BuildFile.mk") or die           "Unable to make $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname/".
441             "BuildFile.mk $!\n";
442  
443          # Create the link targets
# Line 680 | Line 453 | endif
453   ifndef BINMODE
454  
455   define stepdown_$$hashref{'name'}
456 < if [ -d "$self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
457 < cd $self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname; \\
458 < \$(MAKE) BINMODE=true LatestBuildFile=$self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\@; \\
456 > if [ -d "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
457 > cd $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname; \\
458 > \$(MAKE) BINMODE=true LatestBuildFile=$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\@; \\
459   fi
460   endef
461  
462   define stepdown2_$$hashref{'name'}
463 < if [ -d "$self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
464 < cd $self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname; \\
465 < \$(MAKE) BINMODE=true LatestBuildFile=$self->{localtop}/$ENV{INTwork}/$self{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\*; \\
463 > if [ -d "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
464 > cd $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname; \\
465 > \$(MAKE) BINMODE=true LatestBuildFile=$ENV{LOCALTOP}/$ENV{INTwork}/$self{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\*; \\
466   fi
467  
468   endef
# Line 713 | Line 486 | ENDTEXT
486  
487   # the binary specifics makefile
488          print binGNUmakefile "include ".$self->{currentenv}."\n";
489 <        print binGNUmakefile "VPATH+=".$self->{localtop}."/$self{path}\n";
489 >        print binGNUmakefile "VPATH+=$ENV{LOCALTOP}/$self{path}\n";
490  
491   # alias for bin_Insure
492          print binGNUmakefile <<ENDTEXT;
# Line 810 | Line 583 | ENDTEXT
583          close binGNUmakefile;
584   }
585  
586 + sub Module_start {
587 +        my $self=shift;
588 +        my $name=shift;
589 +        my $hashref=shift;
590 +
591 +        my $fileclass;
592 +        my @tools;
593 +        my $tool;
594 +        my $filename;
595 +        my $objectname;
596 +
597 +        $self->verbose(">> In module_start: ".$name." <<");
598 +        
599 +        $self->{switch}->checktag($name,$hashref,'file');
600 +        if ( $self->{Arch} ) {
601 +        if ( ! defined $$hashref{name} ) {
602 +                ($$hashref{name}=$$hashref{file})=~s/\..*//;
603 +        }
604 +        ($filename=$$hashref{file})=~s/\..*//;
605 +
606 +        # Create a new directory for each module target
607 +        my $dirname="module_".$$hashref{name};
608 +        AddDir::adddir("$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/$dirname");
609 +        open (moduleGNUmakefile,
610 +           ">$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/$dirname/BuildFile.mk") or die           "Unable to make $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname/".
611 +           "BuildFile.mk $!\n";
612 +
613 +        # Create the link targets
614 +        $numbins++;
615 +        my $fh=$self->{filehandlestack}[0];
616 +        print $fh <<ENDTEXT;
617 +
618 + # Link Targets to module directories
619 + ifdef MODULEMODE
620 + # We dont want to build a library here
621 + override files:=
622 + endif
623 + ifndef MODULEMODE
624 +
625 + BINMODE=true
626 +  
627 + define stepdown_$$hashref{'name'}
628 + if [ -d "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
629 + cd $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname; \\
630 + \$(MAKE) MODULEMODE=true LatestBuildFile=$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\@; \\
631 + fi
632 + endef
633 +
634 + define stepdown2_$$hashref{'name'}
635 + if [ -d "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
636 + cd $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname; \\
637 + \$(MAKE) MODULEMODE=true LatestBuildFile=$ENV{LOCALTOP}/$ENV{INTwork}/$self{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\*; \\
638 + fi
639 +
640 + endef
641 +
642 + module_$$hashref{'name'}_%:: dummy
643 +        \@\$(stepdown2_$$hashref{'name'})
644 +
645 + $$hashref{'name'}_%:: dummy
646 +        \@\$(stepdown_$$hashref{'name'})
647 +
648 + help module module_debug module_debug_local module_insure module_Insure clean $$hashref{'name'}:: dummy
649 +        \@\$(stepdown_$$hashref{'name'})
650 +
651 + modulefiles+=$$hashref{'file'}
652 + locmodulefiles+=$dirname/$$hashref{'file'}
653 + endif
654 +
655 +
656 + ENDTEXT
657 +
658 +
659 + # the module specifics makefile
660 +        print moduleGNUmakefile "include ".$self->{currentenv}."\n";
661 +        print moduleGNUmakefile "VPATH+=$ENV{LOCALTOP}/$self{path}\n";
662 +
663 + # alias for bin_Insure
664 +        print moduleGNUmakefile <<ENDTEXT;
665 +
666 + module_insure:module_Insure
667 + ifdef MAKETARGET_module_insure
668 + MAKETARGET_$$hashref{name}_Insure=1
669 + endif
670 +
671 + # debuggging target
672 + $$hashref{'name'}_echo_% :: echo_%
673 +
674 + # help targets
675 + help::
676 + \t\@echo  
677 + \t\@echo Targets For $$hashref{'name'}
678 + \t\@echo -------------------------------------
679 + \t\@echo $$hashref{'name'}  - default build
680 + \t\@echo module_$$hashref{'name'}_clean - executable specific cleaning
681 + ENDTEXT
682 +
683 + # Make generic rules for each type
684 +        $targettypes={
685 +                "module" => 'o',
686 +                "module_debug" => 'd',
687 +                "module_debug_local" => 'l_d',
688 +                "module_Insure" => 'Insure'
689 +        };
690 +        #
691 +        foreach $target ( keys %$targettypes ) {
692 +          print moduleGNUmakefile <<ENDTEXT;
693 +
694 + # Type $target specifics
695 + ifdef MAKETARGET_$target
696 + MAKETARGET_$$hashref{name}_$$targettypes{$target}=1
697 + endif
698 + $target ::$$hashref{name}_$$targettypes{$target}
699 +
700 + moduletargets+=$$hashref{name}_$$targettypes{$target}
701 + help::
702 + \t\@echo $$hashref{name}_$$targettypes{$target}
703 + clean::
704 + \t\@if [ -f \$(modulestore)/$$hashref{name}_$$targettypes{$target} ]; then \\
705 + \techo Removing \$(modulestore)/$$hashref{name}; \\
706 + \trm \$(modulestore)/$$hashref{name}_$$targettypes{$target}; \\
707 + \tfi
708 +
709 + ENDTEXT
710 +          ($objectname=$$hashref{file})=~s/\..*/_$$targettypes{$target}\.o/;
711 +          ${"objectname_$$targettypes{$target}"}=$objectname;
712 +          print moduleGNUmakefile "$objectname:$$hashref{name}.dep\n";
713 +        } # end loop
714 +        print moduleGNUmakefile "MDFLAGS= -shared -Wl,-soname,\$\@","\n";
715 +        print moduleGNUmakefile "$$hashref{name}_Insure.so:.psrc\n";
716 +        print moduleGNUmakefile "$$hashref{name}_d.so:$objectname_d\n";
717 +        print moduleGNUmakefile "\t\$(CClinkCmdDebug) \$(MDFLAGS)\n";
718 +        print moduleGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
719 +        print moduleGNUmakefile "$$hashref{name}_l_d.so:$objectname_d\n";
720 +        print moduleGNUmakefile "\t\$(CClinkCmdDebugLocal) \$(MDFLAGS)\n";
721 +        print moduleGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
722 +        print moduleGNUmakefile "$$hashref{name}_Insure.so:$objectname_Insure\n";
723 +        print moduleGNUmakefile "\t\$(CClinkCmdInsure) \$(MDFLAGS)\n";
724 +        print moduleGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
725 +        print moduleGNUmakefile "$$hashref{name}_o.so:$objectname_o\n";
726 +        print moduleGNUmakefile "\t\$(CClinkCmd) \$(MDFLAGS)\n";
727 +        print moduleGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
728 +        print moduleGNUmakefile "$$hashref{name}.dep:$$hashref{file}\n";
729 +        print moduleGNUmakefile "-include $$hashref{name}.dep\n";
730 + print moduleGNUmakefile <<ENDTEXT;
731 + clean::
732 + \t\@if [ -f \$(modulestore)/lib$$hashref{name} ]; then \\
733 + \techo Removing \$(modulestore)/lib$$hashref{name}; \\
734 + \trm \$(modulestore)/lib$$hashref{name}; \\
735 + \tfi
736 +
737 +  
738 + $$hashref{name}_d.so:\$(libslocal_d)
739 + $$hashref{name}_o.so:\$(libslocal)
740 + ifdef MCCABE_DATA_DIR
741 + $$hashref{name}_mccabe.so: \$(libslocal_d) \$(MCCABE_DATA_DIR)/mccabeinstr/instplus.cpp
742 + endif
743 + $$hashref{name}_Insure.so:\$(libslocal_I)
744 + $$hashref{name}_d:$$hashref{name}_d.so
745 +        \@cp $$hashref{name}_d.so \$(modulestore)/lib$$hashref{name}
746 + $$hashref{name}_l_d:$$hashref{name}_l_d.so
747 +        \@cp $$hashref{name}_l_d.so \$(modulestore)/lib$$hashref{name}
748 + $$hashref{name}_Insure:$$hashref{name}_Insure.so
749 +        \@cp $$hashref{name}_Insure.so \$(modulestore)/lib$$hashref{name}_Insure
750 + $$hashref{name}:$$hashref{name}_d.so
751 +        \@mv $$hashref{name}_d.so \$(modulestore)/lib$$hashref{name}
752 + $$hashref{name}_o:$$hashref{name}_o.so
753 +        \@mv $$hashref{name}_o.so \$(modulestore)/lib$$hashref{name}.so
754 + modulefiles+=$$hashref{file}
755 + ENDTEXT
756 +        }
757 +        close moduleGNUmakefile;
758 + }
759 +
760 +
761   sub External_StartTag {
762          my $self=shift;
763          my $name=shift;
764          my $hashref=shift;
765 +
766 +        $self->verbose(">> External_StartTag: NM ".$name." <<");
767          
768          my $tool;
769          if ( $self->{Arch} ) {
# Line 867 | Line 817 | sub Group_start {
817          my $name=shift;
818          my $hashref=shift;
819          
820 +        $self->verbose(">> Group_start: NM ".$name." <<");
821 +        
822          $self->{switch}->checktag($name, $hashref, 'name');
823          if ( $self->{Arch} ) {
824          print GNUmakefile "GROUP_".$$hashref{'name'};
# Line 877 | Line 829 | sub Group_start {
829          }
830   }      
831  
832 < sub Use_start {
833 <        my $self=shift;
834 <        my $name=shift;
835 <        my $hashref=shift;
836 <        my $filename;
837 <        use Utilities::SCRAMUtils;
838 <        
839 <        $self->{switch}->checktag($name, $hashref, "name");
840 <        if ( $self->{Arch} ) {
841 <        if ( exists $$hashref{'group'} ) {
842 <          print GNUmakefile "GROUP_".$$hashref{'group'}."=true\n";
843 <        }
844 <        if ( ! defined $self->{remoteproject} ) {
845 <          $filename=SCRAMUtils::checkfile(
846 <                "/$ENV{INTsrc}/$$hashref{name}/BuildFile");
847 <        }
848 <        else {
849 <          $filename=$self->{remoteproject}."/$$hashref{name}/BuildFile";
850 <        print "trying $filename\n";
851 <          if ( ! -f $filename ) { $filename=""; };
852 <        }
853 <        if ( $filename ne "" ) {
854 <          $self->ParseBuildFile_Export( $filename );
855 <        }
856 <        else {
857 <           $self->{switch}->parseerror("Unable to detect Appropriate ".
858 <                "decription file for <$name name=".$$hashref{name}.">");
859 <        }
860 <        }
832 > sub Use_start
833 >   {
834 >   my $self=shift;
835 >   my $name=shift;
836 >   my $hashref=shift;
837 >   my $filename;
838 >   use Utilities::SCRAMUtils;
839 >
840 >   $self->verbose(">> Use_start: NM ".$name." <<");
841 >  
842 >   $self->{switch}->checktag($name, $hashref, "name");
843 >   if ( $self->{Arch} )
844 >      {
845 >      if ( exists $$hashref{'group'} )
846 >         {
847 >         print GNUmakefile "GROUP_".$$hashref{'group'}."=true\n";
848 >         }
849 >      if ( ! defined $self->{remoteproject} )
850 >         {
851 >         $filename=SCRAMUtils::checkfile("/$ENV{INTsrc}/$$hashref{name}/BuildFile");
852 >         }
853 >      else
854 >         {
855 >         $filename=$self->{remoteproject}."/$$hashref{name}/BuildFile";
856 >         print "Trying $filename\n";
857 >         if ( ! -f $filename ) { $filename=""; };
858 >         }
859 >      if ( $filename ne "" )
860 >         {
861 >         $self->ParseBuildFile_Export( $filename );
862 >         }
863 >      else
864 >         {
865 >         $self->{switch}->parseerror("Unable to detect Appropriate ".
866 >                                     "decription file for <$name name=".$$hashref{name}.">");
867 >         }
868 >      }
869 >   }
870 >
871 > sub CheckBuildFile {
872 >         my $self=shift;
873 >         my $classdir=shift;
874 >         my $ClassName="";
875 >         my $thisfile="$classdir/$buildfile";
876 >        
877 >         if ( -e $ENV{LOCALTOP}."/".$thisfile ) {
878 >            $DefaultBuildfile="$ENV{LOCALTOP}/$thisfile";
879 >            $self->ParseBuildFile($ENV{LOCALTOP}, $classdir, $buildfile);
880 >         }
881 >         elsif ( -e $ENV{RELEASETOP}."/".$thisfile ) {
882 >            $DefaultBuildfile="$ENV{RELEASETOP}/$thisfile";
883 >            $self->ParseBuildFile($ENV{RELEASETOP}, $classdir, $buildfile);
884 >         }
885 >         $self->verbose(">> CheckBuildFile: FN ".$thisfile." CN ".$ClassName." <<");
886 >         return $ClassName;
887   }
888  
889   # List association groups between <AssociateGroup> tags
# Line 916 | Line 894 | sub AssociateGroup {
894          my $string=shift;
895          my $word;
896  
897 +        $self->verbose(">> AssociateGroup: NM ".$name." ST ".$string." <<");
898 +        
899          if ( $self->{Arch} ) {
900          foreach $word ( (split /\s/, $string) ){
901                  chomp $word;
# Line 932 | Line 912 | sub Arch_Start {
912          my $name=shift;
913          my $hashref=shift;
914  
915 +        $self->verbose(">> Arch_Start: NM ".$name." <<");
916 +        
917          $self->{switch}->checktag($name, $hashref,'name');
918          ( ($ENV{SCRAM_ARCH}=~/$$hashref{name}.*/) )? ($self->{Arch}=1)
919                                                  : ($self->{Arch}=0);
# Line 941 | Line 923 | sub Arch_Start {
923   sub Arch_End {
924          my $self=shift;
925          my $name=shift;
926 +        
927 +        $self->verbose(">> Arch_End: NM ".$name." <<");
928  
929 <        pop @{$self->{ARCHBLOCK}};
929 >        pop @{$self->{ARCHBLOCK}};
930          $self->{Arch}=$self->{ARCHBLOCK}[$#{$self->{ARCHBLOCK}}];
931   }
932  
# Line 950 | Line 934 | sub Arch_End {
934   sub _CutBlock {
935      my $self=shift;
936      my $string= shift @_;
937 +
938 +    $self->verbose(">> _CutBlock: ST ".$string." <<");
939 +    
940      @BlockClassA = split /\//, $string;
941   }
942  
# Line 957 | Line 944 | sub OutToMakefile {
944          my $self=shift;
945          my $name=shift;
946          my @vars=@_;
947 +        
948 +        $self->verbose(">> OutToMakefile: <<");
949  
950          if ( $self->{Arch} ) {
951 +          $self->verbose(">> CONT: ".$#vars." lines <<");
952            print GNUmakefile @vars;
953          }
954   }
# Line 966 | Line 956 | sub OutToMakefile {
956   sub OutToScreen {
957          my $name=shift;
958          my @vars=@_;
959 <
959 >        
960          if ( $self->{Arch} ) {
961            print @vars;
962          }
# Line 976 | Line 966 | sub setBlockClassPath {
966          my $name=shift;
967          my $hashref=shift;
968  
969 +        $self->verbose(">> setBlockClassPath: NM ".$name." <<");
970 +        
971          $self->{switch}->checktag($name, $hashref, 'path');
972          $self->{BlockClassPath}=$self->{BlockClassPath}.":".$$hashref{path};
973          $self->_CutBlock($$hashref{path});
# Line 983 | Line 975 | sub setBlockClassPath {
975  
976   sub BlockClassPath {
977          my $self=shift;
978 +
979 +        $self->verbose(">> BlockClassPath: <<");
980 +
981          return $self->{BlockClassPath};
982   }
983  
# Line 991 | Line 986 | sub export_start_export {
986          my $name=shift;
987          my $hashref=shift;
988  
989 +        $self->verbose(">> export_start_export: NM ".$name." <<");
990 +        
991          $self->{switch}->opengroup("__export");
992   }
993  
# Line 999 | Line 996 | sub export_start {
996          my $name=shift;
997          my $hashref=shift;
998  
999 +        $self->verbose(">> export_start: NM ".$name." <<");
1000 +        
1001          $self->{switch}->opengroup("__export");
1002          if ( exists $$hashref{autoexport} ) {
1003            print GNUmakefile "scram_autoexport=".$$hashref{autoexport}."\n";
# Line 1015 | Line 1014 | sub export_start {
1014  
1015   sub export_end_export {
1016          my $self=shift;
1017 +        $self->verbose(">> export_end_export: <<");
1018          $self->{switch}->closegroup("__export");
1019   }
1020  
1021   sub export_end {
1022          my $self=shift;
1023 +        $self->verbose(">> export_end: <<");
1024          $self->{switch}->closegroup("__export");
1025          print GNUmakefile "endif\n";
1026   }
# Line 1027 | Line 1028 | sub export_end {
1028   #
1029   # Standard lib tag
1030   #
1031 < sub lib_start {
1032 <        my $self=shift;
1033 <        my $name=shift;
1034 <        my $hashref=shift;
1035 <
1036 <        $self->{switch}->checktag($name, $hashref, 'name');
1037 <        if ( $self->{Arch} ) {
1038 <           print GNUmakefile "lib+=$$hashref{name}\n";
1039 <        }
1040 < }
1031 > sub lib_start
1032 >   {
1033 >   my $self=shift;
1034 >   my $name=shift;
1035 >   my $hashref=shift;
1036 >  
1037 >   $self->verbose(">> lib_start: NM ".$name." <<");
1038 >  
1039 >   $self->{switch}->checktag($name, $hashref, 'name');
1040 >
1041 >   if ( $self->{Arch} )
1042 >      {
1043 >      print GNUmakefile "lib+=$$hashref{name}\n";
1044 >      }
1045 >   }
1046  
1047   #
1048   # libtype specification
# Line 1045 | Line 1051 | sub LibType_Start {
1051          my $self=shift;
1052          my $name=shift;
1053          my $hashref=shift;
1054 <
1054 >        
1055 >        $self->verbose(">> LibType_Start: NM ".$name." <<");
1056 >        
1057          if ( $self->{Arch} ) {
1058          if ( defined $self->{libtype_conext} ) {
1059            $self->{switch}->parseerror("<$name> tag cannot be specified".
# Line 1078 | Line 1086 | sub LibType_text {
1086          my $self=shift;
1087          my $name=shift;
1088          my $string=shift;
1089 +        $self->verbose(">> LibType_text: NM ".$name." <<");
1090  
1091 <        if ( $self->{Arch} ) {
1091 >        if ( $self->{Arch} ) {
1092            $string=~s/\n/ /g;
1093            print GNUmakefile "libmsg::\n\t\@echo Library info: ";
1094            print GNUmakefile $string;
# Line 1091 | Line 1100 | sub LibType_end {
1100          my $self=shift;
1101          my $name=shift;
1102  
1103 +        $self->verbose(">> LibType_end: NM ".$name." <<");
1104 +
1105          undef $self->{libtype_conext};
1106   }
1107  
# Line 1099 | Line 1110 | sub Environment_start {
1110          my $name=shift;
1111          my $hashref=shift;
1112  
1113 +        $self->verbose(">> Environment_start: NM ".$name." <<");
1114 +        
1115          if ( $self->{Arch} ) {
1116            $self->{envnum}++;
1117  
1118            # open a new Environment File
1119 <          my $envfile="$self->{localtop}/$ENV{INTwork}/$self->{path}/Env_".
1119 >          my $envfile="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/Env_".
1120                  $self->{envnum}.".mk";
1121            use FileHandle;
1122            my $fh=FileHandle->new();
# Line 1113 | Line 1126 | sub Environment_start {
1126  
1127            # include the approprate environment file
1128            if ( $self->{envlevel} == 0 ) {
1129 <             print GNUmakefile "include $self->{localtop}/$ENV{INTwork}/".
1129 >             print GNUmakefile "include $ENV{LOCALTOP}/$ENV{INTwork}/".
1130                  $self->{path}."/BuildFile.mk\n";
1131            }
1132            else {
1133 <             print GNUmakefile "include $self->{localtop}/$ENV{INTwork}/".
1133 >             print GNUmakefile "include $ENV{LOCALTOP}/$ENV{INTwork}/".
1134                  $self->{path}."/Env_".$self->{Envlevels}[$self->{envlevel}].".mk\n";
1135            }
1136            $self->{envlevel}++;
1137            $self->{Envlevels}[$self->{envlevel}]=$self->{envnum};
1138 <          $self->{currentenv}="$self->{localtop}/$ENV{INTwork}/$self->{path}/Env_$self->{envnum}.mk";
1138 >          $self->{currentenv}="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/Env_$self->{envnum}.mk";
1139          }
1140   }
1141  
# Line 1130 | Line 1143 | sub Environment_end {
1143          my $self=shift;
1144          my $fd;
1145  
1146 +        $self->verbose(">> Environment_end: NM ".$name." <<");
1147 +
1148          if ( $self->{Arch} ) {
1149            $self->{envlevel}--;
1150            if ( $self->{envlevel} < 0 ) {
# Line 1142 | Line 1157 | sub Environment_end {
1157            close $fd;
1158            *GNUmakefile=$self->{filehandlestack}[$#{$self->{filehandlestack}}];
1159            if ( $self->{envlevel} < 1 ) {
1160 <            $self->{currentenv}="$self->{localtop}/$ENV{INTwork}/$self->{path}/".
1160 >            $self->{currentenv}="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/".
1161                          "BuildFile.mk";
1162            }
1163            else {
1164              $self->{currentenv}=
1165 <             $self->{localtop}."/$ENV{INTwork}/$self->{path}/Env_".
1165 >             "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/Env_".
1166                  $self->{Envlevels}[$self->{envlevel}];
1167            }
1168          }
1169   }
1170  
1171   sub Store_start {
1172 <        my $self=shift;
1173 <        my $name=shift;
1172 >        my $self=shift;
1173 >        my $name=shift;
1174          my $hashref=shift;
1175  
1176 <        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;
1176 >        $self->verbose(">> Store_start: NM ".$name." <<");
1177  
1178          if ( $self->{Arch} ) {
1179 <          # - default values must always be specified
1180 <          $self->{switch}->checktag( $name, $hashref, 'defaults' );
1181 <          my @blockdirs=split /,/ , $$hashref{'defaults'};
1182 <          $self->{block}->defaultblocks(@blockdirs);
1183 <        }
1179 >          $self->{switch}->checktag( $name, $hashref, 'name' );
1180 >
1181 >          # -- store creation
1182 >          my $dir=$$hashref{'name'};
1183 >          AddDir::adddir($ENV{LOCALTOP}."/".$dir);
1184 >          if ( exists $$hashref{'type'} ) {
1185 >            # -- architecture specific store
1186 >            if ( $$hashref{'type'}=~/^arch/i ) {
1187 >                $dir=$dir."/".$ENV{SCRAM_ARCH};
1188 >                AddDir::adddir($ENV{LOCALTOP}."/".$dir);
1189 >            }
1190 >            else {
1191 >                $self->parseerror("Unknown type in <$name> tag");
1192 >            }
1193 >          }
1194 >
1195 >          # -- set make variables for the store
1196 >          print GNUmakefile "SCRAMSTORENAME_".$$hashref{'name'}.":=".$dir."\n";
1197 >          print GNUmakefile "SCRAMSTORE_".$$hashref{'name'}.":=".
1198 >                                        $ENV{LOCALTOP}."/".$dir."\n";
1199 >          print GNUmakefile "VPATH+=".$ENV{LOCALTOP}
1200 >                        ."/".$dir.":".$ENV{RELEASETOP}."/".$dir."\n";
1201 >        }
1202   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines