]> git.rmz.io Git - dotfiles.git/commitdiff
zsh: set MAKEFLAGS accordingly for macOS
authorSamir Benmendil <samir@fppnt.com>
Thu, 10 Oct 2019 10:23:11 +0000 (11:23 +0100)
committerSamir Benmendil <me@rmz.io>
Thu, 10 Oct 2019 10:54:09 +0000 (11:54 +0100)
zshenv

diff --git a/zshenv b/zshenv
index 26ef6e63af624ef04aea0821e3a0fa75ea08e4ea..a15f063afa36a1c53f9784c0b925176f4688df04 100644 (file)
--- a/zshenv
+++ b/zshenv
@@ -53,6 +53,10 @@ export PASSWORD_STORE_DIR="$XDG_DATA_HOME/pass"
 # weechat
 export WEECHAT_HOME="$XDG_CONFIG_HOME/weechat"
 
-export MAKEFLAGS="-j$(nproc --all --ignore=2)"
+case "$OSTYPE" in
+    linux*)  export MAKEFLAGS="-j$(nproc --all --ignore=2)" ;;
+    darwin*) export MAKEFLAGS="-j$(($(sysctl -n hw.ncpu) - 2))" ;;
+    *)       echo "Unknown OSTYPE: '$OSTYPE'"
+esac
 
 export CTEST_OUTPUT_ON_FAILURE=1