summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2013-02-02 04:57:22 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2014-02-11 02:07:51 (GMT)
commit0f4b365fd141b21499cc10282da375aae6d4f881 (patch)
tree24f40783bef7a25354d4d91fc1ec839500b203c0
parent6ac3f91442e037f5230587546d852caac8b8fc48 (diff)
downloadabc8000-0f4b365fd141b21499cc10282da375aae6d4f881.zip
abc8000-0f4b365fd141b21499cc10282da375aae6d4f881.tar.gz
abc8000-0f4b365fd141b21499cc10282da375aae6d4f881.tar.bz2
abc8000-0f4b365fd141b21499cc10282da375aae6d4f881.tar.xz
tools/build.sh: parallelize more
-rwxr-xr-xtools/build.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/build.sh b/tools/build.sh
index bd783ca..cfc5fec 100755
--- a/tools/build.sh
+++ b/tools/build.sh
@@ -1,6 +1,12 @@
#!/bin/sh -xe
here="$(pwd)"
-cpus=2
+if [ -f /proc/cpuinfo ]; then
+ cpus=$(grep '^processor' /proc/cpuinfo | wc -l)
+else
+ cpus=2
+fi
+# 2 jobs per CPU
+cpus=$((cpus*2))
PATH="$here"/bin:"$PATH"
export PATH