diff options
| author | @syxhe <https://t.me/syxhe> | 2025-04-10 18:58:30 -0500 |
|---|---|---|
| committer | @syxhe <https://t.me/syxhe> | 2025-04-10 18:58:30 -0500 |
| commit | d9d142a7ad0bade65b6f8b777259e203dc6d5301 (patch) | |
| tree | 51e174696bb4397e97b10748a21d67ca5e4f971e /src/depend.sh | |
| parent | e5454e63a086e549f54c23a686ff300b99a83b58 (diff) | |
Overhaul makefile
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 | ||
