2 |
|
# |
3 |
|
# Interface |
4 |
|
# --------- |
5 |
< |
# new(ConfigArea) |
5 |
> |
# new(ConfigArea,Builder) |
6 |
|
# ParseBuildFile($base,$path,$file) |
7 |
|
# ParseBuildFileExport(filename) |
8 |
|
# BlockParse(Block) : perform a parse to modify the block |
9 |
|
# BlockClassPath() : Return the class path |
10 |
|
# ignore() : return 1 if directory should be ignored 0 otherwise |
11 |
< |
# classname() : get/set the associated class |
12 |
< |
# buildfile() : get/set BuildFile location |
13 |
< |
# makefile() : get the generated makefile |
11 |
> |
# classname() : get/set the associated class |
12 |
> |
# buildfile() : get/set BuildFile location |
13 |
> |
# makefile() : get the generated makefile |
14 |
|
|
15 |
|
package BuildSystem::BuildFile; |
16 |
|
use ActiveDoc::SimpleDoc; |
26 |
|
my $self={}; |
27 |
|
bless $self, $class; |
28 |
|
$self->{area}=shift; |
29 |
< |
$self->{toolbox}=$self->{area}->toolbox(); |
30 |
< |
$self->{localtop}=$self->{area}->location(); |
31 |
< |
# -- set RELEASTOP |
29 |
> |
$self->{Builder}=shift; |
30 |
> |
$self->{toolbox}=$self->{area}->toolbox(); |
31 |
> |
$self->{localtop}=$self->{area}->location(); |
32 |
> |
# -- set RELEASTOP |
33 |
|
my $rarea=$self->{area}->linkarea(); |
34 |
|
if ( ! defined $rarea ) { |
35 |
|
$self->{releasetop}=$self->{localtop}; |
37 |
|
else { |
38 |
|
$self->{releasetop}=$rarea->location(); |
39 |
|
} |
40 |
< |
$self->{releasetop}=$self->{area}->location(); |
40 |
> |
$self->{releasetop}=$self->{area}->location(); |
41 |
|
$self->{Arch}=1; |
42 |
|
push @{$self->{ARCHBLOCK}}, $self->{Arch}; |
43 |
|
return $self; |
44 |
|
} |
45 |
|
|
46 |
|
sub buildfile { |
47 |
< |
my $self=shift; |
48 |
< |
if ( @_ ) { |
49 |
< |
$self->{buildfile}=shift; |
50 |
< |
} |
51 |
< |
return $self->{buildfile}; |
47 |
> |
my $self=shift; |
48 |
> |
if ( @_ ) { |
49 |
> |
$self->{buildfile}=shift; |
50 |
> |
} |
51 |
> |
return $self->{buildfile}; |
52 |
|
} |
53 |
|
|
54 |
|
sub makefile { |
55 |
< |
my $self=shift; |
56 |
< |
if ( @_ ) { |
57 |
< |
$self->{makefile}=shift; |
58 |
< |
} |
59 |
< |
return $self->{makefile}; |
55 |
> |
my $self=shift; |
56 |
> |
if ( @_ ) { |
57 |
> |
$self->{makefile}=shift; |
58 |
> |
} |
59 |
> |
return $self->{makefile}; |
60 |
|
} |
61 |
|
|
62 |
|
sub BlockParse { |
63 |
< |
my $self=shift; |
64 |
< |
$self->{block}=shift; |
64 |
< |
|
65 |
< |
# -- set up the block parse |
66 |
< |
my $switch=$self->_initswitcher(); |
67 |
< |
my $parse="block"; |
68 |
< |
$switch->newparse($parse); |
69 |
< |
$switch->addignoretags($parse); |
70 |
< |
$switch->addtag($parse,"BuildParam", \&BuildBlock_start, $self); |
63 |
> |
my $self=shift; |
64 |
> |
$self->{block}=shift; |
65 |
|
|
66 |
< |
# -- parse away |
67 |
< |
$self->{switch}->parse("block"); |
66 |
> |
# -- set up the block parse |
67 |
> |
my $switch=$self->_initswitcher(); |
68 |
> |
my $parse="block"; |
69 |
> |
$switch->newparse($parse); |
70 |
> |
$switch->addignoretags($parse); |
71 |
> |
$switch->addtag($parse,"BuildParam", \&BuildBlock_start, $self); |
72 |
> |
$switch->filetoparse($self->buildfile()); |
73 |
> |
|
74 |
> |
# -- parse away |
75 |
> |
$self->{switch}=$switch; |
76 |
> |
$switch->parse("block"); |
77 |
|
} |
78 |
|
|
79 |
|
sub Parsetofh { |
80 |
< |
my $self=shift; |
81 |
< |
my $fh=shift; |
82 |
< |
$self->{buildblock}=shift; |
80 |
> |
my $self=shift; |
81 |
> |
my $fh=shift; |
82 |
> |
$self->{buildblock}=shift; |
83 |
|
|
84 |
< |
# -- set up for parse |
84 |
> |
# -- set up for parse |
85 |
|
@{$self->{filehandlestack}}=($fh); |
86 |
< |
$self->{switch}->filetoparse($self->buildfile()); |
86 |
> |
$self->{switch}->filetoparse($self->buildfile()); |
87 |
|
*GNUmakefile=$fh; |
88 |
|
|
89 |
< |
# -- generate makefile |
89 |
> |
# -- generate makefile |
90 |
|
$self->{switch}->parse("makebuild"); # sort out supported tags |
91 |
|
|
92 |
< |
# -- Clean up |
92 |
> |
# -- Clean up |
93 |
|
close GNUmakefile; |
94 |
|
} |
95 |
|
|
114 |
|
\&Bin_start,$self, |
115 |
|
\&OutToScreen, $self, |
116 |
|
"", $self); |
117 |
< |
$switch->addtag($parse,"ProductStore", |
118 |
< |
\&Store_start,$self, |
119 |
< |
"", $self, |
120 |
< |
"", $self); |
117 |
> |
$switch->addtag($parse,"ProductStore", |
118 |
> |
\&Store_start,$self, |
119 |
> |
"", $self, |
120 |
> |
"", $self); |
121 |
|
$switch->addtag($parse,"LibType", |
122 |
|
\&LibType_Start,$self, |
123 |
|
\&LibType_text, $self, |
198 |
|
} |
199 |
|
$self->{switch}->parse("makebuild"); # sort out supported tags |
200 |
|
close GNUmakefile; |
201 |
< |
return $outfile; |
201 |
> |
return $outfile; |
202 |
|
} |
203 |
|
|
204 |
|
sub ParseBuildFile { |
219 |
|
$self->{envnum}=0; |
220 |
|
$self->{envlevel}=0; |
221 |
|
$self->{makefile}="$self->{localtop}/$ENV{INTwork}/$self->{path}/". |
222 |
< |
"BuildFile.mk"; |
223 |
< |
$self->{currentenv}=$self->{makefile}; |
222 |
> |
"BuildFile.mk"; |
223 |
> |
$self->{currentenv}=$self->{makefile}; |
224 |
|
$self->{switch}=$self->_initswitcher(); |
225 |
|
$self->{switch}->filetoparse($fullfilename); |
226 |
|
|
227 |
|
# $self->{switch}->{Strict_no_cr}='no'; |
228 |
|
#open a temporary gnumakefile to store output. |
229 |
|
use Utilities::AddDir; |
230 |
< |
AddDir::adddir("$self->{localtop}/$ENV{INTwork}/$self->{path}"); |
231 |
< |
$ENV{LatestBuildFile}=$self->GenerateMakefile($fullfilename, |
232 |
< |
$self->{localtop}."/".$ENV{INTwork}."/".$self->{path}."/BuildFile.mk"); |
230 |
> |
AddDir::adddir("$self->{localtop}/$ENV{INTwork}/$self->{path}"); |
231 |
> |
$ENV{LatestBuildFile}=$self->GenerateMakefile($fullfilename, |
232 |
> |
$self->{localtop}."/".$ENV{INTwork}."/".$self->{path}."/BuildFile.mk"); |
233 |
|
} |
234 |
|
|
235 |
|
sub classname { |
236 |
< |
my $self=shift; |
237 |
< |
if ( @_ ) { |
238 |
< |
$self->{classname}=shift; |
239 |
< |
} |
240 |
< |
return $self->{classname}; |
236 |
> |
my $self=shift; |
237 |
> |
if ( @_ ) { |
238 |
> |
$self->{classname}=shift; |
239 |
> |
} |
240 |
> |
return $self->{classname}; |
241 |
|
} |
242 |
|
|
243 |
|
sub ParseBuildFile_Export { |
244 |
|
my $self=shift; |
245 |
|
my $filename=shift; |
246 |
< |
my $bf=BuildSystem::BuildFile->new($self->{area}); |
246 |
> |
my $bf=BuildSystem::BuildFile->new($self->{area},$self->{Builder}); |
247 |
|
if ( defined $self->{remoteproject} ) { |
248 |
|
$bf->{remoteproject}=$self->{remoteproject}; |
249 |
|
} |
319 |
|
|
320 |
|
if ( $self->{Arch} ) { |
321 |
|
if ( defined $$hashref{'type'} ) { |
322 |
< |
$self->classname($$hashref{'type'}); |
322 |
> |
$self->classname($$hashref{'type'}); |
323 |
|
} |
324 |
|
} |
325 |
|
} |
344 |
|
# Parameter collection |
345 |
|
# |
346 |
|
sub BuildBlock_start { |
347 |
< |
my $self=shift; |
348 |
< |
my $name=shift; |
349 |
< |
my $hashref=shift; |
347 |
< |
|
348 |
< |
|
349 |
< |
my $blockobjid=$self->__blockobjid($hashref); |
350 |
< |
|
351 |
< |
if ( $self->{Arch} ) { |
352 |
< |
|
353 |
< |
|
354 |
< |
# -- get any objects that match |
355 |
< |
my $inheritobj=$self->{block}->getobj($blockobjid); |
356 |
< |
|
357 |
< |
# -- create an object with inherited properties |
358 |
< |
my $obj; |
359 |
< |
if ( ! defined $inheritobj ) { |
360 |
< |
# -- check we have a lookup for the class type |
361 |
< |
my $mapper=$self->_toolmapper(); |
362 |
< |
if ( ! $mapper->exists($$hashref{'class'}) ) { |
363 |
< |
$self->{switch}->parseerror("Unknown class : ". |
364 |
< |
$$hashref{'class'}); |
365 |
< |
} |
366 |
< |
$obj=BuildSystem::BuildClass->new(); |
367 |
< |
} |
368 |
< |
else { |
369 |
< |
# -- inherit the properties from class with the same id class |
370 |
< |
$obj=$inheritobj->child(); |
371 |
< |
} |
372 |
< |
|
373 |
< |
# -- add changes from our tag |
374 |
< |
$obj->paramupdate($hashref); |
375 |
< |
|
376 |
< |
# -- store the new object in the block |
377 |
< |
$self->{block}->setobj($obj,$blockobjid); |
378 |
< |
} |
379 |
< |
} |
380 |
< |
|
381 |
< |
sub BuilderClass_buildmakefile { |
382 |
< |
my $self=shift; |
383 |
< |
my $name=shift; |
384 |
< |
my $hashref=shift; |
385 |
< |
|
386 |
< |
my $blockobjid=$self->__blockobjid($hashref); |
347 |
> |
my $self=shift; |
348 |
> |
my $name=shift; |
349 |
> |
my $hashref=shift; |
350 |
|
|
388 |
– |
if ( $self->{Arch} ) { |
389 |
– |
# -- get the matching block object |
390 |
– |
my $blockobj=$self->{buildblock}->getobj($blockobjid); |
351 |
|
|
352 |
< |
# -- top level buildfile |
393 |
< |
my $fh=$self->{filehandlestack}[0]; |
352 |
> |
my $blockobjid=$self->__blockobjid($hashref); |
353 |
|
|
354 |
< |
# -- var initialisation |
396 |
< |
my @deftypes=(); |
397 |
< |
my $buildname=""; |
398 |
< |
my @types=$self->_toolmapper()->types($$hashref{'class'}); |
354 |
> |
if ( $self->{Arch} ) { |
355 |
|
|
356 |
< |
# -- error checking |
357 |
< |
if ( ! defined $blockobj->param("default") ) { |
402 |
< |
$self->error("No default build parameter defined for ". |
403 |
< |
$$hashref{'class'}." ".$$hashref{'id'}); |
404 |
< |
} |
405 |
< |
if ( ! defined $blockobj->param("name") ) { |
406 |
< |
$self->error("\"name\" parameter defined for ". |
407 |
< |
$$hashref{'class'}." ".$$hashref{'id'}); |
408 |
< |
} |
356 |
> |
# -- get any objects that match |
357 |
> |
my $inheritobj=$self->{block}->getobj($blockobjid); |
358 |
|
|
359 |
+ |
# -- create an object with inherited properties |
360 |
+ |
my $obj; |
361 |
+ |
if ( ! defined $inheritobj ) { |
362 |
+ |
# -- check we have a lookup for the class type |
363 |
+ |
my $mapper=$self->_toolmapper(); |
364 |
+ |
if ( ! $mapper->exists($$hashref{'class'}) ) { |
365 |
+ |
$self->{switch}->parseerror("Unknown class : ". |
366 |
+ |
$$hashref{'class'}); |
367 |
+ |
} |
368 |
+ |
$obj=BuildSystem::BuildClass->new(); |
369 |
+ |
} |
370 |
+ |
else { |
371 |
+ |
# -- inherit the properties from class with the same id class |
372 |
+ |
$obj=$inheritobj->child(); |
373 |
+ |
} |
374 |
|
|
375 |
< |
foreach $param ( $blockobj->paramlist() ) { |
376 |
< |
# -- check for params that need special handling |
413 |
< |
if ( $param eq "default" ) { |
414 |
< |
@deftypes=split /,/, $param; |
415 |
< |
} |
416 |
< |
elsif ( $param eq "name" ) { |
417 |
< |
$buildname=$blockobj->param($param); |
418 |
< |
} |
419 |
< |
else { |
420 |
< |
# -- simple transfer of block object parameters to makefile |
421 |
< |
print $fh $param.":=".$blockobj->param($param)."\n"; |
422 |
< |
} |
423 |
< |
} |
424 |
< |
|
425 |
< |
# -- construct the targets in the top makefile |
426 |
< |
$self->_generatedefaulttargets($fh,$$hashref{'class'},@deftypes); |
427 |
< |
$self->_generatetypetargets($fh,$$hashref{'class'},$buildname,@types); |
375 |
> |
# -- add changes from our tag |
376 |
> |
$obj->paramupdate($hashref); |
377 |
|
|
378 |
< |
} |
378 |
> |
# -- store the new object in the block |
379 |
> |
$self->{block}->setobj($obj,$blockobjid); |
380 |
> |
} |
381 |
|
} |
382 |
|
|
383 |
< |
sub _blockobjid { |
384 |
< |
my $self=shift; |
385 |
< |
my $hashref=shift; |
386 |
< |
|
436 |
< |
$self->{switch}->checktag($name,$hashref,'class'); |
437 |
< |
$self->{switch}->checktag($name,$hashref,'id'); |
438 |
< |
my $blockobjid="bc_".$$hashref{'class'},"_".$$hashref{'id'}; |
383 |
> |
sub BuilderClass_buildmakefile { |
384 |
> |
my $self=shift; |
385 |
> |
my $name=shift; |
386 |
> |
my $hashref=shift; |
387 |
|
|
388 |
< |
return $blockobjid; |
441 |
< |
} |
388 |
> |
my $blockobjid=$self->__blockobjid($hashref); |
389 |
|
|
390 |
< |
sub _generatedefaulttargets { |
391 |
< |
my $self=shift; |
392 |
< |
my $fh=shift; |
446 |
< |
my $class=shift; |
390 |
> |
if ( $self->{Arch} ) { |
391 |
> |
# -- get the matching block object |
392 |
> |
my $blockobj=$self->{buildblock}->getobj($blockobjid); |
393 |
|
|
394 |
< |
my @deftypes=shift; |
394 |
> |
# -- top level buildfile |
395 |
> |
my $fh=$self->{filehandlestack}[0]; |
396 |
|
|
397 |
< |
print $fh "# -- Default type targets\n"; |
398 |
< |
foreach $dtype ( @deftypes ) { |
399 |
< |
print $fh $class."::".$class."_".$dtype."\n"; |
397 |
> |
# -- var initialisation |
398 |
> |
my @deftypes=(); |
399 |
> |
my $buildname=""; |
400 |
> |
my @types=$self->_toolmapper()->types($$hashref{'class'}); |
401 |
> |
|
402 |
> |
# -- error checking |
403 |
> |
if ( ! defined $blockobj->param("default") ) { |
404 |
> |
$self->error("No default build parameter defined for ". |
405 |
> |
$$hashref{'class'}." ".$$hashref{'id'}); |
406 |
> |
} |
407 |
> |
if ( ! defined $blockobj->param("name") ) { |
408 |
> |
$self->error("\"name\" parameter defined for ". |
409 |
> |
$$hashref{'class'}." ".$$hashref{'id'}); |
410 |
> |
} |
411 |
> |
|
412 |
> |
|
413 |
> |
foreach $param ( $blockobj->paramlist() ) { |
414 |
> |
# -- check for params that need special handling |
415 |
> |
if ( $param eq "default" ) { |
416 |
> |
@deftypes=split /,/, $param; |
417 |
> |
} |
418 |
> |
elsif ( $param eq "name" ) { |
419 |
> |
$buildname=$blockobj->param($param); |
420 |
> |
} |
421 |
> |
else { |
422 |
> |
# -- simple transfer of block object parameters to makefile |
423 |
> |
print $fh $param.":=".$blockobj->param($param)."\n"; |
424 |
> |
} |
425 |
> |
} |
426 |
> |
|
427 |
> |
# -- construct the targets in the top makefile |
428 |
> |
$self->_generatedefaulttargets($fh,$$hashref{'class'},@deftypes); |
429 |
> |
$self->_generatetypetargets($fh,$$hashref{'class'},$buildname,@types); |
430 |
|
} |
454 |
– |
print $fh "\n"; |
431 |
|
} |
432 |
|
|
433 |
< |
sub _generatetypetargets { |
434 |
< |
my $self=shift; |
435 |
< |
my $fh=shift; |
460 |
< |
my $class=shift; |
461 |
< |
my $name=shift; |
462 |
< |
|
463 |
< |
my @types=shift; |
464 |
< |
|
465 |
< |
print $fh "# -- Generic type targets\n"; |
466 |
< |
foreach $type ( @types ) { |
467 |
< |
my $pattern=$class."_".$type; |
468 |
< |
my $dirname=$class."_".$type."_".$name; |
469 |
< |
my $makefile=$here."/BuildFile.mk"; |
470 |
< |
|
471 |
< |
# -- map to generic name for each type |
472 |
< |
print $fh "# ------ $pattern rules ---------------\n"; |
473 |
< |
print $fh $class."_".$type."::".$class. |
474 |
< |
"_".$type."_$name\n\n"; |
475 |
< |
|
476 |
< |
print $fh "# -- Link Targets to $type directories\n"; |
477 |
< |
print $fh "$dirname: make_$dirname\n"; |
478 |
< |
print $fh "\t\@cd $here; \\\n"; |
479 |
< |
print $fh "\t\$(MAKE) LatestBuildFile=$makefile _BuildLink_=1". |
480 |
< |
" workdir=$here ". |
481 |
< |
" -f \$(TOOL_HOME)/basics.mk datestamp \$\@; \n\n"; |
433 |
> |
sub _blockobjid { |
434 |
> |
my $self=shift; |
435 |
> |
my $hashref=shift; |
436 |
|
|
437 |
< |
# -- write target to make makefile for each directory |
438 |
< |
print $fh "# -- Build target directories\n"; |
439 |
< |
print $fh "make_$dirname:\n"; |
486 |
< |
print $fh "\tif [ ! -e \"$makefile\" ]; then \\\n"; |
487 |
< |
print $fh "\t if [ ! -d \"$here\" ]; then \\\n"; |
488 |
< |
print $fh "\t mkdir $here; \\\n"; |
489 |
< |
print $fh "\t fi;\\\n"; |
490 |
< |
print $fh "\t cd $dirname; \\\n"; |
491 |
< |
print $fh "\t echo include ".$self->{currentenv}." > ". |
492 |
< |
"$makefile; \\\n"; |
493 |
< |
print $fh "\t echo VPATH+=$self->{localtop}/".$self->{path}. |
494 |
< |
" >> $makefile; \\\n"; |
495 |
< |
print $fh "\t echo buildname=$name >> $makefile;\\\n"; |
496 |
< |
print $fh "\t echo ".$dirname.":".$pattern." >> $makefile;\\\n"; |
497 |
< |
if ( defined (my @file=$mapper->rulesfile($class)) ) { |
498 |
< |
foreach $f ( @file ) { |
499 |
< |
print $fh "\t echo -include $f >> $makefile; \\\n"; |
500 |
< |
} |
501 |
< |
} |
502 |
< |
print $fh "\tfi\n"; |
503 |
< |
print $fh "\n"; |
437 |
> |
$self->{switch}->checktag($name,$hashref,'class'); |
438 |
> |
$self->{switch}->checktag($name,$hashref,'id'); |
439 |
> |
my $blockobjid="bc_".$$hashref{'class'},"_".$$hashref{'id'}; |
440 |
|
|
441 |
< |
# -- cleaning targets |
506 |
< |
push @targets, "clean_$dirname"; |
507 |
< |
print $fh "# -- cleaning targets\n"; |
508 |
< |
print $fh "clean::clean_$dirname\n"; |
509 |
< |
print $fh "clean_".$dirname."::\n"; |
510 |
< |
print $fh "\t\@echo cleaning $dirname\n"; |
511 |
< |
print $fh "\t\@if [ -d $here ]; then \\\n"; |
512 |
< |
print $fh "\tcd $here; \\\n"; |
513 |
< |
print $fh "\t\$(MAKE) LatestBuildFile=$makefile workdir=". |
514 |
< |
$here." _BuildLink_=1 -f ". |
515 |
< |
"\$(TOOL_HOME)/basics.mk clean; \\\n"; |
516 |
< |
print $fh "\tfi\n\n"; |
517 |
< |
|
518 |
< |
} |
519 |
< |
print $fh "\n"; |
441 |
> |
return $blockobjid; |
442 |
|
} |
443 |
|
|
522 |
– |
# |
523 |
– |
# generic build tag |
524 |
– |
# |
444 |
|
sub Build_start { |
445 |
|
my $self=shift; |
446 |
|
my $name=shift; |
474 |
|
|
475 |
|
# -- generate generic targets |
476 |
|
print $fh "ifndef _BuildLink_\n"; |
477 |
< |
$self->_generatedefaulttargets($fh,$$hashref{'class'},@deftypes); |
559 |
< |
|
477 |
> |
print $fh "# -- Generic targets\n"; |
478 |
|
push @targets, $$hashref{'class'}; |
479 |
+ |
foreach $dtype ( @deftypes ) { |
480 |
+ |
print $fh $$hashref{'class'}."::".$$hashref{'class'}."_". |
481 |
+ |
$dtype."\n"; |
482 |
+ |
} |
483 |
+ |
print $fh "\n"; |
484 |
|
|
485 |
|
# -- generate targets for each type |
486 |
|
foreach $type ( @types ) { |
495 |
|
# -- create a new directory for each type |
496 |
|
push @targets, $pattern; |
497 |
|
my $dirname=$$hashref{'class'}."_".$type."_".$name; |
498 |
< |
my $here="$self->{localtop}/$ENV{INTwork}/".$self->{path}. |
576 |
< |
"/".$dirname; |
498 |
> |
my $here="$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/".$dirname; |
499 |
|
my $makefile=$here."/BuildFile.mk"; |
500 |
|
# AddDir::adddir($here); |
501 |
|
|
518 |
|
print $fh "\t cd $dirname; \\\n"; |
519 |
|
print $fh "\t echo include ".$self->{currentenv}." > ". |
520 |
|
"$makefile; \\\n"; |
521 |
< |
print $fh "\t echo VPATH+=$self->{localtop}/".$self->{path}. |
521 |
> |
print $fh "\t echo VPATH+=$ENV{LOCALTOP}/".$self->{path}. |
522 |
|
" >> $makefile; \\\n"; |
523 |
|
print $fh "\t echo buildname=$name >> $makefile;\\\n"; |
524 |
|
print $fh "\t echo ".$dirname.":".$pattern." >> $makefile;\\\n"; |
584 |
|
|
585 |
|
# Create a new directory for each binary target |
586 |
|
my $dirname="bin_".$$hashref{name}; |
587 |
< |
AddDir::adddir("$self->{localtop}/$ENV{INTwork}/".$self->{path}."/$dirname"); |
587 |
> |
AddDir::adddir("$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/$dirname"); |
588 |
|
open (binGNUmakefile, |
589 |
< |
">$self->{localtop}/$ENV{INTwork}/".$self->{path}."/$dirname/BuildFile.mk") or die "Unable to make $self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname/". |
589 |
> |
">$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/$dirname/BuildFile.mk") or die "Unable to make $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname/". |
590 |
|
"BuildFile.mk $!\n"; |
591 |
|
|
592 |
|
# Create the link targets |
602 |
|
ifndef BINMODE |
603 |
|
|
604 |
|
define stepdown_$$hashref{'name'} |
605 |
< |
if [ -d "$self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\ |
606 |
< |
cd $self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname; \\ |
607 |
< |
\$(MAKE) BINMODE=true LatestBuildFile=$self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\@; \\ |
605 |
> |
if [ -d "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\ |
606 |
> |
cd $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname; \\ |
607 |
> |
\$(MAKE) BINMODE=true LatestBuildFile=$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\@; \\ |
608 |
|
fi |
609 |
|
endef |
610 |
|
|
611 |
|
define stepdown2_$$hashref{'name'} |
612 |
< |
if [ -d "$self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\ |
613 |
< |
cd $self->{localtop}/$ENV{INTwork}/$self->{path}/$dirname; \\ |
614 |
< |
\$(MAKE) BINMODE=true LatestBuildFile=$self->{localtop}/$ENV{INTwork}/$self{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\*; \\ |
612 |
> |
if [ -d "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname" ]; then \\ |
613 |
> |
cd $ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/$dirname; \\ |
614 |
> |
\$(MAKE) BINMODE=true LatestBuildFile=$ENV{LOCALTOP}/$ENV{INTwork}/$self{path}/$dirname/BuildFile.mk workdir=\$(workdir)/$dirname -f \$(TOOL_HOME)/basics.mk datestamp \$\*; \\ |
615 |
|
fi |
616 |
|
|
617 |
|
endef |
635 |
|
|
636 |
|
# the binary specifics makefile |
637 |
|
print binGNUmakefile "include ".$self->{currentenv}."\n"; |
638 |
< |
print binGNUmakefile "VPATH+=".$self->{localtop}."/$self{path}\n"; |
638 |
> |
print binGNUmakefile "VPATH+=$ENV{LOCALTOP}/$self{path}\n"; |
639 |
|
|
640 |
|
# alias for bin_Insure |
641 |
|
print binGNUmakefile <<ENDTEXT; |
814 |
|
if ( ! defined $self->{remoteproject} ) { |
815 |
|
$filename=SCRAMUtils::checkfile( |
816 |
|
"/$ENV{INTsrc}/$$hashref{name}/BuildFile"); |
817 |
+ |
# -- force a dependency check if local |
818 |
+ |
if ( $filename=~/^$self->{localtop}/ ) { |
819 |
+ |
$self->{Builder}->BuildDir($ENV{INTsrc}."/".$$hashref{'name'}); |
820 |
+ |
} |
821 |
|
} |
822 |
|
else { |
823 |
|
$filename=$self->{remoteproject}."/$$hashref{name}/BuildFile"; |
1029 |
|
$self->{envnum}++; |
1030 |
|
|
1031 |
|
# open a new Environment File |
1032 |
< |
my $envfile="$self->{localtop}/$ENV{INTwork}/$self->{path}/Env_". |
1032 |
> |
my $envfile=$self->{localtop}."/$ENV{INTwork}/$self->{path}/Env_". |
1033 |
|
$self->{envnum}.".mk"; |
1034 |
|
use FileHandle; |
1035 |
|
my $fh=FileHandle->new(); |
1080 |
|
} |
1081 |
|
|
1082 |
|
sub Store_start { |
1083 |
< |
my $self=shift; |
1084 |
< |
my $name=shift; |
1083 |
> |
my $self=shift; |
1084 |
> |
my $name=shift; |
1085 |
|
my $hashref=shift; |
1086 |
|
|
1087 |
< |
if ( $self->{Arch} ) { |
1088 |
< |
$self->{switch}->checktag( $name, $hashref, 'name' ); |
1087 |
> |
if ( $self->{Arch} ) { |
1088 |
> |
$self->{switch}->checktag( $name, $hashref, 'name' ); |
1089 |
|
|
1090 |
< |
# -- store creation |
1091 |
< |
my $dir=$$hashref{'name'}; |
1092 |
< |
AddDir::adddir($self->{area}->location()."/".$dir); |
1093 |
< |
if ( exists $$hashref{'type'} ) { |
1094 |
< |
# -- architecture specific store |
1095 |
< |
if ( $$hashref{'type'}=~/^arch/i ) { |
1096 |
< |
$dir=$dir."/".$ENV{SCRAM_ARCH}; |
1097 |
< |
AddDir::adddir($self->{area}->location()."/".$dir); |
1098 |
< |
} |
1099 |
< |
else { |
1100 |
< |
$self->parseerror("Unknown type in <$name> tag"); |
1101 |
< |
} |
1102 |
< |
} |
1103 |
< |
|
1104 |
< |
# -- set make variables for the store |
1105 |
< |
print GNUmakefile "SCRAMSTORENAME_".$$hashref{'name'}.":=".$dir."\n"; |
1106 |
< |
print GNUmakefile "SCRAMSTORE_".$$hashref{'name'}.":=". |
1107 |
< |
$self->{localtop}."/".$dir."\n"; |
1108 |
< |
print GNUmakefile "VPATH+=".$self->{localtop} |
1109 |
< |
."/".$dir.":".$self->{releasetop}."/".$dir."\n"; |
1110 |
< |
} |
1090 |
> |
# -- store creation |
1091 |
> |
my $dir=$$hashref{'name'}; |
1092 |
> |
AddDir::adddir($self->{localtop}."/".$dir); |
1093 |
> |
if ( exists $$hashref{'type'} ) { |
1094 |
> |
# -- architecture specific store |
1095 |
> |
if ( $$hashref{'type'}=~/^arch/i ) { |
1096 |
> |
$dir=$dir."/".$ENV{SCRAM_ARCH}; |
1097 |
> |
AddDir::adddir($self->{localtop}."/".$dir); |
1098 |
> |
} |
1099 |
> |
else { |
1100 |
> |
$self->parseerror("Unknown type in <$name> tag"); |
1101 |
> |
} |
1102 |
> |
} |
1103 |
> |
|
1104 |
> |
# -- set make variables for the store |
1105 |
> |
print GNUmakefile "SCRAMSTORENAME_".$$hashref{'name'}.":=".$dir."\n"; |
1106 |
> |
print GNUmakefile "SCRAMSTORE_".$$hashref{'name'}.":=". |
1107 |
> |
$self->{localtop}."/".$dir."\n"; |
1108 |
> |
print GNUmakefile "VPATH+=".$self->{localtop} |
1109 |
> |
."/".$dir.":".$self->{releasetop}."/".$dir."\n"; |
1110 |
> |
} |
1111 |
|
} |
1112 |
|
|
1187 |
– |
sub DropDown { |
1188 |
– |
my $self=shift; |
1189 |
– |
my $name=shift; |
1190 |
– |
my $hashref=shift; |
1191 |
– |
|
1192 |
– |
if ( $self->{Arch} ) { |
1193 |
– |
# - default values must always be specified |
1194 |
– |
$self->{switch}->checktag( $name, $hashref, 'defaults' ); |
1195 |
– |
my @blockdirs=split /,/ , $$hashref{'defaults'}; |
1196 |
– |
$self->{block}->defaultblocks(@blockdirs); |
1197 |
– |
} |
1198 |
– |
} |