diff --git a/nvm.sh b/nvm.sh index b302c5c..428b7cd 100755 --- a/nvm.sh +++ b/nvm.sh @@ -29,6 +29,10 @@ case "$uname" in *x86_64*) arch=x64 ;; esac +# Use gmake when available to support FreeBSD +MAKE_BIN='make' +command -v gmake >/dev/null 2>&1 && MAKE_BIN='gmake' + # Expand a version using the version cache nvm_version() { @@ -219,9 +223,9 @@ nvm() tar -xzf "node-$VERSION.tar.gz" && \ cd "node-$VERSION" && \ ./configure --prefix="$NVM_DIR/$VERSION" $ADDITIONAL_PARAMETERS && \ - make && \ + $MAKE_BIN && \ rm -f "$NVM_DIR/$VERSION" 2>/dev/null && \ - make install + $MAKE_BIN install ) then nvm use $VERSION