author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 31 Aug 2010 16:34:26 +0300 | |
branch | RCL_3 |
changeset 43 | c1f20ce4abcf |
parent 0 | a41df078684a |
child 44 | 3e88ff8f41d5 |
permissions | -rw-r--r-- |
0 | 1 |
# Copyright (c) 2001-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 the License "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 |
# \f32test\loader\dlltree.pl |
|
15 |
# Generate header and build files for one or more trees |
|
16 |
# of DLLs and EXEs according to a description file. |
|
17 |
# |
|
18 |
# |
|
19 |
||
20 |
require Cwd; |
|
21 |
||
22 |
my $dllbasename='dllt'; |
|
23 |
my $dllext='.dll'; |
|
24 |
my $exebasename='exet'; |
|
25 |
my $exeext='.exe'; |
|
26 |
my $mmpext='.mmp'; |
|
27 |
my $defext='.def'; |
|
28 |
my $libext='.lib'; |
|
29 |
||
30 |
my $source0ext='.cpp'; |
|
31 |
my $source1ext='.cia'; |
|
32 |
my $xippath="sys\\bin\\"; |
|
33 |
my $nonxippath="sys\\bin\\"; |
|
34 |
||
35 |
my $hostpath="\\Epoc32\\Release\\##MAIN##\\##BUILD##\\"; |
|
36 |
||
37 |
my $flag_value_exe=1; |
|
38 |
my $flag_value_fixed=2; |
|
39 |
my $flag_value_data=4; |
|
40 |
my $flag_value_xip=8; |
|
41 |
my $flag_value_dll_in_cycle=16; |
|
42 |
my $flag_value_data_in_tree=32; |
|
43 |
my $flag_value_xip_data_in_tree=64; |
|
44 |
my $flag_value_exports=128; |
|
45 |
my $flag_value_pagedcode=256; |
|
46 |
my $flag_value_unpagedcode=512; |
|
47 |
my $flag_value_idrive=1024; |
|
48 |
my $flag_value_vdrive=2048; |
|
49 |
my $flag_value_bytepair=4096; |
|
50 |
my $flag_value_uncompressed=8192; |
|
51 |
my $flag_value_targetonly=16384; |
|
52 |
my $flag_value_pageddata=32768; |
|
53 |
my $flag_value_unpageddata=65536; |
|
54 |
||
55 |
my $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst; |
|
56 |
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime; |
|
57 |
my $copy_end=$year+1900; |
|
58 |
||
59 |
my $argc=scalar(@ARGV); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
60 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
61 |
# check whether its raptor specific |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
62 |
my $is_raptor = 0; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
63 |
if ($ARGV[$argc-1] eq "raptor") # change "raptor" to something you want. |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
64 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
65 |
pop(@ARGV); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
66 |
$is_raptor = 1; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
67 |
$argc--; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
68 |
} |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
69 |
|
0 | 70 |
($argc==1 or $argc==2 or $argc==3) or die "Usage: perl dlltree.pl <filename> <dir> [-allowbad]\n"; |
71 |
my $infile=$ARGV[0]; |
|
72 |
open IN, $infile or die "Cannot open input file $infile\n"; |
|
73 |
my @in; |
|
74 |
while (<IN>) { |
|
75 |
push @in, $_; |
|
76 |
} |
|
77 |
close IN; |
|
78 |
my $destdir=''; |
|
79 |
if ($argc>=2) { |
|
80 |
$destdir=$ARGV[1]; |
|
81 |
unless (-d $destdir) { |
|
82 |
mkdir $destdir, 0777 or die "Can't create directory $destdir\n"; |
|
83 |
} |
|
84 |
chdir $destdir or die "Can't chdir to directory $destdir\n"; |
|
85 |
} |
|
86 |
my $allowbad; |
|
87 |
if ($argc==3) { |
|
88 |
if ($ARGV[2] eq '-allowbad') { |
|
89 |
$allowbad = 1; |
|
90 |
} |
|
91 |
} |
|
92 |
$cwd=Cwd::getcwd(); |
|
93 |
$destpath=$cwd; |
|
94 |
$destpath=~s/\//\\/g; |
|
95 |
if ($destpath=~/^\w\:(.*)/) { |
|
96 |
$destpath=$1; |
|
97 |
} |
|
98 |
unless ($destpath=~/^(.*?)\\$/) { |
|
99 |
$destpath.='\\'; |
|
100 |
} |
|
101 |
#print "$cwd\n"; |
|
102 |
#print "$destpath\n"; |
|
103 |
||
104 |
my @modules; |
|
105 |
my @testcases; |
|
106 |
my $line=0; |
|
107 |
my $modnum=0; |
|
108 |
my $state=0; |
|
109 |
my $concat; |
|
110 |
foreach (@in) { |
|
111 |
++$line; |
|
112 |
next if (/^\s*$/ or /^\s*\#/); |
|
113 |
if ($state==0) { |
|
114 |
if (/^\!TESTCASES/) { |
|
115 |
$state=1; |
|
116 |
next; |
|
117 |
} |
|
118 |
my @moddesc=split; |
|
119 |
my $modname=shift @moddesc; |
|
120 |
if (grep {lc($$_{name}) eq lc($modname)} @modules) { |
|
121 |
die "Duplicate module specification at line $line\n"; |
|
122 |
} |
|
123 |
my %module; |
|
124 |
$module{name}=$modname; |
|
125 |
$module{num}=$modnum; |
|
126 |
$module{exports}=1; |
|
127 |
$module{nclients}=0; # number of modules which import from this one |
|
128 |
while (scalar(@moddesc)) { |
|
129 |
my $att=shift @moddesc; |
|
130 |
if ($att=~/^\:$/) { |
|
131 |
last; |
|
132 |
} elsif ($att=~/^X$/i) { |
|
133 |
$module{exe}=1; |
|
134 |
} elsif ($att=~/^F$/i) { |
|
135 |
$module{fixed}=1; |
|
136 |
} elsif ($att=~/^D$/i) { |
|
137 |
$module{data}=1; |
|
138 |
} elsif ($att=~/^P$/i) { |
|
139 |
$module{pagedcode}=1; |
|
140 |
} elsif ($att=~/^PD$/i) { |
|
141 |
$module{pageddata}=1; |
|
142 |
} elsif ($att=~/^B$/i) { |
|
143 |
$module{bytepair}=1; |
|
144 |
} elsif ($att=~/^U$/i) { |
|
145 |
$module{uncompressed}=1; |
|
146 |
} elsif ($att=~/^I$/i) { |
|
147 |
$module{idrive}=1; |
|
148 |
} elsif ($att=~/^V$/i) { |
|
149 |
$module{vdrive}=1; |
|
150 |
} elsif ($att=~/^N$/i) { |
|
151 |
$module{unpagedcode}=1; |
|
152 |
} elsif ($att=~/^T$/i) { |
|
153 |
$module{targetonly}=1; |
|
154 |
} elsif ($att=~/^R(.*?)$/i) { |
|
155 |
$module{xip}=1; |
|
156 |
my $attp=$1; |
|
157 |
if ($attp=~/^\,(.*?)$/) { |
|
158 |
$module{attpname}=$1; |
|
159 |
} elsif (!($attp=~/^\s*$/)) { |
|
160 |
die "Garbage following R attribute at line $line\n"; |
|
161 |
} |
|
162 |
} |
|
163 |
} |
|
164 |
if ($module{fixed} && !$module{exe}) { |
|
165 |
die "Can't have FIXED without EXE at line $line\n"; |
|
166 |
} |
|
167 |
if ($module{pagedcode} && $module{xip}) { |
|
168 |
die "Can't have PAGEDCODE with XIP at line $line\n"; |
|
169 |
} |
|
170 |
||
171 |
# makmake won't support paged binaries which aren't bytepair or uncompressed. |
|
172 |
# However, P can be specified without them in dlltree.txt. This program generates |
|
173 |
# an MMP file with neither flag. The flag is added when the files are copied to |
|
174 |
# internal media by T_LDRTST. (It would be pointless to copy the files to removable |
|
175 |
# media and then edit them because removable media doesn't support paging.) |
|
176 |
||
177 |
my $bothCodePageFlags = $module{pagedcode} && $module{unpagedcode}; |
|
178 |
if ($bothCodePageFlags && !$module{idrive}) { |
|
179 |
die "Can't have PAGEDCODE and UNPAGEDCODE without INTERNAL DRIVE at line $line\n"; |
|
180 |
} |
|
181 |
if ($module{unpagedcode} && $module{xip}) { |
|
182 |
die "Can't have UNPAGEDCODE with XIP at line $line\n"; |
|
183 |
} |
|
184 |
if ($module{pageddata} && !$module{exe}) { |
|
185 |
die "Can't have PAGEDDATA without EXE at line $line\n"; |
|
186 |
} |
|
187 |
if ($module{idrive} && $module{xip}) { |
|
188 |
die "Can't have INTERNAL DRIVE with XIP at line $line\n"; |
|
189 |
} |
|
190 |
if ($module{vdrive} && $module{xip}) { |
|
191 |
die "Can't have REMOVABLE DRIVE with XIP at line $line\n"; |
|
192 |
} |
|
193 |
if ($module{idrive} && $module{vdrive}) { |
|
194 |
die "Can't have INTERNAL DRIVE with REMOVABLE DRIVE at line $line\n"; |
|
195 |
} |
|
196 |
if ($module{bytepair} && $module{uncompressed}) { |
|
197 |
die "Can't have BYTEPAIR with UNCOMPRESSED at line $line\n"; |
|
198 |
} |
|
199 |
if ($module{exe}) { |
|
200 |
if ($module{attpname}) { |
|
201 |
warn "Attach process with EXE ignored at line $line\n"; |
|
202 |
delete $module{attpname}; |
|
203 |
} |
|
204 |
$module{basefilename}=$exebasename.$modnum; |
|
205 |
$module{filename}=$module{basefilename}.$exeext; |
|
206 |
$module{source0}=$exebasename.$source0ext; |
|
207 |
$module{source1}=""; |
|
208 |
$module{trgtype}='exexp'; |
|
209 |
$module{lib}=$module{basefilename}.$libext; |
|
210 |
} else { |
|
211 |
$module{basefilename}=$dllbasename.$modnum; |
|
212 |
$module{filename}=$module{basefilename}.$dllext; |
|
213 |
$module{source0}=$dllbasename.$source0ext; |
|
214 |
$module{source1}=$dllbasename.$source1ext; |
|
215 |
$module{trgtype}='dll'; |
|
216 |
$module{lib}=$module{basefilename}.$libext; |
|
217 |
} |
|
218 |
$module{depnames}=\@moddesc; # dependency names are left over |
|
219 |
$module{line}=$line; |
|
220 |
$module{mark}=0; |
|
221 |
push @modules, \%module; |
|
222 |
++$modnum; |
|
223 |
} elsif ($state<=2) { |
|
224 |
if ($state==1) { |
|
225 |
$concat=""; |
|
226 |
die "Syntax error at line $line\n" unless (/^(\w+)\:/); |
|
227 |
} |
|
228 |
if (/^(.*?)\\$/) { |
|
229 |
$concat.=$1; |
|
230 |
$concat.=' '; |
|
231 |
$state=2; |
|
232 |
next; |
|
233 |
} else { |
|
234 |
$concat.=$_; |
|
235 |
$state=1; |
|
236 |
} |
|
237 |
my @modlist=split(/\s+/, $concat); |
|
238 |
my $tcname=shift @modlist; |
|
239 |
$tcname=~/^(.*?)\:$/ or die "???\n"; |
|
240 |
$tcname=$1; |
|
241 |
my %tc; |
|
242 |
$tc{name}=$tcname; |
|
243 |
$tc{mod_names}=\@modlist; |
|
244 |
push @testcases, \%tc; |
|
245 |
} |
|
246 |
} |
|
247 |
foreach $modref (@modules) { |
|
248 |
my $moddepref=$$modref{depnames}; |
|
249 |
my @deps; |
|
250 |
foreach (@$moddepref) { |
|
251 |
my $depname=lc($_); |
|
252 |
my @match=grep {lc($$_{name}) eq $depname} @modules; |
|
253 |
if (scalar(@match)==0) { |
|
254 |
die "Unknown dependent module $depname at line $$modref{line}\n"; |
|
255 |
} |
|
256 |
my $depref=$match[0]; |
|
257 |
if ($$modref{xip} and !$$depref{xip}) { |
|
258 |
die "Illegal dependency: $$modref{name} (XIP) on $$depref{name} (non-XIP)\n"; |
|
259 |
} |
|
260 |
push @deps, $$depref{num}; |
|
261 |
++$$depref{nclients}; |
|
262 |
} |
|
263 |
$$modref{deps}=\@deps; |
|
264 |
my $attpname=$$modref{attpname}; |
|
265 |
if ($attpname) { |
|
266 |
my @match=grep {lc($$_{name}) eq lc($attpname)} @modules; |
|
267 |
if (scalar(@match)==0) { |
|
268 |
die "Unknown attach process $attpname at line $$modref{line}\n"; |
|
269 |
} |
|
270 |
my $attpref=$match[0]; |
|
271 |
if (!$$attpref{exe}) { |
|
272 |
die "Specified attach process is not EXE at line $$modref{line}\n"; |
|
273 |
} elsif (!$$attpref{xip}) { |
|
274 |
die "Specified attach process is not XIP at line $$modref{line}\n"; |
|
275 |
} |
|
276 |
$$modref{attp}=$attpref; |
|
277 |
} |
|
278 |
} |
|
279 |
foreach $tcref (@testcases) { |
|
280 |
my $modlistref=$$tcref{mod_names}; |
|
281 |
my @modnums; |
|
282 |
foreach $modname (@$modlistref) { |
|
283 |
next if ($modname=~/^\s*$/); |
|
284 |
my @match=grep {lc($$_{name}) eq lc($modname)} @modules; |
|
285 |
if (scalar(@match)==0) { |
|
286 |
die "Unknown module $modname in test case $$tcref{name}\n"; |
|
287 |
} |
|
288 |
push @modnums, $match[0]->{num}; |
|
289 |
} |
|
290 |
$$tcref{modules}=\@modnums; |
|
291 |
$$tcref{count}=scalar(@modnums); |
|
292 |
} |
|
293 |
my $next_mark=0; |
|
294 |
foreach $modref (@modules) { |
|
295 |
if ($$modref{nclients}==0 and $$modref{exe}) { |
|
296 |
# EXE with no exports |
|
297 |
$$modref{exports}=0; |
|
298 |
$$modref{trgtype}='exe'; |
|
299 |
} |
|
300 |
++$next_mark; |
|
301 |
my $modnum=$$modref{num}; |
|
302 |
my @tcdeps; |
|
303 |
calc_tc(\@tcdeps, \@modules, $modref, $next_mark); |
|
304 |
$$modref{tcdeps}=\@tcdeps; |
|
305 |
if (grep {$_==$modnum} @tcdeps) { |
|
306 |
$$modref{cycle}=1; |
|
307 |
} |
|
308 |
my @exes=grep {$modules[$_]->{exe}} @tcdeps; |
|
309 |
my $nexes=scalar(@exes); |
|
310 |
||
311 |
unless ($allowbad) { |
|
312 |
if ($nexes>1) { |
|
313 |
die "Module $$modref{name} links to more than one EXE\n"; |
|
314 |
} elsif ($nexes==1) { |
|
315 |
my $exeref=$modules[$exes[0]]; |
|
316 |
$$modref{linkexe}=$exeref; |
|
317 |
if ($$modref{exe}) { |
|
318 |
if ($$exeref{num}!=$modnum) { |
|
319 |
die "EXE $modref{name} links to another EXE\n"; |
|
320 |
} |
|
321 |
} else { |
|
322 |
if ($$modref{attp} and $$exeref{num}!=$modref->{attp}->{num}) { |
|
323 |
die "DLL $$modref{name} ($modnum) incompatible attach process\n"; |
|
324 |
} |
|
325 |
if (!$$modref{attp}) { |
|
326 |
$$modref{attp}=$exeref; |
|
327 |
} |
|
328 |
} |
|
329 |
} |
|
330 |
} |
|
331 |
if ($$modref{exe}) { |
|
332 |
foreach $depnum (@tcdeps) { |
|
333 |
my $depref=$modules[$depnum]; |
|
334 |
my $depattpref=$depref->{attp}; |
|
335 |
if ($depattpref and $depattpref->{num}!=$modnum) { |
|
336 |
die "DEP DLL $$depref{name} ($$depref{num}) incompatible attach process\n"; |
|
337 |
} |
|
338 |
# if (!$depattpref) { |
|
339 |
# $$depref{attp}=$modref; |
|
340 |
# } |
|
341 |
} |
|
342 |
} |
|
343 |
} |
|
344 |
foreach $modref (@modules) { |
|
345 |
my @total_deps; |
|
346 |
my $tcdepref=$$modref{tcdeps}; |
|
347 |
push @total_deps, @$tcdepref; |
|
348 |
my $linkexe=$$modref{linkexe}; |
|
349 |
if ($linkexe) { |
|
350 |
my $exetcdepref=$$linkexe{tcdeps}; |
|
351 |
push @total_deps, @$exetcdepref; |
|
352 |
} |
|
353 |
push @total_deps, $$modref{num}; |
|
354 |
my $data=scalar(grep {$modules[$_]->{data}} @total_deps); |
|
355 |
if ($data!=0) { |
|
356 |
$$modref{dataintree}=1; |
|
357 |
} |
|
358 |
my $xipdata=scalar(grep {$modules[$_]->{data} and $modules[$_]->{xip}} @total_deps); |
|
359 |
if ($xipdata!=0) { |
|
360 |
$$modref{xipdataintree}=1; |
|
361 |
} |
|
362 |
} |
|
363 |
||
364 |
#foreach $modref (@modules) { |
|
365 |
# print "Module $$modref{num}:\n"; |
|
366 |
# print "\tName: $$modref{name}\n"; |
|
367 |
# print "\tFilename: $$modref{filename}\n"; |
|
368 |
# my $depref=$$modref{deps}; |
|
369 |
# my $ndeps=scalar(@$depref); |
|
370 |
# print "\t#Deps: $ndeps\n"; |
|
371 |
# print "\tDeps: ",join(',',@$depref),"\n"; |
|
372 |
#} |
|
373 |
||
374 |
my @bldinf; |
|
375 |
my $bldname='dlltree.inf'; |
|
376 |
push @bldinf, "// $destpath$bldname\n"; |
|
377 |
push @bldinf, "//\n"; |
|
378 |
push @bldinf, "// Copyright (c) 2000-$copy_end Symbian Ltd. All rights reserved.\n"; |
|
379 |
push @bldinf, "//\n"; |
|
380 |
push @bldinf, "\n"; |
|
381 |
push @bldinf, "PRJ_PLATFORMS\n"; |
|
382 |
push @bldinf, "BASEUSERDEFAULT\n"; |
|
383 |
push @bldinf, "\n"; |
|
384 |
push @bldinf, "PRJ_TESTMMPFILES\n"; |
|
385 |
push @bldinf, "\n"; |
|
386 |
||
387 |
my @dlltree; |
|
388 |
my $dlltreename='dlltree.h'; |
|
389 |
push @dlltree, "// $destpath$dlltreename\n"; |
|
390 |
push @dlltree, "//\n"; |
|
391 |
push @dlltree, "// Copyright (c) 2000-$copy_end Symbian Ltd. All rights reserved.\n"; |
|
392 |
push @dlltree, "//\n"; |
|
393 |
push @dlltree, "\n"; |
|
394 |
push @dlltree, "#ifndef __DLLTREE_H__\n"; |
|
395 |
push @dlltree, "#define __DLLTREE_H__\n"; |
|
396 |
push @dlltree, "#include <e32std.h>\n"; |
|
397 |
push @dlltree, "\n"; |
|
398 |
push @dlltree, "class MDllList;\n"; |
|
399 |
push @dlltree, "\n"; |
|
400 |
||
401 |
my $ibyname='ldrtest.iby'; |
|
402 |
my @iby; |
|
403 |
||
404 |
foreach $modref (@modules) { |
|
405 |
my @mmp; |
|
406 |
my $num=$$modref{num}; |
|
407 |
my $mmpname=$$modref{basefilename}.$mmpext; |
|
408 |
my $defname=$$modref{basefilename}.$defext; |
|
409 |
my $depsref=$$modref{deps}; |
|
410 |
my $ndeps=scalar(@$depsref); |
|
411 |
push @mmp, "// $destpath$mmpname\n"; |
|
412 |
push @mmp, "//\n"; |
|
413 |
push @mmp, "// Copyright (c) 2000-$copy_end Symbian Ltd. All rights reserved.\n"; |
|
414 |
push @mmp, "//\n"; |
|
415 |
push @mmp, "// Generated from $$modref{name}\n"; |
|
416 |
push @mmp, "\n"; |
|
417 |
push @mmp, "macro __DLLNUM$num\n"; |
|
418 |
push @mmp, "target $$modref{filename}\n"; |
|
419 |
push @mmp, "targettype $$modref{trgtype}\n"; |
|
420 |
push @mmp, "sourcepath .\n"; |
|
421 |
push @mmp, "source $$modref{source0} $$modref{source1}\n"; |
|
422 |
push @mmp, "library euser.lib efsrv.lib\n"; |
|
423 |
push @mmp, "Capability NONE\n"; |
|
424 |
foreach (@$depsref) { |
|
425 |
my $depref=$modules[$_]; |
|
426 |
push @mmp, "library $$depref{lib}\n"; |
|
427 |
} |
|
428 |
if ($$modref{exports}) { |
|
429 |
push @mmp, "deffile ./$defname\n"; |
|
430 |
push @mmp, "nostrictdef\n"; |
|
431 |
} |
|
432 |
push @mmp, "OS_LAYER_SYSTEMINCLUDE_SYMBIAN \n"; |
|
433 |
push @mmp, "systeminclude ../../../e32test/mmu \n"; |
|
434 |
push @mmp, "userinclude . \n"; |
|
435 |
if ($$modref{fixed}) { |
|
436 |
push @mmp, "epocfixedprocess\n"; |
|
437 |
} |
|
438 |
||
439 |
# if both paged flags are set or the compression is not pageable then print neither. |
|
440 |
# T_LDRTST will add the required flags when it copies the file to internal media. |
|
441 |
||
442 |
my $bothCodePageFlags = $$modref{pagedcode} && $$modref{unpagedcode}; |
|
443 |
my $pageableCompression = $$modref{bytepair} || $$modref{uncompressed}; |
|
444 |
if (!$bothCodePageFlags && $pageableCompression) { |
|
445 |
push @mmp, "pagedcode\n" if $$modref{pagedcode}; |
|
446 |
push @mmp, "unpagedcode\n" if $$modref{unpagedcode}; |
|
447 |
} |
|
448 |
||
449 |
if ($$modref{exe}) { |
|
450 |
# make exes unpageddata by default |
|
451 |
if (!$$modref{pageddata}) { |
|
452 |
$$modref{unpageddata}=1; |
|
453 |
} |
|
454 |
if ($$modref{pageddata}) { |
|
455 |
push @mmp, "pageddata\n"; |
|
456 |
} |
|
457 |
if ($$modref{unpageddata}) { |
|
458 |
push @mmp, "unpageddata\n"; |
|
459 |
} |
|
460 |
} |
|
461 |
||
462 |
if ($$modref{bytepair}) { |
|
463 |
push @mmp, "bytepaircompresstarget\n"; |
|
464 |
} |
|
465 |
||
466 |
if ($$modref{uncompressed}) { |
|
467 |
push @mmp, "nocompresstarget\n"; |
|
468 |
} |
|
469 |
||
470 |
if ($$modref{data} && !$$modref{exe}) { |
|
471 |
push @mmp, "epocallowdlldata\n"; |
|
472 |
} |
|
473 |
push @mmp, sprintf("uid 0x00000000 0x%08x\n", $num+256); |
|
474 |
push @mmp, "SMPSAFE\n"; |
|
475 |
$$modref{mmp}=\@mmp; |
|
476 |
||
477 |
if ($$modref{exports}) { |
|
478 |
my @def; |
|
479 |
push @def, "EXPORTS\n"; |
|
480 |
if ($$modref{exe}) { |
|
481 |
push @def, "\tRegisterConstructorCall @ 1 NONAME\n"; |
|
482 |
push @def, "\tRegisterInitCall @ 2 NONAME\n"; |
|
483 |
push @def, "\tRegisterDestructorCall @ 3 NONAME\n"; |
|
484 |
} else { |
|
485 |
push @def, "\tInit$num @ 1 NONAME\n"; |
|
486 |
push @def, "\tChkC$num @ 2 NONAME\n"; |
|
487 |
push @def, "\tBlkI$num @ 3 NONAME\n"; |
|
488 |
push @def, "\tGetGeneration @ 4 NONAME\n"; |
|
489 |
push @def, "\tRBlkI$num @ 5 NONAME\n"; |
|
490 |
push @def, "\tSetCloseLib @ 6 NONAME\n"; |
|
491 |
} |
|
492 |
$$modref{def}=\@def; |
|
493 |
} |
|
494 |
||
495 |
push @bldinf, "$$modref{basefilename}\t\tsupport\n"; |
|
496 |
||
497 |
if ($num==0) { |
|
498 |
push @dlltree, "#if defined(__DLLNUM$num)\n"; |
|
499 |
} else { |
|
500 |
push @dlltree, "#elif defined(__DLLNUM$num)\n"; |
|
501 |
} |
|
502 |
push @dlltree, "#define DLLNUM $num\n"; |
|
503 |
if ($$modref{exe}) { |
|
504 |
push @dlltree, "#define EXENUM $num\n"; |
|
505 |
push @dlltree, "_LIT(KServerName, \"$$modref{name}\");\n"; |
|
506 |
} |
|
507 |
push @dlltree, "#define INITFUNC Init$num\n"; |
|
508 |
push @dlltree, "#define CHKCFUNC ChkC$num\n"; |
|
509 |
push @dlltree, "#define BLKIFUNC BlkI$num\n"; |
|
510 |
push @dlltree, "#define RBLKIFUNC RBlkI$num\n"; |
|
511 |
push @dlltree, "#define CHKDEPS(r) (\\\n"; |
|
512 |
foreach (@$depsref) { |
|
513 |
my $depref=$modules[$_]; |
|
514 |
unless ($$depref{exe}) { |
|
515 |
my $func="ChkC$_"; |
|
516 |
push @dlltree, "\t((r)=$func())!=0 ||\\\n"; |
|
517 |
} |
|
518 |
} |
|
519 |
push @dlltree, "\t((r)=0)!=0 )\n"; |
|
520 |
push @dlltree, "#define INITDEPS(r,l) (\\\n"; |
|
521 |
foreach (@$depsref) { |
|
522 |
my $depref=$modules[$_]; |
|
523 |
unless ($$depref{exe}) { |
|
524 |
my $func="Init$_"; |
|
525 |
push @dlltree, "\t((r)=$func(l))!=0 ||\\\n"; |
|
526 |
} |
|
527 |
} |
|
528 |
push @dlltree, "\t((r)=0)!=0 )\n"; |
|
529 |
my $link_to_exe; |
|
530 |
push @dlltree, "#define RBLKIFUNC_DEPS(i,g) {\\\n"; |
|
531 |
foreach (@$depsref) { |
|
532 |
my $depref=$modules[$_]; |
|
533 |
if ($$depref{exe}) { |
|
534 |
$link_to_exe=1; |
|
535 |
} else { |
|
536 |
my $func="RBlkI$_"; |
|
537 |
push @dlltree, "\t(i)=$func(i,g);\\\n"; |
|
538 |
} |
|
539 |
} |
|
540 |
push @dlltree, "\t}\n"; |
|
541 |
if ($link_to_exe) { |
|
542 |
push @dlltree, "#define __DLL_LINK_TO_EXE\n"; |
|
543 |
} |
|
544 |
if ($$modref{cycle}) { |
|
545 |
push @dlltree, "#define __DLL_IN_CYCLE\n"; |
|
546 |
} |
|
547 |
if ($$modref{data}) { |
|
548 |
push @dlltree, "#define __MODULE_HAS_DATA\n"; |
|
549 |
} |
|
550 |
if ($$modref{exports}) { |
|
551 |
push @dlltree, "#define __MODULE_EXPORT\t\tEXPORT_C\n"; |
|
552 |
push @dlltree, "#define __MODULE_IMPORT\t\tIMPORT_C\n"; |
|
553 |
} else { |
|
554 |
push @dlltree, "#define __MODULE_EXPORT\n"; |
|
555 |
push @dlltree, "#define __MODULE_IMPORT\n"; |
|
556 |
} |
|
557 |
foreach (@$depsref) { |
|
558 |
my $depref=$modules[$_]; |
|
559 |
if ($$depref{exe}) { |
|
560 |
} else { |
|
561 |
push @dlltree, "extern \"C\" IMPORT_C TInt Init$_(MDllList&);\n"; |
|
562 |
push @dlltree, "extern \"C\" IMPORT_C TInt ChkC$_();\n"; |
|
563 |
push @dlltree, "extern \"C\" IMPORT_C TInt RBlkI$_(TInt, TInt);\n"; |
|
564 |
} |
|
565 |
} |
|
566 |
my $hostfullpathname=$hostpath.$$modref{filename}; |
|
567 |
if ($$modref{xip}) { |
|
568 |
my $epocfullpathname=$xippath.$$modref{filename}; |
|
569 |
my $flags; |
|
570 |
if ($$modref{attp}) { |
|
571 |
$flags='process '.$modref->{attp}->{filename}; |
|
572 |
} |
|
573 |
push @iby, "file=$hostfullpathname\t\t$epocfullpathname\t\t$flags\n"; |
|
574 |
} else { |
|
575 |
my $epocfullpathname=$nonxippath.$$modref{filename}; |
|
576 |
push @iby, "data=$hostfullpathname\t\t$epocfullpathname\n"; |
|
577 |
} |
|
578 |
} |
|
579 |
||
580 |
#push @dlltree, "#else\n"; |
|
581 |
#push @dlltree, "#error No __DLLNUM macro defined\n"; |
|
582 |
push @dlltree, "#endif\n"; |
|
583 |
push @dlltree, "\n"; |
|
584 |
||
585 |
my $module_count=scalar(@modules); |
|
586 |
push @dlltree, "const TInt KNumModules=$module_count;\n"; |
|
587 |
push @dlltree, "\n"; |
|
588 |
push @dlltree, "#ifdef __INCLUDE_DEPENDENCY_GRAPH\n"; |
|
589 |
push @dlltree, "static const TText* const ModuleName[KNumModules] =\n"; |
|
590 |
push @dlltree, "\t\{\n"; |
|
591 |
foreach $modref (@modules) { |
|
592 |
my $string="\t(const TText*)L\"$$modref{name}\""; |
|
593 |
unless ($$modref{num}==$module_count-1) { |
|
594 |
$string.=','; |
|
595 |
} |
|
596 |
push @dlltree, $string; |
|
597 |
my $pad=41-length($string); |
|
598 |
$pad=($pad+3)/4; |
|
599 |
push @dlltree, "\t"x$pad, "\/*", $$modref{num}, "*\/\n"; |
|
600 |
} |
|
601 |
push @dlltree, "\t\};\n"; |
|
602 |
push @dlltree, "\n"; |
|
603 |
push @dlltree, "#define MODULE_NAME(n) TPtrC(ModuleName[n])\n"; |
|
604 |
push @dlltree, "\n"; |
|
605 |
push @dlltree, "static const TText* const ModuleFileName[KNumModules] =\n"; |
|
606 |
push @dlltree, "\t\{\n"; |
|
607 |
foreach $modref (@modules) { |
|
608 |
if ($$modref{idrive} || $$modref{vdrive}) { |
|
609 |
my $fn = $$modref{filename}; |
|
610 |
my $used_nxip_path = "?:\\$nonxippath$fn"; |
|
611 |
$used_nxip_path =~ s/\\/\\\\/g; # double backslashes |
|
612 |
substr($used_nxip_path,0,1) = $$modref{idrive} ? "0" : "1"; |
|
613 |
push @dlltree, "\t(const TText*)L\"$used_nxip_path\""; |
|
614 |
} else { |
|
615 |
push @dlltree, "\t(const TText*)L\"$$modref{filename}\""; |
|
616 |
} |
|
617 |
if ($$modref{num}==$module_count-1) { |
|
618 |
push @dlltree, "\n"; |
|
619 |
} else { |
|
620 |
push @dlltree, ",\n"; |
|
621 |
} |
|
622 |
} |
|
623 |
push @dlltree, "\t\};\n"; |
|
624 |
push @dlltree, "\n"; |
|
625 |
push @dlltree, "#define MODULE_FILENAME(n) TPtrC(ModuleFileName[n])\n"; |
|
626 |
push @dlltree, "\n"; |
|
627 |
foreach $modref (@modules) { |
|
628 |
my $modnum=$$modref{num}; |
|
629 |
my $tcdepsref=$$modref{tcdeps}; |
|
630 |
my $numdeps=scalar(@$tcdepsref); |
|
631 |
push @dlltree, "static const TInt Module$modnum","Deps[] =\n"; |
|
632 |
push @dlltree, "\t\{$numdeps"; |
|
633 |
if ($numdeps) { |
|
634 |
push @dlltree, ",", join(',',@$tcdepsref) |
|
635 |
} |
|
636 |
push @dlltree, "\};\n"; |
|
637 |
} |
|
638 |
push @dlltree, "static const TInt* const ModuleDependencies[KNumModules] =\n"; |
|
639 |
push @dlltree, "\t\{\n"; |
|
640 |
foreach $modref (@modules) { |
|
641 |
my $modnum=$$modref{num}; |
|
642 |
push @dlltree, "\tModule$modnum","Deps"; |
|
643 |
if ($$modref{num}==$module_count-1) { |
|
644 |
push @dlltree, "\n"; |
|
645 |
} else { |
|
646 |
push @dlltree, ",\n"; |
|
647 |
} |
|
648 |
} |
|
649 |
push @dlltree, "\t\};\n"; |
|
650 |
push @dlltree, "\n"; |
|
651 |
push @dlltree, sprintf "const TInt KModuleFlagExe=0x%04x;\n", $flag_value_exe; |
|
652 |
push @dlltree, sprintf "const TInt KModuleFlagFixed=0x%04x;\n", $flag_value_fixed; |
|
653 |
push @dlltree, sprintf "const TInt KModuleFlagData=0x%04x;\n", $flag_value_data; |
|
654 |
#push @dlltree, "#ifdef __EPOC32__\n"; |
|
655 |
push @dlltree, sprintf "const TInt KModuleFlagXIP=0x%04x;\n", $flag_value_xip; |
|
656 |
push @dlltree, sprintf "const TInt KModuleFlagPagedCode=0x%04x;\n", $flag_value_pagedcode; |
|
657 |
push @dlltree, sprintf "const TInt KModuleFlagUnpagedCode=0x%04x;\n", $flag_value_unpagedcode; |
|
658 |
push @dlltree, sprintf "const TInt KModuleFlagIDrive=0x%04x;\n", $flag_value_idrive; |
|
659 |
push @dlltree, sprintf "const TInt KModuleFlagVDrive=0x%04x;\n", $flag_value_vdrive; |
|
660 |
push @dlltree, sprintf "const TInt KModuleFlagBytePair=0x%04x;\n", $flag_value_bytepair; |
|
661 |
push @dlltree, sprintf "const TInt KModuleFlagUncompressed=0x%04x;\n", $flag_value_uncompressed; |
|
662 |
#push @dlltree, "#else\n"; |
|
663 |
#push @dlltree, sprintf "const TInt KModuleFlagXIP=0x%04x;\n", 0; # no XIPs on emulator |
|
664 |
#push @dlltree, "#endif\n"; |
|
665 |
push @dlltree, sprintf "const TInt KModuleFlagDllInCycle=0x%04x;\n", $flag_value_dll_in_cycle; |
|
666 |
push @dlltree, sprintf "const TInt KModuleFlagDataInTree=0x%04x;\n", $flag_value_data_in_tree; |
|
667 |
#push @dlltree, "#ifdef __EPOC32__\n"; |
|
668 |
push @dlltree, sprintf "const TInt KModuleFlagXIPDataInTree=0x%04x;\n", $flag_value_xip_data_in_tree; |
|
669 |
#push @dlltree, "#else\n"; |
|
670 |
#push @dlltree, sprintf "const TInt KModuleFlagXIPDataInTree=0x%04x;\n", 0; |
|
671 |
#push @dlltree, "#endif\n"; |
|
672 |
push @dlltree, sprintf "const TInt KModuleFlagExports=0x%04x;\n", $flag_value_exports; |
|
673 |
push @dlltree, sprintf "const TInt KModuleFlagTargetOnly=0x%04x;\n", $flag_value_targetonly; |
|
674 |
push @dlltree, sprintf "const TInt KModuleFlagPagedData=0x%04x;\n", $flag_value_pageddata; |
|
675 |
push @dlltree, sprintf "const TInt KModuleFlagUnpagedData=0x%04x;\n", $flag_value_unpageddata; |
|
676 |
push @dlltree, "static const TInt ModuleFlags[KNumModules] =\n"; |
|
677 |
push @dlltree, "\t\{\n"; |
|
678 |
foreach $modref (@modules) { |
|
679 |
my $flags=0; |
|
680 |
my @flagNames = (); |
|
681 |
||
682 |
push @flagNames, "KModuleFlagExe" if ($$modref{exe}); |
|
683 |
push @flagNames, "KModuleFlagFixed" if ($$modref{fixed}); |
|
684 |
push @flagNames, "KModuleFlagData" if ($$modref{data}); |
|
685 |
push @flagNames, "KModuleFlagXIP" if ($$modref{xip}); |
|
686 |
push @flagNames, "KModuleFlagPagedCode" if ($$modref{pagedcode}); |
|
687 |
push @flagNames, "KModuleFlagUnpagedCode" if ($$modref{unpagedcode}); |
|
688 |
push @flagNames, "KModuleFlagPagedData" if ($$modref{pageddata}); |
|
689 |
push @flagNames, "KModuleFlagUnpagedData" if (!$$modref{pageddata}); |
|
690 |
push @flagNames, "KModuleFlagIDrive" if ($$modref{idrive}); |
|
691 |
push @flagNames, "KModuleFlagVDrive" if ($$modref{vdrive}); |
|
692 |
push @flagNames, "KModuleFlagBytePair" if ($$modref{bytepair}); |
|
693 |
push @flagNames, "KModuleFlagDllInCycle" if ($$modref{cycle}); |
|
694 |
push @flagNames, "KModuleFlagDataInTree" if ($$modref{dataintree}); |
|
695 |
push @flagNames, "KModuleFlagXIPDataInTree" if ($$modref{xipdataintree}); |
|
696 |
push @flagNames, "KModuleFlagExports" if ($$modref{exports}); |
|
697 |
push @flagNames, "KModuleFlagUncompressed" if ($$modref{uncompressed}); |
|
698 |
push @flagNames, "KModuleFlagTargetOnly" if ($$modref{targetonly}); |
|
699 |
||
700 |
@flagNames = qw(0) if (scalar(@flagNames) == 0); |
|
701 |
my $flagString = "/\* " . $$modref{num} . " \*/\t" . join(' | ', @flagNames); |
|
702 |
unless ($$modref{num}==$module_count-1) { |
|
703 |
$flagString.=','; |
|
704 |
} |
|
705 |
push @dlltree, $flagString . "\n"; |
|
706 |
} |
|
707 |
push @dlltree, "\t\};\n"; |
|
708 |
push @dlltree, "\n"; |
|
709 |
foreach $modref (@modules) { |
|
710 |
my $modnum=$$modref{num}; |
|
711 |
my @rblki; |
|
712 |
++$next_mark; |
|
713 |
calc_rblki(\@rblki, \@modules, $modref, $next_mark); |
|
714 |
my $rblki_count=scalar(@rblki); |
|
715 |
my $rblki_sum=0; |
|
716 |
foreach (@rblki) { |
|
717 |
$rblki_sum += $_; |
|
718 |
} |
|
719 |
push @dlltree, "static const TInt Module$modnum","RBlkIParams[2] = \{ $rblki_count, $rblki_sum \};\n"; |
|
720 |
} |
|
721 |
push @dlltree, "\n"; |
|
722 |
push @dlltree, "static const TInt* const ModuleRBlkIParams[KNumModules] =\n"; |
|
723 |
push @dlltree, "\t\{\n"; |
|
724 |
foreach $modref (@modules) { |
|
725 |
my $modnum=$$modref{num}; |
|
726 |
push @dlltree, "\tModule$modnum","RBlkIParams"; |
|
727 |
if ($$modref{num}==$module_count-1) { |
|
728 |
push @dlltree, "\n"; |
|
729 |
} else { |
|
730 |
push @dlltree, ",\n"; |
|
731 |
} |
|
732 |
} |
|
733 |
push @dlltree, "\t\};\n"; |
|
734 |
push @dlltree, "\n"; |
|
735 |
foreach $modref (@modules) { |
|
736 |
my $modnum=$$modref{num}; |
|
737 |
my $mod_attp=$modnum; |
|
738 |
my $mod_linkp=$modnum; |
|
739 |
unless ($$modref{exe}) { |
|
740 |
$mod_attp = ($$modref{attp}) ? ($modref->{attp}->{num}) : -1; |
|
741 |
$mod_linkp = ($$modref{linkexe}) ? ($modref->{linkexe}->{num}) : -1; |
|
742 |
} |
|
743 |
push @dlltree, "static const TInt Module$modnum","ExeInfo[2] = \{ $mod_attp, $mod_linkp \};\n"; |
|
744 |
} |
|
745 |
push @dlltree, "\n"; |
|
746 |
push @dlltree, "static const TInt* const ModuleExeInfo[KNumModules] =\n"; |
|
747 |
push @dlltree, "\t\{\n"; |
|
748 |
foreach $modref (@modules) { |
|
749 |
my $modnum=$$modref{num}; |
|
750 |
push @dlltree, "\tModule$modnum","ExeInfo"; |
|
751 |
if ($$modref{num}==$module_count-1) { |
|
752 |
push @dlltree, "\n"; |
|
753 |
} else { |
|
754 |
push @dlltree, ",\n"; |
|
755 |
} |
|
756 |
} |
|
757 |
push @dlltree, "\t\};\n"; |
|
758 |
||
759 |
foreach $tcref (@testcases) { |
|
760 |
push @dlltree, "\n"; |
|
761 |
my $modlistref=$$tcref{modules}; |
|
762 |
my $count=$$tcref{count}; |
|
763 |
my $arraysize=$count+1; |
|
764 |
push @dlltree, "static const TInt TC_$$tcref{name}\[$arraysize\]=\n\t\{\n"; |
|
765 |
if ($count==0) { |
|
766 |
push @dlltree, "\t$count\n"; |
|
767 |
} else { |
|
768 |
push @dlltree, "\t$count\,\n"; |
|
769 |
} |
|
770 |
foreach (@$modlistref) { |
|
771 |
--$count; |
|
772 |
if ($count==0) { |
|
773 |
push @dlltree, "\t$_\n"; |
|
774 |
} else { |
|
775 |
push @dlltree, "\t$_\,\n"; |
|
776 |
} |
|
777 |
} |
|
778 |
push @dlltree, "\t\};\n"; |
|
779 |
} |
|
780 |
||
781 |
push @dlltree, "#endif\n"; |
|
782 |
push @dlltree, "\n"; |
|
783 |
push @dlltree, "#endif\n"; |
|
784 |
||
785 |
foreach $modref (@modules) { |
|
786 |
my $mmpname=$$modref{basefilename}.$mmpext; |
|
787 |
my $mmpref=$$modref{mmp}; |
|
788 |
open OUT, ">$mmpname" or die "Could not open $mmpname for output\n"; |
|
789 |
print OUT @$mmpref; |
|
790 |
close OUT; |
|
791 |
if ($$modref{exports}) { |
|
792 |
my $defname=$$modref{basefilename}.$defext; |
|
793 |
my $defref=$$modref{def}; |
|
794 |
open OUT, ">$defname" or die "Could not open $defname for output\n"; |
|
795 |
print OUT @$defref; |
|
796 |
close OUT; |
|
797 |
} |
|
798 |
} |
|
799 |
if (!$allowbad) { |
|
800 |
push @bldinf, "t_ldrtst\n"; |
|
801 |
} |
|
802 |
open OUT, ">$bldname" or die "Could not open $bldname for output\n"; |
|
803 |
print OUT @bldinf; |
|
804 |
close OUT; |
|
805 |
open OUT, ">$dlltreename" or die "Could not open $dlltreename for output\n"; |
|
806 |
print OUT @dlltree; |
|
807 |
close OUT; |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
808 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
809 |
my $testbatch =''; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
810 |
if($is_raptor) { |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
811 |
$testbatch="$ENV{EPOCROOT}\\epoc32\\data\\z\\test\\gen\\##MAIN##.auto.bat"; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
812 |
} |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
813 |
else { |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
814 |
$testbatch = "$ENV{EPOCROOT}epoc32\\build"; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
815 |
$destpath =~ s/\//\\/go; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
816 |
$testbatch.="\\" unless ($destpath =~ /^\\/); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
817 |
$testbatch.=$destpath; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
818 |
$testbatch.="##MAIN##.auto.bat"; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
819 |
} |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
820 |
if (!$allowbad){ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
821 |
push @iby, "data=$testbatch\t\ttest\\loader.auto.bat\n"; |
0 | 822 |
} |
823 |
open OUT, ">$ibyname" or die "Could not open $ibyname for output\n"; |
|
824 |
print OUT @iby; |
|
825 |
close OUT; |
|
826 |
||
827 |
# |
|
828 |
# Accumulate list of dependency numbers |
|
829 |
# 1st arg = \output list |
|
830 |
# 2nd arg = \module list |
|
831 |
# 3rd arg = \module to start from |
|
832 |
# 4th arg = mark value to use |
|
833 |
# |
|
834 |
sub calc_tc($$$$) { |
|
835 |
my ($out, $mods, $modref, $mark)=@_; |
|
836 |
my $depsref=$$modref{deps}; |
|
837 |
foreach $dep (@$depsref) { |
|
838 |
my $depref=$$mods[$dep]; |
|
839 |
if ($$depref{mark} != $mark) { |
|
840 |
$$depref{mark}=$mark; |
|
841 |
unless ($$depref{exe}) { |
|
842 |
calc_tc($out, $mods, $depref, $mark); |
|
843 |
} |
|
844 |
push @$out, $dep; |
|
845 |
} |
|
846 |
} |
|
847 |
} |
|
848 |
||
849 |
# |
|
850 |
# Accumulate RBlkI parameters |
|
851 |
# 1st arg = \output list |
|
852 |
# 2nd arg = \module list |
|
853 |
# 3rd arg = \module to start from |
|
854 |
# 4th arg = mark value to use |
|
855 |
# |
|
856 |
sub calc_rblki($$$$) { |
|
857 |
my ($out, $mods, $modref, $mark)=@_; |
|
858 |
if ($$modref{mark} != $mark) { |
|
859 |
$$modref{mark}=$mark; |
|
860 |
if (!$$modref{exe} and $$modref{data}) { |
|
861 |
push @$out, $$modref{num}; |
|
862 |
my $depsref=$$modref{deps}; |
|
863 |
foreach $dep (@$depsref) { |
|
864 |
calc_rblki($out, $mods, $$mods[$dep], $mark); |
|
865 |
} |
|
866 |
} |
|
867 |
} |
|
868 |
} |
|
869 |
||
870 |
||
871 |