mpd/bs/mkdep.sh
Eric Wong 412cb1ee10 bs: a work in progress..
git-svn-id: https://svn.musicpd.org/mpd/trunk@4737 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-09-06 09:26:51 +00:00

22 lines
429 B
Bash
Executable File

#!/bin/sh
f="$1"
d="`dirname $1`"
t=.tmp.$$
# -MM is gcc-specific...
$CC -MM $CPPFLAGS $CFLAGS "$f" > $t
if test $? -ne 0; then
# ok, maybe -M is supported...
$CC -M $CPPFLAGS $CFLAGS "$f" > "$t"
# guess not, fudge the dependencies by using all headers
if test $? -ne 0; then
echo "$O/$f: $f $O/config.h $HDR_DEP_HACK" | sed -e 's#c:#o:#'
exec rm -f $t
fi
fi
sed -e 's#.c$#.o#' -e "1s#^#$O/$d/&#" < $t
exec rm -f $t