Fix finddeps

This commit is contained in:
Nero 2018-01-30 20:42:45 +00:00 committed by Nero
parent e24dfa6e65
commit 387372d302

View File

@ -4,8 +4,8 @@ search() {
echo "$1" echo "$1"
prefix="$(printf "%s\n" "$1"|sed 's|[^/]*$||')" prefix="$(printf "%s\n" "$1"|sed 's|[^/]*$||')"
deps="$(grep -E '^#include "[^"]*"$' "$1"|cut '-d"' -f2| deps="$(grep -E '^#include "[^"]*"$' "$1"|cut '-d"' -f2|
\sed "s|^|$prefix|;s|\.h\$|.c|"|grep -v "$1")" \sed "s|^|$prefix|;s|\.h\$|.c|"|grep -v "^$1")"
for i in $deps; do search $i; done for i in $deps; do search $i; done
} }
search "$1"|sort -u|grep -v "$1"|sed 's|\.c$|.o|' search "$1"|sort -u|grep -v "^$1"|sed 's|\.c$|.o|'