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.21 by sashby, Mon Aug 5 11:54:07 2002 UTC vs.
Revision 1.30 by sashby, Tue Feb 27 11:59:44 2007 UTC

# Line 1 | Line 1
1 < # BuildFile
1 > #____________________________________________________________________
2 > # File: BuildFile.pm
3 > #____________________________________________________________________
4 > #  
5 > # Author: Shaun Ashby <Shaun.Ashby@cern.ch>
6 > # Update: 2003-12-03 19:03:15+0100
7 > # Revision: $Id$
8   #
9 < # Interface
10 < # ---------
11 < # new(toolbox)
6 < # ParseBuildFile($base,$path,$file)
7 < # ParseBuildFileExport(filename)
8 < # BlockClassPath() : Return the class path
9 < # ignore()      : return 1 if directory should be ignored 0 otherwise
10 <
9 > # Copyright: 2003 (C) Shaun Ashby
10 > #
11 > #--------------------------------------------------------------------
12   package BuildSystem::BuildFile;
12 use Utilities::Verbose;
13 use ActiveDoc::SimpleDoc;
14 use BuildSystem::ToolBox;
13   require 5.004;
14 < @ISA=qw(Utilities::Verbose);
14 > use Exporter;
15 > use ActiveDoc::SimpleDoc;
16  
17 < BEGIN {
18 < $buildfile="BuildFile";
19 < }
20 <
21 < sub new {
22 <        my $class=shift;
23 <        my $self={};
24 <        bless $self, $class;
25 <        $self->{toolbox}=shift;
26 <        $self->{Arch}=1;
27 <        push @{$self->{ARCHBLOCK}}, $self->{Arch};
28 <        return $self;
29 < }
30 <
31 < sub ignore {
32 <        my $self=shift;
33 <        $self->verbose(">> ignore......<<");
34 <        
35 <        return (defined $self->{ignore})?$self->{ignore}:0;
36 < }
37 <
38 < sub _initswitcher {
39 <        my $self=shift;
40 <        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);
48 <        $switch->addtag($parse,"none",
49 <                                        \&OutToMakefile,$self,
50 <                                        \&OutToMakefile, $self,
51 <                                        "", $self);
52 <        $switch->addtag($parse,"Bin",
53 <                                        \&Bin_start,$self,
54 <                                        \&OutToScreen, $self,
55 <                                        "", $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,
68 <                                        \&LibType_end,$self);
69 <        $switch->addtag($parse,"ConfigurationClass",
70 <                                        \&Class_StartTag,$self,
71 <                                        \&OutToMakefile, $self,
72 <                                        "", $self);
73 <        $switch->addtag($parse,"ClassPath",
74 <                                        \&setBlockClassPath,$self,
75 <                                        \&OutToMakefile, $self,
76 <                                        "", $self);
77 <        $switch->addtag($parse,"AssociateGroup",
78 <                                        "",$self,
79 <                                        \&AssociateGroup,$self,
80 <                                        "", $self);
81 <        $switch->addtag($parse,"Environment",
82 <                                        \&Environment_start,$self,
83 <                                        \&OutToMakefile, $self,
84 <                                        \&Environment_end,$self);
85 <        $switch->addtag($parse,"Export",
86 <                                        \&export_start,$self,
87 <                                        \&OutToMakefile, $self,
88 <                                        \&export_end,$self);
89 <        return $switch;
90 < }
17 > @ISA=qw(Exporter);
18 > @EXPORT_OK=qw( );
19 > #
20 > sub new()
21 >   ###############################################################
22 >   # new                                                         #
23 >   ###############################################################
24 >   # modified : Wed Dec  3 19:03:22 2003 / SFA                   #
25 >   # params   :                                                  #
26 >   #          :                                                  #
27 >   # function :                                                  #
28 >   #          :                                                  #
29 >   ###############################################################
30 >   {
31 >   my $proto=shift;
32 >   my $class=ref($proto) || $proto;
33 >   $self={};
34 >   bless $self,$class;
35 >   $self->{DEPENDENCIES} = {};
36 >   $self->{content} = {};
37 >   $self->{scramdoc}=ActiveDoc::SimpleDoc->new();
38 >   $self->{scramdoc}->newparse("builder",__PACKAGE__,'Subs');
39 >   return $self;
40 >   }
41  
42 < sub _commontags
42 > sub parse()
43     {
44     my $self=shift;
45 <   my $switch=shift;
46 <   my $parse=shift;
45 >   my ($filename)=@_;
46 >   $self->{scramdoc}->filetoparse($filename);
47 >   $self->{scramdoc}->parse("builder");
48 >   # We're done with the SimpleDoc object so delete it:
49 >   delete $self->{scramdoc};
50 >   }
51 >
52 > sub classpath()
53 >   {
54 >   my ($object,$name,%attributes)=@_;
55 >   # The getter part:
56 >   if (ref($object) eq __PACKAGE__)
57 >      {
58 >      return $self->{content}->{CLASSPATH};
59 >      }
60    
61 <   $self->verbose(">> _commontags: SW ".$switch." PARSE ".$parse." <<");
61 >   $self->{nested} == 1 ? push(@{$self->{tagcontent}->{CLASSPATH}}, $attributes{'path'})
62 >      : push(@{$self->{content}->{CLASSPATH}}, $attributes{'path'});
63 >   }
64 >
65 > sub productstore()
66 >   {
67 >   my ($object,$name,%attributes)=@_;
68 >   # The getter part:
69 >   if (ref($object) eq __PACKAGE__)
70 >      {
71 >      # Return an array of ProductStore hashes:
72 >      return $self->{content}->{PRODUCTSTORE};
73 >      }
74    
75 <   $switch->grouptag("Export",$parse);
76 <   $switch->addtag($parse,"Use",
77 <                   \&Use_start,$self,
78 <                   \&OutToMakefile, $self,
79 <                   "", $self);
105 <   $switch->addtag($parse,"Group",
106 <                   \&Group_start,$self,
107 <                   \&OutToMakefile, $self,
108 <                   "", $self);
109 <   $switch->grouptag("Group",$parse);
110 <   $switch->addtag($parse,"External",
111 <                   \&External_StartTag,$self,
112 <                   \&OutToMakefile, $self,
113 <                   "", $self);
114 <   $switch->addtag($parse,"lib",
115 <                   \&lib_start,$self,
116 <                   \&OutToMakefile, $self,"", $self);
117 <   $switch->addtag($parse,"debuglib",
118 <                   \&debuglib_start,$self,
119 <                   \&OutToMakefile, $self,
120 <                   "", $self);
121 <   $switch->addtag($parse,"Architecture",
122 <                   \&Arch_Start,$self,
123 <                   \&OutToMakefile, $self,
124 <                   \&Arch_End,$self);
125 <   $switch->addtag($parse,"INCLUDE_PATH",
126 <                   \&IncludePath_Start,$self,
127 <                   \&OutToMakefile, $self,
128 <                   "",$self);
129 <   return $switch;
130 <   }
131 <
132 < sub ParseBuildFile {
133 <        my $self=shift;
134 <        my $base=shift;
135 <        my $path=shift;
136 <        my $filename=shift @_;
137 <        my $fullfilename;
138 <        if ( $filename!~/^\// ) {
139 <         $fullfilename="$base/$path/$filename";
140 <        }
141 <        else {
142 <         $fullfilename=$filename;
143 <        }
144 <
145 <        $self->verbose(">> ParseBuildFile: FN ".$fullfilename." <<");
146 <        
147 <        $self->{path}=$path;
148 <        $numbins=0;
149 <        $self->{envnum}=0;
150 <        $self->{envlevel}=0;
151 <        $self->{currentenv}="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/".
152 <                                                                "BuildFile.mk";
153 <        $self->{switch}=$self->_initswitcher();
154 <        $self->{switch}->filetoparse($fullfilename);
155 <
156 <        # open a temporary gnumakefile to store output.
157 <        use Utilities::AddDir;
158 <        AddDir::adddir("$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}");
159 <        my $fh=FileHandle->new();
160 <        open ( $fh, ">$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/BuildFile.mk"
161 <          ) or die "Unable to open /$ENV{INTwork}/".$self->{path}."/BuildFile.mk $!\n";
162 <        @{$self->{filehandlestack}}=($fh);
163 <        # make an alias
164 <        *GNUmakefile=$fh;
165 <        if ( -e $ENV{LatestBuildFile} ) {
166 <          print GNUmakefile "include $ENV{LatestBuildFile}\n";
167 <        }
168 <
169 <        $ENV{LatestBuildFile}="$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/BuildFile.mk";
170 <        $self->{switch}->parse("makebuild"); # sort out supported tags
171 <        if ( $numbins > 0 ) {
172 <         print GNUmakefile <<ENDTEXT;
173 < ifndef BINMODE
174 < help::
175 < \t\@echo Generic Binary targets
176 < \t\@echo ----------------------
177 < endif
178 < ENDTEXT
179 <         foreach $target ( keys %$targettypes ) {
180 <         print GNUmakefile <<ENDTEXT;
181 < ifndef BINMODE
182 < help::
183 < \t\@echo $target
184 < endif
185 < ENDTEXT
186 <         }
187 <        }
188 <        close GNUmakefile;
189 < }
190 <
191 < sub ParseBuildFile_Export {
192 <        my $self=shift;
193 <        my $filename=shift;
194 <
195 <        $self->verbose(">> ParseBuildFile_Export: FN ".$filename." <<");
196 <        
197 <        my $bf=BuildSystem::BuildFile->new($self->{toolbox});
198 <        if ( defined $self->{remoteproject} ) {
199 <           $bf->{remoteproject}=$self->{remoteproject};
200 <        }
201 <        $bf->_parseexport($filename);
202 <        undef $bf;
203 < }
204 <
205 < sub _location {
206 <        my $self=shift;
207 <        use File::Basename;
208 <        $self->verbose(">> _location: <<");
209 <        return dirname($self->{switch}->filetoparse());
210 < }
211 <
212 < sub _parseexport {
213 <        my $self=shift;
214 <        my $filename=shift;
215 <        $self->verbose(">> _parseexport: FN ".$filename." <<");
216 <        
217 <        my $switchex=ActiveDoc::SimpleDoc->new();
218 <        $switchex->filetoparse($filename);
219 <        $switchex->newparse("export");
220 <        $switchex->addignoretags("export");
221 <        $switchex->addtag("export","Export",
222 <                                        \&export_start_export,$self,
223 <                                        \&OutToMakefile, $self,
224 <                                        \&export_end_export,$self);
225 <        $self->_commontags($switchex,"export");
226 <        $switchex->allowgroup("__export","export");
227 <        $self->{switch}=$switchex;
228 <        $switchex->parse("export"); # sort out supported tags
229 < }
230 <
231 < sub _pushremoteproject {
232 <        my $self=shift;
233 <        my $path=shift;
234 <
235 <        $self->verbose(">> _pushremoteproject: PATH ".$path." <<");
236 <        
237 <        if ( defined $self->{remoteproject} ) {
238 <          push @{$self->{rpstack}}, $self->{remoteproject};
239 <        }
240 <        $self->{remoteproject}=$path;
241 < }
242 <
243 < sub _popremoteproject {
244 <        my $self=shift;
245 <        $self->verbose(">> _popremoteproject:  <<");
246 <        
247 <        if ( $#{$self->{rpstack}} >=0 ) {
248 <          $self->{remoteproject}=pop @{$self->{rpstack}};
249 <        }
250 <        else {
251 <          undef $self->{remoteproject};
252 <        }
253 < }
254 <
255 < sub _toolmapper {
256 <        my $self=shift;
257 <
258 <        if ( ! defined $self->{mapper} ) {
259 <           require BuildSystem::ToolMapper;
260 <           $self->{mapper}=BuildSystem::ToolMapper->new();
261 <        }
262 <        $self->verbose(">> _toolmapper: TM ".$self->{mapper}."<<");
263 <        return $self->{mapper};
264 < }
265 <
266 <
267 < # ---- Tag routines
268 <
269 < #-- Override a class type with the <ConfigurationClass type=xxx> tag
270 < #   the type tag will pick up a pre-defined class type from project space.
271 <
272 < sub Class_StartTag {
273 <        my $self=shift;
274 <        my $name=shift;
275 <        my $hashref=shift;
276 <
277 <        $self->verbose(">> Classs_StartTag: NM ".$name." <<");
278 <        
279 <        if ( $self->{Arch} ) {
280 <         if ( defined $$hashref{'type'} ) {
281 <                $ClassName=$$hashref{'type'};
282 <         }
283 <        }
284 < }
285 <
286 < sub IncludePath_Start
75 >   $self->{nested} == 1 ? push(@{$self->{tagcontent}->{PRODUCTSTORE}}, \%attributes)
76 >      : push(@{$self->{content}->{PRODUCTSTORE}}, \%attributes) ;
77 >   }
78 >
79 > sub include()
80     {
81     my $self=shift;
82 <   my $name=shift;
83 <   my $hashref=shift;
82 >   # Return an array of required includes:
83 >   return $self->{content}->{INCLUDE};
84 >   }
85 >
86 > sub include_path()
87 >   {
88 >   my ($object,$name,%attributes)=@_;
89 >   $self->{nested} == 1 ? push(@{$self->{tagcontent}->{INCLUDE}}, $attributes{'path'})
90 >      : push(@{$self->{content}->{INCLUDE}}, $attributes{'path'});
91 >   }
92 >
93 > sub use()
94 >   {
95 >   my $object=shift;
96 >   # The getter part:
97 >   if (ref($object) eq __PACKAGE__)
98 >      {
99 >      # Add or return uses (package deps):
100 >      @_ ? push(@{$self->{content}->{USE}},@_)
101 >         : @{$self->{content}->{USE}};
102 >      }
103 >   else
104 >      {
105 >      my ($name,%attributes)=@_;
106 >      $self->{DEPENDENCIES}->{$attributes{'name'}} = 1;
107 >      $self->{nested} == 1 ? push(@{$self->{tagcontent}->{USE}}, $attributes{'name'})
108 >         : push(@{$self->{content}->{USE}}, $attributes{'name'});
109 >      }
110 >   }
111 >
112 > sub architecture()
113 >   {
114 >   my ($object,$name,%attributes)=@_;
115 >   $self->pushlevel(\%attributes); # Set nested to 1;
116 >   }
117 >
118 > sub architecture_()
119 >   {
120 >   $self->{content}->{ARCH}->{$self->{id}->{'name'}}=$self->{tagcontent};
121 >   $self->poplevel();
122 >   }
123 >
124 > sub export()
125 >   {
126 >   $self->pushlevel(); # Set nested to 1;
127 >   }
128 >
129 > sub export_()
130 >   {
131 >   $self->{content}->{EXPORT} = $self->{tagcontent};
132 >   $self->poplevel();
133 >   }
134 >
135 > sub lib()
136 >   {
137 >   my ($object,$name,%attributes)=@_;
138 >   # The getter part:
139 >   if (ref($object) eq __PACKAGE__)
140 >      {
141 >      # Return an array of required libs:
142 >      return $self->{content}->{LIB};      
143 >      }
144    
145 <   $self->verbose(">> IncludePath_Start: NM ".$name." <<");
145 >   my $libname;
146    
147 <   $self->{switch}->checktag( $name, $hashref, 'path');
148 <   if ( $self->{Arch} )
147 >   if (exists($attributes{'position'}))
148 >      {
149 >      if ($attributes{'position'} eq 'first')
150 >         {
151 >         $libname = "F:".$attributes{'name'};
152 >         }
153 >      else
154 >         {
155 >         # There was a position entry but it didn't make sense:
156 >         $libname = $attributes{'name'};
157 >         }
158 >      }
159 >   else
160        {
161 <      print GNUmakefile "INCLUDE+=".$self->_location()."/".$$hashref{'path'}."\n";
161 >      $libname = $attributes{'name'};
162        }
163 +   # We have a libname, add it to the list:
164 +   $self->{nested} == 1 ? push(@{$self->{tagcontent}->{LIB}}, $libname)
165 +      : push(@{$self->{content}->{LIB}}, $libname);
166     }
167  
168 < #
169 < # generic build tag
170 < #
171 < sub Build_start {
172 <        my $self=shift;
173 <        my $name=shift;
174 <        my $hashref=shift;
175 <
176 <        $self->verbose(">> Build_start: NM ".$name." <<");
177 <        
178 <        $self->{switch}->checktag($name,$hashref,'class');
179 <        if ( $self->{Arch} ) {
180 <
314 <          # -- determine the build products name
315 <          my $name;
316 <          if ( exists $$hashref{'name'} ) {
317 <            $name=$$hashref{'name'};
318 <          }
319 <          else {
320 <            $self->{switch}->parseerror("No name specified for build product");
321 <          }
322 <
323 <          # -- check we have a lookup for the class type
324 <          my $mapper=$self->_toolmapper();
325 <          if ( ! $mapper->exists($$hashref{'class'}) ) {
326 <            $self->{switch}->parseerror("Unknown class : ".$$hashref{'class'});
327 <          }
328 <          else {
329 <           my @types=$self->_toolmapper()->types($$hashref{'class'});
330 <           my @deftypes=$self->_toolmapper()->defaulttypes($$hashref{'class'});
331 <
332 <           my $fh=$self->{filehandlestack}[0];
333 <           my @targets=();
334 <
335 <           # -- generate generic targets
336 <           print $fh "ifndef _BuildLink_\n";
337 <           print $fh "# -- Generic targets\n";
338 <           push @targets, $$hashref{'class'};
339 <           foreach $dtype ( @deftypes ) {
340 <            print $fh $$hashref{'class'}."::".$$hashref{'class'}."_".
341 <                                                                $dtype."\n";
342 <           }
343 <           print $fh "\n";
344 <
345 <           # -- generate targets for each type
346 <           foreach $type ( @types ) {
347 <
348 <            # -- generic name for each type
349 <            my $pattern=$$hashref{'class'}."_".$type;
350 <            my $dirname=$$hashref{'class'}."_".$type."_".$name;
351 <            print $fh "# ------ $pattern rules ---------------\n";
352 <            print $fh $$hashref{'class'}."_".$type."::".$$hashref{'class'}.
353 <                                                        "_".$type."_$name\n\n";
354 <
355 <            # -- create a new directory for each type
356 <            push @targets, $pattern;
357 <            my $dirname=$$hashref{'class'}."_".$type."_".$name;
358 <            my $here="$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/".$dirname;
359 <            my $makefile=$here."/BuildFile.mk";
360 <
361 <            # -- create link targets to the directory
362 <            push @targets, $dirname;
363 <            print $fh "# -- Link Targets to $type directories\n";
364 <            print $fh "$dirname: make_$dirname\n";
365 <            print $fh "\t\@cd $here; \\\n";
366 <            print $fh "\t\$(MAKE) LatestBuildFile=$makefile _BuildLink_=1".
367 <                        " workdir=$here ".
368 <                        " -f \$(TOOL_HOME)/basics.mk datestamp \$\@; \n\n";
369 <
370 <            # -- write target to make makefile for each directory
371 <            print $fh "# -- Build target directories\n";
372 <            print $fh "make_$dirname:\n";
373 <            print $fh "\tif [ ! -e \"$makefile\" ]; then \\\n";
374 <            print $fh "\t if [ ! -d \"$here\" ]; then \\\n";
375 <            print $fh "\t  mkdir $here; \\\n";
376 <            print $fh "\t fi;\\\n";
377 <            print $fh "\t cd $dirname; \\\n";
378 <            print $fh "\t echo include ".$self->{currentenv}." > ".
379 <                                                        "$makefile; \\\n";
380 <            print $fh "\t echo VPATH+=$ENV{LOCALTOP}/".$self->{path}.
381 <                                        " >> $makefile; \\\n";
382 <            print $fh "\t echo buildname=$name >> $makefile;\\\n";
383 <            print $fh "\t echo ".$dirname.":".$pattern." >> $makefile;\\\n";
384 <            if ( defined (my @file=$mapper->rulesfile($$hashref{'class'})) ) {
385 <             foreach $f ( @file ) {
386 <              print $fh "\t echo -include $f >> $makefile; \\\n";
387 <             }
388 <            }
389 <            print $fh "\tfi\n";
390 <            print $fh "\n";
168 > sub libtype()
169 >   {
170 >   my ($object,$name,%attributes)=@_;
171 >   # The getter part:
172 >   if (ref($object) eq __PACKAGE__)
173 >      {
174 >      # Return an array of required libs:
175 >      return $self->{content}->{LIBTYPE};      
176 >      }
177 >
178 >   $self->{nested} == 1 ? push(@{$self->{tagcontent}->{LIBTYPE}}, $attributes{'type'})
179 >      : push(@{$self->{content}->{LIBTYPE}}, $attributes{'type'});
180 >   }
181  
182 <            # -- cleaning targets
183 <            push @targets, "clean_$dirname";
184 <            print $fh "# -- cleaning targets\n";
185 <            print $fh "clean::clean_$dirname\n";
186 <            print $fh "clean_".$dirname."::\n";
187 <            print $fh "\t\@echo cleaning $dirname\n";
398 <            print $fh "\t\@if [ -d $here ]; then \\\n";
399 <            print $fh "\tcd $here; \\\n";
400 <            print $fh "\t\$(MAKE) LatestBuildFile=$makefile workdir=".
401 <                        $here." _BuildLink_=1 -f ".
402 <                        "\$(TOOL_HOME)/basics.mk clean; \\\n";
403 <            print $fh "\tfi\n\n";
404 <
405 <
406 <          }
407 <          # -- help targets
408 <          print $fh "helpheader::\n";
409 <          print $fh "\t\@echo Targets available:\n";
410 <          print $fh "\t\@echo ------------------\n\n";
411 <          print $fh "help::helpheader\n";
412 <          foreach $target ( @targets ) {
413 <            print $fh "help::\n";
414 <            print $fh "\t\@echo $target\n"
415 <          }
416 <          print $fh "endif\n";
417 <         } # end else
418 <        }
419 < }
420 <
421 < sub Bin_start {
422 <        my $self=shift;
423 <        my $name=shift;
424 <        my $hashref=shift;
425 <
426 <        my $fileclass;
427 <        my @tools;
428 <        my $tool;
429 <        my $filename;
430 <        my $objectname;
431 <
432 <        $self->verbose(">>          <<");
433 <        
434 <        $self->{switch}->checktag($name,$hashref,'file');
435 <        if ( $self->{Arch} ) {
436 <        if ( ! defined $$hashref{name} ) {
437 <                ($$hashref{name}=$$hashref{file})=~s/\..*//;
438 <        }
439 <        ($filename=$$hashref{file})=~s/\..*//;
440 <
441 <        # Create a new directory for each binary target
442 <        my $dirname="bin_".$$hashref{name};
443 <        AddDir::adddir("$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/$dirname");
444 <        open (binGNUmakefile,
445 <           ">$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/$dirname/BuildFile.mk") or die           "Unable to make $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname/".
446 <           "BuildFile.mk $!\n";
447 <
448 <        # Create the link targets
449 <        $numbins++;
450 <        my $fh=$self->{filehandlestack}[0];
451 <        print $fh <<ENDTEXT;
452 <
453 < # Link Targets to binary directories
454 < ifdef BINMODE
455 < # We dont want to build a library here
456 < override files:=
457 < endif
458 < ifndef BINMODE
459 <
460 < define stepdown_$$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 \$\@; \\
464 < fi
465 < endef
466 <
467 < define stepdown2_$$hashref{'name'}
468 < if [ -d "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
469 < cd $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname; \\
470 < \$(MAKE) BINMODE=true LatestBuildFile=$ENV{LOCALTOP}/$ENV{INTwork}/$self{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\*; \\
471 < fi
472 <
473 < endef
474 <
475 < bin_$$hashref{'name'}_%:: dummy
476 <        \@\$(stepdown2_$$hashref{'name'})
477 <
478 < $$hashref{'name'}_%:: dummy
479 <        \@\$(stepdown_$$hashref{'name'})
480 <
481 < help bin bin_debug bin_debug_local bin_insure bin_Insure clean $$hashref{'name'}:: dummy
482 <        \@\$(stepdown_$$hashref{'name'})
483 <
484 < binfiles+=$$hashref{'file'}
485 < locbinfiles+=$dirname/$$hashref{'file'}
486 < endif
487 <
488 <
489 < ENDTEXT
490 <
491 <
492 < # the binary specifics makefile
493 <        print binGNUmakefile "include ".$self->{currentenv}."\n";
494 <        print binGNUmakefile "VPATH+=$ENV{LOCALTOP}/$self{path}\n";
495 <
496 < # alias for bin_Insure
497 <        print binGNUmakefile <<ENDTEXT;
498 <
499 < bin_insure:bin_Insure
500 < ifdef MAKETARGET_bin_insure
501 < MAKETARGET_$$hashref{name}_Insure=1
502 < endif
503 <
504 < # debuggging target
505 < $$hashref{'name'}_echo_% :: echo_%
506 <
507 < # help targets
508 < help::
509 < \t\@echo Targets For $$hashref{'name'}
510 < \t\@echo -------------------------------------
511 < \t\@echo $$hashref{'name'}  - default build
512 < \t\@echo bin_$$hashref{'name'}_clean - executable specific cleaning
513 < ENDTEXT
514 <
515 < # Make generic rules for each type
516 <        $targettypes={
517 <                "bin" => 'o',
518 <                "bin_debug" => 'd',
519 <                "bin_debug_local" => 'l_d',
520 <                "bin_Insure" => 'Insure'
521 <        };
522 <        #
523 <        foreach $target ( keys %$targettypes ) {
524 <          print binGNUmakefile <<ENDTEXT;
525 <
526 < # Type $target specifics
527 < ifdef MAKETARGET_$target
528 < MAKETARGET_$$hashref{name}_$$targettypes{$target}=1
529 < endif
530 < $target ::$$hashref{name}_$$targettypes{$target}
531 <
532 < bintargets+=$$hashref{name}_$$targettypes{$target}
533 < help::
534 < \t\@echo $$hashref{name}_$$targettypes{$target}
535 < clean::
536 < \t\@if [ -f \$(binarystore)/$$hashref{name}_$$targettypes{$target} ]; then \\
537 < \techo Removing \$(binarystore)/$$hashref{name}; \\
538 < \trm \$(binarystore)/$$hashref{name}_$$targettypes{$target}; \\
539 < \tfi
540 <
541 < ENDTEXT
542 <          ($objectname=$$hashref{file})=~s/\..*/_$$targettypes{$target}\.o/;
543 <          ${"objectname_$$targettypes{$target}"}=$objectname;
544 <          print binGNUmakefile "$objectname:$$hashref{name}.dep\n";
545 <        } # end loop
546 <
547 <        print binGNUmakefile "$$hashref{name}_Insure.exe:.psrc\n";
548 <        print binGNUmakefile "$$hashref{name}_d.exe:$objectname_d\n";
549 <        print binGNUmakefile "\t\$(CClinkCmdDebug)\n";
550 <        print binGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
551 <        print binGNUmakefile "$$hashref{name}_l_d.exe:$objectname_d\n";
552 <        print binGNUmakefile "\t\$(CClinkCmdDebugLocal)\n";
553 <        print binGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
554 <        print binGNUmakefile "$$hashref{name}_Insure.exe:$objectname_Insure\n";
555 <        print binGNUmakefile "\t\$(CClinkCmdInsure)\n";
556 <        print binGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
557 <        print binGNUmakefile "$$hashref{name}_o.exe:$objectname_o\n";
558 <        print binGNUmakefile "\t\$(CClinkCmd)\n";
559 <        print binGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
560 <        print binGNUmakefile "$$hashref{name}.dep:$$hashref{file}\n";
561 <        print binGNUmakefile "-include $$hashref{name}.dep\n";
562 < print binGNUmakefile <<ENDTEXT;
563 < clean::
564 < \t\@if [ -f \$(binarystore)/$$hashref{name} ]; then \\
565 < \techo Removing \$(binarystore)/$$hashref{name}; \\
566 < \trm \$(binarystore)/$$hashref{name}; \\
567 < \tfi
568 <
569 < $$hashref{name}_d.exe:\$(libslocal_d)
570 < $$hashref{name}_o.exe:\$(libslocal)
571 < ifdef MCCABE_DATA_DIR
572 < $$hashref{name}_mccabe.exe: \$(libslocal_d) \$(MCCABE_DATA_DIR)/mccabeinstr/instplus.cpp
573 < endif
574 < $$hashref{name}_Insure.exe:\$(libslocal_I)
575 < $$hashref{name}_d:$$hashref{name}_d.exe
576 <        \@cp $$hashref{name}_d.exe \$(binarystore)/$$hashref{name}
577 < $$hashref{name}_l_d:$$hashref{name}_l_d.exe
578 <        \@cp $$hashref{name}_l_d.exe \$(binarystore)/$$hashref{name}
579 < $$hashref{name}_Insure:$$hashref{name}_Insure.exe
580 <        \@cp $$hashref{name}_Insure.exe \$(binarystore)/$$hashref{name}_Insure
581 < $$hashref{name}:$$hashref{name}_d.exe
582 <        \@mv $$hashref{name}_d.exe \$(binarystore)/$$hashref{name}
583 < $$hashref{name}_o:$$hashref{name}_o.exe
584 <        \@mv $$hashref{name}_o.exe \$(binarystore)/$$hashref{name}
585 < binfiles+=$$hashref{file}
586 < ENDTEXT
587 <        }
588 <        close binGNUmakefile;
589 < }
590 <
591 < sub Module_start {
592 <        my $self=shift;
593 <        my $name=shift;
594 <        my $hashref=shift;
595 <
596 <        my $fileclass;
597 <        my @tools;
598 <        my $tool;
599 <        my $filename;
600 <        my $objectname;
601 <
602 <        $self->verbose(">> In module_start: ".$name." <<");
603 <        
604 <        $self->{switch}->checktag($name,$hashref,'file');
605 <        if ( $self->{Arch} ) {
606 <        if ( ! defined $$hashref{name} ) {
607 <                ($$hashref{name}=$$hashref{file})=~s/\..*//;
608 <        }
609 <        ($filename=$$hashref{file})=~s/\..*//;
610 <
611 <        # Create a new directory for each module target
612 <        my $dirname="module_".$$hashref{name};
613 <        AddDir::adddir("$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/$dirname");
614 <        open (moduleGNUmakefile,
615 <           ">$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/$dirname/BuildFile.mk") or die           "Unable to make $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname/".
616 <           "BuildFile.mk $!\n";
617 <
618 <        # Create the link targets
619 <        $numbins++;
620 <        my $fh=$self->{filehandlestack}[0];
621 <        print $fh <<ENDTEXT;
622 <
623 < # Link Targets to module directories
624 < ifdef MODULEMODE
625 < # We dont want to build a library here
626 < override files:=
627 < endif
628 < ifndef MODULEMODE
182 > sub skip()
183 >   {
184 >   my ($object,$name,%attributes)=@_;
185 >   $self->{nested} == 1 ? $self->{tagcontent}->{SKIPPEDDIRS} = [ 1 ]
186 >      : $self->{content}->{SKIPPEDDIRS} = [ 1 ];
187 >   }
188  
189 < BINMODE=true
190 <  
191 < define stepdown_$$hashref{'name'}
192 < if [ -d "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
193 < cd $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname; \\
194 < \$(MAKE) MODULEMODE=true LatestBuildFile=$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\@; \\
195 < fi
196 < endef
197 <
198 < define stepdown2_$$hashref{'name'}
640 < if [ -d "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
641 < cd $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname; \\
642 < \$(MAKE) MODULEMODE=true LatestBuildFile=$ENV{LOCALTOP}/$ENV{INTwork}/$self{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\*; \\
643 < fi
644 <
645 < endef
646 <
647 < module_$$hashref{'name'}_%:: dummy
648 <        \@\$(stepdown2_$$hashref{'name'})
649 <
650 < $$hashref{'name'}_%:: dummy
651 <        \@\$(stepdown_$$hashref{'name'})
652 <
653 < help module module_debug module_debug_local module_insure module_Insure clean $$hashref{'name'}:: dummy
654 <        \@\$(stepdown_$$hashref{'name'})
655 <
656 < modulefiles+=$$hashref{'file'}
657 < locmodulefiles+=$dirname/$$hashref{'file'}
658 < endif
659 <
660 <
661 < ENDTEXT
662 <
663 <
664 < # the module specifics makefile
665 <        print moduleGNUmakefile "include ".$self->{currentenv}."\n";
666 <        print moduleGNUmakefile "VPATH+=$ENV{LOCALTOP}/$self{path}\n";
667 <
668 < # alias for bin_Insure
669 <        print moduleGNUmakefile <<ENDTEXT;
670 <
671 < module_insure:module_Insure
672 < ifdef MAKETARGET_module_insure
673 < MAKETARGET_$$hashref{name}_Insure=1
674 < endif
675 <
676 < # debuggging target
677 < $$hashref{'name'}_echo_% :: echo_%
678 <
679 < # help targets
680 < help::
681 < \t\@echo  
682 < \t\@echo Targets For $$hashref{'name'}
683 < \t\@echo -------------------------------------
684 < \t\@echo $$hashref{'name'}  - default build
685 < \t\@echo module_$$hashref{'name'}_clean - executable specific cleaning
686 < ENDTEXT
687 <
688 < # Make generic rules for each type
689 <        $targettypes={
690 <                "module" => 'o',
691 <                "module_debug" => 'd',
692 <                "module_debug_local" => 'l_d',
693 <                "module_Insure" => 'Insure'
694 <        };
695 <        #
696 <        foreach $target ( keys %$targettypes ) {
697 <          print moduleGNUmakefile <<ENDTEXT;
698 <
699 < # Type $target specifics
700 < ifdef MAKETARGET_$target
701 < MAKETARGET_$$hashref{name}_$$targettypes{$target}=1
702 < endif
703 < $target ::$$hashref{name}_$$targettypes{$target}
704 <
705 < moduletargets+=$$hashref{name}_$$targettypes{$target}
706 < help::
707 < \t\@echo $$hashref{name}_$$targettypes{$target}
708 < clean::
709 < \t\@if [ -f \$(modulestore)/$$hashref{name}_$$targettypes{$target} ]; then \\
710 < \techo Removing \$(modulestore)/$$hashref{name}; \\
711 < \trm \$(modulestore)/$$hashref{name}_$$targettypes{$target}; \\
712 < \tfi
713 <
714 < ENDTEXT
715 <          ($objectname=$$hashref{file})=~s/\..*/_$$targettypes{$target}\.o/;
716 <          ${"objectname_$$targettypes{$target}"}=$objectname;
717 <          print moduleGNUmakefile "$objectname:$$hashref{name}.dep\n";
718 <        } # end loop
719 <        print moduleGNUmakefile "MDFLAGS= -shared -Wl,-soname,\$\@","\n";
720 <        print moduleGNUmakefile "$$hashref{name}_Insure.so:.psrc\n";
721 <        print moduleGNUmakefile "$$hashref{name}_d.so:$objectname_d\n";
722 <        print moduleGNUmakefile "\t\$(CClinkCmdDebug) \$(MDFLAGS)\n";
723 <        print moduleGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
724 <        print moduleGNUmakefile "$$hashref{name}_l_d.so:$objectname_d\n";
725 <        print moduleGNUmakefile "\t\$(CClinkCmdDebugLocal) \$(MDFLAGS)\n";
726 <        print moduleGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
727 <        print moduleGNUmakefile "$$hashref{name}_Insure.so:$objectname_Insure\n";
728 <        print moduleGNUmakefile "\t\$(CClinkCmdInsure) \$(MDFLAGS)\n";
729 <        print moduleGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
730 <        print moduleGNUmakefile "$$hashref{name}_o.so:$objectname_o\n";
731 <        print moduleGNUmakefile "\t\$(CClinkCmd) \$(MDFLAGS)\n";
732 <        print moduleGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
733 <        print moduleGNUmakefile "$$hashref{name}.dep:$$hashref{file}\n";
734 <        print moduleGNUmakefile "-include $$hashref{name}.dep\n";
735 < print moduleGNUmakefile <<ENDTEXT;
736 < clean::
737 < \t\@if [ -f \$(modulestore)/lib$$hashref{name} ]; then \\
738 < \techo Removing \$(modulestore)/lib$$hashref{name}; \\
739 < \trm \$(modulestore)/lib$$hashref{name}; \\
740 < \tfi
189 > sub skip_message()
190 >   {
191 >   my ($object,$name,@message) = @_;
192 >   # Save any message text between <skip> tags:
193 >   if ($#message > -1)
194 >      {
195 >      $self->{nested} == 1 ? push(@{$self->{tagcontent}->{SKIPPEDDIRS}}, [ @message ])
196 >         : push(@{$self->{content}->{SKIPPEDDIRS}}, [ @message ]);
197 >      }
198 >   }
199  
200 + sub skip_()
201 +   {
202 +   my ($object,$name)=@_;
203 +   }
204 +
205 + sub makefile()
206 +   {
207 +   my ($object,$name,%attributes)=@_;
208 +   # The getter part:
209 +   if (ref($object) eq __PACKAGE__)
210 +      {
211 +      # Return Makefile content:
212 +      return $self->{content}->{MAKEFILE};
213 +      }
214    
215 < $$hashref{name}_d.so:\$(libslocal_d)
216 < $$hashref{name}_o.so:\$(libslocal)
217 < ifdef MCCABE_DATA_DIR
218 < $$hashref{name}_mccabe.so: \$(libslocal_d) \$(MCCABE_DATA_DIR)/mccabeinstr/instplus.cpp
219 < endif
748 < $$hashref{name}_Insure.so:\$(libslocal_I)
749 < $$hashref{name}_d:$$hashref{name}_d.so
750 <        \@cp $$hashref{name}_d.so \$(modulestore)/lib$$hashref{name}
751 < $$hashref{name}_l_d:$$hashref{name}_l_d.so
752 <        \@cp $$hashref{name}_l_d.so \$(modulestore)/lib$$hashref{name}
753 < $$hashref{name}_Insure:$$hashref{name}_Insure.so
754 <        \@cp $$hashref{name}_Insure.so \$(modulestore)/lib$$hashref{name}_Insure
755 < $$hashref{name}:$$hashref{name}_d.so
756 <        \@mv $$hashref{name}_d.so \$(modulestore)/lib$$hashref{name}
757 < $$hashref{name}_o:$$hashref{name}_o.so
758 <        \@mv $$hashref{name}_o.so \$(modulestore)/lib$$hashref{name}.so
759 < modulefiles+=$$hashref{file}
760 < ENDTEXT
761 <        }
762 <        close moduleGNUmakefile;
763 < }
764 <
765 <
766 < sub External_StartTag {
767 <        my $self=shift;
768 <        my $name=shift;
769 <        my $hashref=shift;
770 <
771 <        $self->verbose(">> External_StartTag: NM ".$name." <<");
772 <        
773 <        my $tool;
774 <        if ( $self->{Arch} ) {
775 <        $self->{switch}->checktag($name,$hashref,'ref');
776 <
777 <        # -- oo toolbox stuff
778 <        # - get the appropriate tool object
779 <        $$hashref{'ref'}=~tr[A-Z][a-z];
780 <        if ( ! exists $$hashref{'version'} ) {
781 <         $tool=$self->{toolbox}->gettool($$hashref{'ref'});
782 <        }
783 <        else {
784 <         $tool=$self->{toolbox}->gettool($$hashref{'ref'},$$hashref{'version'});
785 <        }
786 <        if ( ! defined $tool ) {
787 <          $self->{switch}->parseerror("Unknown Tool Specified ("
788 <                                                        .$$hashref{'ref'}.")");
789 <        }
790 <
791 <        # -- old fashioned GNUmakefile stuff
792 <        print GNUmakefile $$hashref{'ref'};
793 <        if ( defined $$hashref{'version'} ) {
794 <                print GNUmakefile "_V_".$$hashref{'version'};
795 <        }
796 <        print GNUmakefile "=true\n";
797 <        
798 <        # -- Sub system also specified?
799 <        if ( exists $$hashref{'use'} ) {
800 <           # -- look for a buildfile
801 <           my @paths=$tool->getfeature("INCLUDE");
802 <           my $file="";
803 <           my ($path,$testfile);
804 <           foreach $path ( @paths ) {
805 <             $testfile=$path."/".$$hashref{'use'}."/BuildFile" ;
806 <             if ( -f $testfile ) {
807 <                $file=$testfile;
808 <                $self->_pushremoteproject($path);
809 <             }
810 <           }
811 <           if ( $file eq "" ) {
812 <             $self->{switch}->parseerror("Unable to find SubSystem $testfile");
813 <           }
814 <           $self->ParseBuildFile_Export($file);
815 <           $self->_popremoteproject();
816 <         }
817 <        }
818 < }      
215 >   # Set our own Char handler so we can collect the content
216 >   # of the Makefile tag:
217 >   $object->setHandlers(Char => \&makefile_content);
218 >   $self->{makefilecontent} = [];
219 >   }
220  
221 < sub Group_start {
222 <        my $self=shift;
223 <        my $name=shift;
224 <        my $hashref=shift;
225 <        
825 <        $self->verbose(">> Group_start: NM ".$name." <<");
826 <        
827 <        $self->{switch}->checktag($name, $hashref, 'name');
828 <        if ( $self->{Arch} ) {
829 <        print GNUmakefile "GROUP_".$$hashref{'name'};
830 <        if ( defined $$hashref{'version'} ) {
831 <                print GNUmakefile "_V_".$$hashref{'version'};
832 <        }
833 <        print GNUmakefile "=true\n";
834 <        }
835 < }      
221 > sub makefile_content()
222 >   {
223 >   my ($object, @strings) = @_;
224 >   push(@{$self->{makefilecontent}},@strings);
225 >   }
226  
227 < sub Use_start
227 > sub makefile_()
228     {
229 <   my $self=shift;
230 <   my $name=shift;
231 <   my $hashref=shift;
232 <   my $filename;
233 <   use Utilities::SCRAMUtils;
229 >   my ($object,$name)=@_;
230 >   $self->{nested} == 1 ? push(@{$self->{tagcontent}->{MAKEFILE}}, join('',@{$self->{makefilecontent}}))
231 >      : push(@{$self->{content}->{MAKEFILE}}, join('',@{$self->{makefilecontent}}));
232 >   delete $self->{makefilecontent};
233 >   # Unset the Char handler to revert to the default behaviour:
234 >   $object->setHandlers(Char => 0);
235 >   }
236 >
237 > sub define_group()
238 >   {
239 >   my ($object,$name,%attributes)=@_;
240 >   $self->pushlevel(\%attributes); # Set nested to 1;
241 >   }
242 >
243 > sub define_group_()
244 >   {
245 >   $self->{content}->{DEFINED_GROUP}->{$self->{id}->{'name'}}=$self->{tagcontent};
246 >   $self->poplevel();
247 >   }
248 >
249 > sub group()
250 >   {
251 >   my $object=shift;
252 >   # The getter part:
253 >   if (ref($object) eq __PACKAGE__)
254 >      {
255 >      # Add or return groups:
256 >      @_ ? push(@{$self->{content}->{GROUP}},@_)
257 >         : @{$self->{content}->{GROUP}};
258 >      }
259 >   else
260 >      {
261 >      my ($name,%attributes)=@_;
262 >      $self->{nested} == 1 ? push(@{$self->{tagcontent}->{GROUP}}, $attributes{'name'})
263 >         : push(@{$self->{content}->{GROUP}}, $attributes{'name'});
264 >      }
265 >   }
266  
267 <   $self->verbose(">> Use_start: NM ".$name." <<");
267 > sub flags()
268 >   {
269 >   my ($object,$name,%attributes)=@_;
270 >   # The getter part:
271 >   if (ref($object) eq __PACKAGE__)
272 >      {
273 >      # Return an array of ProductStore hashes:
274 >      return $self->{content}->{FLAGS};
275 >      }
276    
277 <   $self->{switch}->checktag($name, $hashref, "name");
278 <   if ( $self->{Arch} )
277 >   # Extract the flag name and its value:
278 >   my ($flagname,$flagvaluestring) = each %attributes;
279 >   $flagname =~ tr/[a-z]/[A-Z]/; # Keep flag name uppercase
280 >   chomp($flagvaluestring);
281 >   # Split the value on whitespace so we can push all
282 >   # individual flags into an array:
283 >   my @flagvalues = split(' ',$flagvaluestring);
284 >   # Is current tag within another tag block?
285 >   if ($self->{nested} == 1)
286        {
287 <      if ( exists $$hashref{'group'} )
288 <         {
289 <         print GNUmakefile "GROUP_".$$hashref{'group'}."=true\n";
853 <         }
854 <      if ( ! defined $self->{remoteproject} )
287 >      # Check to see if the current flag name is already stored in the hash. If so,
288 >      # just add the new values to the array of flag values:
289 >      if (exists ($self->{tagcontent}->{FLAGS}->{$flagname}))
290           {
291 <         $filename=SCRAMUtils::checkfile("/$ENV{INTsrc}/$$hashref{name}/BuildFile");
291 >         push(@{$self->{tagcontent}->{FLAGS}->{$flagname}},@flagvalues);
292           }
293        else
294           {
295 <         $filename=$self->{remoteproject}."/$$hashref{name}/BuildFile";
861 <         # Not sure how useful this statement is, so I'll remove it for now:
862 <         # print STDERR "Trying $filename\n";
863 <         if ( ! -f $filename ) { $filename=""; };
295 >         $self->{tagcontent}->{FLAGS}->{$flagname} = [ @flagvalues ];
296           }
297 <      if ( $filename ne "" )
297 >      }
298 >   else
299 >      {
300 >      if (exists ($self->{content}->{FLAGS}->{$flagname}))
301           {
302 <         $self->ParseBuildFile_Export( $filename );
302 >         push(@{$self->{content}->{FLAGS}->{$flagname}},@flagvalues);
303           }
304        else
305           {
306 <         $self->{switch}->parseerror("Unable to detect Appropriate ".
872 <                                     "decription file for <$name name=".$$hashref{name}.">");
306 >         $self->{content}->{FLAGS}->{$flagname} = [ @flagvalues ];
307           }
308        }
309     }
310  
311 < sub CheckBuildFile {
312 <         my $self=shift;
313 <         my $classdir=shift;
314 <         my $ClassName="";
315 <         my $thisfile="$classdir/$buildfile";
316 <        
883 <         if ( -e $ENV{LOCALTOP}."/".$thisfile ) {
884 <            $DefaultBuildfile="$ENV{LOCALTOP}/$thisfile";
885 <            $self->ParseBuildFile($ENV{LOCALTOP}, $classdir, $buildfile);
886 <         }
887 <         elsif ( -e $ENV{RELEASETOP}."/".$thisfile ) {
888 <            $DefaultBuildfile="$ENV{RELEASETOP}/$thisfile";
889 <            $self->ParseBuildFile($ENV{RELEASETOP}, $classdir, $buildfile);
890 <         }
891 <         $self->verbose(">> CheckBuildFile: FN ".$thisfile." CN ".$ClassName." <<");
892 <         return $ClassName;
893 < }
894 <
895 < # List association groups between <AssociateGroup> tags
896 < # seperated by newlines or spaces
897 < sub AssociateGroup {
898 <        my $self=shift;
899 <        my $name=shift;
900 <        my $string=shift;
901 <        my $word;
902 <
903 <        $self->verbose(">> AssociateGroup: NM ".$name." ST ".$string." <<");
904 <        
905 <        if ( $self->{Arch} ) {
906 <        foreach $word ( (split /\s/, $string) ){
907 <                chomp $word;
908 <                next if /^#/;
909 <                if ( $word=~/none/ ) {
910 <                        $self->{ignore}=1;
911 <                }
912 <        }
913 <        }
914 < }
915 <
916 < sub Arch_Start {
917 <        my $self=shift;
918 <        my $name=shift;
919 <        my $hashref=shift;
920 <
921 <        $self->verbose(">> Arch_Start: NM ".$name." <<");
922 <        
923 <        $self->{switch}->checktag($name, $hashref,'name');
924 <        ( ($ENV{SCRAM_ARCH}=~/$$hashref{name}.*/) )? ($self->{Arch}=1)
925 <                                                : ($self->{Arch}=0);
926 <        push @{$self->{ARCHBLOCK}}, $self->{Arch};
927 < }
928 <
929 < sub Arch_End {
930 <        my $self=shift;
931 <        my $name=shift;
932 <        
933 <        $self->verbose(">> Arch_End: NM ".$name." <<");
934 <
935 <        pop @{$self->{ARCHBLOCK}};
936 <        $self->{Arch}=$self->{ARCHBLOCK}[$#{$self->{ARCHBLOCK}}];
937 < }
938 <
939 < # Split up the Class Block String into a useable array
940 < sub _CutBlock {
941 <    my $self=shift;
942 <    my $string= shift @_;
943 <
944 <    $self->verbose(">> _CutBlock: ST ".$string." <<");
945 <    
946 <    @BlockClassA = split /\//, $string;
947 < }
948 <
949 < sub OutToMakefile {
950 <        my $self=shift;
951 <        my $name=shift;
952 <        my @vars=@_;
953 <        
954 <        $self->verbose(">> OutToMakefile: <<");
955 <
956 <        if ( $self->{Arch} ) {
957 <          $self->verbose(">> CONT: ".$#vars." lines <<");
958 <          print GNUmakefile @vars;
959 <        }
960 < }
961 <
962 < sub OutToScreen {
963 <        my $name=shift;
964 <        my @vars=@_;
965 <        
966 <        if ( $self->{Arch} ) {
967 <          print @vars;
968 <        }
969 < }
970 < sub setBlockClassPath {
971 <        my $self=shift;
972 <        my $name=shift;
973 <        my $hashref=shift;
974 <
975 <        $self->verbose(">> setBlockClassPath: NM ".$name." <<");
976 <        
977 <        $self->{switch}->checktag($name, $hashref, 'path');
978 <        $self->{BlockClassPath}=$self->{BlockClassPath}.":".$$hashref{path};
979 <        $self->_CutBlock($$hashref{path});
980 < }
981 <
982 < sub BlockClassPath {
983 <        my $self=shift;
984 <
985 <        $self->verbose(">> BlockClassPath: <<");
986 <
987 <        return $self->{BlockClassPath};
988 < }
989 <
990 < sub export_start_export {
991 <        my $self=shift;
992 <        my $name=shift;
993 <        my $hashref=shift;
994 <
995 <        $self->verbose(">> export_start_export: NM ".$name." <<");
996 <        
997 <        $self->{switch}->opengroup("__export");
998 < }
999 <
1000 < sub export_start {
1001 <        my $self=shift;
1002 <        my $name=shift;
1003 <        my $hashref=shift;
1004 <
1005 <        $self->verbose(">> export_start: NM ".$name." <<");
1006 <        
1007 <        $self->{switch}->opengroup("__export");
1008 <        if ( exists $$hashref{autoexport} ) {
1009 <          print GNUmakefile "scram_autoexport=".$$hashref{autoexport}."\n";
1010 <          if ( $$hashref{autoexport}=~/true/ ) {
1011 <           $self->{switch}->allowgroup("__export","makebuild");
1012 <          }
1013 <          else {
1014 <           $self->{switch}->disallowgroup("__export","makebuild");
1015 <          }
1016 <        }
1017 <        # -- allow default setting from other makefiles
1018 <        print GNUmakefile "ifeq (\$(scram_autoexport),true)\n";
1019 < }
1020 <
1021 < sub export_end_export {
1022 <        my $self=shift;
1023 <        $self->verbose(">> export_end_export: <<");
1024 <        $self->{switch}->closegroup("__export");
1025 < }
1026 <
1027 < sub export_end {
1028 <        my $self=shift;
1029 <        $self->verbose(">> export_end: <<");
1030 <        $self->{switch}->closegroup("__export");
1031 <        print GNUmakefile "endif\n";
1032 < }
311 > sub allflags()
312 >   {
313 >   my $self=shift;
314 >   # Return hash data for flags:
315 >   return $self->{content}->{FLAGS};
316 >   }
317  
318 < #
319 < # Standard lib tag
320 < #
321 < sub lib_start
318 > sub archspecific()
319 >   {
320 >   my $self=shift;
321 >  
322 >   # Check to see if there is arch-dependent data. If so, return it:
323 >   if ((my $nkeys=keys %{$self->{content}->{ARCH}}) > 0)
324 >      {
325 >      while (my ($k,$v) = each %{$self->{content}->{ARCH}})
326 >         {
327 >         if ( $ENV{SCRAM_ARCH} =~ /$k.*/ )
328 >            {
329 >            return $self->{content}->{ARCH}->{$k};
330 >            }
331 >         }
332 >      }
333 >   return "";
334 >   }
335 >
336 > sub bin()
337 >   {
338 >   my ($object,$name,%attributes) = @_;
339 >   $self->pushlevel(\%attributes);# Set nested to 1;
340 >   }
341 >
342 > sub bin_()
343 >   {
344 >   # Need unique name for the binary (always use name of product). Either use "name"
345 >   # given, or use "file" value minus the ending:
346 >   if (exists ($self->{id}->{'name'}))
347 >      {
348 >      $name = $self->{id}->{'name'};
349 >      }
350 >   else
351 >      {
352 >      ($name) = ($self->{id}->{'file'} =~ /(.*)?\..*$/);
353 >      }
354 >
355 >   # Store the data:
356 >   $self->productcollector($name,'bin','BIN');
357 >   $self->poplevel();
358 >   }
359 >
360 > sub module()
361 >   {
362 >   my ($object,$name,%attributes) = @_;
363 >   $self->pushlevel(\%attributes);# Set nested to 1;
364 >   }
365 >
366 > sub module_()
367 >   {
368 >   # Need unique name for the module (always use name of product). Either use "name"
369 >   # given, or use "file" value minus the ending:
370 >   if (exists ($self->{id}->{'name'}))
371 >      {
372 >      $name = $self->{id}->{'name'};
373 >      }
374 >   else
375 >      {
376 >      ($name) = ($self->{id}->{'file'} =~ /(.*)?\..*$/);
377 >      }
378 >
379 >   # Store the data:
380 >   $self->productcollector($name,'mod','MODULE');
381 >   $self->poplevel();
382 >   }
383 >
384 > sub application()
385 >   {
386 >   my ($object,$name,%attributes) = @_;
387 >   $self->pushlevel(\%attributes);# Set nested to 1;
388 >   }
389 >
390 > sub application_()
391 >   {
392 >   # Need unique name for the application (always use name of product). Either use "name"
393 >   # given, or use "file" value minus the ending:
394 >   if (exists ($self->{id}->{'name'}))
395 >      {
396 >      $name = $self->{id}->{'name'};
397 >      }
398 >   else
399 >      {
400 >      ($name) = ($self->{id}->{'file'} =~ /(.*)?\..*$/);
401 >      }
402 >
403 >   # Store the data:
404 >   $self->productcollector($name,'app','APPLICATION');
405 >   $self->poplevel();
406 >   }
407 >
408 > sub library()
409 >   {
410 >   my ($object,$name,%attributes) = @_;
411 >   $self->pushlevel(\%attributes);# Set nested to 1;
412 >   }
413 >
414 > sub library_()
415 >   {
416 >   # Need unique name for the library (always use name of product). Either use "name"
417 >   # given, or use "file" value minus the ending:
418 >   if (exists ($self->{id}->{'name'}))
419 >      {
420 >      $name = $self->{id}->{'name'};
421 >      }
422 >   else
423 >      {
424 >      ($name) = ($self->{id}->{'file'} =~ /(.*)?\..*$/);
425 >      }
426 >
427 >   # Store the data:
428 >   $self->productcollector($name,'lib','LIBRARY');
429 >   $self->poplevel();
430 >   }
431 >
432 > sub plugin()
433 >   {
434 >   my ($object,$name,%attributes) = @_;
435 >   $self->pushlevel(\%attributes);# Set nested to 1;
436 >   }
437 >
438 > sub plugin_()
439 >   {
440 >   # Need unique name for the plugin (always use name of product). Either use "name"
441 >   # given, or use "file" value minus the ending:
442 >   if (exists ($self->{id}->{'name'}))
443 >      {
444 >      $name = $self->{id}->{'name'};
445 >      }
446 >   else
447 >      {
448 >      ($name) = ($self->{id}->{'file'} =~ /(.*)?\..*$/);
449 >      }
450 >
451 >   # Store the data:
452 >   $self->productcollector($name,'plugin','PLUGIN');
453 >   $self->poplevel();
454 >   }
455 >
456 > sub unittest()
457 >   {
458 >   my ($object,$name,%attributes) = @_;
459 >   $self->pushlevel(\%attributes);# Set nested to 1;
460 >   }
461 >
462 > sub unittest_()
463 >   {
464 >   # Need unique name for the unittest (always use name of product). Either use "name"
465 >   # given, or use "file" value minus the ending:
466 >   if (exists ($self->{id}->{'name'}))
467 >      {
468 >      $name = $self->{id}->{'name'};
469 >      }
470 >   else
471 >      {
472 >      ($name) = ($self->{id}->{'file'} =~ /(.*)?\..*$/);
473 >      }
474 >
475 >   # Store the data:
476 >   $self->productcollector($name,'unittest','unittest');
477 >   $self->poplevel();
478 >   }
479 >
480 > sub productcollector()
481     {
482     my $self=shift;
483 <   my $name=shift;
484 <   my $hashref=shift;
483 >   my ($name,$typeshort,$typefull)=@_;
484 >   # Create a new Product object for storage of data:
485 >   use BuildSystem::Product;
486 >   my $product = BuildSystem::Product->new();
487 >   # Store the name:
488 >   $product->name($name);
489 >   $product->type($typeshort);
490 >   # Store the files. Take the BuildFile path as the initial path for
491 >   # expanding source file globs:
492 >   $product->_files($self->{id}->{'file'},[ $self->{scramdoc}->filetoparse() ]);
493 >   # Store the data content:
494 >   $product->_data($self->{tagcontent});
495 >   # And store in a hash (all build products in same place):
496 >   $self->{content}->{BUILDPRODUCTS}->{$typefull}->{$name} = $product;
497 >   }
498 >
499 > sub pushlevel
500 >   {
501 >   my $self = shift;
502 >   my ($info)=@_;
503    
504 <   $self->verbose(">> lib_start: NM ".$name." <<");
504 >   $self->{id} = $info if (defined $info);
505 >   $self->{nested} = 1;
506 >   $self->{tagcontent}={};
507 >   }
508 >
509 > sub poplevel
510 >   {
511 >   my $self = shift;
512 >   delete $self->{id};
513 >   delete $self->{nested};
514 >   delete $self->{tagcontent};
515 >   }
516 >
517 > sub dependencies()
518 >   {
519 >   my $self=shift;
520 >   # Make a copy of the variable so that
521 >   # we don't have a DEPENDENCIES entry in RAWDATA:
522 >   my %DEPS=%{$self->{DEPENDENCIES}};
523 >   delete $self->{DEPENDENCIES};
524 >   return \%DEPS;
525 >   }
526 >
527 > sub skippeddirs()
528 >   {
529 >   my $self=shift;
530 >   my ($here)=@_;
531 >   my $skipped;
532 >
533 >   if ($self->{content}->{SKIPPEDDIRS}->[0] == 1)
534 >      {
535 >      $skipped = [ @{$self->{content}->{SKIPPEDDIRS}} ];
536 >      delete $self->{content}->{SKIPPEDDIRS};
537 >      }
538    
539 <   $self->{switch}->checktag($name, $hashref, 'name');
539 >   delete $self->{content}->{SKIPPEDDIRS};
540 >   return $skipped;
541 >   }
542 >
543 > sub hasexport()
544 >   {
545 >   my $self=shift;
546 >   # Check to see if there is a valid export block:
547 >   my $nkeys = $self->exporteddatatypes();
548 >   $nkeys > 0 ? return 1 : return 0;
549 >   }
550 >
551 > sub has()
552 >   {
553 >   my $self=shift;
554 >   my ($datatype)=@_;  
555 >   (exists ($self->{content}->{$datatype})) ? return 1 : return 0;
556 >   }
557 >
558 > sub exported()
559 >   {
560 >   my $self=shift;
561 >   # Return a hash. Keys are type of data provided:
562 >   return ($self->{content}->{EXPORT});
563 >   }
564 >
565 > sub exporteddatatypes()
566 >   {
567 >   my $self=shift;
568 >   # Return exported data types:
569 >   return keys %{$self->{content}->{EXPORT}};
570 >   }
571  
572 <   if ( $self->{Arch} )
572 > sub defined_group()
573 >   {
574 >   my $self=shift;
575 >
576 >   if (exists($self->{content}->{DEFINED_GROUP}))
577 >      {  
578 >      # Return a list of keys (group names) for defined groups:
579 >      return [ keys %{$self->{content}->{DEFINED_GROUP}} ];
580 >      }
581 >   else
582        {
583 <      print GNUmakefile "lib+=$$hashref{name}\n";
583 >      return 0;
584        }
585     }
586  
587 < # Standard debug lib tag
588 < #
589 < sub debuglib_start
587 > sub dataforgroup()
588 >   {
589 >   my $self=shift;
590 >   my ($groupname)=@_;
591 >   # Return hash containing data for defined group
592 >   # $groupname or return undef:
593 >   return $self->{content}->{DEFINED_GROUP}->{$groupname};
594 >   }
595 >
596 > sub buildproducts()
597 >   {
598 >   my $self=shift;
599 >   # Returns hash of build products and their data:
600 >   return $self->{content}->{BUILDPRODUCTS};
601 >   }
602 >
603 > sub values()
604     {
605     my $self=shift;
606 <   my $name=shift;
607 <   my $hashref=shift;
606 >   my ($type)=@_;
607 >   # Get a list of values from known types
608 >   return $self->{content}->{BUILDPRODUCTS}->{$type};
609 >   }
610 >
611 > sub basic_tags()
612 >   {
613 >   my $self=shift;
614 >   my $datatags=[];
615 >   my $buildtags=[ qw(BIN LIBRARY APPLICATION MODULE PLUGIN BUILDPRODUCTS) ];
616 >   my $skiptags=[ qw(DEFINED_GROUP ARCH EXPORT GROUP USE CLASSPATH) ];
617 >   my $otherskiptags=[ qw( SKIPPEDDIRS ) ];
618 >   my @all_skip_tags;
619    
620 <   $self->verbose(">> debuglib_start: NM ".$name." <<");
1062 <   $self->{switch}->checktag($name, $hashref, 'name');
620 >   push(@all_skip_tags,@$skiptags,@$buildtags,@$otherskiptags);
621  
622 <   if ( $self->{Arch} )
622 >   foreach my $t (keys %{$self->{content}})
623        {
624 <      print GNUmakefile "debuglib+=$$hashref{name}\n";
624 >      push(@$datatags,$t),if (! grep($t eq $_, @all_skip_tags));
625        }
626 +   return @{$datatags};
627     }
628  
629 < #
630 < # libtype specification
631 < #
632 < sub LibType_Start {
633 <        my $self=shift;
634 <        my $name=shift;
635 <        my $hashref=shift;
636 <        
637 <        $self->verbose(">> LibType_Start: NM ".$name." <<");
638 <        
639 <        if ( $self->{Arch} ) {
640 <        if ( defined $self->{libtype_conext} ) {
641 <          $self->{switch}->parseerror("<$name> tag cannot be specified".
642 <                " without a </$name> tag to close previous context");
643 <        }
644 <        else {
645 <        $self->{libtype_conext}=1;
646 <        $self->{switch}->checktag($name, $hashref, 'type');
647 <        
648 <        print GNUmakefile "# Specify Library Type\n";
649 <        print GNUmakefile "DefaultLibsOff=yes\n";
650 <        if ( $$hashref{'type'}=~/^archive/i ) {
651 <          print GNUmakefile "LibArchive=true\n";
652 <        }
653 <        elsif ($$hashref{'type'}=~/debug_archive/i ) {
654 <          print GNUmakefile "LibDebugArchive=true\n";
655 <        }
656 <        elsif ($$hashref{'type'}=~/debug_shared/i ) {
657 <          print GNUmakefile "LibDebugShared=true\n";
658 <        }
659 <        elsif ($$hashref{'type'}=~/shared/i ) {
1101 <          print GNUmakefile 'LibShared=true'."\n";
1102 <        }
1103 <        print GNUmakefile "\n";
1104 <        }
1105 <        }
1106 < }
1107 <
1108 < sub LibType_text {
1109 <        my $self=shift;
1110 <        my $name=shift;
1111 <        my $string=shift;
1112 <        $self->verbose(">> LibType_text: NM ".$name." <<");
1113 <
1114 <        if ( $self->{Arch} ) {
1115 <          $string=~s/\n/ /g;
1116 <          print GNUmakefile "libmsg::\n\t\@echo Library info: ";
1117 <          print GNUmakefile $string;
1118 <          print GNUmakefile "\n";
1119 <        }
1120 < }
1121 <
1122 < sub LibType_end {
1123 <        my $self=shift;
1124 <        my $name=shift;
1125 <
1126 <        $self->verbose(">> LibType_end: NM ".$name." <<");
1127 <
1128 <        undef $self->{libtype_conext};
1129 < }
1130 <
1131 < sub Environment_start {
1132 <        my $self=shift;
1133 <        my $name=shift;
1134 <        my $hashref=shift;
1135 <
1136 <        $self->verbose(">> Environment_start: NM ".$name." <<");
1137 <        
1138 <        if ( $self->{Arch} ) {
1139 <          $self->{envnum}++;
1140 <
1141 <          # open a new Environment File
1142 <          my $envfile="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/Env_".
1143 <                $self->{envnum}.".mk";
1144 <          use FileHandle;
1145 <          my $fh=FileHandle->new();
1146 <          open ($fh,">$envfile") or die "Unable to open file $envfile \n$!\n";
1147 <          push @{$self->{filehandlestack}}, $fh;
1148 <          *GNUmakefile=$fh;
1149 <
1150 <          # include the approprate environment file
1151 <          if ( $self->{envlevel} == 0 ) {
1152 <             print GNUmakefile "include $ENV{LOCALTOP}/$ENV{INTwork}/".
1153 <                $self->{path}."/BuildFile.mk\n";
1154 <          }
1155 <          else {
1156 <             print GNUmakefile "include $ENV{LOCALTOP}/$ENV{INTwork}/".
1157 <                $self->{path}."/Env_".$self->{Envlevels}[$self->{envlevel}].".mk\n";
1158 <          }
1159 <          $self->{envlevel}++;
1160 <          $self->{Envlevels}[$self->{envlevel}]=$self->{envnum};
1161 <          $self->{currentenv}="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/Env_$self->{envnum}.mk";
1162 <        }
1163 < }
1164 <
1165 < sub Environment_end {
1166 <        my $self=shift;
1167 <        my $fd;
1168 <
1169 <        $self->verbose(">> Environment_end: NM ".$name." <<");
1170 <
1171 <        if ( $self->{Arch} ) {
1172 <          $self->{envlevel}--;
1173 <          if ( $self->{envlevel} < 0 ) {
1174 <            print "Too many </Environent> Tags on $self->{switch}->line()\n";
1175 <            exit 1;
1176 <          }
1177 <          close GNUmakefile;
1178 <          # restore the last filehandle
1179 <          $fd=pop @{$self->{filehandlestack}};
1180 <          close $fd;
1181 <          *GNUmakefile=$self->{filehandlestack}[$#{$self->{filehandlestack}}];
1182 <          if ( $self->{envlevel} < 1 ) {
1183 <            $self->{currentenv}="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/".
1184 <                        "BuildFile.mk";
1185 <          }
1186 <          else {
1187 <            $self->{currentenv}=
1188 <             "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/Env_".
1189 <                $self->{Envlevels}[$self->{envlevel}];
1190 <          }
1191 <        }
1192 < }
1193 <
1194 < sub Store_start {
1195 <        my $self=shift;
1196 <        my $name=shift;
1197 <        my $hashref=shift;
1198 <
1199 <        $self->verbose(">> Store_start: NM ".$name." <<");
1200 <
1201 <        if ( $self->{Arch} ) {
1202 <          $self->{switch}->checktag( $name, $hashref, 'name' );
1203 <
1204 <          # -- store creation
1205 <          my $dir=$$hashref{'name'};
1206 <          AddDir::adddir($ENV{LOCALTOP}."/".$dir);
1207 <          if ( exists $$hashref{'type'} ) {
1208 <            # -- architecture specific store
1209 <            if ( $$hashref{'type'}=~/^arch/i ) {
1210 <                $dir=$dir."/".$ENV{SCRAM_ARCH};
1211 <                AddDir::adddir($ENV{LOCALTOP}."/".$dir);
1212 <            }
1213 <            else {
1214 <                $self->parseerror("Unknown type in <$name> tag");
1215 <            }
1216 <          }
1217 <
1218 <          # -- set make variables for the store
1219 <          print GNUmakefile "SCRAMSTORENAME_".$$hashref{'name'}.":=".$dir."\n";
1220 <          print GNUmakefile "SCRAMSTORE_".$$hashref{'name'}.":=".
1221 <                                        $ENV{LOCALTOP}."/".$dir."\n";
1222 <          print GNUmakefile "VPATH+=".$ENV{LOCALTOP}
1223 <                        ."/".$dir.":".$ENV{RELEASETOP}."/".$dir."\n";
1224 <        }
1225 < }
629 > sub clean()
630 >   {
631 >   my $self=shift;
632 >   my (@tags) = @_;
633 >
634 >   # Delete some useless entries:
635 >   delete $self->{makefilecontent};
636 >   delete $self->{simpledoc};
637 >   delete $self->{id};
638 >   delete $self->{tagcontent};
639 >   delete $self->{nested};
640 >
641 >   delete $self->{DEPENDENCIES};
642 >  
643 >   map
644 >      {
645 >      delete $self->{content}->{$_} if (exists($self->{content}->{$_}));
646 >      } @tags;
647 >  
648 >   return $self;
649 >   }
650 >
651 > sub AUTOLOAD()
652 >   {
653 >   my ($xmlparser,$name,%attributes)=@_;
654 >   return if $AUTOLOAD =~ /::DESTROY$/;
655 >   my $name=$AUTOLOAD;
656 >   $name =~ s/.*://;
657 >   }
658 >
659 > 1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines