bash 在没有 make 的情况下安装 make 命令(mac os 10.5)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2556444/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 19:07:23  来源:igfitidea点击:

install make command without already having make (mac os 10.5)

bashmacosmakefile

提问by nightfire

I'm trying to write a script that uses the make command, but Mac os 10.5 doesn't come with make installed by default, and when you download the make source code from gnu's website, you have to use make itself to compile and install it. which is hard if you don't have it in the first place. How can I install make?
(I know you can get make by installing Xcode and the developer tools that come with mac os, but I don't want people to have to go find their mac os install dvds to be able to use the script.)

我正在尝试编写一个使用 make 命令的脚本,但是 Mac os 10.5 默认没有安装 make,当你从 gnu 的网站下载 make 源代码时,你必须使用 make 本身来编译和安装它。如果你一开始就没有它,这很难。我如何安装make?
(我知道您可以通过安装 Xcode 和 mac os 附带的开发人员工具来获得 make,但我不希望人们必须去寻找他们的 mac os install dvds 才能使用该脚本。)

It doesn't even have to be make, i'm just looking for a utility that you can easily download in a script (using ftp or curl) and use to compile source code.

它甚至不必是 make,我只是在寻找一个可以在脚本中轻松下载(使用 ftp 或 curl)并用于编译源代码的实用程序。

回答by John Marshall

A GNU Make source tarball contains a build.shscript to resolve this chicken-and-egg situation. From the README:

一个 GNU Make 源 tarball 包含一个build.sh脚本来解决这种先有鸡还是先有蛋的情况。从自述文件:

If you need to build GNU Make and have no other makeprogram to use, you can use the shell script build.shinstead. To do this, first run configureas described in INSTALL. Then, instead of typing maketo build the program, type sh build.sh. This should compile the program in the current directory. Then you will have a Make program that you can use for ./make install, or whatever else.

如果您需要构建 GNU Make 并且没有其他make程序可以使用,您可以使用 shell 脚本build.sh来代替。为此,首先configure按照安装中的说明运行 。然后,不要输入make来构建程序,而是输入sh build.sh. 这应该编译当前目录中的程序。然后您将拥有一个 Make 程序,您可以将其用于./make install或其他任何用途。

Yes, they thought of this problem!

是的,他们想到了这个问题!

回答by Paused until further notice.

The Developer Toolsare included on the OS X install disk under "Optional Installs".

开发工具包含在OS X下的“可选安装”安装盘。

Edit:

编辑:

You can download Xcodeif you're registered as an Apple Developer.

如果您已注册为 Apple Developer,则可以下载 Xcode

回答by errno

How about using a precompiled make binary?

如何使用预编译的 make 二进制文件?

See:

看:

http://rudix.org/packages-mn.html#make

http://rudix.org/packages-mn.html#make

回答by amertune

Have you tried looking at the fink project? It looks like they have a make package. http://pdb.finkproject.org/pdb/browse.php?name=make&sec=devel

你试过查看 fink 项目吗?看起来他们有一个 make 包。 http://pdb.finkproject.org/pdb/browse.php?name=make&sec=devel