2 |
|
# |
3 |
|
# Interface |
4 |
|
# --------- |
5 |
< |
# new(ConfigArea) |
5 |
> |
# new(toolbox) |
6 |
|
# ParseBuildFile($base,$path,$file) |
7 |
|
# ParseBuildFileExport(filename) |
8 |
– |
# blockparse(Block) : perform a parse to modify the block |
8 |
|
# BlockClassPath() : Return the class path |
9 |
|
# ignore() : return 1 if directory should be ignored 0 otherwise |
11 |
– |
# classname() : get/set the associated class |
12 |
– |
# buildfile() : get/set BuildFile location |
13 |
– |
# makefile() : get the generated makefile |
10 |
|
|
11 |
|
package BuildSystem::BuildFile; |
12 |
+ |
use Utilities::Verbose; |
13 |
|
use ActiveDoc::SimpleDoc; |
14 |
|
use BuildSystem::ToolBox; |
15 |
|
require 5.004; |
16 |
+ |
@ISA=qw(Utilities::Verbose); |
17 |
|
|
18 |
|
BEGIN { |
19 |
|
$buildfile="BuildFile"; |
23 |
|
my $class=shift; |
24 |
|
my $self={}; |
25 |
|
bless $self, $class; |
26 |
< |
$self->{area}=shift; |
29 |
< |
$self->{toolbox}=$self->{area}->toolbox(); |
30 |
< |
$self->{localtop}=$self->{area}->location(); |
26 |
> |
$self->{toolbox}=shift; |
27 |
|
$self->{Arch}=1; |
28 |
|
push @{$self->{ARCHBLOCK}}, $self->{Arch}; |
29 |
|
return $self; |
30 |
|
} |
31 |
|
|
36 |
– |
sub buildfile { |
37 |
– |
my $self=shift; |
38 |
– |
if ( @_ ) { |
39 |
– |
$self->{buildfile}=shift; |
40 |
– |
} |
41 |
– |
return $self->{buildfile}; |
42 |
– |
} |
43 |
– |
|
44 |
– |
sub makefile { |
45 |
– |
my $self=shift; |
46 |
– |
if ( @_ ) { |
47 |
– |
$self->{makefile}=shift; |
48 |
– |
} |
49 |
– |
return $self->{makefile}; |
50 |
– |
} |
51 |
– |
|
52 |
– |
sub blockparse { |
53 |
– |
my $self=shift; |
54 |
– |
$self->{block}=shift; |
55 |
– |
|
56 |
– |
$self->{switch}=$self->_initswitcher(); |
57 |
– |
$self->_initblockparse($self->{switch}); |
58 |
– |
} |
59 |
– |
|
32 |
|
sub ignore { |
33 |
|
my $self=shift; |
34 |
+ |
$self->verbose(">> ignore......<<"); |
35 |
+ |
|
36 |
|
return (defined $self->{ignore})?$self->{ignore}:0; |
37 |
|
} |
38 |
|
|
40 |
|
my $self=shift; |
41 |
|
my $switch=ActiveDoc::SimpleDoc->new(); |
42 |
|
my $parse="makebuild"; |
43 |
+ |
$self->verbose(">> _initswitcher: <<"); |
44 |
|
$switch->newparse($parse); |
45 |
|
$switch->addignoretags($parse); |
46 |
|
$self->_commontags($switch,$parse); |
47 |
< |
#$switch->addtag($parse,"Build", \&Build_start, $self); |
47 |
> |
$switch->addtag($parse,"Build", \&Build_start, $self); |
48 |
|
$switch->addtag($parse,"none", |
49 |
|
\&OutToMakefile,$self, |
50 |
|
\&OutToMakefile, $self, |
53 |
|
\&Bin_start,$self, |
54 |
|
\&OutToScreen, $self, |
55 |
|
"", $self); |
56 |
< |
$switch->addtag($parse,"ProductStore", |
57 |
< |
\&Store_start,$self, |
58 |
< |
"", $self, |
56 |
> |
$switch->addtag($parse,"Module", |
57 |
> |
\&Module_start,$self, |
58 |
> |
\&OutToScreen, $self, |
59 |
|
"", $self); |
60 |
+ |
|
61 |
+ |
$switch->addtag($parse,"ProductStore", |
62 |
+ |
\&Store_start,$self, |
63 |
+ |
"", $self, |
64 |
+ |
"", $self); |
65 |
|
$switch->addtag($parse,"LibType", |
66 |
|
\&LibType_Start,$self, |
67 |
|
\&LibType_text, $self, |
89 |
|
return $switch; |
90 |
|
} |
91 |
|
|
92 |
< |
sub _initblockparse { |
93 |
< |
my $self=shift; |
94 |
< |
my $switch=shift; |
95 |
< |
|
96 |
< |
my $parse="block"; |
97 |
< |
$switch->newparse($parse); |
98 |
< |
$switch->addignoretags($parse); |
99 |
< |
$switch->addtag($parse,"DropDown", |
100 |
< |
\&DropDown_start,$self, |
101 |
< |
"", $self, |
102 |
< |
"", $self); |
103 |
< |
$switch->addtag($parse,"Build", \&Build_start, $self); |
104 |
< |
} |
105 |
< |
|
106 |
< |
sub _commontags { |
107 |
< |
my $self=shift; |
108 |
< |
my $switch=shift; |
109 |
< |
my $parse=shift; |
110 |
< |
|
111 |
< |
$switch->grouptag("Export",$parse); |
112 |
< |
$switch->addtag($parse,"Use",\&Use_start,$self, |
113 |
< |
\&OutToMakefile, $self, |
114 |
< |
"", $self); |
115 |
< |
$switch->addtag($parse,"Group",\&Group_start,$self, |
116 |
< |
\&OutToMakefile, $self, |
117 |
< |
"", $self); |
118 |
< |
$switch->grouptag("Group",$parse); |
119 |
< |
$switch->addtag($parse,"External", |
120 |
< |
\&External_StartTag,$self, |
121 |
< |
\&OutToMakefile, $self, |
122 |
< |
"", $self); |
123 |
< |
$switch->addtag($parse,"lib", |
124 |
< |
\&lib_start,$self, |
125 |
< |
\&OutToMakefile, $self, |
126 |
< |
"", $self); |
127 |
< |
$switch->addtag($parse,"Architecture", |
128 |
< |
\&Arch_Start,$self, |
129 |
< |
\&OutToMakefile, $self, |
130 |
< |
\&Arch_End,$self); |
151 |
< |
$switch->addtag($parse,"INCLUDE_PATH", |
152 |
< |
\&IncludePath_Start,$self, |
153 |
< |
\&OutToMakefile, $self, |
154 |
< |
"",$self); |
155 |
< |
return $switch; |
156 |
< |
} |
157 |
< |
|
158 |
< |
sub GenerateMakefile { |
159 |
< |
my $self=shift; |
160 |
< |
my $infile=shift; |
161 |
< |
my $outfile=shift; |
162 |
< |
|
163 |
< |
$self->{switch}=$self->_initswitcher(); |
164 |
< |
$self->{switch}->filetoparse($infile); |
165 |
< |
|
166 |
< |
# open a temporary gnumakefile to store output. |
167 |
< |
my $fh=FileHandle->new(); |
168 |
< |
open ( $fh, ">$outfile") or die "Unable to open $outfile for output ". |
169 |
< |
"$!\n"; |
170 |
< |
@{$self->{filehandlestack}}=($fh); |
171 |
< |
|
172 |
< |
# -- make an alias |
173 |
< |
*GNUmakefile=$fh; |
174 |
< |
if ( -e $ENV{LatestBuildFile} ) { |
175 |
< |
print GNUmakefile "include $ENV{LatestBuildFile}\n"; |
176 |
< |
} |
177 |
< |
$self->{switch}->parse("makebuild"); # sort out supported tags |
178 |
< |
close GNUmakefile; |
179 |
< |
return $outfile; |
180 |
< |
} |
92 |
> |
sub _commontags |
93 |
> |
{ |
94 |
> |
my $self=shift; |
95 |
> |
my $switch=shift; |
96 |
> |
my $parse=shift; |
97 |
> |
|
98 |
> |
$self->verbose(">> _commontags: SW ".$switch." PARSE ".$parse." <<"); |
99 |
> |
|
100 |
> |
$switch->grouptag("Export",$parse); |
101 |
> |
$switch->addtag($parse,"Use", |
102 |
> |
\&Use_start,$self, |
103 |
> |
\&OutToMakefile, $self, |
104 |
> |
"", $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; |
141 |
|
else { |
142 |
|
$fullfilename=$filename; |
143 |
|
} |
144 |
+ |
|
145 |
+ |
$self->verbose(">> ParseBuildFile: FN ".$fullfilename." <<"); |
146 |
+ |
|
147 |
|
$self->{path}=$path; |
195 |
– |
#print "Processing $fullfilename\n"; |
148 |
|
$numbins=0; |
149 |
|
$self->{envnum}=0; |
150 |
|
$self->{envlevel}=0; |
151 |
< |
$self->{makefile}="$self->{localtop}/$ENV{INTwork}/$self->{path}/". |
151 |
> |
$self->{currentenv}="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/". |
152 |
|
"BuildFile.mk"; |
201 |
– |
$self->{currentenv}=$self->{makefile}; |
153 |
|
$self->{switch}=$self->_initswitcher(); |
154 |
|
$self->{switch}->filetoparse($fullfilename); |
155 |
|
|
156 |
< |
# $self->{switch}->{Strict_no_cr}='no'; |
206 |
< |
#open a temporary gnumakefile to store output. |
156 |
> |
# open a temporary gnumakefile to store output. |
157 |
|
use Utilities::AddDir; |
158 |
< |
AddDir::adddir("$self->{localtop}/$ENV{INTwork}/$self->{path}"); |
159 |
< |
$ENV{LatestBuildFile}=$self->GenerateMakefile($fullfilename, |
160 |
< |
$self->{localtop}."/".$ENV{INTwork}."/".$self->{path}."/BuildFile.mk"); |
161 |
< |
} |
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 |
< |
sub classname { |
170 |
< |
my $self=shift; |
171 |
< |
if ( @_ ) { |
172 |
< |
$self->{classname}=shift; |
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 |
< |
return $self->{classname}; |
188 |
> |
close GNUmakefile; |
189 |
|
} |
190 |
|
|
191 |
|
sub ParseBuildFile_Export { |
192 |
|
my $self=shift; |
193 |
|
my $filename=shift; |
194 |
< |
my $bf=BuildSystem::BuildFile->new($self->{area}); |
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 |
|
} |
205 |
|
sub _location { |
206 |
|
my $self=shift; |
207 |
|
use File::Basename; |
208 |
< |
|
208 |
> |
$self->verbose(">> _location: <<"); |
209 |
|
return dirname($self->{switch}->filetoparse()); |
210 |
|
} |
211 |
|
|
212 |
|
sub _parseexport { |
213 |
|
my $self=shift; |
214 |
|
my $filename=shift; |
215 |
< |
|
215 |
> |
$self->verbose(">> _parseexport: FN ".$filename." <<"); |
216 |
> |
|
217 |
|
my $switchex=ActiveDoc::SimpleDoc->new(); |
218 |
|
$switchex->filetoparse($filename); |
219 |
|
$switchex->newparse("export"); |
224 |
|
\&export_end_export,$self); |
225 |
|
$self->_commontags($switchex,"export"); |
226 |
|
$switchex->allowgroup("__export","export"); |
253 |
– |
# $switchex->{Strict_no_cr}='no'; |
227 |
|
$self->{switch}=$switchex; |
228 |
|
$switchex->parse("export"); # sort out supported tags |
229 |
|
} |
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}; |
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 |
|
} |
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 |
|
|
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 |
< |
$self->classname($$hashref{'type'}); |
281 |
> |
$ClassName=$$hashref{'type'}; |
282 |
|
} |
283 |
|
} |
284 |
|
} |
285 |
|
|
286 |
< |
sub IncludePath_Start { |
287 |
< |
my $self=shift; |
288 |
< |
my $name=shift; |
289 |
< |
my $hashref=shift; |
290 |
< |
|
291 |
< |
$self->{switch}->checktag( $name, $hashref, 'path'); |
292 |
< |
if ( $self->{Arch} ) { |
293 |
< |
print GNUmakefile "INCLUDE+=".$self->_location()."/". |
294 |
< |
$$hashref{'path'}."\n"; |
295 |
< |
} |
296 |
< |
} |
286 |
> |
sub IncludePath_Start |
287 |
> |
{ |
288 |
> |
my $self=shift; |
289 |
> |
my $name=shift; |
290 |
> |
my $hashref=shift; |
291 |
> |
|
292 |
> |
$self->verbose(">> IncludePath_Start: NM ".$name." <<"); |
293 |
> |
|
294 |
> |
$self->{switch}->checktag( $name, $hashref, 'path'); |
295 |
> |
if ( $self->{Arch} ) |
296 |
> |
{ |
297 |
> |
print GNUmakefile "INCLUDE+=".$self->_location()."/".$$hashref{'path'}."\n"; |
298 |
> |
} |
299 |
> |
} |
300 |
|
|
301 |
|
# |
302 |
|
# generic build tag |
306 |
|
my $name=shift; |
307 |
|
my $hashref=shift; |
308 |
|
|
309 |
+ |
$self->verbose(">> Build_start: NM ".$name." <<"); |
310 |
+ |
|
311 |
|
$self->{switch}->checktag($name,$hashref,'class'); |
326 |
– |
$self->{switch}->checktag($name,$hashref,'id'); |
312 |
|
if ( $self->{Arch} ) { |
313 |
|
|
314 |
|
# -- determine the build products name |
318 |
|
} |
319 |
|
else { |
320 |
|
$self->{switch}->parseerror("No name specified for build product"); |
336 |
– |
#$name="\$(buildname)"; |
321 |
|
} |
322 |
|
|
323 |
|
# -- check we have a lookup for the class type |
355 |
|
# -- create a new directory for each type |
356 |
|
push @targets, $pattern; |
357 |
|
my $dirname=$$hashref{'class'}."_".$type."_".$name; |
358 |
< |
my $here="$self->{localtop}/$ENV{INTwork}/".$self->{path}."/".$dirname; |
358 |
> |
my $here="$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/".$dirname; |
359 |
|
my $makefile=$here."/BuildFile.mk"; |
376 |
– |
# AddDir::adddir($here); |
360 |
|
|
361 |
|
# -- create link targets to the directory |
362 |
|
push @targets, $dirname; |
377 |
|
print $fh "\t cd $dirname; \\\n"; |
378 |
|
print $fh "\t echo include ".$self->{currentenv}." > ". |
379 |
|
"$makefile; \\\n"; |
380 |
< |
print $fh "\t echo VPATH+=$self->{localtop}/".$self->{path}. |
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"; |
388 |
|
} |
389 |
|
print $fh "\tfi\n"; |
390 |
|
print $fh "\n"; |
408 |
– |
# print $typefile "$name :\n"; |
409 |
– |
# print $typefile "\t\$(_quietbuild_)"; |
410 |
– |
# print $typefile $mapper->template($$hashref{'class'},$type)."\n"; |
411 |
– |
# print $typefile "\t\$(_quietstamp_)"; |
412 |
– |
# print $typefile "\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$@.ds \$@ \$^\n"; |
391 |
|
|
392 |
|
# -- cleaning targets |
393 |
|
push @targets, "clean_$dirname"; |
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} ) { |
440 |
|
|
441 |
|
# Create a new directory for each binary target |
442 |
|
my $dirname="bin_".$$hashref{name}; |
443 |
< |
AddDir::adddir("$self->{localtop}/$ENV{INTwork}/".$self->{path}."/$dirname"); |
443 |
> |
AddDir::adddir("$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/$dirname"); |
444 |
|
open (binGNUmakefile, |
445 |
< |
">$self->{localtop}/$ENV{INTwork}/".$self->{path}."/$dirname/BuildFile.mk") or die "Unable to make $self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname/". |
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 |
458 |
|
ifndef BINMODE |
459 |
|
|
460 |
|
define stepdown_$$hashref{'name'} |
461 |
< |
if [ -d "$self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\ |
462 |
< |
cd $self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname; \\ |
463 |
< |
\$(MAKE) BINMODE=true LatestBuildFile=$self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\@; \\ |
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 "$self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\ |
469 |
< |
cd $self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname; \\ |
470 |
< |
\$(MAKE) BINMODE=true LatestBuildFile=$self->{localtop}/$ENV{INTwork}/$self{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\*; \\ |
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 |
491 |
|
|
492 |
|
# the binary specifics makefile |
493 |
|
print binGNUmakefile "include ".$self->{currentenv}."\n"; |
494 |
< |
print binGNUmakefile "VPATH+=$self->{localtop}/$self{path}\n"; |
494 |
> |
print binGNUmakefile "VPATH+=$ENV{LOCALTOP}/$self{path}\n"; |
495 |
|
|
496 |
|
# alias for bin_Insure |
497 |
|
print binGNUmakefile <<ENDTEXT; |
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 |
629 |
+ |
|
630 |
+ |
BINMODE=true |
631 |
+ |
|
632 |
+ |
define stepdown_$$hashref{'name'} |
633 |
+ |
if [ -d "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\ |
634 |
+ |
cd $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname; \\ |
635 |
+ |
\$(MAKE) MODULEMODE=true LatestBuildFile=$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\@; \\ |
636 |
+ |
fi |
637 |
+ |
endef |
638 |
+ |
|
639 |
+ |
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 |
741 |
+ |
|
742 |
+ |
|
743 |
+ |
$$hashref{name}_d.so:\$(libslocal_d) |
744 |
+ |
$$hashref{name}_o.so:\$(libslocal) |
745 |
+ |
ifdef MCCABE_DATA_DIR |
746 |
+ |
$$hashref{name}_mccabe.so: \$(libslocal_d) \$(MCCABE_DATA_DIR)/mccabeinstr/instplus.cpp |
747 |
+ |
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} ) { |
822 |
|
my $name=shift; |
823 |
|
my $hashref=shift; |
824 |
|
|
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'}; |
834 |
|
} |
835 |
|
} |
836 |
|
|
837 |
< |
sub Use_start { |
838 |
< |
my $self=shift; |
839 |
< |
my $name=shift; |
840 |
< |
my $hashref=shift; |
841 |
< |
my $filename; |
842 |
< |
use Utilities::SCRAMUtils; |
843 |
< |
|
844 |
< |
$self->{switch}->checktag($name, $hashref, "name"); |
845 |
< |
if ( $self->{Arch} ) { |
846 |
< |
if ( exists $$hashref{'group'} ) { |
847 |
< |
print GNUmakefile "GROUP_".$$hashref{'group'}."=true\n"; |
848 |
< |
} |
849 |
< |
if ( ! defined $self->{remoteproject} ) { |
850 |
< |
$filename=SCRAMUtils::checkfile( |
851 |
< |
"/$ENV{INTsrc}/$$hashref{name}/BuildFile"); |
852 |
< |
} |
853 |
< |
else { |
854 |
< |
$filename=$self->{remoteproject}."/$$hashref{name}/BuildFile"; |
855 |
< |
print "trying $filename\n"; |
856 |
< |
if ( ! -f $filename ) { $filename=""; }; |
857 |
< |
} |
858 |
< |
if ( $filename ne "" ) { |
859 |
< |
$self->ParseBuildFile_Export( $filename ); |
860 |
< |
} |
861 |
< |
else { |
862 |
< |
$self->{switch}->parseerror("Unable to detect Appropriate ". |
863 |
< |
"decription file for <$name name=".$$hashref{name}.">"); |
864 |
< |
} |
865 |
< |
} |
837 |
> |
sub Use_start |
838 |
> |
{ |
839 |
> |
my $self=shift; |
840 |
> |
my $name=shift; |
841 |
> |
my $hashref=shift; |
842 |
> |
my $filename; |
843 |
> |
use Utilities::SCRAMUtils; |
844 |
> |
|
845 |
> |
$self->verbose(">> Use_start: NM ".$name." <<"); |
846 |
> |
|
847 |
> |
$self->{switch}->checktag($name, $hashref, "name"); |
848 |
> |
if ( $self->{Arch} ) |
849 |
> |
{ |
850 |
> |
if ( exists $$hashref{'group'} ) |
851 |
> |
{ |
852 |
> |
print GNUmakefile "GROUP_".$$hashref{'group'}."=true\n"; |
853 |
> |
} |
854 |
> |
if ( ! defined $self->{remoteproject} ) |
855 |
> |
{ |
856 |
> |
$filename=SCRAMUtils::checkfile("/$ENV{INTsrc}/$$hashref{name}/BuildFile"); |
857 |
> |
} |
858 |
> |
else |
859 |
> |
{ |
860 |
> |
$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=""; }; |
864 |
> |
} |
865 |
> |
if ( $filename ne "" ) |
866 |
> |
{ |
867 |
> |
$self->ParseBuildFile_Export( $filename ); |
868 |
> |
} |
869 |
> |
else |
870 |
> |
{ |
871 |
> |
$self->{switch}->parseerror("Unable to detect Appropriate ". |
872 |
> |
"decription file for <$name name=".$$hashref{name}.">"); |
873 |
> |
} |
874 |
> |
} |
875 |
> |
} |
876 |
> |
|
877 |
> |
sub CheckBuildFile { |
878 |
> |
my $self=shift; |
879 |
> |
my $classdir=shift; |
880 |
> |
my $ClassName=""; |
881 |
> |
my $thisfile="$classdir/$buildfile"; |
882 |
> |
|
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 |
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; |
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); |
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}}; |
935 |
> |
pop @{$self->{ARCHBLOCK}}; |
936 |
|
$self->{Arch}=$self->{ARCHBLOCK}[$#{$self->{ARCHBLOCK}}]; |
937 |
|
} |
938 |
|
|
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 |
|
|
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 |
|
} |
962 |
|
sub OutToScreen { |
963 |
|
my $name=shift; |
964 |
|
my @vars=@_; |
965 |
< |
|
965 |
> |
|
966 |
|
if ( $self->{Arch} ) { |
967 |
|
print @vars; |
968 |
|
} |
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}); |
981 |
|
|
982 |
|
sub BlockClassPath { |
983 |
|
my $self=shift; |
984 |
+ |
|
985 |
+ |
$self->verbose(">> BlockClassPath: <<"); |
986 |
+ |
|
987 |
|
return $self->{BlockClassPath}; |
988 |
|
} |
989 |
|
|
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 |
|
|
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"; |
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 |
|
} |
1034 |
|
# |
1035 |
|
# Standard lib tag |
1036 |
|
# |
1037 |
< |
sub lib_start { |
1038 |
< |
my $self=shift; |
1039 |
< |
my $name=shift; |
1040 |
< |
my $hashref=shift; |
1037 |
> |
sub lib_start |
1038 |
> |
{ |
1039 |
> |
my $self=shift; |
1040 |
> |
my $name=shift; |
1041 |
> |
my $hashref=shift; |
1042 |
> |
|
1043 |
> |
$self->verbose(">> lib_start: NM ".$name." <<"); |
1044 |
> |
|
1045 |
> |
$self->{switch}->checktag($name, $hashref, 'name'); |
1046 |
> |
|
1047 |
> |
if ( $self->{Arch} ) |
1048 |
> |
{ |
1049 |
> |
print GNUmakefile "lib+=$$hashref{name}\n"; |
1050 |
> |
} |
1051 |
> |
} |
1052 |
|
|
1053 |
< |
$self->{switch}->checktag($name, $hashref, 'name'); |
1054 |
< |
if ( $self->{Arch} ) { |
1055 |
< |
print GNUmakefile "lib+=$$hashref{name}\n"; |
1056 |
< |
} |
1057 |
< |
} |
1053 |
> |
# Standard debug lib tag |
1054 |
> |
# |
1055 |
> |
sub debuglib_start |
1056 |
> |
{ |
1057 |
> |
my $self=shift; |
1058 |
> |
my $name=shift; |
1059 |
> |
my $hashref=shift; |
1060 |
> |
|
1061 |
> |
$self->verbose(">> debuglib_start: NM ".$name." <<"); |
1062 |
> |
$self->{switch}->checktag($name, $hashref, 'name'); |
1063 |
> |
|
1064 |
> |
if ( $self->{Arch} ) |
1065 |
> |
{ |
1066 |
> |
print GNUmakefile "debuglib+=$$hashref{name}\n"; |
1067 |
> |
} |
1068 |
> |
} |
1069 |
|
|
1070 |
|
# |
1071 |
|
# libtype specification |
1074 |
|
my $self=shift; |
1075 |
|
my $name=shift; |
1076 |
|
my $hashref=shift; |
1077 |
< |
|
1077 |
> |
|
1078 |
> |
$self->verbose(">> LibType_Start: NM ".$name." <<"); |
1079 |
> |
|
1080 |
|
if ( $self->{Arch} ) { |
1081 |
|
if ( defined $self->{libtype_conext} ) { |
1082 |
|
$self->{switch}->parseerror("<$name> tag cannot be specified". |
1109 |
|
my $self=shift; |
1110 |
|
my $name=shift; |
1111 |
|
my $string=shift; |
1112 |
+ |
$self->verbose(">> LibType_text: NM ".$name." <<"); |
1113 |
|
|
1114 |
< |
if ( $self->{Arch} ) { |
1114 |
> |
if ( $self->{Arch} ) { |
1115 |
|
$string=~s/\n/ /g; |
1116 |
|
print GNUmakefile "libmsg::\n\t\@echo Library info: "; |
1117 |
|
print GNUmakefile $string; |
1123 |
|
my $self=shift; |
1124 |
|
my $name=shift; |
1125 |
|
|
1126 |
+ |
$self->verbose(">> LibType_end: NM ".$name." <<"); |
1127 |
+ |
|
1128 |
|
undef $self->{libtype_conext}; |
1129 |
|
} |
1130 |
|
|
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="$self->{localtop}/$ENV{INTwork}/$self->{path}/Env_". |
1142 |
> |
my $envfile="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/Env_". |
1143 |
|
$self->{envnum}.".mk"; |
1144 |
|
use FileHandle; |
1145 |
|
my $fh=FileHandle->new(); |
1149 |
|
|
1150 |
|
# include the approprate environment file |
1151 |
|
if ( $self->{envlevel} == 0 ) { |
1152 |
< |
print GNUmakefile "include $self->{localtop}/$ENV{INTwork}/". |
1152 |
> |
print GNUmakefile "include $ENV{LOCALTOP}/$ENV{INTwork}/". |
1153 |
|
$self->{path}."/BuildFile.mk\n"; |
1154 |
|
} |
1155 |
|
else { |
1156 |
< |
print GNUmakefile "include $self->{localtop}/$ENV{INTwork}/". |
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}="$self->{localtop}/$ENV{INTwork}/$self->{path}/Env_$self->{envnum}.mk"; |
1161 |
> |
$self->{currentenv}="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/Env_$self->{envnum}.mk"; |
1162 |
|
} |
1163 |
|
} |
1164 |
|
|
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 ) { |
1180 |
|
close $fd; |
1181 |
|
*GNUmakefile=$self->{filehandlestack}[$#{$self->{filehandlestack}}]; |
1182 |
|
if ( $self->{envlevel} < 1 ) { |
1183 |
< |
$self->{currentenv}="$self->{localtop}/$ENV{INTwork}/$self->{path}/". |
1183 |
> |
$self->{currentenv}="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/". |
1184 |
|
"BuildFile.mk"; |
1185 |
|
} |
1186 |
|
else { |
1187 |
|
$self->{currentenv}= |
1188 |
< |
$self->{localtop}."/$ENV{INTwork}/$self->{path}/Env_". |
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; |
1195 |
> |
my $self=shift; |
1196 |
> |
my $name=shift; |
1197 |
|
my $hashref=shift; |
1198 |
|
|
1199 |
< |
if ( $self->{Arch} ) { |
960 |
< |
$self->{switch}->checktag( $name, $hashref, 'name' ); |
961 |
< |
|
962 |
< |
# -- store creation |
963 |
< |
my $dir=$$hashref{'name'}; |
964 |
< |
AddDir::adddir($self->{area}->location()."/".$dir); |
965 |
< |
if ( exists $$hashref{'type'} ) { |
966 |
< |
# -- architecture specific store |
967 |
< |
if ( $$hashref{'type'}=~/^arch/i ) { |
968 |
< |
$dir=$dir."/".$ENV{SCRAM_ARCH}; |
969 |
< |
AddDir::adddir($self->{area}->location()."/".$dir); |
970 |
< |
} |
971 |
< |
else { |
972 |
< |
$self->parseerror("Unknown type in <$name> tag"); |
973 |
< |
} |
974 |
< |
} |
975 |
< |
|
976 |
< |
# -- set make variables for the store |
977 |
< |
print GNUmakefile "SCRAMSTORENAME_".$$hashref{'name'}.":=".$dir."\n"; |
978 |
< |
print GNUmakefile "SCRAMSTORE_".$$hashref{'name'}.":=". |
979 |
< |
$self->{localtop}."/".$dir."\n"; |
980 |
< |
print GNUmakefile "VPATH+=".$self->{localtop} |
981 |
< |
."/".$dir.":".$self->{releasetop}."/".$dir."\n"; |
982 |
< |
} |
983 |
< |
} |
984 |
< |
|
985 |
< |
sub DropDown { |
986 |
< |
my $self=shift; |
987 |
< |
my $name=shift; |
988 |
< |
my $hashref=shift; |
1199 |
> |
$self->verbose(">> Store_start: NM ".$name." <<"); |
1200 |
|
|
1201 |
|
if ( $self->{Arch} ) { |
1202 |
< |
# - default values must always be specified |
1203 |
< |
$self->{switch}->checktag( $name, $hashref, 'defaults' ); |
1204 |
< |
my @blockdirs=split /,/ , $$hashref{'defaults'}; |
1205 |
< |
$self->{block}->defaultblocks(@blockdirs); |
1206 |
< |
} |
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 |
|
} |