Walk up tree to find makefiles in mma
Call findmakefile in mma to walk up the tree to find the nearest
makefile. Fixes mma in subdirectories of directories that have
Android.mk or Android.bp files.
Change-Id: I6fa509171699071fc34a2a75dd7e191d4ddca31a
diff --git a/envsetup.sh b/envsetup.sh
index ea2446c..e919891 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -886,8 +886,10 @@
echo "Couldn't locate the top of the tree. Try setting TOP."
return 1
fi
- local MY_PWD=`PWD= /bin/pwd|sed 's:'$T'/::'`
- local MODULES_IN_PATHS=MODULES-IN-$MY_PWD
+ local M=$(findmakefile)
+ # Remove the path to top as the makefilepath needs to be relative
+ local M=`echo $M|sed 's:'$T'/::'`
+ local MODULES_IN_PATHS=MODULES-IN-$(dirname ${M})
# Convert "/" to "-".
MODULES_IN_PATHS=${MODULES_IN_PATHS//\//-}
$DRV make -C $T -f build/core/main.mk $@ $MODULES_IN_PATHS