23 |
|
bless $self, $class; |
24 |
|
$self->{toolbox}=shift; |
25 |
|
$self->{Arch}=1; |
26 |
< |
push @{$self->{ARCHBLOCK}}, $Arch; |
26 |
> |
push @{$self->{ARCHBLOCK}}, $self->{Arch}; |
27 |
|
return $self; |
28 |
|
} |
29 |
|
|
50 |
|
$switch->addtag($parse,"LibType", |
51 |
|
\&LibType_Start,$self, |
52 |
|
\&LibType_text, $self, |
53 |
< |
"",$self); |
53 |
> |
\&LibType_end,$self); |
54 |
|
$switch->addtag($parse,"ConfigurationClass", |
55 |
|
\&Class_StartTag,$self, |
56 |
|
\&OutToMakefile, $self, |
93 |
|
"", $self); |
94 |
|
$switch->addtag($parse,"lib", |
95 |
|
\&lib_start,$self, |
96 |
< |
\&OutToScreen, $self, |
96 |
> |
\&OutToMakefile, $self, |
97 |
|
"", $self); |
98 |
|
$switch->addtag($parse,"Architecture", |
99 |
|
\&Arch_Start,$self, |
100 |
|
\&OutToMakefile, $self, |
101 |
|
\&Arch_End,$self); |
102 |
+ |
$switch->addtag($parse,"INCLUDE_PATH", |
103 |
+ |
\&IncludePath_Start,$self, |
104 |
+ |
\&OutToMakefile, $self, |
105 |
+ |
"",$self); |
106 |
|
return $switch; |
107 |
|
} |
108 |
|
|
126 |
|
use Utilities::AddDir; |
127 |
|
AddDir::adddir("$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}"); |
128 |
|
my $fh=FileHandle->new(); |
129 |
< |
open ( $fh, ">$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/BuildFile.mk" |
130 |
< |
) or die 'Unable to open /$ENV{INTwork}/$self->{path}/BuildFile.mk $!\n'; |
129 |
> |
open ( $fh, ">$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/BuildFile.mk" |
130 |
> |
) or die 'Unable to open /$ENV{INTwork}/".$self->{path}."/BuildFile.mk $!\n'; |
131 |
|
@{$self->{filehandlestack}}=($fh); |
132 |
|
# make an alias |
133 |
|
*GNUmakefile=$fh; |
136 |
|
} |
137 |
|
# print "writing to :\n". |
138 |
|
# "$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/BuildFile.mk\n"; |
139 |
< |
$ENV{LatestBuildFile}="$ENV{LOCALTOP}/$ENV{INTwork}/$self->{path}/BuildFile.mk"; |
139 |
> |
$ENV{LatestBuildFile}="$ENV{LOCALTOP}/$ENV{INTwork}/".$self->{path}."/BuildFile.mk"; |
140 |
|
$self->{switch}->parse("makebuild"); # sort out supported tags |
141 |
|
if ( $numbins > 0 ) { |
142 |
|
print GNUmakefile <<ENDTEXT; |
161 |
|
sub ParseBuildFile_Export { |
162 |
|
my $self=shift; |
163 |
|
my $filename=shift; |
164 |
< |
my $bf=BuildSystem::BuildFile->new(); |
164 |
> |
my $bf=BuildSystem::BuildFile->new($self->{toolbox}); |
165 |
|
if ( defined $self->{remoteproject} ) { |
166 |
|
$bf->{remoteproject}=$self->{remoteproject}; |
167 |
|
} |
169 |
|
undef $bf; |
170 |
|
} |
171 |
|
|
172 |
+ |
sub _location { |
173 |
+ |
my $self=shift; |
174 |
+ |
use File::Basename; |
175 |
+ |
|
176 |
+ |
return dirname($self->{switch}->filetoparse()); |
177 |
+ |
} |
178 |
+ |
|
179 |
|
sub _parseexport { |
180 |
|
my $self=shift; |
181 |
|
my $filename=shift; |
232 |
|
} |
233 |
|
} |
234 |
|
|
235 |
+ |
sub IncludePath_Start { |
236 |
+ |
my $self=shift; |
237 |
+ |
my $name=shift; |
238 |
+ |
my $hashref=shift; |
239 |
+ |
|
240 |
+ |
$self->{switch}->checktag( $name, $hashref, 'path'); |
241 |
+ |
if ( $self->{Arch} ) { |
242 |
+ |
print GNUmakefile "INCLUDE+=".$self->_location()."/". |
243 |
+ |
$$hashref{'path'}."\n"; |
244 |
+ |
} |
245 |
+ |
} |
246 |
+ |
|
247 |
|
sub Bin_start { |
248 |
|
my $self=shift; |
249 |
|
my $name=shift; |
492 |
|
|
493 |
|
$self->{switch}->checktag($name, $hashref, "name"); |
494 |
|
if ( $self->{Arch} ) { |
495 |
+ |
if ( exists $$hashref{'group'} ) { |
496 |
+ |
print GNUmakefile "GROUP_".$$hashref{'group'}."=true\n"; |
497 |
+ |
} |
498 |
|
if ( ! defined $self->{remoteproject} ) { |
499 |
|
$filename=SCRAMUtils::checkfile( |
500 |
|
"/$ENV{INTsrc}/$$hashref{name}/BuildFile"); |
553 |
|
my $name=shift; |
554 |
|
my $hashref=shift; |
555 |
|
|
556 |
< |
$toolswitch->checktag($name, $hashref,'name'); |
556 |
> |
$self->{switch}->checktag($name, $hashref,'name'); |
557 |
|
( ($ENV{SCRAM_ARCH}=~/$$hashref{name}.*/) )? ($self->{Arch}=1) |
558 |
|
: ($self->{Arch}=0); |
559 |
|
push @{$self->{ARCHBLOCK}}, $self->{Arch}; |
668 |
|
my $hashref=shift; |
669 |
|
|
670 |
|
if ( $self->{Arch} ) { |
671 |
+ |
if ( defined $self->{libtype_conext} ) { |
672 |
+ |
$self->{switch}->parseerror("<$name> tag cannot be specified". |
673 |
+ |
" without a </$name> tag to close previous context"); |
674 |
+ |
} |
675 |
+ |
else { |
676 |
+ |
$self->{libtype_conext}=1; |
677 |
|
$self->{switch}->checktag($name, $hashref, 'type'); |
678 |
|
|
679 |
|
print GNUmakefile "# Specify Library Type\n"; |
692 |
|
} |
693 |
|
print GNUmakefile "\n"; |
694 |
|
} |
695 |
+ |
} |
696 |
|
} |
697 |
+ |
|
698 |
|
sub LibType_text { |
699 |
|
my $self=shift; |
700 |
|
my $name=shift; |
701 |
|
my $string=shift; |
702 |
|
|
703 |
|
if ( $self->{Arch} ) { |
704 |
+ |
$string=~s/\n/ /g; |
705 |
|
print GNUmakefile "libmsg::\n\t\@echo Library info: "; |
706 |
|
print GNUmakefile $string; |
707 |
|
print GNUmakefile "\n"; |
708 |
|
} |
709 |
|
} |
710 |
|
|
711 |
+ |
sub LibType_end { |
712 |
+ |
my $self=shift; |
713 |
+ |
my $name=shift; |
714 |
+ |
|
715 |
+ |
undef $self->{libtype_conext}; |
716 |
+ |
} |
717 |
+ |
|
718 |
|
sub Environment_start { |
719 |
|
my $self=shift; |
720 |
|
my $name=shift; |