Arquivos
Travis Geiselbrecht 993b4202a9 [scripts][bash] use /usr/bin/env to find bash for FreeBSD
Change-Id: I377efbccc233d85cba8ef794fbf2b1669e82e0ea
2017-06-17 14:13:06 -07:00

29 linhas
498 B
Bash
Arquivo Executável

#!/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
$MAKE $PARALLEL "$@"