tools/static_dependencies.pl
author William Roberts <williamr@symbian.org>
Sun, 10 Oct 2010 20:19:00 +0100
changeset 16 58fdbe891c31
parent 12 ab7598bdae30
child 22 76c5e260003e
permissions -rw-r--r--
Update static_dependencies.pl to handle dlls with interesting version numbers (e.g. backend.dll)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
     1
# Copyright (c) 2010 Symbian Foundation Ltd.
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
     2
# All rights reserved.
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
     3
# This component and the accompanying materials are made available
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
     4
# under the terms of the License "Eclipse Public License v1.0"
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
     5
# which accompanies this distribution, and is available
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
     7
#
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
     8
# Initial Contributors:
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
     9
# Symbian Foundation - initial contribution.
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    10
#
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    11
# Contributors:
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    12
#
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    13
# Description: 
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    14
# This script generates a list of static dependencies for files in a ROM
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    15
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    16
use strict;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    17
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    18
my %romfiles;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    19
my @contents;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    20
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    21
my $line;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    22
while ($line = <>)
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    23
	{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    24
  my ($romfile,$hostfile,@columns) = split /,/, $line;		# first two fields are guaranteed to be simple
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    25
	next if (!defined $hostfile);
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    26
	next if ($romfile eq "ROM file");		# skip header line
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    27
	
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    28
	push @contents, "$romfile\t$hostfile";		# for use with "grep" later
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    29
	$romfiles{lc $romfile} = $romfile;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    30
	}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    31
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    32
my %dependents;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    33
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    34
sub print_dependency($$@)
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    35
	{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    36
	my ($romfile,$hostfile,@dependencies) = @_;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    37
	print "$romfile\t$hostfile\t", join(":",@dependencies), "\n";
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    38
	
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    39
	# Create inverted table 
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    40
	foreach my $dependent (@dependencies)
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    41
		{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    42
		next if ($dependent =~ /^sid=/);
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    43
		$dependent = lc $dependent;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    44
		
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    45
		$dependent =~ s/^sys\\bin\\//;	# no directory => sys\bin anyway
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    46
		$dependent =~ s/\[\S+\]//;	# ignore the UIDs for now
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    47
		
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    48
		if (!defined $dependents{$dependent})
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    49
			{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    50
			$dependents{$dependent} = $romfile;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    51
			}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    52
		else
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    53
			{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    54
			$dependents{$dependent} .= "\t$romfile";
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    55
			}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    56
		}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    57
	}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    58
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    59
sub generate_elftran_dependencies($$)
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    60
	{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    61
	my ($romfile,$hostfile) = @_;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    62
	
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    63
	return if ($hostfile =~ /\/z\//); 	# data files in armv5\urel\z
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    64
	return if ($hostfile =~ /\.sis$/);	# not an e32 image file
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    65
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    66
	my @elftran = `elftran $hostfile`;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    67
	
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    68
	my $sid;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    69
	my @imports;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    70
	foreach my $line (@elftran)
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    71
		{
16
58fdbe891c31 Update static_dependencies.pl to handle dlls with interesting version numbers (e.g. backend.dll)
William Roberts <williamr@symbian.org>
parents: 12
diff changeset
    72
		# 2 imports from backend{00010001}[102828d5].dll
58fdbe891c31 Update static_dependencies.pl to handle dlls with interesting version numbers (e.g. backend.dll)
William Roberts <williamr@symbian.org>
parents: 12
diff changeset
    73
		# 17 imports from dfpaeabi{000a0000}.dll
58fdbe891c31 Update static_dependencies.pl to handle dlls with interesting version numbers (e.g. backend.dll)
William Roberts <williamr@symbian.org>
parents: 12
diff changeset
    74
		if ($line =~ /imports from (\S+)\{.{8}\}(\S+)$/)
12
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    75
			{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    76
			push @imports, $1.$2;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    77
			next;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    78
			}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    79
		if ($line =~ /^Secure ID: (\S+)$/)
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    80
			{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    81
			$sid = $1; 	# presumably owns private/$sid  and various $sid.etxn files
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    82
			next;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    83
			}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    84
		}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    85
	print_dependency($romfile,$hostfile,"sid=$sid",@imports);
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    86
	}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    87
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    88
sub find_dependency_in_sys_bin($$$)
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    89
	{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    90
	my ($romfile,$hostfile,$basename) = @_;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    91
	$basename = lc $basename;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    92
	foreach my $extension (".exe",".dll")
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    93
		{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    94
		my $dependency = "sys\\bin\\$basename$extension";
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    95
		if (defined $romfiles{$dependency})
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    96
			{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    97
			print_dependency($romfile,$hostfile,$romfiles{$dependency});
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    98
			return;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    99
			}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   100
		}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   101
	# grep in the contents list?
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   102
	# print_dependency($romfile,$hostfile,"unmatched sys\\bin\\$basename");
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   103
	}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   104
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   105
foreach $line (@contents)
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   106
	{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   107
	my ($romfile,$hostfile) = split /\t/, $line;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   108
	
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   109
	if ($hostfile =~ /epoc32.release.arm/i)
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   110
		{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   111
		generate_elftran_dependencies($romfile,$hostfile);
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   112
		next;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   113
		}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   114
	
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   115
	# App registration files
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   116
	if ($romfile =~ /private.10003a3f.*apps\\(.*)_reg\.rsc$/i)
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   117
		{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   118
		my $dependency = "sys\\bin\\$1.exe";
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   119
		print_dependency($romfile,$hostfile,$dependency);
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   120
		next;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   121
		}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   122
	# app resources
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   123
	if ($romfile =~ /resource.apps\\(.*)(\.mif|\.mbm|\.rsc)$/)
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   124
		{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   125
		my $executable = $1;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   126
		$executable =~ s/_aif$//; 	# xxx_aif.mif
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   127
		$executable =~ s/_loc$//; 	# xxx_loc.rsc
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   128
		
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   129
		find_dependency_in_sys_bin($romfile,$hostfile,$executable);
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   130
		next;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   131
		}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   132
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   133
	# Assume that the rest don't depend on anything, and leave them out.
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   134
	}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   135
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   136
print "\n";
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   137
foreach my $inverted (sort keys %dependents)
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   138
	{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   139
	print "x\t$inverted\t$dependents{$inverted}\n";
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   140
	}