build-aux/gen-make: Recurse without dir change

Before this change, it was impossible for the initial paths provided to the
script to be more than one level deep (relative to the cwd).

* build-aux/gen-make: Handle multi-level children.
master
Mike Gerwitz 2018-05-04 11:41:53 -04:00
parent 70f9e9c277
commit c271ee696e
1 changed files with 2 additions and 2 deletions

View File

@ -73,7 +73,7 @@ until [ $# -eq 0 ]; do (
path="${1%%/}"
echo "[gen-make] scanning $path" >&2
cd "$( basename $path )/" || exit $?
cd "$path" || exit $?
deps=$( find -maxdepth 1 -iname '*.dep' )
for dpath in $deps; do
@ -103,7 +103,7 @@ until [ $# -eq 0 ]; do (
# recurse on every subdirectory
for p in */; do
[ "$p" == ./ -o "$p" == ../ ] && continue
[ ! -d "$p" ] || "$GEN_MAKE" "$path/$p" || {
[ ! -d "$p" ] || ( cd "$OLDPWD" && "$GEN_MAKE" "$path/$p" ) || {
echo "fatal: failed to recurse on $( pwd )/$path/$p" >&2
exit 1
}