blob: a7fe8f4b18417002b70133c45eb0e26fda24d200 [file] [log] [blame]
#!/usr/bin/env bash
# Copyright 2016 The Fuchsia Authors
#
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT
MAKE=make
case `uname` in
Linux)
N=`cat /proc/cpuinfo | grep processor | wc -l`
PARALLEL=-j`expr $N + $N`
;;
Darwin)
PARALLEL=-j`sysctl -n hw.ncpu`
;;
FreeBSD)
PARALLEL=-j`sysctl -n hw.ncpu`
MAKE=gmake
;;
*)
PARALLEL=-j8
;;
esac
exec $MAKE $PARALLEL "$@"