#!/usr/bin/perl -p -0

# outputs the specified .d file, striping out the absolute path names, and
# substituting $(SOURCE) and $(TARGET)

s!$ENV{'SOURCE'}\b!\$(SOURCE)!go;
s!$ENV{'TARGET'}\b!\$(TARGET)!go;

# create individual targets to help while files are deleted
# idea comes from PG/src/Makefile.global.in

($i = $_) =~ s/^.*?: //;
$i =~ s/$/:\n/;

$_ .= $i;
