rockbox/tools/addtargetdir.pl
Björn Stenberg 6640978129 Altered mkdepfile to use a single gcc call and post-process the output. This speeds up the dependency generation, especially in cygwin.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19169 a1c6a512-1295-4272-9138-f99709370657
2008-11-21 15:07:15 +00:00

28 lines
851 B
Perl
Executable file

#!/usr/bin/perl
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
#
# addtargetdir.pl - Adds target directory to gcc-generated dependency data
use File::Basename;
my $rbroot = $ARGV[0];
my $builddir = $ARGV[1];
for (<STDIN>) {
if (/^([^:]+): (\S+) (.*)/) {
my ($target, $src, $rest) = ($1, $2, $3);
my $dir = dirname $src;
$dir =~ s/$rbroot//;
print "$builddir$dir/$target: $src $rest\n";
}
else {
print $_;
}
}