diff --git a/ghcup b/ghcup index 3bd30ad..769cd2d 100755 --- a/ghcup +++ b/ghcup @@ -453,6 +453,24 @@ edo() "$@" || exit 2 } +# @FUNCTION: emake +# @USAGE: [arguments] +# @DESCRIPTION: +# Wrapper around 'make', may call 'gmake' if it exists. +emake() { # avoid re-checking for gmake + if [ -n "${MAKE}" ] ; then + edo ${MAKE} "$@" + else + if command_exists gmake ; then + MAKE=gmake + edo ${MAKE} "$@" + else + MAKE=make + edo ${MAKE} "$@" + fi + fi +} + # @FUNCTION: debug_message # @USAGE: # @DESCRIPTION: @@ -1189,7 +1207,7 @@ install_ghc() { debug_message "Installing GHC into ${inst_location}" edo ./configure --prefix="${inst_location}" - edo make install + emake install # clean up edo cd .. @@ -1545,8 +1563,8 @@ compile_ghc() { edo ./boot edo ./configure --prefix="${inst_location}" --with-ghc="${bootstrap_ghc}" - edo make -j${JOBS} - edo make install + emake -j${JOBS} + emake install # clean up edo cd ..