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.6 by williamc, Fri Sep 15 11:18:21 2000 UTC vs.
Revision 1.28 by sashby, Wed Mar 9 19:28:19 2005 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(ConfigArea)
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 < # classname()   : get/set the associated class
11 < # buildfile()   : get/set BuildFile location
12 <
9 > # Copyright: 2003 (C) Shaun Ashby
10 > #
11 > #--------------------------------------------------------------------
12   package BuildSystem::BuildFile;
14 use ActiveDoc::SimpleDoc;
15 use BuildSystem::ToolBox;
13   require 5.004;
14 + use Exporter;
15 + use BuildSystem::TagUtils;
16 + use BuildSystem::BuildDataUtils;
17 + use ActiveDoc::SimpleDoc;
18  
19 < BEGIN {
20 < $buildfile="BuildFile";
20 < }
21 <
22 < sub new {
23 <        my $class=shift;
24 <        my $self={};
25 <        bless $self, $class;
26 <        $self->{area}=shift;
27 <        $self->{toolbox}=$self->{area}->toolbox();
28 <        $self->{localtop}=$self->{area}->location();
29 <        $self->{Arch}=1;
30 <        push @{$self->{ARCHBLOCK}}, $self->{Arch};
31 <        return $self;
32 < }
33 <
34 < sub buildfile {
35 <        my $self=shift;
36 <        if ( @_ ) {
37 <          $self->{buildfile}=shift;
38 <        }
39 <        return $self->{buildfile};
40 < }
41 <
42 < sub ignore {
43 <        my $self=shift;
44 <        return (defined $self->{ignore})?$self->{ignore}:0;
45 < }
46 <
47 < sub _initswitcher {
48 <        my $self=shift;
49 <        my $switch=ActiveDoc::SimpleDoc->new();
50 <        my $parse="makebuild";
51 <        $switch->newparse($parse);
52 <        $switch->addignoretags($parse);
53 <        $self->_commontags($switch,$parse);
54 <        $switch->addtag($parse,"Build", \&Build_start, $self);
55 <        $switch->addtag($parse,"none",
56 <                                        \&OutToMakefile,$self,
57 <                                        \&OutToMakefile, $self,
58 <                                        "", $self);
59 <        $switch->addtag($parse,"Bin",
60 <                                        \&Bin_start,$self,
61 <                                        \&OutToScreen, $self,
62 <                                        "", $self);
63 <        $switch->addtag($parse,"LibType",
64 <                                        \&LibType_Start,$self,
65 <                                        \&LibType_text, $self,
66 <                                        \&LibType_end,$self);
67 <        $switch->addtag($parse,"ConfigurationClass",
68 <                                        \&Class_StartTag,$self,
69 <                                        \&OutToMakefile, $self,
70 <                                        "", $self);
71 <        $switch->addtag($parse,"ClassPath",
72 <                                        \&setBlockClassPath,$self,
73 <                                        \&OutToMakefile, $self,
74 <                                        "", $self);
75 <        $switch->addtag($parse,"AssociateGroup",
76 <                                        "",$self,
77 <                                        \&AssociateGroup,$self,
78 <                                        "", $self);
79 <        $switch->addtag($parse,"Environment",
80 <                                        \&Environment_start,$self,
81 <                                        \&OutToMakefile, $self,
82 <                                        \&Environment_end,$self);
83 <        $switch->addtag($parse,"Export",
84 <                                        \&export_start,$self,
85 <                                        \&OutToMakefile, $self,
86 <                                        \&export_end,$self);
87 <        return $switch;
88 < }
89 <
90 < sub _commontags {
91 <        my $self=shift;
92 <        my $switch=shift;
93 <        my $parse=shift;
94 <
95 <        $switch->grouptag("Export",$parse);
96 <        $switch->addtag($parse,"Use",\&Use_start,$self,
97 <                                               \&OutToMakefile, $self,
98 <                                                "", $self);
99 <        $switch->addtag($parse,"Group",\&Group_start,$self,
100 <                                               \&OutToMakefile, $self,
101 <                                                "", $self);
102 <        $switch->grouptag("Group",$parse);
103 <        $switch->addtag($parse,"External",
104 <                                        \&External_StartTag,$self,
105 <                                        \&OutToMakefile, $self,
106 <                                        "", $self);
107 <        $switch->addtag($parse,"lib",
108 <                                        \&lib_start,$self,
109 <                                        \&OutToMakefile, $self,
110 <                                        "", $self);
111 <        $switch->addtag($parse,"Architecture",
112 <                                        \&Arch_Start,$self,
113 <                                        \&OutToMakefile, $self,
114 <                                        \&Arch_End,$self);
115 <        $switch->addtag($parse,"INCLUDE_PATH",
116 <                                        \&IncludePath_Start,$self,
117 <                                        \&OutToMakefile, $self,
118 <                                        "",$self);
119 <        return $switch;
120 < }
121 <
122 < sub GenerateMakefile {
123 <        my $self=shift;
124 <        my $infile=shift;
125 <        my $outfile=shift;
126 <
127 <        $self->{switch}=$self->_initswitcher();
128 <        $self->{switch}->filetoparse($infile);
129 <
130 <        # open a temporary gnumakefile to store output.
131 <        my $fh=FileHandle->new();
132 <        open ( $fh, ">$outfile") or die "Unable to open $outfile for output ".
133 <                                                                "$!\n";
134 <        @{$self->{filehandlestack}}=($fh);
135 <
136 <        #  -- make an alias
137 <        *GNUmakefile=$fh;
138 <        if ( -e $ENV{LatestBuildFile} ) {
139 <          print GNUmakefile "include $ENV{LatestBuildFile}\n";
140 <        }
141 <        $ENV{LatestBuildFile}=$outfile;
142 <        $self->{switch}->parse("makebuild"); # sort out supported tags
143 <        close GNUmakefile;
144 < }
145 <
146 < sub ParseBuildFile {
147 <        my $self=shift;
148 <        my $base=shift;
149 <        my $path=shift;
150 <        my $filename=shift @_;
151 <        my $fullfilename;
152 <        if ( $filename!~/^\// ) {
153 <         $fullfilename="$base/$path/$filename";
154 <        }
155 <        else {
156 <         $fullfilename=$filename;
157 <        }
158 <        $self->{path}=$path;
159 <        #print "Processing $fullfilename\n";
160 <        $numbins=0;
161 <        $self->{envnum}=0;
162 <        $self->{envlevel}=0;
163 <        $self->{currentenv}="$self->{localtop}/$ENV{INTwork}/$self->{path}/".
164 <                                                                "BuildFile.mk";
165 <        $self->{switch}=$self->_initswitcher();
166 <        $self->{switch}->filetoparse($fullfilename);
167 <
168 < #       $self->{switch}->{Strict_no_cr}='no';
169 <        #open a temporary gnumakefile to store output.
170 <        use Utilities::AddDir;
171 <        AddDir::adddir("$self->{localtop}/$ENV{INTwork}/$self->{path}");
172 <        my $fh=FileHandle->new();
173 <        open ( $fh, ">$self->{localtop}/$ENV{INTwork}/".$self->{path}."/BuildFile.mk"
174 <          ) or die 'Unable to open /$ENV{INTwork}/".$self->{path}."/BuildFile.mk $!\n';
175 <        @{$self->{filehandlestack}}=($fh);
176 <        # make an alias
177 <        *GNUmakefile=$fh;
178 <        if ( -e $ENV{LatestBuildFile} ) {
179 <          print GNUmakefile "include $ENV{LatestBuildFile}\n";
180 <        }
181 < #       print "writing to :\n".
182 < #               "$self->{localtop}/$ENV{INTwork}/$self->{path}/BuildFile.mk\n";
183 <        $ENV{LatestBuildFile}="$self->{localtop}/$ENV{INTwork}/".$self->{path}."/BuildFile.mk";
184 <        $self->{switch}->parse("makebuild"); # sort out supported tags
185 <        if ( $numbins > 0 ) {
186 <         print GNUmakefile <<ENDTEXT;
187 < ifndef BINMODE
188 < help::
189 < \t\@echo Generic Binary targets
190 < \t\@echo ----------------------
191 < endif
192 < ENDTEXT
193 <         foreach $target ( keys %$targettypes ) {
194 <         print GNUmakefile <<ENDTEXT;
195 < ifndef BINMODE
196 < help::
197 < \t\@echo $target
198 < endif
199 < ENDTEXT
200 <         }
201 <        }
202 <        close GNUmakefile;
203 < }
204 <
205 < sub classname {
206 <        my $self=shift;
207 <        if ( @_ ) {
208 <          $self->{classname}=shift;
209 <        }
210 <        return $self->{classname};
211 < }
212 <
213 < sub ParseBuildFile_Export {
214 <        my $self=shift;
215 <        my $filename=shift;
216 <        my $bf=BuildSystem::BuildFile->new($self->{area});
217 <        if ( defined $self->{remoteproject} ) {
218 <           $bf->{remoteproject}=$self->{remoteproject};
219 <        }
220 <        $bf->_parseexport($filename);
221 <        undef $bf;
222 < }
223 <
224 < sub _location {
225 <        my $self=shift;
226 <        use File::Basename;
227 <
228 <        return dirname($self->{switch}->filetoparse());
229 < }
230 <
231 < sub _parseexport {
232 <        my $self=shift;
233 <        my $filename=shift;
234 <
235 <        my $switchex=ActiveDoc::SimpleDoc->new();
236 <        $switchex->filetoparse($filename);
237 <        $switchex->newparse("export");
238 <        $switchex->addignoretags("export");
239 <        $switchex->addtag("export","Export",
240 <                                        \&export_start_export,$self,
241 <                                        \&OutToMakefile, $self,
242 <                                        \&export_end_export,$self);
243 <        $self->_commontags($switchex,"export");
244 <        $switchex->allowgroup("__export","export");
245 < #       $switchex->{Strict_no_cr}='no';
246 <        $self->{switch}=$switchex;
247 <        $switchex->parse("export"); # sort out supported tags
248 < }
249 <
250 < sub _pushremoteproject {
251 <        my $self=shift;
252 <        my $path=shift;
253 <        
254 <        if ( defined $self->{remoteproject} ) {
255 <          push @{$self->{rpstack}}, $self->{remoteproject};
256 <        }
257 <        $self->{remoteproject}=$path;
258 < }
259 <
260 < sub _popremoteproject {
261 <        my $self=shift;
262 <        if ( $#{$self->{rpstack}} >=0 ) {
263 <          $self->{remoteproject}=pop @{$self->{rpstack}};
264 <        }
265 <        else {
266 <          undef $self->{remoteproject};
267 <        }
268 < }
269 <
270 < sub _toolmapper {
271 <        my $self=shift;
272 <        if ( ! defined $self->{mapper} ) {
273 <           require BuildSystem::ToolMapper;
274 <           $self->{mapper}=BuildSystem::ToolMapper->new();
275 <        }
276 <        return $self->{mapper};
277 < }
278 <
279 <
280 < # ---- Tag routines
281 <
282 < #-- Override a class type with the <ConfigurationClass type=xxx> tag
283 < #   the type tag will pick up a pre-defined class type from project space.
284 <
285 < sub Class_StartTag {
286 <        my $self=shift;
287 <        my $name=shift;
288 <        my $hashref=shift;
289 <        
290 <        if ( $self->{Arch} ) {
291 <         if ( defined $$hashref{'type'} ) {
292 <                $self->classname($$hashref{'type'});
293 <         }
294 <        }
295 < }
296 <
297 < sub IncludePath_Start {
298 <        my $self=shift;
299 <        my $name=shift;
300 <        my $hashref=shift;
301 <
302 <        $self->{switch}->checktag( $name, $hashref, 'path');
303 <        if ( $self->{Arch} ) {
304 <          print GNUmakefile "INCLUDE+=".$self->_location()."/".
305 <                                                $$hashref{'path'}."\n";
306 <        }
307 < }
19 > @ISA=qw(Exporter BuildSystem::BuildDataUtils);
20 > @EXPORT_OK=qw( );
21  
22   #
23 < # generic build tag
24 < #
25 < sub Build_start {
26 <        my $self=shift;
27 <        my $name=shift;
28 <        my $hashref=shift;
29 <
30 <        $self->{switch}->checktag($name,$hashref,'class');
31 <        if ( $self->{Arch} ) {
32 <
33 <          # -- determine the build products name
34 <          my $name;
35 <          if ( exists $$hashref{'name'} ) {
36 <            $name=$$hashref{'name'};
37 <          }
38 <          else {
39 <            $self->{switch}->parseerror("No name specified for build product");
40 <            #$name="\$(buildname)";
41 <          }
42 <
43 <          # -- check we have a lookup for the class type
44 <          my $mapper=$self->_toolmapper();
45 <          if ( ! $mapper->exists($$hashref{'class'}) ) {
46 <            $self->{switch}->parseerror("Unknown class : ".$$hashref{'class'});
47 <          }
48 <          else {
49 <           my @types=$self->_toolmapper()->types($$hashref{'class'});
50 <           my @deftypes=$self->_toolmapper()->defaulttypes($$hashref{'class'});
51 <
52 <           my $fh=$self->{filehandlestack}[0];
53 <           my @targets=();
54 <
55 <           # -- generate generic targets
56 <           print $fh "ifndef _BuildLink_\n";
57 <           print $fh "# -- Generic targets\n";
58 <           push @targets, $$hashref{'class'};
59 <           foreach $dtype ( @deftypes ) {
60 <            print $fh $$hashref{'class'}."::".$$hashref{'class'}."_".
61 <                                                                $dtype."\n";
62 <           }
63 <           print $fh "\n";
64 <
65 <           # -- generate targets for each type
66 <           foreach $type ( @types ) {
67 <
68 <            # -- generic name for each type
69 <            my $pattern=$$hashref{'class'}."_".$type;
70 <            my $dirname=$$hashref{'class'}."_".$type."_".$name;
71 <            print $fh "# ------ $pattern rules ---------------\n";
72 <            print $fh $$hashref{'class'}."_".$type."::".$$hashref{'class'}.
73 <                                                        "_".$type."_$name\n\n";
74 <
75 <            # -- create a new directory for each type
76 <            push @targets, $pattern;
77 <            my $dirname=$$hashref{'class'}."_".$type."_".$name;
78 <            my $here="$self->{localtop}/$ENV{INTwork}/".$self->{path}."/".$dirname;
79 <            my $makefile=$here."/BuildFile.mk";
80 < #           AddDir::adddir($here);
81 <
82 <            # -- create link targets to the directory
83 <            push @targets, $dirname;
84 <            print $fh "# -- Link Targets to $type directories\n";
85 <            print $fh "$dirname: make_$dirname\n";
86 <            print $fh "\t\@cd $here; \\\n";
87 <            print $fh "\t\$(MAKE) LatestBuildFile=$makefile _BuildLink_=1".
88 <                        " workdir=$here ".
89 <                        " -f \$(TOOL_HOME)/basics.mk datestamp \$\@; \n\n";
90 <
91 <            # -- write target to make makefile for each directory
92 <            print $fh "# -- Build target directories\n";
93 <            print $fh "make_$dirname:\n";
94 <            print $fh "\tif [ ! -e \"$makefile\" ]; then \\\n";
95 <            print $fh "\t if [ ! -d \"$here\" ]; then \\\n";
96 <            print $fh "\t  mkdir $here; \\\n";
97 <            print $fh "\t fi;\\\n";
98 <            print $fh "\t cd $dirname; \\\n";
99 <            print $fh "\t echo include ".$self->{currentenv}." > ".
100 <                                                        "$makefile; \\\n";
101 <            print $fh "\t echo VPATH+=$self->{localtop}/".$self->{path}.
102 <                                        " >> $makefile; \\\n";
103 <            print $fh "\t echo buildname=$name >> $makefile;\\\n";
104 <            print $fh "\t echo ".$dirname.":".$pattern." >> $makefile;\\\n";
105 <            if ( defined (my @file=$mapper->rulesfile($$hashref{'class'})) ) {
106 <             foreach $f ( @file ) {
107 <              print $fh "\t echo -include $f >> $makefile; \\\n";
108 <             }
109 <            }
110 <            print $fh "\tfi\n";
111 <            print $fh "\n";
112 < #           print $typefile "$name :\n";
113 < #           print $typefile "\t\$(_quietbuild_)";
114 < #           print $typefile $mapper->template($$hashref{'class'},$type)."\n";
115 < #           print $typefile "\t\$(_quietstamp_)";
116 < #           print $typefile "\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$@.ds \$@ \$^\n";
117 <
118 <            # -- cleaning targets
119 <            push @targets, "clean_$dirname";
120 <            print $fh "# -- cleaning targets\n";
121 <            print $fh "clean::clean_$dirname\n";
122 <            print $fh "clean_".$dirname."::\n";
123 <            print $fh "\t\@echo cleaning $dirname\n";
124 <            print $fh "\t\@if [ -d $here ]; then \\\n";
125 <            print $fh "\tcd $here; \\\n";
126 <            print $fh "\t\$(MAKE) LatestBuildFile=$makefile workdir=".
127 <                        $here." _BuildLink_=1 -f ".
128 <                        "\$(TOOL_HOME)/basics.mk clean; \\\n";
129 <            print $fh "\tfi\n\n";
130 <
131 <
132 <          }
133 <          # -- help targets
134 <          print $fh "helpheader::\n";
135 <          print $fh "\t\@echo Targets available:\n";
136 <          print $fh "\t\@echo ------------------\n\n";
137 <          print $fh "help::helpheader\n";
138 <          foreach $target ( @targets ) {
139 <            print $fh "help::\n";
140 <            print $fh "\t\@echo $target\n"
141 <          }
142 <          print $fh "endif\n";
143 <         } # end else
144 <        }
145 < }
146 <
147 < sub Bin_start {
148 <        my $self=shift;
149 <        my $name=shift;
150 <        my $hashref=shift;
151 <
439 <        my $fileclass;
440 <        my @tools;
441 <        my $tool;
442 <        my $filename;
443 <        my $objectname;
444 <        
445 <        $self->{switch}->checktag($name,$hashref,'file');
446 <        if ( $self->{Arch} ) {
447 <        if ( ! defined $$hashref{name} ) {
448 <                ($$hashref{name}=$$hashref{file})=~s/\..*//;
449 <        }
450 <        ($filename=$$hashref{file})=~s/\..*//;
451 <
452 <        # Create a new directory for each binary target
453 <        my $dirname="bin_".$$hashref{name};
454 <        AddDir::adddir("$self->{localtop}/$ENV{INTwork}/".$self->{path}."/$dirname");
455 <        open (binGNUmakefile,
456 <           ">$self->{localtop}/$ENV{INTwork}/".$self->{path}."/$dirname/BuildFile.mk") or die           "Unable to make $self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname/".
457 <           "BuildFile.mk $!\n";
458 <
459 <        # Create the link targets
460 <        $numbins++;
461 <        my $fh=$self->{filehandlestack}[0];
462 <        print $fh <<ENDTEXT;
463 <
464 < # Link Targets to binary directories
465 < ifdef BINMODE
466 < # We dont want to build a library here
467 < override files:=
468 < endif
469 < ifndef BINMODE
470 <
471 < define stepdown_$$hashref{'name'}
472 < if [ -d "$self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
473 < cd $self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname; \\
474 < \$(MAKE) BINMODE=true LatestBuildFile=$self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\@; \\
475 < fi
476 < endef
477 <
478 < define stepdown2_$$hashref{'name'}
479 < if [ -d "$self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\
480 < cd $self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname; \\
481 < \$(MAKE) BINMODE=true LatestBuildFile=$self->{localtop}/$ENV{INTwork}/$self{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\*; \\
482 < fi
483 <
484 < endef
485 <
486 < bin_$$hashref{'name'}_%:: dummy
487 <        \@\$(stepdown2_$$hashref{'name'})
488 <
489 < $$hashref{'name'}_%:: dummy
490 <        \@\$(stepdown_$$hashref{'name'})
491 <
492 < help bin bin_debug bin_debug_local bin_insure bin_Insure clean $$hashref{'name'}:: dummy
493 <        \@\$(stepdown_$$hashref{'name'})
494 <
495 < binfiles+=$$hashref{'file'}
496 < locbinfiles+=$dirname/$$hashref{'file'}
497 < endif
498 <
499 <
500 < ENDTEXT
501 <
502 <
503 < # the binary specifics makefile
504 <        print binGNUmakefile "include ".$self->{currentenv}."\n";
505 <        print binGNUmakefile "VPATH+=$self->{localtop}/$self{path}\n";
506 <
507 < # alias for bin_Insure
508 <        print binGNUmakefile <<ENDTEXT;
509 <
510 < bin_insure:bin_Insure
511 < ifdef MAKETARGET_bin_insure
512 < MAKETARGET_$$hashref{name}_Insure=1
513 < endif
514 <
515 < # debuggging target
516 < $$hashref{'name'}_echo_% :: echo_%
517 <
518 < # help targets
519 < help::
520 < \t\@echo Targets For $$hashref{'name'}
521 < \t\@echo -------------------------------------
522 < \t\@echo $$hashref{'name'}  - default build
523 < \t\@echo bin_$$hashref{'name'}_clean - executable specific cleaning
524 < ENDTEXT
525 <
526 < # Make generic rules for each type
527 <        $targettypes={
528 <                "bin" => 'o',
529 <                "bin_debug" => 'd',
530 <                "bin_debug_local" => 'l_d',
531 <                "bin_Insure" => 'Insure'
532 <        };
533 <        #
534 <        foreach $target ( keys %$targettypes ) {
535 <          print binGNUmakefile <<ENDTEXT;
536 <
537 < # Type $target specifics
538 < ifdef MAKETARGET_$target
539 < MAKETARGET_$$hashref{name}_$$targettypes{$target}=1
540 < endif
541 < $target ::$$hashref{name}_$$targettypes{$target}
542 <
543 < bintargets+=$$hashref{name}_$$targettypes{$target}
544 < help::
545 < \t\@echo $$hashref{name}_$$targettypes{$target}
546 < clean::
547 < \t\@if [ -f \$(binarystore)/$$hashref{name}_$$targettypes{$target} ]; then \\
548 < \techo Removing \$(binarystore)/$$hashref{name}; \\
549 < \trm \$(binarystore)/$$hashref{name}_$$targettypes{$target}; \\
550 < \tfi
551 <
552 < ENDTEXT
553 <          ($objectname=$$hashref{file})=~s/\..*/_$$targettypes{$target}\.o/;
554 <          ${"objectname_$$targettypes{$target}"}=$objectname;
555 <          print binGNUmakefile "$objectname:$$hashref{name}.dep\n";
556 <        } # end loop
557 <
558 <        print binGNUmakefile "$$hashref{name}_Insure.exe:.psrc\n";
559 <        print binGNUmakefile "$$hashref{name}_d.exe:$objectname_d\n";
560 <        print binGNUmakefile "\t\$(CClinkCmdDebug)\n";
561 <        print binGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
562 <        print binGNUmakefile "$$hashref{name}_l_d.exe:$objectname_d\n";
563 <        print binGNUmakefile "\t\$(CClinkCmdDebugLocal)\n";
564 <        print binGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
565 <        print binGNUmakefile "$$hashref{name}_Insure.exe:$objectname_Insure\n";
566 <        print binGNUmakefile "\t\$(CClinkCmdInsure)\n";
567 <        print binGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
568 <        print binGNUmakefile "$$hashref{name}_o.exe:$objectname_o\n";
569 <        print binGNUmakefile "\t\$(CClinkCmd)\n";
570 <        print binGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n";
571 <        print binGNUmakefile "$$hashref{name}.dep:$$hashref{file}\n";
572 <        print binGNUmakefile "-include $$hashref{name}.dep\n";
573 < print binGNUmakefile <<ENDTEXT;
574 < clean::
575 < \t\@if [ -f \$(binarystore)/$$hashref{name} ]; then \\
576 < \techo Removing \$(binarystore)/$$hashref{name}; \\
577 < \trm \$(binarystore)/$$hashref{name}; \\
578 < \tfi
579 <
580 < $$hashref{name}_d.exe:\$(libslocal_d)
581 < $$hashref{name}_o.exe:\$(libslocal)
582 < ifdef MCCABE_DATA_DIR
583 < $$hashref{name}_mccabe.exe: \$(libslocal_d) \$(MCCABE_DATA_DIR)/mccabeinstr/instplus.cpp
584 < endif
585 < $$hashref{name}_Insure.exe:\$(libslocal_I)
586 < $$hashref{name}_d:$$hashref{name}_d.exe
587 <        \@cp $$hashref{name}_d.exe \$(binarystore)/$$hashref{name}
588 < $$hashref{name}_l_d:$$hashref{name}_l_d.exe
589 <        \@cp $$hashref{name}_l_d.exe \$(binarystore)/$$hashref{name}
590 < $$hashref{name}_Insure:$$hashref{name}_Insure.exe
591 <        \@cp $$hashref{name}_Insure.exe \$(binarystore)/$$hashref{name}_Insure
592 < $$hashref{name}:$$hashref{name}_d.exe
593 <        \@mv $$hashref{name}_d.exe \$(binarystore)/$$hashref{name}
594 < $$hashref{name}_o:$$hashref{name}_o.exe
595 <        \@mv $$hashref{name}_o.exe \$(binarystore)/$$hashref{name}
596 < binfiles+=$$hashref{file}
597 < ENDTEXT
598 <        }
599 <        close binGNUmakefile;
600 < }
601 <
602 < sub External_StartTag {
603 <        my $self=shift;
604 <        my $name=shift;
605 <        my $hashref=shift;
606 <        
607 <        my $tool;
608 <        if ( $self->{Arch} ) {
609 <        $self->{switch}->checktag($name,$hashref,'ref');
610 <
611 <        # -- oo toolbox stuff
612 <        # - get the appropriate tool object
613 <        $$hashref{'ref'}=~tr[A-Z][a-z];
614 <        if ( ! exists $$hashref{'version'} ) {
615 <         $tool=$self->{toolbox}->gettool($$hashref{'ref'});
616 <        }
617 <        else {
618 <         $tool=$self->{toolbox}->gettool($$hashref{'ref'},$$hashref{'version'});
619 <        }
620 <        if ( ! defined $tool ) {
621 <          $self->{switch}->parseerror("Unknown Tool Specified ("
622 <                                                        .$$hashref{'ref'}.")");
623 <        }
624 <
625 <        # -- old fashioned GNUmakefile stuff
626 <        print GNUmakefile $$hashref{'ref'};
627 <        if ( defined $$hashref{'version'} ) {
628 <                print GNUmakefile "_V_".$$hashref{'version'};
629 <        }
630 <        print GNUmakefile "=true\n";
631 <        
632 <        # -- Sub system also specified?
633 <        if ( exists $$hashref{'use'} ) {
634 <           # -- look for a buildfile
635 <           my @paths=$tool->getfeature("INCLUDE");
636 <           my $file="";
637 <           my ($path,$testfile);
638 <           foreach $path ( @paths ) {
639 <             $testfile=$path."/".$$hashref{'use'}."/BuildFile" ;
640 <             if ( -f $testfile ) {
641 <                $file=$testfile;
642 <                $self->_pushremoteproject($path);
643 <             }
644 <           }
645 <           if ( $file eq "" ) {
646 <             $self->{switch}->parseerror("Unable to find SubSystem $testfile");
647 <           }
648 <           $self->ParseBuildFile_Export($file);
649 <           $self->_popremoteproject();
650 <         }
651 <        }
652 < }      
653 <
654 < sub Group_start {
655 <        my $self=shift;
656 <        my $name=shift;
657 <        my $hashref=shift;
658 <        
659 <        $self->{switch}->checktag($name, $hashref, 'name');
660 <        if ( $self->{Arch} ) {
661 <        print GNUmakefile "GROUP_".$$hashref{'name'};
662 <        if ( defined $$hashref{'version'} ) {
663 <                print GNUmakefile "_V_".$$hashref{'version'};
664 <        }
665 <        print GNUmakefile "=true\n";
666 <        }
667 < }      
668 <
669 < sub Use_start {
670 <        my $self=shift;
671 <        my $name=shift;
672 <        my $hashref=shift;
673 <        my $filename;
674 <        use Utilities::SCRAMUtils;
675 <        
676 <        $self->{switch}->checktag($name, $hashref, "name");
677 <        if ( $self->{Arch} ) {
678 <        if ( exists $$hashref{'group'} ) {
679 <          print GNUmakefile "GROUP_".$$hashref{'group'}."=true\n";
680 <        }
681 <        if ( ! defined $self->{remoteproject} ) {
682 <          $filename=SCRAMUtils::checkfile(
683 <                "/$ENV{INTsrc}/$$hashref{name}/BuildFile");
684 <        }
685 <        else {
686 <          $filename=$self->{remoteproject}."/$$hashref{name}/BuildFile";
687 <        print "trying $filename\n";
688 <          if ( ! -f $filename ) { $filename=""; };
689 <        }
690 <        if ( $filename ne "" ) {
691 <          $self->ParseBuildFile_Export( $filename );
692 <        }
693 <        else {
694 <           $self->{switch}->parseerror("Unable to detect Appropriate ".
695 <                "decription file for <$name name=".$$hashref{name}.">");
696 <        }
697 <        }
698 < }
699 <
700 < # List association groups between <AssociateGroup> tags
701 < # seperated by newlines or spaces
702 < sub AssociateGroup {
703 <        my $self=shift;
704 <        my $name=shift;
705 <        my $string=shift;
706 <        my $word;
707 <
708 <        if ( $self->{Arch} ) {
709 <        foreach $word ( (split /\s/, $string) ){
710 <                chomp $word;
711 <                next if /^#/;
712 <                if ( $word=~/none/ ) {
713 <                        $self->{ignore}=1;
714 <                }
715 <        }
716 <        }
717 < }
718 <
719 < sub Arch_Start {
720 <        my $self=shift;
721 <        my $name=shift;
722 <        my $hashref=shift;
723 <
724 <        $self->{switch}->checktag($name, $hashref,'name');
725 <        ( ($ENV{SCRAM_ARCH}=~/$$hashref{name}.*/) )? ($self->{Arch}=1)
726 <                                                : ($self->{Arch}=0);
727 <        push @{$self->{ARCHBLOCK}}, $self->{Arch};
728 < }
729 <
730 < sub Arch_End {
731 <        my $self=shift;
732 <        my $name=shift;
733 <
734 <        pop @{$self->{ARCHBLOCK}};
735 <        $self->{Arch}=$self->{ARCHBLOCK}[$#{$self->{ARCHBLOCK}}];
736 < }
737 <
738 < # Split up the Class Block String into a useable array
739 < sub _CutBlock {
740 <    my $self=shift;
741 <    my $string= shift @_;
742 <    @BlockClassA = split /\//, $string;
743 < }
744 <
745 < sub OutToMakefile {
746 <        my $self=shift;
747 <        my $name=shift;
748 <        my @vars=@_;
749 <
750 <        if ( $self->{Arch} ) {
751 <          print GNUmakefile @vars;
752 <        }
753 < }
754 <
755 < sub OutToScreen {
756 <        my $name=shift;
757 <        my @vars=@_;
758 <
759 <        if ( $self->{Arch} ) {
760 <          print @vars;
761 <        }
762 < }
763 < sub setBlockClassPath {
764 <        my $self=shift;
765 <        my $name=shift;
766 <        my $hashref=shift;
767 <
768 <        $self->{switch}->checktag($name, $hashref, 'path');
769 <        $self->{BlockClassPath}=$self->{BlockClassPath}.":".$$hashref{path};
770 <        $self->_CutBlock($$hashref{path});
771 < }
772 <
773 < sub BlockClassPath {
774 <        my $self=shift;
775 <        return $self->{BlockClassPath};
776 < }
777 <
778 < sub export_start_export {
779 <        my $self=shift;
780 <        my $name=shift;
781 <        my $hashref=shift;
782 <
783 <        $self->{switch}->opengroup("__export");
784 < }
785 <
786 < sub export_start {
787 <        my $self=shift;
788 <        my $name=shift;
789 <        my $hashref=shift;
790 <
791 <        $self->{switch}->opengroup("__export");
792 <        if ( exists $$hashref{autoexport} ) {
793 <          print GNUmakefile "scram_autoexport=".$$hashref{autoexport}."\n";
794 <          if ( $$hashref{autoexport}=~/true/ ) {
795 <           $self->{switch}->allowgroup("__export","makebuild");
796 <          }
797 <          else {
798 <           $self->{switch}->disallowgroup("__export","makebuild");
799 <          }
800 <        }
801 <        # -- allow default setting from other makefiles
802 <        print GNUmakefile "ifeq (\$(scram_autoexport),true)\n";
803 < }
804 <
805 < sub export_end_export {
806 <        my $self=shift;
807 <        $self->{switch}->closegroup("__export");
808 < }
809 <
810 < sub export_end {
811 <        my $self=shift;
812 <        $self->{switch}->closegroup("__export");
813 <        print GNUmakefile "endif\n";
814 < }
23 > sub new()
24 >   ###############################################################
25 >   # new                                                         #
26 >   ###############################################################
27 >   # modified : Wed Dec  3 19:03:22 2003 / SFA                   #
28 >   # params   :                                                  #
29 >   #          :                                                  #
30 >   # function :                                                  #
31 >   #          :                                                  #
32 >   ###############################################################
33 >   {
34 >   my $proto=shift;
35 >   my $class=ref($proto) || $proto;
36 >   my $self={};
37 >  
38 >   bless $self,$class;
39 >
40 >   $self->{DEPENDENCIES} = {};
41 >   $self->{content} = {};
42 >   return $self;
43 >   }
44 >
45 > sub _initparser()
46 >   {
47 >   my $self=shift;
48 >
49 >   $self->{simpledoc}=ActiveDoc::SimpleDoc->new();
50 >   $self->{simpledoc}->newparse("builder");
51 >   $self->{simpledoc}->addignoretags("builder");
52 >
53 >   # For blank lines do nothing:
54 >   $self->{simpledoc}->addtag("builder","none",
55 >                              "", $self,
56 >                              "", $self,
57 >                              "", $self);
58 >  
59 >   # Define the tags to be used in this class:
60 >   $self->{simpledoc}->addtag("builder","classpath",
61 >                              \&BuildSystem::TagUtils::classpathtagOpen, $self,
62 >                              "", $self,
63 >                              "", $self);
64 >
65 >   $self->{simpledoc}->addtag("builder","productstore",
66 >                              \&BuildSystem::TagUtils::productstoretagOpen, $self,
67 >                              "", $self,
68 >                              "", $self);
69 >
70 >   $self->{simpledoc}->addtag("builder","architecture",
71 >                              \&BuildSystem::TagUtils::archtagOpen, $self,
72 >                              "", $self,
73 >                              \&BuildSystem::TagUtils::archtagClose, $self);
74 >
75 >   $self->{simpledoc}->addtag("builder","include_path",
76 >                              \&BuildSystem::TagUtils::includetagOpen, $self,
77 >                              "", $self,
78 >                              "", $self);
79 >  
80 >   $self->{simpledoc}->addtag("builder","define_group",
81 >                              \&BuildSystem::TagUtils::groupdeftagOpen, $self,
82 >                              "", $self,
83 >                              \&BuildSystem::TagUtils::groupdeftagClose, $self);
84 >  
85 >   $self->{simpledoc}->addtag("builder","group",
86 >                              \&BuildSystem::TagUtils::grouptagOpen, $self,
87 >                              "", $self,
88 >                              "", $self);
89 >  
90 >   $self->{simpledoc}->addtag("builder","lib",
91 >                              \&BuildSystem::TagUtils::libtagOpen, $self,
92 >                              "", $self,
93 >                              "", $self);
94 >
95 >   $self->{simpledoc}->addtag("builder","export",
96 >                              \&BuildSystem::TagUtils::exporttagOpen, $self,
97 >                              "", $self,
98 >                              \&BuildSystem::TagUtils::exporttagClose, $self);
99 >
100 >   $self->{simpledoc}->addtag("builder","use",
101 >                              \&BuildSystem::TagUtils::usetagOpen, $self,
102 >                              "", $self,
103 >                              "", $self);
104 >  
105 >   $self->{simpledoc}->addtag("builder","libtype",
106 >                              \&BuildSystem::TagUtils::libtypetagOpen, $self,
107 >                              "", $self,
108 >                              "", $self);
109 >
110 >   $self->{simpledoc}->addtag("builder","skip",
111 >                              \&BuildSystem::TagUtils::skiptagOpen, $self,
112 >                              \&BuildSystem::TagUtils::skiptagMessage, $self,
113 >                              \&BuildSystem::TagUtils::skiptagClose, $self);
114 >
115 >   $self->{simpledoc}->addtag("builder","makefile",
116 >                              \&BuildSystem::TagUtils::makefiletagOpen, $self,
117 >                              \&BuildSystem::TagUtils::makefiletagContent, $self,
118 >                              \&BuildSystem::TagUtils::makefiletagClose, $self);
119 >
120 >   $self->{simpledoc}->addtag("builder","flags",
121 >                              \&BuildSystem::TagUtils::flagstagOpen, $self,
122 >                              "", $self,
123 >                              "", $self);
124 >  
125 >   $self->{simpledoc}->addtag("builder","bin",
126 >                              \&BuildSystem::TagUtils::binarytagOpen, $self,
127 >                              "", $self,
128 >                              \&BuildSystem::TagUtils::binarytagClose, $self);
129 >  
130 >   $self->{simpledoc}->addtag("builder","module",
131 >                              \&BuildSystem::TagUtils::moduletagOpen, $self,
132 >                              "", $self,
133 >                              \&BuildSystem::TagUtils::moduletagClose, $self);
134 >  
135 >   $self->{simpledoc}->addtag("builder","application",
136 >                              \&BuildSystem::TagUtils::applicationtagOpen, $self,
137 >                              "", $self,
138 >                              \&BuildSystem::TagUtils::applicationtagClose, $self);
139 >
140 >   $self->{simpledoc}->addtag("builder","library",
141 >                              \&BuildSystem::TagUtils::librarytagOpen, $self,
142 >                              "", $self,
143 >                              \&BuildSystem::TagUtils::librarytagClose, $self);
144 >
145 > #    $self->{simpledoc}->addtag("builder"," ",
146 > #                             \&BuildSystem::TagUtils::  ,$self,
147 > #                             \&BuildSystem::TagUtils::  ,$self,
148 > #                             \&BuildSystem::TagUtils::  ,$self);
149 >
150 >   return $self->{simpledoc};
151 >   }
152  
153 < #
154 < # Standard lib tag
155 < #
156 < sub lib_start {
157 <        my $self=shift;
158 <        my $name=shift;
159 <        my $hashref=shift;
160 <
161 <        $self->{switch}->checktag($name, $hashref, 'name');
162 <        if ( $self->{Arch} ) {
163 <           print GNUmakefile "lib+=$$hashref{name}\n";
164 <        }
165 < }
153 > sub parse()
154 >   {
155 >   my $self=shift;
156 >   my ($filename)=@_;
157 >
158 >   $self->{simpledoc}=$self->_initparser();
159 >   $self->{simpledoc}->filetoparse($filename);
160 >   $self->{simpledoc}->parse("builder");
161 >  
162 >   # We're done with the SimpleDoc object so delete it:
163 >   delete $self->{simpledoc};
164 >   }
165 >
166 > sub _initbranchparser()
167 >   {
168 >   my $self=shift;
169 >
170 >   $self->{simpledoc}=ActiveDoc::SimpleDoc->new();
171 >   $self->{simpledoc}->newparse("branchbuilder");
172 >   $self->{simpledoc}->addignoretags("branchbuilder");
173 >
174 >   # For blank lines do nothing:
175 >   $self->{simpledoc}->addtag("branchbuilder","none",
176 >                              "", $self,
177 >                              "", $self,
178 >                              "", $self);
179 >  
180 >   # Define the tags to be used in this class:
181 >   $self->{simpledoc}->addtag("branchbuilder","productstore",
182 >                              \&BuildSystem::TagUtils::productstoretagOpen, $self,
183 >                              "", $self,
184 >                              "", $self);
185 >  
186 >   $self->{simpledoc}->addtag("branchbuilder","architecture",
187 >                              \&BuildSystem::TagUtils::archtagOpen, $self,
188 >                              "", $self,
189 >                              \&BuildSystem::TagUtils::archtagClose, $self);
190 >
191 >   $self->{simpledoc}->addtag("branchbuilder","include_path",
192 >                              \&BuildSystem::TagUtils::includetagOpen, $self,
193 >                              "", $self,
194 >                              "", $self);
195 >  
196 >   $self->{simpledoc}->addtag("branchbuilder","export",
197 >                              \&BuildSystem::TagUtils::exporttagOpen, $self,
198 >                              "", $self,
199 >                              \&BuildSystem::TagUtils::exporttagClose, $self);
200 >
201 >   $self->{simpledoc}->addtag("branchbuilder","define_group",
202 >                              \&BuildSystem::TagUtils::groupdeftagOpen, $self,
203 >                              "", $self,
204 >                              \&BuildSystem::TagUtils::groupdeftagClose, $self);
205 >  
206 >   $self->{simpledoc}->addtag("branchbuilder","group",
207 >                              \&BuildSystem::TagUtils::grouptagOpen, $self,
208 >                              "", $self,
209 >                              "", $self);
210 >  
211 >   $self->{simpledoc}->addtag("branchbuilder","lib",
212 >                              \&BuildSystem::TagUtils::libtagOpen, $self,
213 >                              "", $self,
214 >                              "", $self);
215 >
216 >   $self->{simpledoc}->addtag("branchbuilder","use",
217 >                              \&BuildSystem::TagUtils::usetagOpen, $self,
218 >                              "", $self,
219 >                              "", $self);
220 >  
221 >   $self->{simpledoc}->addtag("branchbuilder","libtype",
222 >                              \&BuildSystem::TagUtils::libtypetagOpen, $self,
223 >                              "", $self,
224 >                              "", $self);
225 >  
226 >   $self->{simpledoc}->addtag("branchbuilder","makefile",
227 >                              \&BuildSystem::TagUtils::makefiletagOpen, $self,
228 >                              \&BuildSystem::TagUtils::makefiletagContent, $self,
229 >                              \&BuildSystem::TagUtils::makefiletagClose, $self);
230 >
231 >   $self->{simpledoc}->addtag("branchbuilder","flags",
232 >                              \&BuildSystem::TagUtils::flagstagOpen, $self,
233 >                              "", $self,
234 >                              "", $self);
235 >  
236 >   $self->{simpledoc}->addtag("branchbuilder","bin",
237 >                              \&BuildSystem::TagUtils::binarytagOpen, $self,
238 >                              "", $self,
239 >                              \&BuildSystem::TagUtils::binarytagClose, $self);
240 >  
241 >   $self->{simpledoc}->addtag("branchbuilder","module",
242 >                              \&BuildSystem::TagUtils::moduletagOpen, $self,
243 >                              "", $self,
244 >                              \&BuildSystem::TagUtils::moduletagClose, $self);
245 >  
246 >   $self->{simpledoc}->addtag("branchbuilder","application",
247 >                              \&BuildSystem::TagUtils::applicationtagOpen, $self,
248 >                              "", $self,
249 >                              \&BuildSystem::TagUtils::applicationtagClose, $self);
250 >
251 >   $self->{simpledoc}->addtag("branchbuilder","library",
252 >                              \&BuildSystem::TagUtils::librarytagOpen, $self,
253 >                              "", $self,
254 >                              \&BuildSystem::TagUtils::librarytagClose, $self);
255 >  
256 >   return $self->{simpledoc};
257 >   }
258 >
259 > sub parsebranchfiles()
260 >   {
261 >   my $self=shift;
262 >   my ($filenames)=@_; # array ref
263 >   # List of buildfiles:
264 >   $self->{localpaths}=$filenames;
265 >   $self->{simpledoc}=$self->_initbranchparser();
266 >   # We iterate over an array of files to be read in turn: all
267 >   # build data will be stored in the same BuildFile object:
268 >   $self->{simpledoc}->parsefilelist("branchbuilder",$filenames);
269 >   # We're done with the SimpleDoc object so delete it:
270 >   delete $self->{simpledoc};
271 >   }
272 >
273 > sub productcollector()
274 >   {
275 >   my $self=shift;
276 >   my ($name,$typeshort,$typefull)=@_;
277 >   # Create a new Product object for storage of data:
278 >   use BuildSystem::Product;
279 >   my $product = BuildSystem::Product->new();
280 >   # Store the name:
281 >   $product->name($name);
282 >   $product->type($typeshort);
283 >   # Store the files:
284 >   $product->_files($self->{id}->{'file'},$self->{localpaths});
285 >   # Store the data content:
286 >   $product->_data($self->{tagcontent});
287 >   # And store in a hash (all build products in same place):
288 >   $self->{content}->{BUILDPRODUCTS}->{$typefull}->{$name} = $product;
289 >   }
290 >
291 > sub pushlevel
292 >   {
293 >   my $self = shift;
294 >   my ($info)=@_;
295 >  
296 >   $self->{id} = $info if (defined $info);
297 >   $self->{nested} = 1;
298 >   $self->{tagcontent}={};
299 >   }
300 >
301 > sub poplevel
302 >   {
303 >   my $self = shift;
304 >   delete $self->{id};
305 >   delete $self->{nested};
306 >   delete $self->{tagcontent};
307 >   }
308 >
309 > sub dependencies()
310 >   {
311 >   my $self=shift;
312 >   # Make a copy of the variable so that
313 >   # we don't have a DEPENDENCIES entry in RAWDATA:
314 >   my %DEPS=%{$self->{DEPENDENCIES}};
315 >   delete $self->{DEPENDENCIES};
316 >   return \%DEPS;
317 >   }
318 >
319 > sub skippeddirs()
320 >   {
321 >   my $self=shift;
322 >   my ($here)=@_;
323 >   my $skipped;
324 >
325 >   if ($self->{content}->{SKIPPEDDIRS}->[0] == 1)
326 >      {
327 >      $skipped = [ @{$self->{content}->{SKIPPEDDIRS}} ];
328 >      delete $self->{content}->{SKIPPEDDIRS};
329 >      }
330 >  
331 >   delete $self->{content}->{SKIPPEDDIRS};
332 >   return $skipped;
333 >   }
334  
335   #
336 < # libtype specification
336 > # All data access methods are inherited from BuildDataUtils.
337   #
338 < sub LibType_Start {
834 <        my $self=shift;
835 <        my $name=shift;
836 <        my $hashref=shift;
837 <
838 <        if ( $self->{Arch} ) {
839 <        if ( defined $self->{libtype_conext} ) {
840 <          $self->{switch}->parseerror("<$name> tag cannot be specified".
841 <                " without a </$name> tag to close previous context");
842 <        }
843 <        else {
844 <        $self->{libtype_conext}=1;
845 <        $self->{switch}->checktag($name, $hashref, 'type');
846 <        
847 <        print GNUmakefile "# Specify Library Type\n";
848 <        print GNUmakefile "DefaultLibsOff=yes\n";
849 <        if ( $$hashref{'type'}=~/^archive/i ) {
850 <          print GNUmakefile "LibArchive=true\n";
851 <        }
852 <        elsif ($$hashref{'type'}=~/debug_archive/i ) {
853 <          print GNUmakefile "LibDebugArchive=true\n";
854 <        }
855 <        elsif ($$hashref{'type'}=~/debug_shared/i ) {
856 <          print GNUmakefile "LibDebugShared=true\n";
857 <        }
858 <        elsif ($$hashref{'type'}=~/shared/i ) {
859 <          print GNUmakefile 'LibShared=true'."\n";
860 <        }
861 <        print GNUmakefile "\n";
862 <        }
863 <        }
864 < }
865 <
866 < sub LibType_text {
867 <        my $self=shift;
868 <        my $name=shift;
869 <        my $string=shift;
870 <
871 <        if ( $self->{Arch} ) {
872 <          $string=~s/\n/ /g;
873 <          print GNUmakefile "libmsg::\n\t\@echo Library info: ";
874 <          print GNUmakefile $string;
875 <          print GNUmakefile "\n";
876 <        }
877 < }
878 <
879 < sub LibType_end {
880 <        my $self=shift;
881 <        my $name=shift;
882 <
883 <        undef $self->{libtype_conext};
884 < }
885 <
886 < sub Environment_start {
887 <        my $self=shift;
888 <        my $name=shift;
889 <        my $hashref=shift;
890 <
891 <        if ( $self->{Arch} ) {
892 <          $self->{envnum}++;
893 <
894 <          # open a new Environment File
895 <          my $envfile="$self->{localtop}/$ENV{INTwork}/$self->{path}/Env_".
896 <                $self->{envnum}.".mk";
897 <          use FileHandle;
898 <          my $fh=FileHandle->new();
899 <          open ($fh,">$envfile") or die "Unable to open file $envfile \n$!\n";
900 <          push @{$self->{filehandlestack}}, $fh;
901 <          *GNUmakefile=$fh;
902 <
903 <          # include the approprate environment file
904 <          if ( $self->{envlevel} == 0 ) {
905 <             print GNUmakefile "include $self->{localtop}/$ENV{INTwork}/".
906 <                $self->{path}."/BuildFile.mk\n";
907 <          }
908 <          else {
909 <             print GNUmakefile "include $self->{localtop}/$ENV{INTwork}/".
910 <                $self->{path}."/Env_".$self->{Envlevels}[$self->{envlevel}].".mk\n";
911 <          }
912 <          $self->{envlevel}++;
913 <          $self->{Envlevels}[$self->{envlevel}]=$self->{envnum};
914 <          $self->{currentenv}="$self->{localtop}/$ENV{INTwork}/$self->{path}/Env_$self->{envnum}.mk";
915 <        }
916 < }
917 <
918 < sub Environment_end {
919 <        my $self=shift;
920 <        my $fd;
921 <
922 <        if ( $self->{Arch} ) {
923 <          $self->{envlevel}--;
924 <          if ( $self->{envlevel} < 0 ) {
925 <            print "Too many </Environent> Tags on $self->{switch}->line()\n";
926 <            exit 1;
927 <          }
928 <          close GNUmakefile;
929 <          # restore the last filehandle
930 <          $fd=pop @{$self->{filehandlestack}};
931 <          close $fd;
932 <          *GNUmakefile=$self->{filehandlestack}[$#{$self->{filehandlestack}}];
933 <          if ( $self->{envlevel} < 1 ) {
934 <            $self->{currentenv}="$self->{localtop}/$ENV{INTwork}/$self->{path}/".
935 <                        "BuildFile.mk";
936 <          }
937 <          else {
938 <            $self->{currentenv}=
939 <             $self->{localtop}."/$ENV{INTwork}/$self->{path}/Env_".
940 <                $self->{Envlevels}[$self->{envlevel}];
941 <          }
942 <        }
943 < }
338 > 1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines