Consistently use nproc for counting the CPUs

Coreutils command nproc can be used on Linux and BSD to count the number of
available CPU cores. Use this instead of relying on the parsing of the
Linux specific proc file system.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
Heinrich Schuchardt
2020-01-27 07:59:46 +01:00
committed by Tom Rini
parent 0f97e923d4
commit 84f0415201
3 changed files with 3 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
CROSS_COMPILE := aarch64-linux-gnu-
output_dir := $(PWD)/../bin
makejobs := $(shell grep '^processor' /proc/cpuinfo | sort -u | wc -l)
makejobs := $(nproc)
makethreads := $(shell dc -e "$(makejobs) 1 + p")
make_options := GCC49_AARCH64_PREFIX=$CROSS_COMPILE \
-j$(makethreads) -l$(makejobs)