summaryrefslogtreecommitdiffstats
path: root/depends.sh
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2007-10-01 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2007-10-01 08:01:00 -0700
commit4812c90424dfc40d26725244723887a2d16ddfd9 (patch)
treeb32ace96e7e2d84d586e09ba605463b6f49c3271 /depends.sh
parente54d9691616b9a0326e2fdb3156bb4eeb8abfcd7 (diff)
downloadabc-4812c90424dfc40d26725244723887a2d16ddfd9.tar.gz
abc-4812c90424dfc40d26725244723887a2d16ddfd9.tar.bz2
abc-4812c90424dfc40d26725244723887a2d16ddfd9.zip
Version abc71001
Diffstat (limited to 'depends.sh')
-rwxr-xr-xdepends.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/depends.sh b/depends.sh
new file mode 100755
index 00000000..d302cd04
--- /dev/null
+++ b/depends.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+#echo "## Got: $*"
+CC="$1"
+DIR="$2"
+shift 2
+case "$DIR" in
+ "" | ".")
+ $CC -MM -MG "$@" | sed -e 's@^\(.*\)\.o:@\1.d \1.o:@'
+ ;;
+ *)
+ $CC -MM -MG "$@" | sed -e "s@^\(.*\)\.o:@$DIR/\1.d $DIR/\1.o:@"
+ ;;
+esac