37 |
|
'ClassPath_StartTag' => \&setBlockClassPath, |
38 |
|
'lib' => 'none', |
39 |
|
'lib_StartTag' => \&lib_start, |
40 |
< |
'lib_EndTag' => 'none' |
40 |
> |
'lib_EndTag' => 'none', |
41 |
> |
'ignore' => 'none', |
42 |
> |
'ignore_EndTag' => \&ignoretag_end, |
43 |
> |
'ignore_StartTag' => \&ignoretag, |
44 |
> |
'Architecture_StartTag' => \&Arch_Start, |
45 |
> |
'Architecture_EndTag' => \&Arch_End, |
46 |
> |
'Architecture' => \&OutToMakefile, |
47 |
> |
'LibType_StartTag' => \&LibType_Start, |
48 |
> |
'LibType_EndTag' => 'none', |
49 |
> |
'LibType' => \&OutToMakefile |
50 |
|
}; |
51 |
|
use Utilities::Switcher; |
52 |
|
$switch=Switcher->new($SupportedTags, $fullfilename); |
75 |
|
'export_StartTag' => \&export_start, |
76 |
|
'export_EndTag' => \&export_end, |
77 |
|
'lib_StartTag' => \&lib_start_export, |
78 |
+ |
'External_StartTag' => \&Ext_start_export, |
79 |
|
'lib' => 'none' |
80 |
|
}; |
81 |
|
use Utilities::Switcher; |
113 |
|
my @vars=@_; |
114 |
|
|
115 |
|
$hashref=$switch->SetupValueHash(\@vars); |
116 |
+ |
if ( $Arch ) { |
117 |
|
if ( defined $$hashref{'type'} ) { |
118 |
|
$ClassName=$$hashref{'type'}; |
119 |
|
} |
120 |
+ |
} |
121 |
|
} |
122 |
|
|
123 |
|
sub ClassPath_StartTag { |
126 |
|
my $hashref; |
127 |
|
|
128 |
|
$hashref=$switch->SetupValueHash(\@vars); |
129 |
+ |
if ( $Arch ) { |
130 |
|
if ( defined $$hashref{'defaultpath'} ) { |
131 |
|
} |
132 |
+ |
} |
133 |
|
} |
134 |
|
|
135 |
|
sub Bin_start { |
144 |
|
|
145 |
|
$hashref=$switch->SetupValueHash(\@vars); |
146 |
|
$switch->checkparam($hashref, $name, 'file'); |
147 |
+ |
if ( $Arch ) { |
148 |
|
if ( ! defined $$hashref{name} ) { |
149 |
|
($$hashref{name}=$$hashref{file})=~s/\..*//; |
150 |
|
} |
155 |
|
($objectname=$$hashref{file})=~s/\..*/\.o/; |
156 |
|
($objectname_d=$$hashref{file})=~s/\..*/_d\.o/; |
157 |
|
($objectname_Insure=$$hashref{file})=~s/\..*/_Insure\.o/; |
158 |
< |
print GNUmakefile "bin:$$hashref{name}\n"; |
158 |
> |
print GNUmakefile "bin:$$hashref{name}_o\n"; |
159 |
|
print GNUmakefile "bin_debug:$$hashref{name}_d\n"; |
160 |
|
print GNUmakefile "bin_insure:$$hashref{name}_Insure\n"; |
161 |
< |
print GNUmakefile ".INTERMEDIATE::$$hashref{name}_d.exe\n"; |
162 |
< |
print GNUmakefile ".INTERMEDIATE::$$hashref{name}_Insure.exe\n"; |
161 |
> |
# print GNUmakefile ".INTERMEDIATE::$$hashref{name}_d.exe\n"; |
162 |
> |
# print GNUmakefile ".INTERMEDIATE::$$hashref{name}_Insure.exe\n"; |
163 |
|
print GNUmakefile ".INTERMEDIATE::$$hashref{name}.exe\n"; |
164 |
|
print GNUmakefile "$$hashref{name}_Insure:.psrc\n"; |
165 |
|
print GNUmakefile "$$hashref{name}_d.exe:$objectname_d\n"; |
177 |
|
print GNUmakefile <<ENDTEXT; |
178 |
|
$$hashref{name}_d.exe:\$(libslocal_d) |
179 |
|
$$hashref{name}.exe:\$(libslocal) |
180 |
+ |
ifdef MCCABE_DATA_DIR |
181 |
+ |
$$hashref{name}_mccabe.exe: \$(libslocal_d) $(MCCABE_DATA_DIR)/mccabeinstr/instplus.cpp |
182 |
+ |
endif |
183 |
|
$$hashref{name}_Insure.exe:\$(libslocal_I) |
184 |
|
$$hashref{name}_d:$$hashref{name}_d.exe |
185 |
< |
\@mv $$hashref{name}_d.exe \$(binarystore)/$$hashref{name} |
185 |
> |
\@cp $$hashref{name}_d.exe \$(binarystore)/$$hashref{name} |
186 |
|
$$hashref{name}_Insure:$$hashref{name}_Insure.exe |
187 |
< |
\@mv $$hashref{name}_Insure.exe \$(binarystore)/$$hashref{name}_Insure |
187 |
> |
\@cp $$hashref{name}_Insure.exe \$(binarystore)/$$hashref{name}_Insure |
188 |
|
$$hashref{name}:$$hashref{name}_d.exe |
189 |
|
\@mv $$hashref{name}_d.exe \$(binarystore)/$$hashref{name} |
190 |
< |
$$hashref{name}_o:$$hashref{name}_o.exe |
190 |
> |
$$hashref{name}_o:$$hashref{name}.exe |
191 |
|
\@mv $$hashref{name}.exe \$(binarystore)/$$hashref{name} |
192 |
< |
binfiles+=$filename |
192 |
> |
binfiles+=$$hashref{file} |
193 |
|
bintargets+=$$hashref{name} $$hashref{name}_d $$hashref{name}_Insure |
194 |
|
ENDTEXT |
195 |
+ |
} |
196 |
+ |
} |
197 |
+ |
|
198 |
+ |
sub Ext_start_export { |
199 |
+ |
my $name=shift; |
200 |
+ |
my @vars=@_; |
201 |
+ |
my $hashref; |
202 |
+ |
|
203 |
+ |
$hashref=$switch->SetupValueHash(\@vars); |
204 |
+ |
if ( $Arch ) { |
205 |
+ |
if ( $switchex->context('export') ) { |
206 |
+ |
$$hashref{'ref'}=~tr[A-Z][a-z]; |
207 |
+ |
print GNUmakefile $$hashref{'ref'}; |
208 |
+ |
if ( defined $$hashref{'version'} ) { |
209 |
+ |
print GNUmakefile "_V_".$$hashref{'version'}; |
210 |
+ |
} |
211 |
+ |
print GNUmakefile "=true\n"; |
212 |
+ |
} |
213 |
+ |
} |
214 |
|
} |
215 |
|
|
216 |
|
sub External_StartTag { |
237 |
|
|
238 |
|
$hashref=$switch->SetupValueHash(\@vars); |
239 |
|
$switch->checkparam($hashref, $name, 'name'); |
240 |
+ |
if ( $Arch ) { |
241 |
|
print GNUmakefile "GROUP_".$$hashref{'name'}; |
242 |
|
if ( defined $$hashref{'version'} ) { |
243 |
|
print GNUmakefile "_V_".$$hashref{'version'}; |
244 |
|
} |
245 |
|
print GNUmakefile "=true\n"; |
246 |
+ |
} |
247 |
|
} |
248 |
|
|
249 |
|
sub External { |
270 |
|
|
271 |
|
$hashref=$switch->SetupValueHash(\@vars); |
272 |
|
$switch->checkparam($hashref, $name, "name"); |
273 |
+ |
if ( $Arch ) { |
274 |
|
$filename=SCRAMUtils::checkfile( |
275 |
|
"$ENV{INTsrc}/$$hashref{name}/BuildFile"); |
276 |
|
if ( $filename ne "" ) { |
277 |
|
ParseBuildFile_Export( $filename ); |
278 |
|
} |
279 |
+ |
} |
280 |
|
} |
281 |
|
|
282 |
|
sub CheckBuildFile { |
309 |
|
} |
310 |
|
} |
311 |
|
|
312 |
+ |
sub ignoretag { |
313 |
+ |
my $name=shift; |
314 |
+ |
my @vars=@_; |
315 |
+ |
|
316 |
+ |
$Arch=0; |
317 |
+ |
push @ARCHBLOCK, $Arch; |
318 |
+ |
} |
319 |
+ |
|
320 |
+ |
sub ignoretag_end { |
321 |
+ |
my $name=shift; |
322 |
+ |
my @vars=@_; |
323 |
+ |
|
324 |
+ |
pop @ARCHBLOCK; |
325 |
+ |
$Arch=$ARCHBLOCK[$#ARCHBLOCK]; |
326 |
+ |
} |
327 |
+ |
|
328 |
+ |
sub Arch_Start { |
329 |
+ |
my $name=shift; |
330 |
+ |
my @vars=@_; |
331 |
+ |
my $hashref; |
332 |
+ |
|
333 |
+ |
$hashref=$toolswitch->SetupValueHash( \@vars ); |
334 |
+ |
$toolswitch->checkparam($hashref, $name, 'name'); |
335 |
+ |
#( ($$hashref{name}=~/$ENV{SCRAM_ARCH}/) )?$Arch=1:$Arch=0; |
336 |
+ |
( ($ENV{SCRAM_ARCH}=~/$$hashref{name}.*/) )? ($Arch=1) : ($Arch=0); |
337 |
+ |
push @ARCHBLOCK, $Arch; |
338 |
+ |
} |
339 |
+ |
sub Arch_End { |
340 |
+ |
my $name=shift; |
341 |
+ |
my @vars=@_; |
342 |
+ |
|
343 |
+ |
pop @ARCHBLOCK; |
344 |
+ |
$Arch=$ARCHBLOCK[$#ARCHBLOCK]; |
345 |
+ |
} |
346 |
+ |
|
347 |
|
# Split up the Class Block String into a useable array |
348 |
|
sub _CutBlock { |
349 |
|
my $string= shift @_; |
409 |
|
print GNUmakefile "lib+=$$hashref{name}\n"; |
410 |
|
} |
411 |
|
} |
412 |
+ |
|
413 |
+ |
# |
414 |
+ |
# libtype specification |
415 |
+ |
# |
416 |
+ |
sub LibType_Start { |
417 |
+ |
my $name=shift; |
418 |
+ |
my @vars=@_; |
419 |
+ |
my $hashref; |
420 |
+ |
|
421 |
+ |
if ( $Arch ) { |
422 |
+ |
$hashref=$switch->SetupValueHash( \@vars ); |
423 |
+ |
$switch->checkparam($hashref, $name, 'type'); |
424 |
+ |
|
425 |
+ |
print GNUmakefile "# Specify Library Type\n"; |
426 |
+ |
print GNUmakefile "DefaultLibsOff=yes\n"; |
427 |
+ |
if ( $$hashref{'type'}=~/^archive/i ) { |
428 |
+ |
print GNUmakefile "LibArchive=true\n"; |
429 |
+ |
} |
430 |
+ |
elsif ($$hashref{'type'}=~/debug_archive/i ) { |
431 |
+ |
print GNUmakefile "LibDebugArchive=true\n"; |
432 |
+ |
} |
433 |
+ |
elsif ($$hashref{'type'}=~/debug_shared/i ) { |
434 |
+ |
print GNUmakefile "LibDebugShared=true\n"; |
435 |
+ |
} |
436 |
+ |
elsif ($$hashref{'type'}=~/shared/i ) { |
437 |
+ |
print GNUmakefile 'LibShared=true'."\n"; |
438 |
+ |
} |
439 |
+ |
print GNUmakefile "\n"; |
440 |
+ |
} |
441 |
+ |
} |