summaryrefslogtreecommitdiffstats
path: root/depends.sh
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2005-07-29 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2005-07-29 08:01:00 -0700
commit888e5bed5d7f56a5d86d91a6e8e88f3e5a3454dc (patch)
tree11d48c9e9069f54dc300c3571ae63c744c802c50 /depends.sh
parent7f94414388cce67bd3cc1a6d6269f0ed31ed0d06 (diff)
downloadabc-888e5bed5d7f56a5d86d91a6e8e88f3e5a3454dc.tar.gz
abc-888e5bed5d7f56a5d86d91a6e8e88f3e5a3454dc.tar.bz2
abc-888e5bed5d7f56a5d86d91a6e8e88f3e5a3454dc.zip
Version abc50729
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