From 6371b4915c60105a64f9fcdb3137f68dddd2f529 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 2 Oct 2019 17:11:33 -0600 Subject: [PATCH] tools/testbuild.sh: Add an option to select the number of CPUs to use with 'make' --- tools/testbuild.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/testbuild.sh b/tools/testbuild.sh index f2179bf78d..6f9a761a86 100755 --- a/tools/testbuild.sh +++ b/tools/testbuild.sh @@ -45,10 +45,11 @@ APPSDIR=../apps MAKE_FLAGS=-i MAKE=make unset testfile +unset JOPTION; function showusage { echo "" - echo "USAGE: $progname [-w|l] [-c|u|n] [-s] [-d] [-x] [-a ] [-t " + echo "USAGE: $progname [-w|l] [-c|u|n] [-s] [-d] [-x] [-j ] [-a ] [-t " echo " $progname -h" echo "" echo "Where:" @@ -58,6 +59,7 @@ function showusage { echo " -s Use C++ unsigned long size_t in new operator. Default unsigned int" echo " -d enables script debug output" echo " -x exit on build failures" + echo " -j passed on to make. Default: No -j make option." echo " -a provides the relative path to the apps/ directory. Default ../apps" echo " -t provides the absolute path to top nuttx/ directory. Default $PWD/../nuttx" echo " -h will show this help test and terminate" @@ -106,6 +108,10 @@ while [ ! -z "$1" ]; do shift APPSDIR="$1" ;; + -j ) + shift + JOPTION="-j $1" + ;; -t ) shift nuttx="$1" @@ -240,7 +246,7 @@ function build { cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; } echo " Building NuttX..." echo "------------------------------------------------------------------------------------" - ${MAKE} ${MAKE_FLAGS} 1>/dev/null + ${MAKE} ${JOPTION} ${MAKE_FLAGS} 1>/dev/null } # Coordinate the steps for the next build test