summaryrefslogtreecommitdiff
path: root/src/depend.sh
diff options
context:
space:
mode:
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
commitd9d142a7ad0bade65b6f8b777259e203dc6d5301 (patch)
tree51e174696bb4397e97b10748a21d67ca5e4f971e /src/depend.sh
parente5454e63a086e549f54c23a686ff300b99a83b58 (diff)
Overhaul makefile
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