如何在 mac 终端上从源代码安装

how to install from source code on mac terminal

我正在尝试在 mac 上安装名为 "pigz" 的软件。下载源代码后,在终端中我转到包含源代码的文件夹,然后我 运行 make。当我尝试使用 sudo make install 安装它时,我收到此消息

make: *** No rule to make target `install'.  Stop.

或者当我尝试使用 brew

安装它时
brew install pigz 

我收到这个错误

Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles/pigz-2.4.catalina.bottle.ta
Warning: Transient problem: timeout Will retry in 1 seconds. 3 retries left.
Warning: Transient problem: timeout Will retry in 2 seconds. 2 retries left.  
Warning: Transient problem: timeout Will retry in 4 seconds. 1 retries left.  
##O=#  #                                                                      
curl: (6) Could not resolve host: homebrew.bintray.com
Error: Failed to download resource "pigz"
Download failed: https://homebrew.bintray.com/bottles/pigz-2.4.catalina.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==> Downloading https://zlib.net/pigz/pigz-2.4.tar.gz
######################################################################## 100.0%
==> make CC=clang CFLAGS=
  /usr/local/Cellar/pigz/2.4: 7 files, 154KB, built in 4 seconds

因为我是命令行的新手,所以我真的不知道这意味着什么以及我应该做什么 感谢您的帮助

在您查看的源代码中,有一个 Makefile。当您 运行 命令 make 时,它会执行它在该文件中看到的第一个默认规则。

当您 运行 命令 sudo make install 时,它会在 Makefile 内部查找并查找 install 规则。但是,如果您查看正在查看的软件的 Makefile,则没有 install 规则,因此您收到错误消息的原因是:

make: *** No rule to make target `install'.  Stop.

这仅仅是因为 install 没有任何规则,所以当你 运行 该命令时,它根本不会做任何事情。

您可以通过在线搜索 Makefiles 是什么来更好地了解这些内容,您会找到大量资源。 This 可以是一个很好的起点。