diff options
author | Travis Geiselbrecht <geist@foobox.com> | 2013-05-25 11:31:00 -0700 |
---|---|---|
committer | Travis Geiselbrecht <geist@foobox.com> | 2013-05-25 11:31:00 -0700 |
commit | f2342458cbbc287a6db1192952e71efca471150f (patch) | |
tree | b4600f01b2e1714687633f269ed2de25814fa7ad | |
parent | 728bcd829741fd6be26bb708792d3e37bcfaf9cb (diff) | |
download | lk-f2342458cbbc287a6db1192952e71efca471150f.tar.gz |
[scripts][buildall] try to guess the number of cpus on linux machines
-rwxr-xr-x | scripts/buildall | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/buildall b/scripts/buildall index 7416985e..2102e576 100755 --- a/scripts/buildall +++ b/scripts/buildall @@ -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 |