summaryrefslogtreecommitdiff
path: root/depend.sh
blob: f1da434d053f957288738e83bd644083f61d0d4f (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh

DEP=$1
CC=$2
shift 2

echo -n "$DEP" | awk '{ ORS = ""; print $1 " "; sub (".d", ".o"); print $1 " "; }' > $DEP
( $CC -MM $* || exit 1 ) >> $DEP

#sed -e 's@^\(.*\)\.o:@\1.d \1.o:@'