diff options
Diffstat (limited to 'src/depend.sh')
| -rwxr-xr-x | src/depend.sh | 14 |
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 | ||
| 2 | DIR="$1" | ||
| 3 | shift 1 | ||
| 4 | case "$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 | ;; | ||
| 11 | esac | ||
| 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 | ||
