diff options
author | Wolfgang Denk | 2008-12-09 00:39:08 +0100 |
---|---|---|
committer | Wolfgang Denk | 2008-12-09 00:39:08 +0100 |
commit | 7fa6a2f3b66579dea8bc1a9177646e1141731b15 (patch) | |
tree | a67cd9d341773b783d29f9629c1768c44413cced /MAKEALL | |
parent | 268405fa7c44156c5192a70779920c70906af8d6 (diff) |
MAKEALL: Automatically use parallel builds
Add logic to the MAKEALL script to determine the number of CPU cores
on the system, and run a parallel build if there is more than one.
Usually this significantrly accelerates builds.
Allow to manually adjust the number of parallel make jobs by using
the "BUILD_NCPUS" environment variable.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'MAKEALL')
-rwxr-xr-x | MAKEALL | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -1,6 +1,15 @@ #!/bin/sh -: ${JOBS:=} +# Determine number of CPU cores if no default was set +: ${BUILD_NCPUS:="`getconf _NPROCESSORS_ONLN`"} + +if [ "$BUILD_NCPUS" -gt 1 ] +then + JOBS=-j`expr "$BUILD_NCPUS" + 1` +else + JOBS="" +fi + if [ "${CROSS_COMPILE}" ] ; then MAKE="make CROSS_COMPILE=${CROSS_COMPILE}" |