40 |
|
{ |
41 |
|
my $self=shift; |
42 |
|
my $outfile=shift; |
43 |
< |
|
43 |
> |
|
44 |
|
# -- specifiy these files for dependency information |
45 |
|
# NB: This file is never used! |
46 |
|
|
66 |
|
my $fout=FileHandle->new(); |
67 |
|
$fout->open(">".$outfile) or die "Unable to open $outfile for output". |
68 |
|
$!."\n"; |
69 |
< |
|
69 |
> |
|
70 |
|
# -- print out tool/ version info |
71 |
|
my ($tool,$toolobj,$f,$val,$version); |
72 |
< |
|
72 |
> |
|
73 |
|
foreach $tool ( $self->{toolbox}->tools() ) |
74 |
|
{ |
75 |
|
$version=$self->{toolbox}->defaultversion($tool); |
76 |
|
|
77 |
|
# default versions |
78 |
|
print $fout "ifdef $tool\n".$tool."_V_".$version."=true\nendif\n"; |
79 |
< |
|
79 |
> |
|
80 |
|
# -- set up the different version -- externals |
81 |
|
foreach $version ( $self->{toolbox}->versions($tool) ) |
82 |
|
{ |
95 |
|
{ |
96 |
|
foreach $val ( $toolobj->getfeature($f) ) |
97 |
|
{ |
98 |
< |
print $fout "\t".$f." += ".$val."\n"; |
98 |
> |
if ( $f eq 'LIBDIR' || $f eq 'INCLUDE' ) |
99 |
> |
{ |
100 |
> |
# Remove duplications: |
101 |
> |
print $fout "\t".$f." := \$(filter-out ".$val.",\$(".$f."))","\n"; |
102 |
> |
print $fout "\t".$f." += ".$val."\n"; |
103 |
> |
} |
104 |
> |
else |
105 |
> |
{ |
106 |
> |
print $fout "\t".$f." += ".$val."\n"; |
107 |
> |
} |
108 |
|
} |
109 |
|
} |
110 |
|
# -- include any makefiles associated with the tool |
121 |
|
print $fout 'LDFLAGS+=$(addprefix -L,$(LIBDIR))'."\n"; |
122 |
|
print $fout 'CPPFLAGS+=$(addprefix -D,$(CPPDEFINES))'."\n"; |
123 |
|
print $fout 'lib+=$(extralib)'."\n"; |
124 |
< |
print $fout 'LDLIBS+=$(addprefix -l,$(lib))'."\n"; |
124 |
> |
# Hack to parse the lib list and remove duplicates: |
125 |
> |
print $fout 'ORDEREDLIB=$(shell $(SCRAMPERL) $(TOOL_HOME)/ProcessLibs $(lib))',"\n"; |
126 |
> |
print $fout 'LDLIBS+=$(addprefix -l,$(ORDEREDLIB))'."\n"; |
127 |
|
print $fout 'LDLIBS+=$(addprefix -l,$(REQUIRES))'."\n"; |
128 |
|
print $fout 'LD_LIBRARY_PATH:=$(subst $(space),:,$(LD_LIBRARY_PATH))'."\n"; |
129 |
< |
|
129 |
> |
|
130 |
|
undef $fout; |
131 |
|
} |
132 |
|
} |
268 |
|
my $gmakejobsflag = "-j"; |
269 |
|
# Temporarily hard-code ncpu as 1: |
270 |
|
my $ncpu = 1; |
271 |
< |
|
271 |
> |
|
272 |
|
$rv=system("gmake","--no-print-directory","$gmakejobsflag","$ncpu","-r","-k","-f","$ENV{DefaultMakefile}","-I$ENV{TOOL_HOME}",datestamp, @Targets); |
273 |
|
|
274 |
|
return $rv/256; # return the exit status of gmake |