summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlon Albert <aalbert@google.com>2011-11-30 13:04:32 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-11-30 13:04:32 -0800
commit6a9024ed0ac49fcc8c6cecec9bce800d662fc73f (patch)
tree8de93d0157bc119ac1861085c403af7dbfdd90a8
parentdf8e43494e5c24cc6f3c74753e51bf298b75eab7 (diff)
parent68895a96999f651b9f5020e13197250a57a91eaa (diff)
downloadbuild-6a9024ed0ac49fcc8c6cecec9bce800d662fc73f.zip
build-6a9024ed0ac49fcc8c6cecec9bce800d662fc73f.tar.gz
build-6a9024ed0ac49fcc8c6cecec9bce800d662fc73f.tar.bz2
Merge "Add support for building specific modules with mmm using the following syntax: Build all modules: mmm dir Build a single module: mmm dir:module Build multiple modules: mmm dir:module1,module2 Or in other words:"
-rw-r--r--envsetup.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/envsetup.sh b/envsetup.sh
index 272eb18..26784ad 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -615,12 +615,17 @@ function mmm()
T=$(gettop)
if [ "$T" ]; then
local MAKEFILE=
+ local MODULES=
local ARGS=
local DIR TO_CHOP
local DASH_ARGS=$(echo "$@" | awk -v RS=" " -v ORS=" " '/^-.*$/')
local DIRS=$(echo "$@" | awk -v RS=" " -v ORS=" " '/^[^-].*$/')
for DIR in $DIRS ; do
- DIR=`echo $DIR | sed -e 's:/$::'`
+ MODULES=`echo $DIR | sed -n -e 's/.*:\(.*$\)/\1/p' | sed 's/,/ /'`
+ if [ "$MODULES" = "" ]; then
+ MODULES=all_modules
+ fi
+ DIR=`echo $DIR | sed -e 's/:.*//' -e 's:/$::'`
if [ -f $DIR/Android.mk ]; then
TO_CHOP=`(cd -P -- $T && pwd -P) | wc -c | tr -d ' '`
TO_CHOP=`expr $TO_CHOP + 1`
@@ -647,7 +652,7 @@ function mmm()
fi
fi
done
- ONE_SHOT_MAKEFILE="$MAKEFILE" make -C $T $DASH_ARGS all_modules $ARGS
+ ONE_SHOT_MAKEFILE="$MAKEFILE" make -C $T $DASH_ARGS $MODULES $ARGS
else
echo "Couldn't locate the top of the tree. Try setting TOP."
fi