diff options
| author | Daniel Stenberg <daniel@haxx.se> | 2005-03-06 00:05:33 +0000 |
|---|---|---|
| committer | Daniel Stenberg <daniel@haxx.se> | 2005-03-06 00:05:33 +0000 |
| commit | 1167b403e65cbf6bf9e8b4fc27e212e2c913d717 (patch) | |
| tree | e9269b4c031cf89bafdc5f3d4236d1de72828e3f /apps/plugins | |
| parent | db7986cf0e79728a16650ea6238ed99e98a2fa53 (diff) | |
| download | rockbox-1167b403e65cbf6bf9e8b4fc27e212e2c913d717.zip rockbox-1167b403e65cbf6bf9e8b4fc27e212e2c913d717.tar.gz rockbox-1167b403e65cbf6bf9e8b4fc27e212e2c913d717.tar.bz2 rockbox-1167b403e65cbf6bf9e8b4fc27e212e2c913d717.tar.xz | |
first shot at a perl script that generates the dependencies for the .elf files
that are the plugins. Not used by anything just yet.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6149 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
| -rw-r--r-- | apps/plugins/elfdep.pl | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/apps/plugins/elfdep.pl b/apps/plugins/elfdep.pl new file mode 100644 index 0000000..0e32852 --- /dev/null +++ b/apps/plugins/elfdep.pl @@ -0,0 +1,48 @@ +#!/usr/bin/perl + +sub getdir { + my ($some_dir, $files)=@_; + opendir(DIR, $some_dir) || die "can't opendir $some_dir: $!"; + my @all = grep { /$files$/ && -f "$some_dir/$_" } readdir(DIR); + closedir DIR; + return @all; +} + +my @all=getdir(".", "\.c"); +my @pluginhead=getdir("lib", "\.h"); + +for(@pluginhead) { + $plug{$_}=$_; +} + +my %head2lib=('Tremor' => 'libTremor'); + +my $s; +foreach $s (sort @all) { + + my $plib=0; + my $codec; + open(F, "<$s"); + while(<F>) { + if($_ =~ /^ *\#include [\"<]([^\"]+)[\">]/) { + my $f = $1; + if($plug{$f}) { + $plib=1; + } + if($f =~ /codecs\/([^\/]+)/) { + $codec=$1; + my $d = $head2lib{$codec}; + if($d) { + $codec = $d; + } + } + } + } + + #print "$s uses $plib and $codec\n"; + + $s =~ s/\.c//; + printf("\$(OBJDIR)/$s.elf: \$(OBJDIR)/$s.o \$(LINKFILE)%s%s\n\t\$(ELFIT)\n\n", + $plib?" \$(OBJDIR)/libplugin.a":"", + $codec?" \$(OBJDIR)/$codec.a":""); +} |