Inaky Perez-Gonzalez | 8ddf82c | 2015-04-10 16:44:37 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # |
| 4 | # Copyright (c) 2014-2015 Wind River Systems, Inc. |
| 5 | # |
David B. Kinder | ac74d8b | 2017-01-18 17:01:01 -0800 | [diff] [blame] | 6 | # SPDX-License-Identifier: Apache-2.0 |
Inaky Perez-Gonzalez | 8ddf82c | 2015-04-10 16:44:37 -0700 | [diff] [blame] | 7 | # |
| 8 | |
| 9 | [ x$(which grep) = x ] && exit -1 |
| 10 | |
| 11 | num_cpus=$(\grep -c "^processor" /proc/cpuinfo) |
| 12 | |
Allan Stephens | 570795f | 2015-06-08 11:43:48 -0400 | [diff] [blame] | 13 | if [ x${ZEPHYR_JOBS} = x ]; then |
| 14 | ZEPHYR_JOBS=$((${num_cpus} * 2 + 1)) |
Inaky Perez-Gonzalez | 8ddf82c | 2015-04-10 16:44:37 -0700 | [diff] [blame] | 15 | fi |
| 16 | |
Allan Stephens | 570795f | 2015-06-08 11:43:48 -0400 | [diff] [blame] | 17 | echo Using $ZEPHYR_JOBS threads |
| 18 | nice make --jobs=${ZEPHYR_JOBS} --load-average=${num_cpus} $@ |