diff --git a/bashrc b/bashrc index 7daa19ea..62bed253 100644 --- a/bashrc +++ b/bashrc @@ -264,7 +264,12 @@ export CLICOLOR=1 export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx # make -export NPROC=`nproc` +if [[ $UNAME != Darwin ]]; then + export NPROC=`nproc` +else + export NPROC=`sysctl -n hw.cpu` +fi + export MAKEFLAGS="-j$NPROC" export MAKE="make $MAKEFLAGS" alias make="make $MAKEFLAGS" diff --git a/zshrc b/zshrc index 3e405c99..46e781a7 100644 --- a/zshrc +++ b/zshrc @@ -202,7 +202,12 @@ export CLICOLOR=1 export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx # make -export NPROC=`nproc` +if [[ $UNAME != Darwin ]]; then + export NPROC=`nproc` +else + export NPROC=`sysctl -n hw.cpu` +fi + export MAKEFLAGS="-j$NPROC" export MAKE="make $MAKEFLAGS" alias make="make $MAKEFLAGS"