am feca5313: am 2f9f1fb3: resolved conflicts for 964f06b1 to stage-aosp-master

* commit 'feca5313b73dbc163d6a73a6e93ee918e83e3bc7':
  Re-implement mma/mmma using make goals.
This commit is contained in:
Ying Wang 2015-09-24 04:17:53 +00:00 committed by Android Git Automerger
commit da88400c0a
2 changed files with 20 additions and 9 deletions

View file

@ -255,6 +255,15 @@ $(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_MODULE:= $(my_register_name)
.PHONY: $(my_register_name) .PHONY: $(my_register_name)
$(my_register_name): $(LOCAL_BUILT_MODULE) $(LOCAL_INSTALLED_MODULE) $(my_register_name): $(LOCAL_BUILT_MODULE) $(LOCAL_INSTALLED_MODULE)
# Set up phony targets that covers all modules under the given paths.
# This allows us to build everything in given paths by running mmma/mma.
my_path_components := $(subst /,$(space),$(LOCAL_PATH))
my_path_prefix := MODULES-IN
$(foreach c, $(my_path_components),\
$(eval my_path_prefix := $(my_path_prefix)/$(c))\
$(eval .PHONY : $(my_path_prefix))\
$(eval $(my_path_prefix) : $(my_register_name)))
########################################################### ###########################################################
## Module installation rule ## Module installation rule
########################################################### ###########################################################

View file

@ -751,7 +751,7 @@ function mmm()
MAKEFILE="$MAKEFILE $MFILE" MAKEFILE="$MAKEFILE $MFILE"
else else
case $DIR in case $DIR in
showcommands | snod | dist | incrementaljavac | *=*) ARGS="$ARGS $DIR";; showcommands | snod | dist | *=*) ARGS="$ARGS $DIR";;
GET-INSTALL-PATH) GET_INSTALL_PATH=$DIR;; GET-INSTALL-PATH) GET_INSTALL_PATH=$DIR;;
*) echo "No Android.mk in $DIR."; return 1;; *) echo "No Android.mk in $DIR."; return 1;;
esac esac
@ -780,7 +780,7 @@ function mma()
return 1 return 1
fi fi
local MY_PWD=`PWD= /bin/pwd|sed 's:'$T'/::'` local MY_PWD=`PWD= /bin/pwd|sed 's:'$T'/::'`
$DRV make -C $T -f build/core/main.mk $@ all_modules BUILD_MODULES_IN_PATHS="$MY_PWD" $DRV make -C $T -f build/core/main.mk $@ MODULES-IN/$MY_PWD
fi fi
} }
@ -798,23 +798,25 @@ function mmma()
MY_PWD=`echo $MY_PWD|sed 's:'$T'/::'` MY_PWD=`echo $MY_PWD|sed 's:'$T'/::'`
fi fi
local DIR= local DIR=
local MODULE_PATHS= local MODULES_IN_PATHS=
local ARGS= local ARGS=
for DIR in $DIRS ; do for DIR in $DIRS ; do
if [ -d $DIR ]; then if [ -d $DIR ]; then
if [ "$MY_PWD" = "" ]; then # Remove the leading ./ and trailing / if any exists.
MODULE_PATHS="$MODULE_PATHS $DIR" DIR=${DIR#./}
else DIR=${DIR%/}
MODULE_PATHS="$MODULE_PATHS $MY_PWD/$DIR" if [ "$MY_PWD" != "" ]; then
DIR=$MY_PWD/$DIR
fi fi
MODULES_IN_PATHS="$MODULES_IN_PATHS MODULES-IN/$DIR"
else else
case $DIR in case $DIR in
showcommands | snod | dist | incrementaljavac | *=*) ARGS="$ARGS $DIR";; showcommands | snod | dist | *=*) ARGS="$ARGS $DIR";;
*) echo "Couldn't find directory $DIR"; return 1;; *) echo "Couldn't find directory $DIR"; return 1;;
esac esac
fi fi
done done
$DRV make -C $T -f build/core/main.mk $DASH_ARGS $ARGS all_modules BUILD_MODULES_IN_PATHS="$MODULE_PATHS" $DRV make -C $T -f build/core/main.mk $DASH_ARGS $ARGS $MODULES_IN_PATHS
else else
echo "Couldn't locate the top of the tree. Try setting TOP." echo "Couldn't locate the top of the tree. Try setting TOP."
return 1 return 1