blob: 1630690c9ea6770ee50f3b35dfcd1a99661c8817 [file] [log] [blame]
Inaky Perez-Gonzalez8ddf82c2015-04-10 16:44:37 -07001#!/bin/bash
2
3#
4# Copyright (c) 2014-2015 Wind River Systems, Inc.
5#
David B. Kinderac74d8b2017-01-18 17:01:01 -08006# SPDX-License-Identifier: Apache-2.0
Inaky Perez-Gonzalez8ddf82c2015-04-10 16:44:37 -07007#
8
9[ x$(which grep) = x ] && exit -1
10
11num_cpus=$(\grep -c "^processor" /proc/cpuinfo)
12
Allan Stephens570795f2015-06-08 11:43:48 -040013if [ x${ZEPHYR_JOBS} = x ]; then
14 ZEPHYR_JOBS=$((${num_cpus} * 2 + 1))
Inaky Perez-Gonzalez8ddf82c2015-04-10 16:44:37 -070015fi
16
Allan Stephens570795f2015-06-08 11:43:48 -040017echo Using $ZEPHYR_JOBS threads
18nice make --jobs=${ZEPHYR_JOBS} --load-average=${num_cpus} $@