From 38495a38243598cc2939b2cd917a43aed4050e4c Mon Sep 17 00:00:00 2001 From: Andres AG Date: Tue, 12 Jul 2016 16:54:33 +0100 Subject: [PATCH] Use MAKEFLAGS to pass args to make in all.sh Modify the script at tests/scripts/all.sh to export the variable MAKEFLAGS with -j if it was not set before. This should decrease the total runtime of tests/scripts/all.sh by letting make run multiple jobs in parallel. Also, add a check at the top of the script to cause a failure if the environment is not Linux. --- tests/scripts/all.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index f40d52f4d..ff60c278b 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -22,8 +22,11 @@ # Abort on errors (and uninitialised variables) set -eu -if [ -d library -a -d include -a -d tests ]; then :; else - err_msg "Must be run from mbed TLS root" +if [ "$( uname )" != "Linux" ]; then + echo "This script only works in Linux" >&2 + exit 1 +elif [ -d library -a -d include -a -d tests ]; then :; else + echo "Must be run from mbed TLS root" >&2 exit 1 fi @@ -42,6 +45,11 @@ FORCE=0 : ${GNUTLS_LEGACY_SERV:="$GNUTLS_SERV"} : ${OUT_OF_SOURCE_DIR:=./mbedtls_out_of_source_build} +# if MAKEFLAGS is not set add the -j option to speed up invocations of make +if [ -n "${MAKEFLAGS+set}" ]; then + export MAKEFLAGS="-j" +fi + usage() { printf "Usage: $0\n"