summaryrefslogtreecommitdiff
path: root/src/depend.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/depend.sh')
-rwxr-xr-xsrc/depend.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/depend.sh b/src/depend.sh
new file mode 100755
index 0000000..b6084b1
--- /dev/null
+++ b/src/depend.sh
@@ -0,0 +1,14 @@
1#!/bin/bash
2DIR="$1"
3shift 1
4case "$DIR" in
5 "" | ".")
6 gcc -MM -MG "$@" | sed -e "s@^\(.*\)\.o:@\1.d \1.o:@"
7 ;;
8 *)
9 gcc -MM -MG "$@" | sed -e "s@^\(.*\)\.o:@$DIR/\1.d $DIR/\1.o:@"
10 ;;
11esac
12
13# Shamelessly stolen from Peter Miller's "Recursive Make Considered Harmful"
14 # https://web.archive.org/web/20250404190928/https://aegis.sourceforge.net/auug97.pdf \ No newline at end of file