2 |
|
# |
3 |
|
# Interface |
4 |
|
# --------- |
5 |
< |
# new(ConfigArea) |
5 |
> |
# new(toolbox) |
6 |
|
# ParseBuildFile($base,$path,$file) |
7 |
|
# ParseBuildFileExport(filename) |
8 |
|
# BlockClassPath() : Return the class path |
21 |
|
my $class=shift; |
22 |
|
my $self={}; |
23 |
|
bless $self, $class; |
24 |
< |
$self->{area}=shift; |
25 |
< |
$self->{toolbox}=$self->{area}->toolbox(); |
24 |
> |
$self->{toolbox}=shift; |
25 |
|
$self->{Arch}=1; |
26 |
|
push @{$self->{ARCHBLOCK}}, $self->{Arch}; |
27 |
|
return $self; |
48 |
|
\&Bin_start,$self, |
49 |
|
\&OutToScreen, $self, |
50 |
|
"", $self); |
51 |
+ |
$switch->addtag($parse,"ProductStore", |
52 |
+ |
\&Store_start,$self, |
53 |
+ |
"", $self, |
54 |
+ |
"", $self); |
55 |
|
$switch->addtag($parse,"LibType", |
56 |
|
\&LibType_Start,$self, |
57 |
|
\&LibType_text, $self, |
111 |
|
return $switch; |
112 |
|
} |
113 |
|
|
111 |
– |
sub GenerateMakefile { |
112 |
– |
my $self=shift; |
113 |
– |
my $infile=shift; |
114 |
– |
my $outfile=shift; |
115 |
– |
|
116 |
– |
$self->{switch}=$self->_initswitcher(); |
117 |
– |
$self->{switch}->filetoparse($infile); |
118 |
– |
|
119 |
– |
# open a temporary gnumakefile to store output. |
120 |
– |
my $fh=FileHandle->new(); |
121 |
– |
open ( $fh, ">$outfile") or die "Unable to open $outfile for output ". |
122 |
– |
"$!\n"; |
123 |
– |
@{$self->{filehandlestack}}=($fh); |
124 |
– |
|
125 |
– |
# -- make an alias |
126 |
– |
*GNUmakefile=$fh; |
127 |
– |
if ( -e $ENV{LatestBuildFile} ) { |
128 |
– |
print GNUmakefile "include $ENV{LatestBuildFile}\n"; |
129 |
– |
} |
130 |
– |
$ENV{LatestBuildFile}=$outfile; |
131 |
– |
$self->{switch}->parse("makebuild"); # sort out supported tags |
132 |
– |
close GNUmakefile; |
133 |
– |
} |
134 |
– |
|
114 |
|
sub ParseBuildFile { |
115 |
|
my $self=shift; |
116 |
|
my $base=shift; |
124 |
|
$fullfilename=$filename; |
125 |
|
} |
126 |
|
$self->{path}=$path; |
148 |
– |
#print "Processing $fullfilename\n"; |
127 |
|
$numbins=0; |
128 |
|
$self->{envnum}=0; |
129 |
|
$self->{envlevel}=0; |
132 |
|
$self->{switch}=$self->_initswitcher(); |
133 |
|
$self->{switch}->filetoparse($fullfilename); |
134 |
|
|
135 |
< |
# $self->{switch}->{Strict_no_cr}='no'; |
158 |
< |
#open a temporary gnumakefile to store output. |
135 |
> |
# open a temporary gnumakefile to store output. |
136 |
|
use Utilities::AddDir; |
137 |
|
AddDir::adddir("$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}"); |
138 |
|
my $fh=FileHandle->new(); |
139 |
|
open ( $fh, ">$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/BuildFile.mk" |
140 |
< |
) or die 'Unable to open /$ENV{INTwork}/".$self->{path}."/BuildFile.mk $!\n'; |
140 |
> |
) or die "Unable to open /$ENV{INTwork}/".$self->{path}."/BuildFile.mk $!\n"; |
141 |
|
@{$self->{filehandlestack}}=($fh); |
142 |
|
# make an alias |
143 |
|
*GNUmakefile=$fh; |
144 |
|
if ( -e $ENV{LatestBuildFile} ) { |
145 |
|
print GNUmakefile "include $ENV{LatestBuildFile}\n"; |
146 |
|
} |
147 |
< |
# print "writing to :\n". |
171 |
< |
# "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/BuildFile.mk\n"; |
147 |
> |
|
148 |
|
$ENV{LatestBuildFile}="$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/BuildFile.mk"; |
149 |
|
$self->{switch}->parse("makebuild"); # sort out supported tags |
150 |
|
if ( $numbins > 0 ) { |
170 |
|
sub ParseBuildFile_Export { |
171 |
|
my $self=shift; |
172 |
|
my $filename=shift; |
173 |
< |
my $bf=BuildSystem::BuildFile->new($self->{area}); |
173 |
> |
my $bf=BuildSystem::BuildFile->new($self->{toolbox}); |
174 |
|
if ( defined $self->{remoteproject} ) { |
175 |
|
$bf->{remoteproject}=$self->{remoteproject}; |
176 |
|
} |
199 |
|
\&export_end_export,$self); |
200 |
|
$self->_commontags($switchex,"export"); |
201 |
|
$switchex->allowgroup("__export","export"); |
226 |
– |
# $switchex->{Strict_no_cr}='no'; |
202 |
|
$self->{switch}=$switchex; |
203 |
|
$switchex->parse("export"); # sort out supported tags |
204 |
|
} |
280 |
|
} |
281 |
|
else { |
282 |
|
$self->{switch}->parseerror("No name specified for build product"); |
308 |
– |
#$name="\$(buildname)"; |
283 |
|
} |
284 |
|
|
285 |
|
# -- check we have a lookup for the class type |
319 |
|
my $dirname=$$hashref{'class'}."_".$type."_".$name; |
320 |
|
my $here="$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/".$dirname; |
321 |
|
my $makefile=$here."/BuildFile.mk"; |
348 |
– |
# AddDir::adddir($here); |
322 |
|
|
323 |
|
# -- create link targets to the directory |
324 |
|
push @targets, $dirname; |
350 |
|
} |
351 |
|
print $fh "\tfi\n"; |
352 |
|
print $fh "\n"; |
380 |
– |
# print $typefile "$name :\n"; |
381 |
– |
# print $typefile "\t\$(_quietbuild_)"; |
382 |
– |
# print $typefile $mapper->template($$hashref{'class'},$type)."\n"; |
383 |
– |
# print $typefile "\t\$(_quietstamp_)"; |
384 |
– |
# print $typefile "$(SCRAMPERL) $(SCRAM_HOME)/src/scramdatestamp \$@.ds \$@ \$^\n"; |
353 |
|
|
354 |
|
# -- cleaning targets |
355 |
|
push @targets, "clean_$dirname"; |
507 |
|
print binGNUmakefile "$$hashref{name}_Insure.exe:.psrc\n"; |
508 |
|
print binGNUmakefile "$$hashref{name}_d.exe:$objectname_d\n"; |
509 |
|
print binGNUmakefile "\t\$(CClinkCmdDebug)\n"; |
510 |
< |
print binGNUmakefile "\t\@\$(SCRAMPERL) $(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n"; |
510 |
> |
print binGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n"; |
511 |
|
print binGNUmakefile "$$hashref{name}_l_d.exe:$objectname_d\n"; |
512 |
|
print binGNUmakefile "\t\$(CClinkCmdDebugLocal)\n"; |
513 |
< |
print binGNUmakefile "\t\@\$(SCRAMPERL) $(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n"; |
513 |
> |
print binGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n"; |
514 |
|
print binGNUmakefile "$$hashref{name}_Insure.exe:$objectname_Insure\n"; |
515 |
|
print binGNUmakefile "\t\$(CClinkCmdInsure)\n"; |
516 |
< |
print binGNUmakefile "\t\@\$(SCRAMPERL) $(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n"; |
516 |
> |
print binGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n"; |
517 |
|
print binGNUmakefile "$$hashref{name}_o.exe:$objectname_o\n"; |
518 |
|
print binGNUmakefile "\t\$(CClinkCmd)\n"; |
519 |
< |
print binGNUmakefile "\t\@\$(SCRAMPERL) $(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n"; |
519 |
> |
print binGNUmakefile "\t\@\$(SCRAMPERL) \$(SCRAM_HOME)/src/scramdatestamp \$\@\.ds \$\@ \$\^\n"; |
520 |
|
print binGNUmakefile "$$hashref{name}.dep:$$hashref{file}\n"; |
521 |
|
print binGNUmakefile "-include $$hashref{name}.dep\n"; |
522 |
|
print binGNUmakefile <<ENDTEXT; |
907 |
|
} |
908 |
|
} |
909 |
|
} |
910 |
+ |
|
911 |
+ |
sub Store_start { |
912 |
+ |
my $self=shift; |
913 |
+ |
my $name=shift; |
914 |
+ |
my $hashref=shift; |
915 |
+ |
|
916 |
+ |
if ( $self->{Arch} ) { |
917 |
+ |
$self->{switch}->checktag( $name, $hashref, 'name' ); |
918 |
+ |
|
919 |
+ |
# -- store creation |
920 |
+ |
my $dir=$$hashref{'name'}; |
921 |
+ |
AddDir::adddir($ENV{LOCALTOP}."/".$dir); |
922 |
+ |
if ( exists $$hashref{'type'} ) { |
923 |
+ |
# -- architecture specific store |
924 |
+ |
if ( $$hashref{'type'}=~/^arch/i ) { |
925 |
+ |
$dir=$dir."/".$ENV{SCRAM_ARCH}; |
926 |
+ |
AddDir::adddir($ENV{LOCALTOP}."/".$dir); |
927 |
+ |
} |
928 |
+ |
else { |
929 |
+ |
$self->parseerror("Unknown type in <$name> tag"); |
930 |
+ |
} |
931 |
+ |
} |
932 |
+ |
|
933 |
+ |
# -- set make variables for the store |
934 |
+ |
print GNUmakefile "SCRAMSTORENAME_".$$hashref{'name'}.":=".$dir."\n"; |
935 |
+ |
print GNUmakefile "SCRAMSTORE_".$$hashref{'name'}.":=". |
936 |
+ |
$ENV{LOCALTOP}."/".$dir."\n"; |
937 |
+ |
print GNUmakefile "VPATH+=".$ENV{LOCALTOP} |
938 |
+ |
."/".$dir.":".$ENV{RELEASETOP}."/".$dir."\n"; |
939 |
+ |
} |
940 |
+ |
} |
941 |
+ |
|