在Mac上更新Make版本 [英] Updating Make Version on Mac

查看:151
本文介绍了在Mac上更新Make版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Mac上更新make的版本,但是遇到了问题.最小项目依赖项为4.1,但我的版本似乎为3.81.我已经将Xcode更新到最新版本并安装了命令行工具,但它似乎仍然是较旧的版本.

I'm trying to update the version of make on my mac but am running into issues. The minimum project dependency is 4.1 but my version seems to be 3.81. I've updated Xcode to the latest version and installed the command line tools but it still seems to be the older version.

有人遇到这个问题或知道解决该问题的方法吗?

Has anyone run into this issue or know of a way to resolve it?

推荐答案

这就是我所做的,并且可以在我的MacOS上运行:

Here is what I did, and it works on my MacOS:

第一步:安装自制软件(安装命令来自 https://brew.sh/):

Step1: Install homebrew (installation command comes from https://brew.sh/):

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

第二步:使用自制软件安装make

Step2: Use homebrew to install make

brew install make --with-default-names

以防万一它不起作用,请尝试以下操作:

just incase it doesn't work, try this:

brew install homebrew/dupes/make --with-default-names

第3步:您需要更改默认命令以使用正确的品牌,而不是MacBook或Mac上的默认品牌.

Step3: You need to change the default command to use correct make instead of the default one from your MacBook or Mac.

例如,如果您键入

make --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

这是默认版本的默认路径.

Which is the default path for default version.

因此,现在,在您的.bash_profile(应位于主目录/Users/您的名字下)中,添加以下行:

So, now, in your .bash_profile (which should be under your home dir /Users/your_name), add the following line:

export PATH="/usr/local/bin:$PATH"

注意:如果在安装make时看到以下消息:

Note: If you see the following message when you installed make:

GNU"make"已安装为"gmake".如果需要将其用作"make",则可以从以下位置将"gnubin"目录添加到PATH中:您的bashrc就像:

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"

然后运行,

export PATH="/usr/local/opt/make/libexec/gnubin:$PATH"

然后获取您的.bash_profile.现在尝试检查您的版本:

Then source your .bash_profile. Now try to check your version:

make --version

它应该显示:

GNU Make 4.2.1
Built for x86_64-apple-darwin16.5.0
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later     <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

干杯.

这篇关于在Mac上更新Make版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆