Skip to content

Instantly share code, notes, and snippets.

@sr105
Created May 26, 2015 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sr105/e9143d4ee00465f71def to your computer and use it in GitHub Desktop.
Save sr105/e9143d4ee00465f71def to your computer and use it in GitHub Desktop.
android mm()
mm ()
{
if [ -f build/core/envsetup.mk -a -f Makefile ]; then
make $@;
else
T=$(gettop);
local M=$(findmakefile);
local MODULES=;
local GET_INSTALL_PATH=;
local ARGS=;
local M=`echo $M|sed 's:'$T'/::'`;
if [ ! "$T" ]; then
echo "Couldn't locate the top of the tree. Try setting TOP.";
else
if [ ! "$M" ]; then
echo "Couldn't locate a makefile from the current directory.";
else
for ARG in $@;
do
case $ARG in
GET-INSTALL-PATH)
GET_INSTALL_PATH=$ARG
;;
esac;
done;
if [ -n "$GET_INSTALL_PATH" ]; then
MODULES=;
ARGS=GET-INSTALL-PATH;
else
MODULES=all_modules;
ARGS=$@;
fi;
ONE_SHOT_MAKEFILE=$M make -C $T -f build/core/main.mk $MODULES $ARGS;
fi;
fi;
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment