655
|
1 |
# Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
# All rights reserved.
|
|
3 |
# This component and the accompanying materials are made available
|
|
4 |
# under the terms of "Eclipse Public License v1.0"
|
|
5 |
# which accompanies this distribution, and is available
|
|
6 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
#
|
|
8 |
# Initial Contributors:
|
|
9 |
# Nokia Corporation - initial contribution.
|
|
10 |
#
|
|
11 |
# Contributors:
|
|
12 |
#
|
|
13 |
# Description:
|
|
14 |
#
|
|
15 |
|
|
16 |
package GenBuild;
|
|
17 |
|
|
18 |
use strict;
|
|
19 |
use Carp;
|
|
20 |
use IO::File;
|
|
21 |
|
|
22 |
# Global Variables
|
|
23 |
|
|
24 |
my @components;
|
|
25 |
my $iIDCount;
|
|
26 |
my $iStageCount;
|
|
27 |
my %arm_assplist;
|
|
28 |
my $savespace="";
|
|
29 |
my $keepgoing="";
|
|
30 |
my $build_tools=0;
|
|
31 |
my $build_cwtools=0;
|
|
32 |
my $build_winc=0;
|
|
33 |
my $build_thumb=0;
|
|
34 |
my $build_armi=0;
|
|
35 |
my $build_arm4=0;
|
|
36 |
my $build_arm4t=0;
|
|
37 |
my $build_armv5=0;
|
|
38 |
my $build_arm3=0;
|
|
39 |
my $epoc_only=0;
|
|
40 |
my $build_winscw=0;
|
|
41 |
my $build_wins=0;
|
|
42 |
my $build_bootstrap;
|
|
43 |
my $basename;
|
|
44 |
my $iSourceDir;
|
|
45 |
my $build_UREL=0;
|
|
46 |
my $build_UDEB=0;
|
|
47 |
my $build_urel_udeb="";
|
|
48 |
my $build_test=0;
|
|
49 |
|
|
50 |
my ($XMLFileH, $gLogFileH);
|
|
51 |
|
|
52 |
my ($gHiResTimer) = 0; #Flag - true (1) if HiRes Timer module available
|
|
53 |
|
|
54 |
# Check if HiRes Timer is available
|
|
55 |
if (eval "require Time::HiRes;") {
|
|
56 |
$gHiResTimer = 1;
|
|
57 |
} else {
|
|
58 |
print "Cannot load HiResTimer Module\n";
|
|
59 |
}
|
|
60 |
|
|
61 |
sub Start
|
|
62 |
{
|
|
63 |
my ($iDataSource, $iDataOutput, $iLogFile, $iSourceDir, $iReallyClean, $iClean) = @_;
|
|
64 |
|
|
65 |
# Copied from genbuild.pl
|
|
66 |
|
|
67 |
# Check for EPOCROOT
|
|
68 |
# It's not used directly by GENBUILD, but this is a good early stage at which
|
|
69 |
# to discover that it hasn't been set...
|
|
70 |
|
|
71 |
my $epocroot = $ENV{EPOCROOT};
|
|
72 |
die "ERROR: Must set the EPOCROOT environment variable\n" if (!defined($epocroot));
|
|
73 |
$epocroot =~ s-/-\\-go; # for those working with UNIX shells
|
|
74 |
die "ERROR: EPOCROOT must not include a drive letter\n" if ($epocroot =~ /^.:/);
|
|
75 |
die "ERROR: EPOCROOT must be an absolute path without a drive letter\n" if ($epocroot !~ /^\\/);
|
|
76 |
die "ERROR: EPOCROOT must not be a UNC path\n" if ($epocroot =~ /^\\\\/);
|
|
77 |
die "ERROR: EPOCROOT must end with a backslash\n" if ($epocroot !~ /\\$/);
|
|
78 |
die "ERROR: EPOCROOT must specify an existing directory\n" if (!-d $epocroot);
|
|
79 |
|
|
80 |
# $iSourceDir must en in a \
|
|
81 |
# Add a \ if not present
|
|
82 |
if ($iSourceDir !~ /\\$/)
|
|
83 |
{
|
|
84 |
$iSourceDir .= "\\";
|
|
85 |
}
|
|
86 |
|
|
87 |
for(my $j = 0; $j < scalar(@$iDataSource); $j++)
|
|
88 |
{
|
|
89 |
$GenBuild::basename .= " " if ($j > 0);
|
|
90 |
my ($iFile) = @$iDataSource[$j] =~ m#.*([\\\/]|^)(.*?)\..*$#;
|
|
91 |
$GenBuild::basename .= @$iDataSource[$j];
|
|
92 |
}
|
|
93 |
|
|
94 |
#Set the global iSourceDir
|
|
95 |
$GenBuild::iSourceDir = $iSourceDir;
|
|
96 |
|
|
97 |
# Open Log file
|
|
98 |
$GenBuild::gLogFileH = IO::File->new("> $iLogFile")
|
|
99 |
or croak "Couldn't open $iLogFile for writing: $!\n";
|
|
100 |
|
|
101 |
print $GenBuild::gLogFileH "===-------------------------------------------------\n";
|
|
102 |
print $GenBuild::gLogFileH "=== Genxml\n";
|
|
103 |
print $GenBuild::gLogFileH "===-------------------------------------------------\n";
|
|
104 |
print $GenBuild::gLogFileH "=== Genxml started ".localtime()."\n";
|
|
105 |
|
|
106 |
for(my $j = 0; $j < scalar(@$iDataSource); $j++)
|
|
107 |
{
|
|
108 |
# Open DataSource
|
|
109 |
my ($iFile) = @$iDataSource[$j];
|
|
110 |
open FILE, "< $iFile" or die "Can't read $iFile\n";
|
|
111 |
|
|
112 |
print $GenBuild::gLogFileH "=== Genxml == $iFile\n";
|
|
113 |
|
|
114 |
print $GenBuild::gLogFileH "-- Genxml\n";
|
|
115 |
# Add the per command start timestamp
|
|
116 |
print $GenBuild::gLogFileH "++ Started at ".localtime()."\n";
|
|
117 |
# Add the per command start HiRes timestamp if available
|
|
118 |
if ($gHiResTimer == 1)
|
|
119 |
{
|
|
120 |
print $GenBuild::gLogFileH "+++ HiRes Start ".Time::HiRes::time()."\n";
|
|
121 |
} else {
|
|
122 |
# Add the HiRes timer missing statement
|
|
123 |
print $GenBuild::gLogFileH "+++ HiRes Time Unavailable\n";
|
|
124 |
}
|
|
125 |
|
|
126 |
# Process the Txt file in the same manner as the old genbuild
|
|
127 |
# Note:
|
|
128 |
# Additional options 'udeb', 'urel' and 'test' were added in response
|
|
129 |
# to a specific request, but are not otherwise supported by Symbian.
|
|
130 |
while (<FILE>)
|
|
131 |
{
|
|
132 |
s/\s*#.*$//;
|
|
133 |
s/^\s*//;
|
|
134 |
my $line = lc $_;
|
|
135 |
if ($line =~ /^$/)
|
|
136 |
{
|
|
137 |
next;
|
|
138 |
}
|
|
139 |
|
|
140 |
if ($line =~ /<option (\w+)\s*(.*)>/)
|
|
141 |
{
|
|
142 |
my $option = $1;
|
|
143 |
my $optargs= $2;
|
|
144 |
if ($option =~ "savespace")
|
|
145 |
{
|
|
146 |
$GenBuild::savespace = "-savespace";
|
|
147 |
next;
|
|
148 |
}
|
|
149 |
if ($option =~ "keepgoing")
|
|
150 |
{
|
|
151 |
$GenBuild::keepgoing = "-keepgoing";
|
|
152 |
next;
|
|
153 |
}
|
|
154 |
if ($option =~ "tools")
|
|
155 |
{
|
|
156 |
$GenBuild::build_tools = 1;
|
|
157 |
next;
|
|
158 |
}
|
|
159 |
if ($option eq "cwtools")
|
|
160 |
{
|
|
161 |
$GenBuild::build_cwtools = 1;
|
|
162 |
next;
|
|
163 |
}
|
|
164 |
if ($option =~ "winc")
|
|
165 |
{
|
|
166 |
$GenBuild::build_winc = 1;
|
|
167 |
next;
|
|
168 |
}
|
|
169 |
|
|
170 |
# Do not build winc, wins or winscw
|
|
171 |
if ($option =~ "epoconly")
|
|
172 |
{
|
|
173 |
$GenBuild::build_winc = 0;
|
|
174 |
$GenBuild::epoc_only = 1;
|
|
175 |
next;
|
|
176 |
}
|
|
177 |
if ($option =~ "thumb")
|
|
178 |
{
|
|
179 |
$GenBuild::build_thumb = 1;
|
|
180 |
next;
|
|
181 |
}
|
|
182 |
|
|
183 |
# ARMI option
|
|
184 |
if ($option =~ "armi")
|
|
185 |
{
|
|
186 |
$GenBuild::build_armi = 1;
|
|
187 |
next;
|
|
188 |
}
|
|
189 |
|
|
190 |
# ARM4
|
|
191 |
if ($option eq "arm4")
|
|
192 |
{
|
|
193 |
$GenBuild::build_arm4 = 1;
|
|
194 |
next;
|
|
195 |
}
|
|
196 |
|
|
197 |
# ARM4T
|
|
198 |
if ($option eq "arm4t")
|
|
199 |
{
|
|
200 |
$GenBuild::build_arm4t = 1;
|
|
201 |
next;
|
|
202 |
}
|
|
203 |
|
|
204 |
# ARMv5
|
|
205 |
if ($option =~ "armv5")
|
|
206 |
{
|
|
207 |
$GenBuild::build_armv5 = 1;
|
|
208 |
next;
|
|
209 |
}
|
|
210 |
|
|
211 |
if ($option =~ "arm3")
|
|
212 |
{
|
|
213 |
$GenBuild::build_arm3 = 1;
|
|
214 |
next;
|
|
215 |
}
|
|
216 |
|
|
217 |
# Use Visual Studio
|
|
218 |
if ($option eq "wins")
|
|
219 |
{
|
|
220 |
$GenBuild::build_wins = 1;
|
|
221 |
next;
|
|
222 |
}
|
|
223 |
|
|
224 |
# Use CodeWarrior
|
|
225 |
if ($option eq "winscw")
|
|
226 |
{
|
|
227 |
$GenBuild::build_winscw = 1;
|
|
228 |
next;
|
|
229 |
}
|
|
230 |
|
|
231 |
if ($option eq "udeb")
|
|
232 |
{
|
|
233 |
$GenBuild::build_UDEB = 1;
|
|
234 |
next;
|
|
235 |
}
|
|
236 |
|
|
237 |
if ($option eq "urel")
|
|
238 |
{
|
|
239 |
$GenBuild::build_UREL = 1;
|
|
240 |
next;
|
|
241 |
}
|
|
242 |
|
|
243 |
if ($option eq "test")
|
|
244 |
{
|
|
245 |
$GenBuild::build_test = 1;
|
|
246 |
next;
|
|
247 |
}
|
|
248 |
|
|
249 |
if ($option =~ "arm_assp")
|
|
250 |
{
|
|
251 |
$GenBuild::arm_assplist{$optargs} = 1;
|
|
252 |
next;
|
|
253 |
}
|
|
254 |
|
|
255 |
|
|
256 |
print "Option $1 not yet implemented\n";
|
|
257 |
next;
|
|
258 |
}
|
|
259 |
if ($line =~ /^([^<]\S+)\s+(\S+)/)
|
|
260 |
{
|
|
261 |
if (!-e "$GenBuild::iSourceDir$2\\bld.inf")
|
|
262 |
{
|
|
263 |
print $GenBuild::gLogFileH "MISSING COMPONENT $1: can't find $GenBuild::iSourceDir$2\\bld.inf\n";
|
|
264 |
next;
|
|
265 |
}
|
|
266 |
}
|
|
267 |
if ($line =~ /<special bldfiles e32toolp group>/)
|
|
268 |
{
|
|
269 |
# Handle Special
|
|
270 |
$GenBuild::build_bootstrap = 1;
|
|
271 |
next;
|
|
272 |
}
|
|
273 |
|
|
274 |
push @GenBuild::components, $line;
|
|
275 |
}
|
|
276 |
|
|
277 |
close(FILE);
|
|
278 |
# Add the per command end HiRes timestamp if available
|
|
279 |
print $GenBuild::gLogFileH "+++ HiRes End ".Time::HiRes::time()."\n" if ($gHiResTimer == 1);
|
|
280 |
# Add the per command end timestamp
|
|
281 |
print $GenBuild::gLogFileH "++ Finished at ".localtime()."\n";
|
|
282 |
}
|
|
283 |
|
|
284 |
print $GenBuild::gLogFileH "=== Genxml == Output\n";
|
|
285 |
|
|
286 |
print $GenBuild::gLogFileH "-- Genxml\n";
|
|
287 |
# Add the per command start timestamp
|
|
288 |
print $GenBuild::gLogFileH "++ Started at ".localtime()."\n";
|
|
289 |
# Add the per command start HiRes timestamp if available
|
|
290 |
if ($gHiResTimer == 1)
|
|
291 |
{
|
|
292 |
print $GenBuild::gLogFileH "+++ HiRes Start ".Time::HiRes::time()."\n";
|
|
293 |
} else {
|
|
294 |
# Add the HiRes timer missing statement
|
|
295 |
print $GenBuild::gLogFileH "+++ HiRes Missing\n";
|
|
296 |
}
|
|
297 |
|
|
298 |
&PBuildLevels($iDataOutput);
|
|
299 |
|
|
300 |
# Generate additional ReallyClean and Clean XML files if required
|
|
301 |
&GenReallyClean($iReallyClean) if (defined $iReallyClean);
|
|
302 |
&GenClean($iClean) if (defined $iClean);
|
|
303 |
|
|
304 |
# Close file handles
|
|
305 |
close($GenBuild::gLogFileH);
|
|
306 |
|
|
307 |
}
|
|
308 |
|
|
309 |
# PBuildLevels
|
|
310 |
#
|
|
311 |
# Inputs
|
|
312 |
# $iDataOutput - Filename for normal build xml
|
|
313 |
#
|
|
314 |
# Outputs
|
|
315 |
#
|
|
316 |
# Description
|
|
317 |
# This function generates a xml file to run normal buildon all components
|
|
318 |
sub PBuildLevels
|
|
319 |
{
|
|
320 |
my ($iDataOutput) = @_;
|
|
321 |
# Print the XML file
|
|
322 |
$GenBuild::XMLFileH = IO::File->new("> $iDataOutput")
|
|
323 |
or croak "Couldn't open $iDataOutput for writing: $!\n";
|
|
324 |
|
|
325 |
$GenBuild::iIDCount = 1;
|
|
326 |
$GenBuild::iStageCount = 1;
|
|
327 |
|
|
328 |
my ($epocroot) = $ENV{'EPOCROOT'};
|
|
329 |
|
|
330 |
&PrintXMLHeader($GenBuild::XMLFileH);
|
|
331 |
|
|
332 |
if (($GenBuild::build_UREL) && (!$GenBuild::build_UDEB))
|
|
333 |
{
|
|
334 |
$GenBuild::build_urel_udeb = " UREL";
|
|
335 |
}
|
|
336 |
elsif ((!$GenBuild::build_UREL) && ($GenBuild::build_UDEB))
|
|
337 |
{
|
|
338 |
$GenBuild::build_urel_udeb = " UDEB";
|
|
339 |
}
|
|
340 |
|
|
341 |
if ($GenBuild::build_bootstrap)
|
|
342 |
{
|
|
343 |
# Do the BootStrapping
|
|
344 |
# Temporary workaround for non-common code between old setup and Beech
|
|
345 |
# Defaults to old setup
|
|
346 |
# This will be removed when final functionality is added
|
|
347 |
if ($ENV{'Platform'} eq 'beech')
|
|
348 |
{
|
|
349 |
print $GenBuild::XMLFileH qq{\t\t<Execute ID="$GenBuild::iIDCount" Stage="$GenBuild::iStageCount" Component="BootStrap" Cwd="$GenBuild::iSourceDir}.qq{beech\\generic\\tools\\e32toolp\\group" CommandLine="setupprj.bat"/>\n};
|
|
350 |
} elsif ($ENV{'Platform'} eq 'cedar') {
|
|
351 |
print $GenBuild::XMLFileH qq{\t\t<Execute ID="$GenBuild::iIDCount" Stage="$GenBuild::iStageCount" Component="BootStrap" Cwd="$GenBuild::iSourceDir}.qq{os\\buildtools\\sbsv1_os\\e32toolp\\group" CommandLine="setupprj.bat"/>\n};
|
|
352 |
} else {
|
|
353 |
print $GenBuild::XMLFileH qq{\t\t<Execute ID="$GenBuild::iIDCount" Stage="$GenBuild::iStageCount" Component="BootStrap" Cwd="$GenBuild::iSourceDir}.qq{tools\\e32toolp\\group" CommandLine="setupprj.bat"/>\n};
|
|
354 |
}
|
|
355 |
$GenBuild::iIDCount++;
|
|
356 |
$GenBuild::iStageCount++;
|
|
357 |
# Temporary workaround for non-common code between old setup and Beech
|
|
358 |
# Defaults to old setup
|
|
359 |
# This will be removed when final functionality is added
|
|
360 |
if ($ENV{'Platform'} eq 'beech')
|
|
361 |
{
|
|
362 |
print $GenBuild::XMLFileH qq{\t\t<Execute ID="$GenBuild::iIDCount" Stage="$GenBuild::iStageCount" Component="BootStrap" Cwd="$GenBuild::iSourceDir}.qq{beech\\generic\\tools\\e32toolp\\group" CommandLine="bld.bat rel"/>\n};
|
|
363 |
} elsif ($ENV{'Platform'} eq 'cedar') {
|
|
364 |
print $GenBuild::XMLFileH qq{\t\t<Execute ID="$GenBuild::iIDCount" Stage="$GenBuild::iStageCount" Component="BootStrap" Cwd="$GenBuild::iSourceDir}.qq{os\\buildtools\\sbsv1_os\\e32toolp\\group" CommandLine="bld.bat rel"/>\n};
|
|
365 |
} else {
|
|
366 |
print $GenBuild::XMLFileH qq{\t\t<Execute ID="$GenBuild::iIDCount" Stage="$GenBuild::iStageCount" Component="BootStrap" Cwd="$GenBuild::iSourceDir}.qq{tools\\e32toolp\\group" CommandLine="bld.bat rel"/>\n};
|
|
367 |
}
|
|
368 |
$GenBuild::iIDCount++;
|
|
369 |
$GenBuild::iStageCount++;
|
|
370 |
}
|
|
371 |
|
|
372 |
&BuildLevels("0", "bldmake bldfiles $GenBuild::keepgoing");
|
|
373 |
$GenBuild::iStageCount++;
|
|
374 |
&BuildLevels("0", "abld export $GenBuild::keepgoing");
|
|
375 |
&BuildLevels("0", "abld test export $GenBuild::keepgoing") if ($GenBuild::build_test);
|
|
376 |
$GenBuild::iStageCount++;
|
|
377 |
|
|
378 |
if ($GenBuild::build_tools)
|
|
379 |
{
|
|
380 |
&BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", "tools");
|
|
381 |
$GenBuild::iStageCount++;
|
|
382 |
&BuildLevels("1", "abld library $GenBuild::keepgoing", "tools");
|
|
383 |
&BuildLevels("1", "abld target $GenBuild::keepgoing $GenBuild::savespace", "tools", "rel");
|
|
384 |
&BuildLevels("0", "abld -what build", "tools", "rel");
|
|
385 |
&BuildLevels("0", "abld -check build", "tools", "rel");
|
|
386 |
$GenBuild::iStageCount++;
|
|
387 |
}
|
|
388 |
|
|
389 |
if ($GenBuild::build_cwtools)
|
|
390 |
{
|
|
391 |
&BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", "cwtools");
|
|
392 |
$GenBuild::iStageCount++;
|
|
393 |
&BuildLevels("1", "abld library $GenBuild::keepgoing", "cwtools");
|
|
394 |
&BuildLevels("1", "abld target $GenBuild::keepgoing $GenBuild::savespace", "cwtools", "rel");
|
|
395 |
&BuildLevels("0", "abld -what build", "cwtools", "rel");
|
|
396 |
&BuildLevels("0", "abld -check build", "cwtools", "rel");
|
|
397 |
$GenBuild::iStageCount++;
|
|
398 |
}
|
|
399 |
|
|
400 |
if ($GenBuild::build_winc)
|
|
401 |
{
|
|
402 |
&BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", "winc");
|
|
403 |
$GenBuild::iStageCount++;
|
|
404 |
&BuildLevels("1", "abld library $GenBuild::keepgoing", "winc");
|
|
405 |
&BuildLevels("1", "abld target $GenBuild::keepgoing $GenBuild::savespace", "winc");
|
|
406 |
&BuildLevels("0", "abld -what build", "winc");
|
|
407 |
&BuildLevels("0", "abld -check build", "winc");
|
|
408 |
$GenBuild::iStageCount++;
|
|
409 |
|
|
410 |
}
|
|
411 |
|
|
412 |
unless ($epoc_only)
|
|
413 |
{
|
|
414 |
# Emulator things, WINS, up to resources
|
|
415 |
if ($GenBuild::build_wins)
|
|
416 |
{
|
|
417 |
&BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", "wins");
|
|
418 |
&BuildLevels("0", "abld test makefile $GenBuild::keepgoing $GenBuild::savespace", "wins") if ($GenBuild::build_test);
|
|
419 |
$GenBuild::iStageCount++;
|
|
420 |
&BuildLevels("1", "abld resource $GenBuild::keepgoing", "wins$GenBuild::build_urel_udeb");
|
|
421 |
&BuildLevels("1", "abld test resource $GenBuild::keepgoing", "wins$GenBuild::build_urel_udeb") if ($GenBuild::build_test);
|
|
422 |
&BuildLevels("1", "abld library $GenBuild::keepgoing", "wins");
|
|
423 |
&BuildLevels("1", "abld test library $GenBuild::keepgoing", "wins") if ($GenBuild::build_test);
|
|
424 |
}
|
|
425 |
|
|
426 |
# Emulator things, WINSCW, up to resources
|
|
427 |
if ($GenBuild::build_winscw)
|
|
428 |
{
|
|
429 |
&BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", "winscw");
|
|
430 |
&BuildLevels("0", "abld test makefile $GenBuild::keepgoing $GenBuild::savespace", "winscw") if ($GenBuild::build_test);
|
|
431 |
$GenBuild::iStageCount++;
|
|
432 |
&BuildLevels("1", "abld resource $GenBuild::keepgoing", "winscw$GenBuild::build_urel_udeb");
|
|
433 |
&BuildLevels("1", "abld test resource $GenBuild::keepgoing", "winscw$GenBuild::build_urel_udeb") if ($GenBuild::build_test);
|
|
434 |
&BuildLevels("1", "abld library $GenBuild::keepgoing", "winscw");
|
|
435 |
&BuildLevels("1", "abld test library $GenBuild::keepgoing", "winscw") if ($GenBuild::build_test);
|
|
436 |
}
|
|
437 |
}
|
|
438 |
# Arm Stuff
|
|
439 |
if ($GenBuild::build_arm4)
|
|
440 |
{
|
|
441 |
&BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", "arm4");
|
|
442 |
&BuildLevels("0", "abld test makefile $GenBuild::keepgoing $GenBuild::savespace", "arm4") if ($GenBuild::build_test);
|
|
443 |
$GenBuild::iStageCount++;
|
|
444 |
}
|
|
445 |
if ($GenBuild::build_arm4t)
|
|
446 |
{
|
|
447 |
&BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", "arm4t");
|
|
448 |
&BuildLevels("0", "abld test makefile $GenBuild::keepgoing $GenBuild::savespace", "arm4t") if ($GenBuild::build_test);
|
|
449 |
$GenBuild::iStageCount++;
|
|
450 |
}
|
|
451 |
if ($GenBuild::build_armv5)
|
|
452 |
{
|
|
453 |
&BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", "armv5");
|
|
454 |
&BuildLevels("0", "abld test makefile $GenBuild::keepgoing $GenBuild::savespace", "arm5") if ($GenBuild::build_test);
|
|
455 |
$GenBuild::iStageCount++;
|
|
456 |
}
|
|
457 |
if ($GenBuild::build_armi)
|
|
458 |
{
|
|
459 |
&BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", "armi");
|
|
460 |
&BuildLevels("0", "abld test makefile $GenBuild::keepgoing $GenBuild::savespace", "armi") if ($GenBuild::build_test);
|
|
461 |
$GenBuild::iStageCount++;
|
|
462 |
}
|
|
463 |
if ($GenBuild::build_thumb)
|
|
464 |
{
|
|
465 |
&BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", "thumb");
|
|
466 |
&BuildLevels("0", "abld test makefile $GenBuild::keepgoing $GenBuild::savespace", "thumb") if ($GenBuild::build_test);
|
|
467 |
$GenBuild::iStageCount++;
|
|
468 |
}
|
|
469 |
if ($GenBuild::build_arm3)
|
|
470 |
{
|
|
471 |
&BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", "arm3");
|
|
472 |
&BuildLevels("0", "abld test makefile $GenBuild::keepgoing $GenBuild::savespace", "arm3") if ($GenBuild::build_test);
|
|
473 |
$GenBuild::iStageCount++;
|
|
474 |
}
|
|
475 |
foreach my $iAssp (sort keys %GenBuild::arm_assplist)
|
|
476 |
{
|
|
477 |
&BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", $iAssp);
|
|
478 |
&BuildLevels("0", "abld test makefile $GenBuild::keepgoing $GenBuild::savespace", $iAssp) if ($GenBuild::build_test);
|
|
479 |
$GenBuild::iStageCount++;
|
|
480 |
}
|
|
481 |
|
|
482 |
&BuildLevels("1", "abld resource $GenBuild::keepgoing", "arm4$GenBuild::build_urel_udeb") if ($GenBuild::build_arm4);
|
|
483 |
&BuildLevels("1", "abld test resource $GenBuild::keepgoing", "arm4$GenBuild::build_urel_udeb") if (($GenBuild::build_arm4) && ($GenBuild::build_test));
|
|
484 |
&BuildLevels("1", "abld resource $GenBuild::keepgoing", "arm4t$GenBuild::build_urel_udeb") if ($GenBuild::build_arm4t);
|
|
485 |
&BuildLevels("1", "abld test resource $GenBuild::keepgoing", "arm4t$GenBuild::build_urel_udeb") if (($GenBuild::build_arm4t) && ($GenBuild::build_test));
|
|
486 |
&BuildLevels("1", "abld resource $GenBuild::keepgoing", "armv5$GenBuild::build_urel_udeb") if ($GenBuild::build_armv5);
|
|
487 |
&BuildLevels("1", "abld test resource $GenBuild::keepgoing", "armv5$GenBuild::build_urel_udeb") if (($GenBuild::build_armv5) && ($GenBuild::build_test));
|
|
488 |
&BuildLevels("1", "abld resource $GenBuild::keepgoing", "armi$GenBuild::build_urel_udeb") if ($GenBuild::build_armi);
|
|
489 |
&BuildLevels("1", "abld test resource $GenBuild::keepgoing", "armi$GenBuild::build_urel_udeb") if (($GenBuild::build_armi) && ($GenBuild::build_test));
|
|
490 |
&BuildLevels("1", "abld resource $GenBuild::keepgoing", "thumb$GenBuild::build_urel_udeb") if ($GenBuild::build_thumb);
|
|
491 |
&BuildLevels("1", "abld test resource $GenBuild::keepgoing", "thumb$GenBuild::build_urel_udeb") if (($GenBuild::build_thumb) && ($GenBuild::build_test));
|
|
492 |
&BuildLevels("1", "abld resource $GenBuild::keepgoing", "arm3$GenBuild::build_urel_udeb") if ($GenBuild::build_arm3);
|
|
493 |
&BuildLevels("1", "abld test resource $GenBuild::keepgoing", "arm3$GenBuild::build_urel_udeb") if (($GenBuild::build_arm3) && ($GenBuild::build_test));
|
|
494 |
|
|
495 |
foreach my $iAssp (sort keys %GenBuild::arm_assplist)
|
|
496 |
{
|
|
497 |
&BuildLevels("1", "abld resource $GenBuild::keepgoing", "$iAssp$GenBuild::build_urel_udeb");
|
|
498 |
&BuildLevels("1", "abld test resource $GenBuild::keepgoing", "$iAssp$GenBuild::build_urel_udeb") if ($GenBuild::build_test);
|
|
499 |
}
|
|
500 |
|
|
501 |
&BuildLevels("1", "abld library $GenBuild::keepgoing", "arm4") if ($GenBuild::build_arm4);
|
|
502 |
&BuildLevels("1", "abld test library $GenBuild::keepgoing", "arm4") if (($GenBuild::build_arm4) &&($GenBuild::build_test));
|
|
503 |
&BuildLevels("1", "abld library $GenBuild::keepgoing", "arm4t") if ($GenBuild::build_arm4t);
|
|
504 |
&BuildLevels("1", "abld test library $GenBuild::keepgoing", "arm4t") if (($GenBuild::build_arm4t) && ($GenBuild::build_test));
|
|
505 |
&BuildLevels("1", "abld library $GenBuild::keepgoing", "armv5") if ($GenBuild::build_armv5);
|
|
506 |
&BuildLevels("1", "abld test library $GenBuild::keepgoing", "armv5") if (($GenBuild::build_armv5) && ($GenBuild::build_test));
|
|
507 |
&BuildLevels("1", "abld library $GenBuild::keepgoing", "armi") if ($GenBuild::build_armi);
|
|
508 |
&BuildLevels("1", "abld test library $GenBuild::keepgoing", "armi") if (($GenBuild::build_armi) && ($GenBuild::build_test));
|
|
509 |
&BuildLevels("1", "abld library $GenBuild::keepgoing", "thumb") if ($GenBuild::build_thumb);
|
|
510 |
&BuildLevels("1", "abld test library $GenBuild::keepgoing", "thumb") if (($GenBuild::build_thumb) && ($GenBuild::build_test));
|
|
511 |
&BuildLevels("1", "abld library $GenBuild::keepgoing", "arm3") if ($GenBuild::build_arm3);
|
|
512 |
&BuildLevels("1", "abld test library $GenBuild::keepgoing", "arm3") if (($GenBuild::build_arm3) && ($GenBuild::build_test));
|
|
513 |
|
|
514 |
foreach my $iAssp (sort keys %GenBuild::arm_assplist)
|
|
515 |
{
|
|
516 |
&BuildLevels("1", "abld library $GenBuild::keepgoing", $iAssp);
|
|
517 |
&BuildLevels("1", "abld test library $GenBuild::keepgoing", $iAssp) if ($GenBuild::build_test);
|
|
518 |
}
|
|
519 |
|
|
520 |
# Build all targets
|
|
521 |
my @iTargets;
|
|
522 |
# Push the defaults on
|
|
523 |
push @iTargets, "wins$GenBuild::build_urel_udeb" if (($GenBuild::build_wins) && (!$GenBuild::epoc_only));
|
|
524 |
push @iTargets, "arm4$GenBuild::build_urel_udeb" if ($GenBuild::build_arm4);
|
|
525 |
push @iTargets, "arm4t$GenBuild::build_urel_udeb" if ($GenBuild::build_arm4t);
|
|
526 |
push @iTargets, "armv5$GenBuild::build_urel_udeb" if ($GenBuild::build_armv5);
|
|
527 |
push @iTargets, "armi$GenBuild::build_urel_udeb" if ($GenBuild::build_armi);
|
|
528 |
push @iTargets, "winscw$GenBuild::build_urel_udeb" if (($GenBuild::build_winscw) && (!$GenBuild::epoc_only));
|
|
529 |
push @iTargets, "thumb$GenBuild::build_urel_udeb" if ($GenBuild::build_thumb);
|
|
530 |
push @iTargets, "arm3$GenBuild::build_urel_udeb" if ($GenBuild::build_arm3);
|
|
531 |
foreach my $iAssp (sort keys %GenBuild::arm_assplist)
|
|
532 |
{
|
|
533 |
push @iTargets, "$iAssp$GenBuild::build_urel_udeb";
|
|
534 |
}
|
|
535 |
&BuildTargets("0", "abld target $GenBuild::keepgoing $GenBuild::savespace", @iTargets);
|
|
536 |
&BuildTargets("0", "abld test target $GenBuild::keepgoing $GenBuild::savespace", @iTargets) if ($GenBuild::build_test);
|
|
537 |
|
|
538 |
unless ($epoc_only)
|
|
539 |
{
|
|
540 |
if ($GenBuild::build_wins)
|
|
541 |
{
|
|
542 |
# Final Part of WINS
|
|
543 |
&BuildLevels("1", "abld final $GenBuild::keepgoing", "wins","$GenBuild::build_urel_udeb");
|
|
544 |
&BuildLevels("1", "abld test final $GenBuild::keepgoing", "wins","$GenBuild::build_urel_udeb") if ($GenBuild::build_test);
|
|
545 |
&BuildLevels("0", "abld -what build", "wins","$GenBuild::build_urel_udeb");
|
|
546 |
&BuildLevels("0", "abld test -what build", "wins","$GenBuild::build_urel_udeb") if ($GenBuild::build_test);
|
|
547 |
$GenBuild::iStageCount++;
|
|
548 |
&BuildLevels("0", "abld -check build", "wins","$GenBuild::build_urel_udeb");
|
|
549 |
&BuildLevels("0", "abld test -check build", "wins","$GenBuild::build_urel_udeb") if ($GenBuild::build_test);
|
|
550 |
$GenBuild::iStageCount++;
|
|
551 |
}
|
|
552 |
|
|
553 |
if ($GenBuild::build_winscw)
|
|
554 |
{
|
|
555 |
# Final Part of WINSCW
|
|
556 |
&BuildLevels("1", "abld final $GenBuild::keepgoing", "winscw$GenBuild::build_urel_udeb");
|
|
557 |
&BuildLevels("1", "abld test final $GenBuild::keepgoing", "winscw$GenBuild::build_urel_udeb") if ($GenBuild::build_test);
|
|
558 |
&BuildLevels("0", "abld -what build", "winscw$GenBuild::build_urel_udeb");
|
|
559 |
&BuildLevels("0", "abld test -what build", "winscw$GenBuild::build_urel_udeb") if ($GenBuild::build_test);
|
|
560 |
$GenBuild::iStageCount++;
|
|
561 |
&BuildLevels("0", "abld -check build", "winscw$GenBuild::build_urel_udeb");
|
|
562 |
&BuildLevels("0", "abld test -check build", "winscw$GenBuild::build_urel_udeb") if ($GenBuild::build_test);
|
|
563 |
$GenBuild::iStageCount++;
|
|
564 |
}
|
|
565 |
}
|
|
566 |
|
|
567 |
# Other Final Parts
|
|
568 |
&BuildLevels("1", "abld final $GenBuild::keepgoing", "arm4$GenBuild::build_urel_udeb") if ($GenBuild::build_arm4);
|
|
569 |
&BuildLevels("1", "abld test final $GenBuild::keepgoing", "arm4$GenBuild::build_urel_udeb") if (($GenBuild::build_arm4) && ($GenBuild::build_test));
|
|
570 |
&BuildLevels("1", "abld final $GenBuild::keepgoing", "arm4t$GenBuild::build_urel_udeb") if ($GenBuild::build_arm4t);
|
|
571 |
&BuildLevels("1", "abld test final $GenBuild::keepgoing", "arm4t$GenBuild::build_urel_udeb") if (($GenBuild::build_arm4t) && ($GenBuild::build_test));
|
|
572 |
&BuildLevels("1", "abld final $GenBuild::keepgoing", "armv5$GenBuild::build_urel_udeb") if ($GenBuild::build_armv5);
|
|
573 |
&BuildLevels("1", "abld test final $GenBuild::keepgoing", "armv5$GenBuild::build_urel_udeb") if (($GenBuild::build_armv5) && ($GenBuild::build_test));
|
|
574 |
&BuildLevels("1", "abld final $GenBuild::keepgoing", "armi$GenBuild::build_urel_udeb") if ($GenBuild::build_armi);
|
|
575 |
&BuildLevels("1", "abld test final $GenBuild::keepgoing", "armi$GenBuild::build_urel_udeb") if (($GenBuild::build_armi) && ($GenBuild::build_test));
|
|
576 |
&BuildLevels("1", "abld final $GenBuild::keepgoing", "thumb$GenBuild::build_urel_udeb") if ($GenBuild::build_thumb);
|
|
577 |
&BuildLevels("1", "abld test final $GenBuild::keepgoing", "thumb$GenBuild::build_urel_udeb") if (($GenBuild::build_thumb) && ($GenBuild::build_test));
|
|
578 |
&BuildLevels("1", "abld final $GenBuild::keepgoing", "arm3$GenBuild::build_urel_udeb") if ($GenBuild::build_arm3);
|
|
579 |
&BuildLevels("1", "abld test final $GenBuild::keepgoing", "arm3$GenBuild::build_urel_udeb") if (($GenBuild::build_arm3) && ($GenBuild::build_test));
|
|
580 |
foreach my $iAssp (sort keys %GenBuild::arm_assplist)
|
|
581 |
{
|
|
582 |
&BuildLevels("1", "abld final $GenBuild::keepgoing", $iAssp);
|
|
583 |
&BuildLevels("1", "abld test final $GenBuild::keepgoing", $iAssp) if ($GenBuild::build_test);
|
|
584 |
}
|
|
585 |
|
|
586 |
&BuildLevels("0", "abld -what build", "arm4$GenBuild::build_urel_udeb") if ($GenBuild::build_arm4);
|
|
587 |
&BuildLevels("0", "abld test -what build", "arm4$GenBuild::build_urel_udeb") if (($GenBuild::build_arm4) && ($GenBuild::build_test));
|
|
588 |
&BuildLevels("0", "abld -what build", "arm4t$GenBuild::build_urel_udeb") if ($GenBuild::build_arm4t);
|
|
589 |
&BuildLevels("0", "abld test -what build", "arm4t$GenBuild::build_urel_udeb") if (($GenBuild::build_arm4t) && ($GenBuild::build_test));
|
|
590 |
&BuildLevels("0", "abld -what build", "armv5$GenBuild::build_urel_udeb") if ($GenBuild::build_armv5);
|
|
591 |
&BuildLevels("0", "abld test -what build", "armv5$GenBuild::build_urel_udeb") if (($GenBuild::build_armv5) && ($GenBuild::build_test));
|
|
592 |
&BuildLevels("0", "abld -what build", "armi$GenBuild::build_urel_udeb") if ($GenBuild::build_armi);
|
|
593 |
&BuildLevels("0", "abld test -what build", "armi$GenBuild::build_urel_udeb") if (($GenBuild::build_armi) && ($GenBuild::build_test));
|
|
594 |
&BuildLevels("0", "abld -what build", "thumb$GenBuild::build_urel_udeb") if ($GenBuild::build_thumb);
|
|
595 |
&BuildLevels("0", "abld test -what build", "thumb$GenBuild::build_urel_udeb") if (($GenBuild::build_thumb) && ($GenBuild::build_test));
|
|
596 |
&BuildLevels("0", "abld -what build", "arm3$GenBuild::build_urel_udeb") if ($GenBuild::build_arm3);
|
|
597 |
&BuildLevels("0", "abld test -what build", "arm3$GenBuild::build_urel_udeb") if (($GenBuild::build_arm3) && ($GenBuild::build_test));
|
|
598 |
|
|
599 |
foreach my $iAssp (sort keys %GenBuild::arm_assplist)
|
|
600 |
{
|
|
601 |
&BuildLevels("0", "abld -what build", $iAssp);
|
|
602 |
&BuildLevels("0", "abld test -what build", $iAssp) if ($GenBuild::build_test);
|
|
603 |
}
|
|
604 |
$GenBuild::iStageCount++;
|
|
605 |
|
|
606 |
&BuildLevels("0", "abld -check build", "arm4$GenBuild::build_urel_udeb") if ($GenBuild::build_arm4);
|
|
607 |
&BuildLevels("0", "abld test -check build", "arm4$GenBuild::build_urel_udeb") if (($GenBuild::build_arm4) && ($GenBuild::build_test));
|
|
608 |
&BuildLevels("0", "abld -check build", "arm4t$GenBuild::build_urel_udeb") if ($GenBuild::build_arm4t);
|
|
609 |
&BuildLevels("0", "abld test -check build", "arm4t$GenBuild::build_urel_udeb") if (($GenBuild::build_arm4t) && ($GenBuild::build_test));
|
|
610 |
&BuildLevels("0", "abld -check build", "armv5$GenBuild::build_urel_udeb") if ($GenBuild::build_armv5);
|
|
611 |
&BuildLevels("0", "abld test -check build", "armv5$GenBuild::build_urel_udeb") if (($GenBuild::build_armv5) && ($GenBuild::build_test));
|
|
612 |
&BuildLevels("0", "abld -check build", "armi$GenBuild::build_urel_udeb") if ($GenBuild::build_armi);
|
|
613 |
&BuildLevels("0", "abld test -check build", "armi$GenBuild::build_urel_udeb") if (($GenBuild::build_armi) && ($GenBuild::build_test));
|
|
614 |
&BuildLevels("0", "abld -check build", "thumb$GenBuild::build_urel_udeb") if ($GenBuild::build_thumb);
|
|
615 |
&BuildLevels("0", "abld test -check build", "thumb$GenBuild::build_urel_udeb") if (($GenBuild::build_thumb) && ($GenBuild::build_test));
|
|
616 |
&BuildLevels("0", "abld -check build", "arm3$GenBuild::build_urel_udeb") if ($GenBuild::build_arm3);
|
|
617 |
&BuildLevels("0", "abld test -check build", "arm3$GenBuild::build_urel_udeb") if (($GenBuild::build_arm3) && ($GenBuild::build_test));
|
|
618 |
|
|
619 |
foreach my $iAssp (sort keys %GenBuild::arm_assplist)
|
|
620 |
{
|
|
621 |
&BuildLevels("0", "abld -check build", $iAssp);
|
|
622 |
&BuildLevels("0", "abld test -check build", $iAssp) if ($GenBuild::build_test);
|
|
623 |
}
|
|
624 |
|
|
625 |
# Print the XML Footer
|
|
626 |
print $GenBuild::XMLFileH qq{\t</Commands>\n</Product>};
|
|
627 |
|
|
628 |
# Add the per command end HiRes timestamp if available
|
|
629 |
print $GenBuild::gLogFileH "+++ HiRes End ".Time::HiRes::time()."\n" if ($gHiResTimer == 1);
|
|
630 |
# Add the per command end timestamp
|
|
631 |
print $GenBuild::gLogFileH "++ Finished at ".localtime()."\n";
|
|
632 |
|
|
633 |
# Print Genxml log footer
|
|
634 |
print $GenBuild::gLogFileH "=== Genxml finished ".localtime()."\n";
|
|
635 |
|
|
636 |
# Close XML File
|
|
637 |
close($GenBuild::XMLFileH);
|
|
638 |
}
|
|
639 |
|
|
640 |
sub BuildLevels
|
|
641 |
{
|
|
642 |
my ($iIncStage, $action, $arg1, $arg2, $arg3) = @_;
|
|
643 |
|
|
644 |
for(my $j = 0; $j < scalar(@GenBuild::components); $j++)
|
|
645 |
{
|
|
646 |
my $line = $GenBuild::components[$j];
|
|
647 |
my @MyList;
|
|
648 |
my $tempvar;
|
|
649 |
|
|
650 |
@MyList = split(/\s+/,$line);
|
|
651 |
$tempvar= lc $MyList[$#MyList];
|
|
652 |
$tempvar =~ s/\\group//;
|
|
653 |
push @MyList, $tempvar;
|
|
654 |
|
|
655 |
print $GenBuild::XMLFileH qq{\t\t<Execute ID="$GenBuild::iIDCount" Stage="$GenBuild::iStageCount" Component="$MyList[2]" Cwd="$GenBuild::iSourceDir$MyList[1]" CommandLine="$action $arg1 $arg2 $arg3"/>\n};
|
|
656 |
$GenBuild::iIDCount++;
|
|
657 |
|
|
658 |
if ( $iIncStage )
|
|
659 |
{
|
|
660 |
$GenBuild::iStageCount++;
|
|
661 |
}
|
|
662 |
}
|
|
663 |
|
|
664 |
}
|
|
665 |
|
|
666 |
sub BuildTargets
|
|
667 |
{
|
|
668 |
my ($iIncStage, $action, @iTargets) = @_;
|
|
669 |
|
|
670 |
|
|
671 |
for(my $j = 0; $j < scalar(@GenBuild::components); $j++)
|
|
672 |
{
|
|
673 |
my $line = $GenBuild::components[$j];
|
|
674 |
my @MyList;
|
|
675 |
my $tempvar;
|
|
676 |
|
|
677 |
@MyList = split(/\s+/,$line);
|
|
678 |
$tempvar= lc $MyList[$#MyList];
|
|
679 |
$tempvar =~ s/\\group//;
|
|
680 |
push @MyList, $tempvar;
|
|
681 |
|
|
682 |
# Process target list
|
|
683 |
foreach my $iTarget (@iTargets)
|
|
684 |
{
|
|
685 |
print $GenBuild::XMLFileH qq{\t\t<Execute ID="$GenBuild::iIDCount" Stage="$GenBuild::iStageCount" Component="$MyList[2]" Cwd="$GenBuild::iSourceDir$MyList[1]" CommandLine="$action $iTarget"/>\n};
|
|
686 |
$GenBuild::iIDCount++;
|
|
687 |
}
|
|
688 |
if ( $iIncStage )
|
|
689 |
{
|
|
690 |
$GenBuild::iStageCount++;
|
|
691 |
}
|
|
692 |
}
|
|
693 |
$GenBuild::iStageCount++ if (!$iIncStage);
|
|
694 |
|
|
695 |
}
|
|
696 |
|
|
697 |
# GenReallyClean
|
|
698 |
#
|
|
699 |
# Inputs
|
|
700 |
# $iReallyClean - Filename for reallyclean xml
|
|
701 |
#
|
|
702 |
# Outputs
|
|
703 |
#
|
|
704 |
# Description
|
|
705 |
# This function generates a xml file to run abld reallyclean on all components
|
|
706 |
sub GenReallyClean
|
|
707 |
{
|
|
708 |
my ($iReallyClean) = @_;
|
|
709 |
|
|
710 |
# Reset ID and Stage Counf for New XML File
|
|
711 |
$GenBuild::iIDCount = 1;
|
|
712 |
$GenBuild::iStageCount = 1;
|
|
713 |
|
|
714 |
|
|
715 |
# Add the section header
|
|
716 |
print $GenBuild::gLogFileH "=== Genxml == ReallyClean\n";
|
|
717 |
|
|
718 |
print $GenBuild::gLogFileH "-- Genxml\n";
|
|
719 |
# Add the per command start timestamp
|
|
720 |
print $GenBuild::gLogFileH "++ Started at ".localtime()."\n";
|
|
721 |
# Add the per command start HiRes timestamp if available
|
|
722 |
if ($gHiResTimer == 1)
|
|
723 |
{
|
|
724 |
print $GenBuild::gLogFileH "+++ HiRes Start ".Time::HiRes::time()."\n";
|
|
725 |
} else {
|
|
726 |
# Add the HiRes timer missing statement
|
|
727 |
print $GenBuild::gLogFileH "+++ HiRes Missing\n";
|
|
728 |
}
|
|
729 |
|
|
730 |
# Open XML file
|
|
731 |
$GenBuild::XMLFileH = IO::File->new("> $iReallyClean")
|
|
732 |
or croak "Couldn't open $iReallyClean for writing: $!\n";
|
|
733 |
|
|
734 |
# Write Header
|
|
735 |
&PrintXMLHeader($GenBuild::XMLFileH);
|
|
736 |
# Generate XML file
|
|
737 |
&BuildLevels("0", "abld reallyclean");
|
|
738 |
# Write Footer and Close XML File
|
|
739 |
print $GenBuild::XMLFileH qq{\t</Commands>\n</Product>};
|
|
740 |
close($GenBuild::XMLFileH);
|
|
741 |
|
|
742 |
|
|
743 |
# Add the per command end HiRes timestamp if available
|
|
744 |
print $GenBuild::gLogFileH "+++ HiRes End ".Time::HiRes::time()."\n" if ($gHiResTimer == 1);
|
|
745 |
# Add the per command end timestamp
|
|
746 |
print $GenBuild::gLogFileH "++ Finished at ".localtime()."\n";
|
|
747 |
|
|
748 |
# Print Genxml log footer
|
|
749 |
print $GenBuild::gLogFileH "=== Genxml finished ".localtime()."\n";
|
|
750 |
}
|
|
751 |
|
|
752 |
# GenClean
|
|
753 |
#
|
|
754 |
# Inputs
|
|
755 |
# $iClean - Filename for reallyclean xml
|
|
756 |
#
|
|
757 |
# Outputs
|
|
758 |
#
|
|
759 |
# Description
|
|
760 |
# This function generates a xml file to run abld reallyclean on all components
|
|
761 |
sub GenClean
|
|
762 |
{
|
|
763 |
my ($iClean) = @_;
|
|
764 |
|
|
765 |
# Reset ID and Stage Counf for New XML File
|
|
766 |
$GenBuild::iIDCount = 1;
|
|
767 |
$GenBuild::iStageCount = 1;
|
|
768 |
|
|
769 |
# Add the section header
|
|
770 |
print $GenBuild::gLogFileH "=== Genxml == Clean\n";
|
|
771 |
|
|
772 |
print $GenBuild::gLogFileH "-- Genxml\n";
|
|
773 |
# Add the per command start timestamp
|
|
774 |
print $GenBuild::gLogFileH "++ Started at ".localtime()."\n";
|
|
775 |
# Add the per command start HiRes timestamp if available
|
|
776 |
if ($gHiResTimer == 1)
|
|
777 |
{
|
|
778 |
print $GenBuild::gLogFileH "+++ HiRes Start ".Time::HiRes::time()."\n";
|
|
779 |
} else {
|
|
780 |
# Add the HiRes timer missing statement
|
|
781 |
print $GenBuild::gLogFileH "+++ HiRes Missing\n";
|
|
782 |
}
|
|
783 |
|
|
784 |
# Open XML file
|
|
785 |
$GenBuild::XMLFileH = IO::File->new("> $iClean")
|
|
786 |
or croak "Couldn't open $iClean for writing: $!\n";
|
|
787 |
|
|
788 |
# Write Header
|
|
789 |
&PrintXMLHeader($GenBuild::XMLFileH);
|
|
790 |
# Generate XML file
|
|
791 |
&BuildLevels("0", "abld clean");
|
|
792 |
|
|
793 |
# Write Footer and Close XML File
|
|
794 |
print $GenBuild::XMLFileH qq{\t</Commands>\n</Product>};
|
|
795 |
close($GenBuild::XMLFileH);
|
|
796 |
|
|
797 |
|
|
798 |
# Add the per command end HiRes timestamp if available
|
|
799 |
print $GenBuild::gLogFileH "+++ HiRes End ".Time::HiRes::time()."\n" if ($gHiResTimer == 1);
|
|
800 |
# Add the per command end timestamp
|
|
801 |
print $GenBuild::gLogFileH "++ Finished at ".localtime()."\n";
|
|
802 |
|
|
803 |
# Print Genxml log footer
|
|
804 |
print $GenBuild::gLogFileH "=== Genxml finished ".localtime()."\n";
|
|
805 |
}
|
|
806 |
|
|
807 |
# PrintXMLHeader
|
|
808 |
#
|
|
809 |
# Inputs
|
|
810 |
# $iFileHandle
|
|
811 |
#
|
|
812 |
# Outputs
|
|
813 |
#
|
|
814 |
# Description
|
|
815 |
# This function print the common start of the XML File
|
|
816 |
sub PrintXMLHeader
|
|
817 |
{
|
|
818 |
my ($iFileHandle) = @_;
|
|
819 |
|
|
820 |
my ($epocroot) = $ENV{'EPOCROOT'};
|
|
821 |
|
|
822 |
# Print the XML Header
|
|
823 |
print $iFileHandle qq{<?xml version="1.0"?>\n};
|
|
824 |
print $iFileHandle <<DTD_EOF;
|
|
825 |
<!DOCTYPE Build [
|
|
826 |
<!ELEMENT Product (Commands)>
|
|
827 |
<!ATTLIST Product name CDATA #REQUIRED>
|
|
828 |
<!ELEMENT Commands (Execute+ | SetEnv*)>
|
|
829 |
<!ELEMENT Execute EMPTY>
|
|
830 |
<!ATTLIST Execute ID CDATA #REQUIRED>
|
|
831 |
<!ATTLIST Execute Stage CDATA #REQUIRED>
|
|
832 |
<!ATTLIST Execute Component CDATA #REQUIRED>
|
|
833 |
<!ATTLIST Execute Cwd CDATA #REQUIRED>
|
|
834 |
<!ATTLIST Execute CommandLine CDATA #REQUIRED>
|
|
835 |
<!ELEMENT SetEnv EMPTY>
|
|
836 |
<!ATTLIST SetEnv Order ID #REQUIRED>
|
|
837 |
<!ATTLIST SetEnv Name CDATA #REQUIRED>
|
|
838 |
<!ATTLIST SetEnv Value CDATA #REQUIRED>
|
|
839 |
]>
|
|
840 |
DTD_EOF
|
|
841 |
print $iFileHandle qq{<Product Name="$GenBuild::basename">\n\t<Commands>\n};
|
|
842 |
|
|
843 |
#Set EPOCROOT
|
|
844 |
print $iFileHandle qq{\t\t<SetEnv Order="1" Name="EPOCROOT" Value="$epocroot"/>\n};
|
|
845 |
|
|
846 |
#Add Tools to the path using EPOCROOT
|
|
847 |
print $iFileHandle qq{\t\t<SetEnv Order="2" Name="PATH" Value="}.$epocroot.qq{epoc32\\gcc\\bin;}.$epocroot.qq{epoc32\\tools;%PATH%"/>\n};
|
|
848 |
|
|
849 |
}
|
|
850 |
1;
|