Created
December 13, 2014 17:05
-
-
Save warped-rudi/522d717348faec77a00e to your computer and use it in GitHub Desktop.
Limit number of make job to actuall number of processors, gracefully handle invalid values for CONCURRENCY_MAKE_LEVEL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/config/path b/config/path | |
index 78f53d5..9043ddc 100644 | |
--- a/config/path | |
+++ b/config/path | |
@@ -52,6 +52,11 @@ ROOT=`pwd` | |
# Toolchain Settings # | |
###################### | |
+NUM_PROCESSORS=`grep -c processor /proc/cpuinfo` | |
+[ -z "$CONCURRENCY_MAKE_LEVEL" ] && CONCURRENCY_MAKE_LEVEL=0 | |
+[ $CONCURRENCY_MAKE_LEVEL -lt 1 -o $CONCURRENCY_MAKE_LEVEL -gt $NUM_PROCESSORS ] && \ | |
+ CONCURRENCY_MAKE_LEVEL=$NUM_PROCESSORS | |
+ | |
. config/toolchain | |
TOOLCHAIN_LANGUAGES=c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment