blob: 7b3caa7eb0fcf1476a00756be447d40c6d19f68f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
#!/usr/bin/env -S bash
DIR="$1"
shift 1
case "$DIR" in
"" | ".")
gcc -MM -MG "$@" | sed -e "s@^\(.*\)\.o:@\1.d \1.o:@"
;;
*)
gcc -MM -MG "$@" | sed -e "s@^\(.*\)\.o:@$DIR/\1.d $DIR/\1.o:@"
;;
esac
# Shamelessly stolen from Peter Miller's "Recursive Make Considered Harmful"
# https://web.archive.org/web/20250404190928/https://aegis.sourceforge.net/auug97.pdf
|