[scripts][buildall] try to guess the number of cpus on linux machines

This commit is contained in:
Travis Geiselbrecht
2013-05-25 11:31:00 -07:00
parent 728bcd8297
commit f2342458cb

View File

@@ -1,9 +1,20 @@
#!/bin/sh
# build everything in the projects directory
PROJECTS=`echo project/* | xargs basename | sed 's/\.mk//'`
PROJECTS=`echo project/* | xargs -n1 basename | sed 's/\.mk//'`
FAILED=""
UNAME=`uname`
case `uname` in
Linux)
N=`cat /proc/cpuinfo | grep processor | wc -l`
PARALLEL=-j`expr $N + $N`
;;
*)
PARALLEL=-j4
;;
esac
for p in $PROJECTS; do
PROJECT=$p nice make -j4 || FAILED="$FAILED $p"
done