tools/static_dependencies.pl
author William Roberts <williamr@symbian.org>
Mon, 11 Oct 2010 22:33:08 +0100
changeset 22 76c5e260003e
parent 16 58fdbe891c31
child 25 f213623e3c86
permissions -rw-r--r--
Calculate the inverted dependency table in filter_obyfile.pl, and make it optional (-i) in static_dependencies.pl Select the stem_ version of the file if stem_ is specified in the rom_content.csv
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;
22
76c5e260003e Calculate the inverted dependency table in filter_obyfile.pl, and make it optional (-i) in static_dependencies.pl
William Roberts <williamr@symbian.org>
parents: 16
diff changeset
    17
use Getopt::Long;
76c5e260003e Calculate the inverted dependency table in filter_obyfile.pl, and make it optional (-i) in static_dependencies.pl
William Roberts <williamr@symbian.org>
parents: 16
diff changeset
    18
76c5e260003e Calculate the inverted dependency table in filter_obyfile.pl, and make it optional (-i) in static_dependencies.pl
William Roberts <williamr@symbian.org>
parents: 16
diff changeset
    19
my $inverted_table = 0;
76c5e260003e Calculate the inverted dependency table in filter_obyfile.pl, and make it optional (-i) in static_dependencies.pl
William Roberts <williamr@symbian.org>
parents: 16
diff changeset
    20
GetOptions(
76c5e260003e Calculate the inverted dependency table in filter_obyfile.pl, and make it optional (-i) in static_dependencies.pl
William Roberts <williamr@symbian.org>
parents: 16
diff changeset
    21
  "i|invert" => \$inverted_table,   # add the inverted table
76c5e260003e Calculate the inverted dependency table in filter_obyfile.pl, and make it optional (-i) in static_dependencies.pl
William Roberts <williamr@symbian.org>
parents: 16
diff changeset
    22
  );
12
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 %romfiles;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    25
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
    26
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    27
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
    28
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
    29
	{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    30
  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
    31
	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
    32
	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
    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
	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
    35
	$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
    36
	}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    37
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    38
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
    39
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    40
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
    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
	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
    43
	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
    44
	
22
76c5e260003e Calculate the inverted dependency table in filter_obyfile.pl, and make it optional (-i) in static_dependencies.pl
William Roberts <williamr@symbian.org>
parents: 16
diff changeset
    45
	next unless $inverted_table;
76c5e260003e Calculate the inverted dependency table in filter_obyfile.pl, and make it optional (-i) in static_dependencies.pl
William Roberts <williamr@symbian.org>
parents: 16
diff changeset
    46
	
12
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    47
	# 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
    48
	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
    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
		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
    51
		$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
    52
		
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    53
		$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
    54
		$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
    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
		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
    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
			$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
    59
			}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    60
		else
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    61
			{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    62
			$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
    63
			}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    64
		}
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
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    67
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
    68
	{
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 ($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
    70
	
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    71
	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
    72
	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
    73
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    74
	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
    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
	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
    77
	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
    78
	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
    79
		{
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
    80
		# 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
    81
		# 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
    82
		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
    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
			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
    85
			next;
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
		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
    88
			{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    89
			$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
    90
			next;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    91
			}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    92
		}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    93
	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
    94
	}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    95
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    96
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
    97
	{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
    98
	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
    99
	$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
   100
	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
   101
		{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   102
		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
   103
		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
   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
			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
   106
			return;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   107
			}
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
	# 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
   110
	# 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
   111
	}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   112
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   113
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
   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
	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
   116
	
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   117
	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
   118
		{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   119
		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
   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
	
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   123
	# 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
   124
	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
   125
		{
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   126
		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
   127
		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
   128
		next;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   129
		}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   130
	# 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
   131
	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
   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
		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
   134
		$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
   135
		$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
   136
		
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   137
		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
   138
		next;
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   139
		}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   140
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   141
	# 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
   142
	}
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   143
22
76c5e260003e Calculate the inverted dependency table in filter_obyfile.pl, and make it optional (-i) in static_dependencies.pl
William Roberts <williamr@symbian.org>
parents: 16
diff changeset
   144
if ($inverted_table)
12
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   145
	{
22
76c5e260003e Calculate the inverted dependency table in filter_obyfile.pl, and make it optional (-i) in static_dependencies.pl
William Roberts <williamr@symbian.org>
parents: 16
diff changeset
   146
	print "\n";
76c5e260003e Calculate the inverted dependency table in filter_obyfile.pl, and make it optional (-i) in static_dependencies.pl
William Roberts <williamr@symbian.org>
parents: 16
diff changeset
   147
	foreach my $inverted (sort keys %dependents)
76c5e260003e Calculate the inverted dependency table in filter_obyfile.pl, and make it optional (-i) in static_dependencies.pl
William Roberts <williamr@symbian.org>
parents: 16
diff changeset
   148
		{
76c5e260003e Calculate the inverted dependency table in filter_obyfile.pl, and make it optional (-i) in static_dependencies.pl
William Roberts <williamr@symbian.org>
parents: 16
diff changeset
   149
		print "x\t$inverted\t$dependents{$inverted}\n";
76c5e260003e Calculate the inverted dependency table in filter_obyfile.pl, and make it optional (-i) in static_dependencies.pl
William Roberts <williamr@symbian.org>
parents: 16
diff changeset
   150
		}
12
ab7598bdae30 Add tools\static_dependencies.pl which processes rom_contents.csv calculates static dependency information
William Roberts <williamr@symbian.org>
parents:
diff changeset
   151
	}