问题
I downloaded GNU make 4.2.1 from here (make-4.2.1.tar.gz) and installed it following the instruction found in the INSTALL file that is present in the expanded folder.
Now I run make -v
in the shell and I still get that the system sees the old version:
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.
This program built for i386-apple-darwin11.3.0
Any suggestion?
I'm working on a macOS 10.12.3 machine.
Thanks in advance.
回答1:
It is bad practice to alter the contents of /usr/bin
. The best way is to have /usr/local/bin
before /usr/bin
in your PATH. Add the following to your ~/.bashrc
:
[[ "$PATH" = */usr/local/bin* ]] || PATH="/usr/local/bin:$PATH"
回答2:
Type command which make
. If nothing unexpected happens, the shell will print out /usr/bin/make
, which is the path of default make
.
In INSTALL file:
By default,
make install
will install the package's files in/usr/local/bin
,/usr/local/man
, etc. You can specify an installation prefix other than/usr/local
by giving configure the option--prefix=PATH
.
So maybe you can try make --prefix=/usr/bin
. Or remove the default make
create soft link for make
in /usr/local/bin
.
来源:https://stackoverflow.com/questions/42026502/updating-gnu-make-on-macos