From e9842248993762d8456a37fef97ff8684bb3c9e4 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Fri, 28 Jul 2017 13:00:13 -0700 Subject: [PATCH] Continue using the real make if -C is used To allow building other make-based systems from the top of the android tree. Bug: 64145979 Test: get_make_command Test: get_make_command -C Test: get_make_command -C. Test: get_make_command -C . Test: get_make_command -j test Test: get_make_command test-C Test: get_make_command " -C" Test: make Test: make -C. Change-Id: I406dd2706f19e5d2a6afdff441335f4e01ba6d12 --- envsetup.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/envsetup.sh b/envsetup.sh index dca817a16..ae65832a8 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -1542,6 +1542,13 @@ function get_make_command() { # If we're in the top of an Android tree, use soong_ui.bash instead of make if [ -f build/soong/soong_ui.bash ]; then + # Always use the real make if -C is passed in + for arg in "$@"; do + if [[ $arg == -C* ]]; then + echo command make + return + fi + done echo build/soong/soong_ui.bash --make-mode else echo command make @@ -1588,7 +1595,7 @@ function _wrap_build() function make() { - _wrap_build $(get_make_command) "$@" + _wrap_build $(get_make_command "$@") "$@" } function provision()