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:

Change-Id: If32770c19f03a4d460f32046a3dd06656e33ee11
This commit is contained in:
Alon Albert 2011-11-30 12:40:19 -08:00
parent b50bd7f009
commit 68895a9699
1 changed files with 7 additions and 2 deletions

View File

@ -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