aboutsummaryrefslogtreecommitdiffstats
path: root/bs/mkdep.sh
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2006-09-06 09:26:51 +0000
committerEric Wong <normalperson@yhbt.net>2006-09-06 09:26:51 +0000
commit412cb1ee105a74999a3ffac4e60e6602c5f2e541 (patch)
treefc8b9e117fc3ff5eaf0f55113be9dc89418b7a6f /bs/mkdep.sh
parent7b6d45f50fa49f4da56cc4ae29758a01ec958792 (diff)
downloadmpd-412cb1ee105a74999a3ffac4e60e6602c5f2e541.tar.gz
mpd-412cb1ee105a74999a3ffac4e60e6602c5f2e541.tar.xz
mpd-412cb1ee105a74999a3ffac4e60e6602c5f2e541.zip
bs: a work in progress..
git-svn-id: https://svn.musicpd.org/mpd/trunk@4737 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rwxr-xr-xbs/mkdep.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/bs/mkdep.sh b/bs/mkdep.sh
new file mode 100755
index 000000000..fb3ce12a7
--- /dev/null
+++ b/bs/mkdep.sh
@@ -0,0 +1,21 @@
+#!/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