3 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
11 # addtargetdir.pl - Adds target directory to gcc-generated dependency data
15 my $rbroot = $ARGV[0];
16 my $builddir = $ARGV[1];
20 my $rootlen = length $rbroot;
23 # Split the input file on any runs of '\' and whitespace.
24 for (split(/[\s\\]+/m, <STDIN
>)) {
26 # Save target and continue if this item ends in ':'
27 if (!($2 && ($target=$&))) {
29 # If $target is set, prefix it with the target path
31 my $dir = dirname
$src;
32 substr($dir, 0, $rootlen) = $builddir;
33 print "\n$dir/$target";
35 # Otherwise, check for an incomplete path for the source file
37 $src = "$builddir/$src";