summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMAKEALL11
1 files changed, 10 insertions, 1 deletions
diff --git a/MAKEALL b/MAKEALL
index dbed268..a16549c 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -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}"