5 |
|
# new(ConfigArea) |
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 |
28 |
|
$self->{area}=shift; |
29 |
|
$self->{toolbox}=$self->{area}->toolbox(); |
30 |
|
$self->{localtop}=$self->{area}->location(); |
31 |
+ |
# -- set RELEASTOP |
32 |
+ |
my $rarea=$self->{area}->linkarea(); |
33 |
+ |
if ( ! defined $rarea ) { |
34 |
+ |
$self->{releasetop}=$self->{localtop}; |
35 |
+ |
} |
36 |
+ |
else { |
37 |
+ |
$self->{releasetop}=$rarea->location(); |
38 |
+ |
} |
39 |
+ |
$self->{releasetop}=$self->{area}->location(); |
40 |
|
$self->{Arch}=1; |
41 |
|
push @{$self->{ARCHBLOCK}}, $self->{Arch}; |
42 |
|
return $self; |
58 |
|
return $self->{makefile}; |
59 |
|
} |
60 |
|
|
61 |
+ |
sub blockparse { |
62 |
+ |
my $self=shift; |
63 |
+ |
$self->{block}=shift; |
64 |
+ |
|
65 |
+ |
$self->{switch}=$self->_initswitcher(); |
66 |
+ |
$self->_initblockparse($self->{switch}); |
67 |
+ |
} |
68 |
+ |
|
69 |
|
sub ignore { |
70 |
|
my $self=shift; |
71 |
|
return (defined $self->{ignore})?$self->{ignore}:0; |
78 |
|
$switch->newparse($parse); |
79 |
|
$switch->addignoretags($parse); |
80 |
|
$self->_commontags($switch,$parse); |
81 |
< |
$switch->addtag($parse,"Build", \&Build_start, $self); |
81 |
> |
#$switch->addtag($parse,"Build", \&Build_start, $self); |
82 |
|
$switch->addtag($parse,"none", |
83 |
|
\&OutToMakefile,$self, |
84 |
|
\&OutToMakefile, $self, |
87 |
|
\&Bin_start,$self, |
88 |
|
\&OutToScreen, $self, |
89 |
|
"", $self); |
90 |
+ |
$switch->addtag($parse,"ProductStore", |
91 |
+ |
\&Store_start,$self, |
92 |
+ |
"", $self, |
93 |
+ |
"", $self); |
94 |
|
$switch->addtag($parse,"LibType", |
95 |
|
\&LibType_Start,$self, |
96 |
|
\&LibType_text, $self, |
118 |
|
return $switch; |
119 |
|
} |
120 |
|
|
121 |
+ |
sub _initblockparse { |
122 |
+ |
my $self=shift; |
123 |
+ |
my $switch=shift; |
124 |
+ |
|
125 |
+ |
my $parse="block"; |
126 |
+ |
$switch->newparse($parse); |
127 |
+ |
$switch->addignoretags($parse); |
128 |
+ |
$switch->addtag($parse,"DropDown", |
129 |
+ |
\&DropDown_start,$self, |
130 |
+ |
"", $self, |
131 |
+ |
"", $self); |
132 |
+ |
$switch->addtag($parse,"Build", \&Build_start, $self); |
133 |
+ |
} |
134 |
+ |
|
135 |
|
sub _commontags { |
136 |
|
my $self=shift; |
137 |
|
my $switch=shift; |
183 |
|
if ( -e $ENV{LatestBuildFile} ) { |
184 |
|
print GNUmakefile "include $ENV{LatestBuildFile}\n"; |
185 |
|
} |
150 |
– |
$ENV{LatestBuildFile}=$outfile; |
186 |
|
$self->{switch}->parse("makebuild"); # sort out supported tags |
187 |
|
close GNUmakefile; |
188 |
+ |
return $outfile; |
189 |
|
} |
190 |
|
|
191 |
|
sub ParseBuildFile { |
215 |
|
#open a temporary gnumakefile to store output. |
216 |
|
use Utilities::AddDir; |
217 |
|
AddDir::adddir("$self->{localtop}/$ENV{INTwork}/$self->{path}"); |
218 |
< |
$self->GenerateMakefile($fullfilename, |
218 |
> |
$ENV{LatestBuildFile}=$self->GenerateMakefile($fullfilename, |
219 |
|
$self->{localtop}."/".$ENV{INTwork}."/".$self->{path}."/BuildFile.mk"); |
220 |
|
} |
221 |
|
|
332 |
|
my $hashref=shift; |
333 |
|
|
334 |
|
$self->{switch}->checktag($name,$hashref,'class'); |
335 |
+ |
$self->{switch}->checktag($name,$hashref,'id'); |
336 |
|
if ( $self->{Arch} ) { |
337 |
|
|
338 |
|
# -- determine the build products name |
520 |
|
|
521 |
|
# the binary specifics makefile |
522 |
|
print binGNUmakefile "include ".$self->{currentenv}."\n"; |
523 |
< |
print binGNUmakefile "VPATH+=$self->{localtop}/$self{path}\n"; |
523 |
> |
print binGNUmakefile "VPATH+=".$self->{localtop}."/$self{path}\n"; |
524 |
|
|
525 |
|
# alias for bin_Insure |
526 |
|
print binGNUmakefile <<ENDTEXT; |
959 |
|
} |
960 |
|
} |
961 |
|
} |
962 |
+ |
|
963 |
+ |
sub Store_start { |
964 |
+ |
my $self=shift; |
965 |
+ |
my $name=shift; |
966 |
+ |
my $hashref=shift; |
967 |
+ |
|
968 |
+ |
if ( $self->{Arch} ) { |
969 |
+ |
$self->{switch}->checktag( $name, $hashref, 'name' ); |
970 |
+ |
|
971 |
+ |
# -- store creation |
972 |
+ |
my $dir=$$hashref{'name'}; |
973 |
+ |
AddDir::adddir($self->{area}->location()."/".$dir); |
974 |
+ |
if ( exists $$hashref{'type'} ) { |
975 |
+ |
# -- architecture specific store |
976 |
+ |
if ( $$hashref{'type'}=~/^arch/i ) { |
977 |
+ |
$dir=$dir."/".$ENV{SCRAM_ARCH}; |
978 |
+ |
AddDir::adddir($self->{area}->location()."/".$dir); |
979 |
+ |
} |
980 |
+ |
else { |
981 |
+ |
$self->parseerror("Unknown type in <$name> tag"); |
982 |
+ |
} |
983 |
+ |
} |
984 |
+ |
|
985 |
+ |
# -- set make variables for the store |
986 |
+ |
print GNUmakefile "SCRAMSTORENAME_".$$hashref{'name'}.":=".$dir."\n"; |
987 |
+ |
print GNUmakefile "SCRAMSTORE_".$$hashref{'name'}.":=". |
988 |
+ |
$self->{localtop}."/".$dir."\n"; |
989 |
+ |
print GNUmakefile "VPATH+=".$self->{localtop} |
990 |
+ |
."/".$dir.":".$self->{releasetop}."/".$dir."\n"; |
991 |
+ |
} |
992 |
+ |
} |
993 |
+ |
|
994 |
+ |
sub DropDown { |
995 |
+ |
my $self=shift; |
996 |
+ |
my $name=shift; |
997 |
+ |
my $hashref=shift; |
998 |
+ |
|
999 |
+ |
if ( $self->{Arch} ) { |
1000 |
+ |
# - default values must always be specified |
1001 |
+ |
$self->{switch}->checktag( $name, $hashref, 'defaults' ); |
1002 |
+ |
my @blockdirs=split /,/ , $$hashref{'defaults'}; |
1003 |
+ |
$self->{block}->defaultblocks(@blockdirs); |
1004 |
+ |
} |
1005 |
+ |
} |