Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f751d253 authored by Chirayu Desai's avatar Chirayu Desai Committed by Gerrit Code Review
Browse files

envsetup: allow using mka for mm{,m}

Change-Id: I6c0fce5e67a3b5c49023d3c00825e35b08d41845
parent 724feedb
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -792,10 +792,17 @@ function findmakefile()

function mm()
{
    local MM_MAKE=make
    local ARG=
    for ARG in $@ ; do
        if [ "$ARG" = mka ]; then
            MM_MAKE=mka
        fi
    done
    # If we're sitting in the root of the build tree, just do a
    # normal make.
    if [ -f build/core/envsetup.mk -a -f Makefile ]; then
        make $@
        $MM_MAKE $@
    else
        # Find the closest Android.mk file.
        T=$(gettop)
@@ -807,13 +814,14 @@ function mm()
        elif [ ! "$M" ]; then
            echo "Couldn't locate a makefile from the current directory."
        else
            ONE_SHOT_MAKEFILE=$M make -C $T all_modules $@
            ONE_SHOT_MAKEFILE=$M $MM_MAKE -C $T all_modules $@
        fi
    fi
}

function mmm()
{
    local MMM_MAKE=make
    T=$(gettop)
    if [ "$T" ]; then
        local MAKEFILE=
@@ -848,13 +856,15 @@ function mmm()
                    ARGS="$ARGS dist"
                elif [ "$DIR" = incrementaljavac ]; then
                    ARGS="$ARGS incrementaljavac"
                elif [ "$DIR" = mka ]; then
                    MMM_MAKE=mka
                else
                    echo "No Android.mk in $DIR."
                    return 1
                fi
            fi
        done
        ONE_SHOT_MAKEFILE="$MAKEFILE" make -C $T $DASH_ARGS $MODULES $ARGS
        ONE_SHOT_MAKEFILE="$MAKEFILE" $MMM_MAKE -C $T $DASH_ARGS $MODULES $ARGS
    else
        echo "Couldn't locate the top of the tree.  Try setting TOP."
    fi