From cbb68a99b5c02c5601fb9e6c135d1b4e7764068d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 17 Feb 2017 14:40:31 +0300 Subject: Add support for environment variable jobs. It set jobs number for make. If jobs unset, it autodetected based on number of cpu cores. --- scripts/include/common.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/include/common.sh b/scripts/include/common.sh index e54922b..e348e5d 100644 --- a/scripts/include/common.sh +++ b/scripts/include/common.sh @@ -165,9 +165,19 @@ function run_cmake { } function run_make { - echo "make" - make + if [[ "${jobs}" == "" ]]; then + if [ -f "/proc/cpuinfo" ]; then + jobs="$(cat /proc/cpuinfo|grep processor|wc -l)" + else + jobs="1" + fi + fi + j=" -j${jobs}" + + echo "make$j" + make$j check_error $? + unset j } function run_make_install { -- cgit v1.2.3-60-g2f50