diff options
author | Alexandre Rames <alexandre.rames@linaro.org> | 2016-06-28 11:35:30 +0100 |
---|---|---|
committer | Alexandre Rames <alexandre.rames@linaro.org> | 2016-06-28 17:44:57 +0100 |
commit | 1addb493d121fc1eb67e688943a795c8c0e96603 (patch) | |
tree | d8f5b17418d1a2c1b291b87eda56230341bdec4c /utils | |
parent | 728937698995241aac592578c50730a15be55a91 (diff) |
Fix android helpers.
Change-Id: I63638a8ab82be2167f7cc662d1083a280802a488
Diffstat (limited to 'utils')
-rw-r--r-- | utils/utils_android.sh | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/utils/utils_android.sh b/utils/utils_android.sh index 7630867..5900891 100644 --- a/utils/utils_android.sh +++ b/utils/utils_android.sh @@ -2,7 +2,7 @@ # Common android build methods. -readonly jcpu_count=$(($(nproc) * 2)) +readonly jcpu_count=$(nproc) readonly build_log="$(get_workspace)/log_build.txt" env_defines_lunch_target() { @@ -79,7 +79,7 @@ mm_build() { disable_error_on_unset_expansion start_logging "${build_log}" # shellcheck disable=SC2086 - safe mm -j"${jcpu_count}" ${1:+"$1"} + safe mm -j"${jcpu_count}" "$@" stop_logging enable_error_on_unset_expansion } @@ -88,28 +88,28 @@ mma_build() { disable_error_on_unset_expansion start_logging "${build_log}" # shellcheck disable=SC2086 - safe mma -j"${jcpu_count}" ${1:+"$1"} + safe mma -j"${jcpu_count}" "$@" stop_logging enable_error_on_unset_expansion } # $1: Safe or unsafe call to make. Default: safe. -# $2: Make target. Can be empty. -# $3: Log file. Default: ${build_log}. -# $4: # for -j#. Default: ${jcpu_count}. +# $2: Log file. Default: ${build_log}. +# $3: # for -j#. Default: ${jcpu_count}. +# Following arguments: make targets make_build() { safe_run=${1:-"safe"} - dash_j=${4:-"${jcpu_count}"} - output_file=${3:-"${build_log}"} + output_file=${2:-"${build_log}"} + dash_j=${3:-"${jcpu_count}"} disable_error_on_unset_expansion start_logging "${output_file}" if [[ ${safe_run} == "safe" ]]; then # shellcheck disable=SC2086 - safe make -j"${dash_j}" ${2:+"$2"} + safe make -j"${dash_j}" "${@:4}" elif [[ ${safe_run} == "unsafe" ]]; then # shellcheck disable=SC2086 - make -j"${dash_j}" ${2:+"$2"} + make -j"${dash_j}" "${@:4}" else log E "Don't know how to build with ${safe_run}, only 'safe' or 'unsafe'." abort @@ -121,16 +121,16 @@ make_build() { return ${ret} } -# $1: make target -# $2: log file (optional. default: ${build_log}) -# $3: # for -j# (optional. default: ${jcpu_count}) +# $1: log file (optional. default: ${build_log}) +# $2: # for -j# (optional. default: ${jcpu_count}) +# Following arguments: make targets safe_make_build() { make_build "safe" "$@" } -# $1: make target -# $2: log file (optional. default: ${build_log}) -# $3: # for -j# (optional. default: ${jcpu_count}) +# $1: log file (optional. default: ${build_log}) +# $2: # for -j# (optional. default: ${jcpu_count}) +# Following arguments: make targets unsafe_make_build() { make_build "unsafe" "$@" } |