如何让终端使用更新版本的 GNU make(4.3) 而不是默认的旧版本 (3.81)?
How to make terminal use newer version of GNU make(4.3) instead of default old(3.81) one?
我尝试使用命令
通过HomeBrew将我的make
更新到较新的版本
brew upgrade make
哪个returns
Warning: make 4.3 already installed
但是当我运行
make -v
说明还在使用老版本(3.81)
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
在线搜索时,我发现我必须将 PATH 环境变量 设置为 "/usr/local/bin:$PATH"
才能解决此问题。
但是当通过 echo $PATH
看到时,我的路径变量前面已经有 /usr/local/bin:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
那我应该怎么更新呢?
P.S.
brew version - Homebrew 2.5.8
OS - macOS Catalina 10.15.7
这些是我在网上搜索时已经看到的以下链接:-
1 updating-make-version-4-1-on-mac
2
查看最新情况:
brew info make
GNU "make" has been installed as "gmake".
If you need to use it as "make", you can add a "gnubin" directory
to your PATH from your bashrc like:
PATH="/usr/local/opt/make/libexec/gnubin:$PATH"
因此,您可以执行上面的建议并更改您的 PATH,或者使用 gmake
而不是 make
。
我尝试使用命令
通过HomeBrew将我的make
更新到较新的版本
brew upgrade make
哪个returns
Warning: make 4.3 already installed
但是当我运行
make -v
说明还在使用老版本(3.81)
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
在线搜索时,我发现我必须将 PATH 环境变量 设置为 "/usr/local/bin:$PATH"
才能解决此问题。
但是当通过 echo $PATH
/usr/local/bin:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
那我应该怎么更新呢?
P.S.
brew version - Homebrew 2.5.8
OS - macOS Catalina 10.15.7
这些是我在网上搜索时已经看到的以下链接:-
1 updating-make-version-4-1-on-mac
2
查看最新情况:
brew info make
GNU "make" has been installed as "gmake". If you need to use it as "make", you can add a "gnubin" directory to your PATH from your bashrc like:
PATH="/usr/local/opt/make/libexec/gnubin:$PATH"
因此,您可以执行上面的建议并更改您的 PATH,或者使用 gmake
而不是 make
。