“make”和“make install”永远不会工作

Nir*_*mik 8 compiling make

用于从提取的 tar 球安装程序的命令makemake install出于某种原因从不工作。

make命令给了我错误:

  make: *** No targets specified and no makefile found.  Stop.
Run Code Online (Sandbox Code Playgroud)

make install命令给了我错误:

  make: *** No rule to make target `install'.  Stop.
Run Code Online (Sandbox Code Playgroud)

为什么这些命令没有执行?我应该怎么做才能解决这个问题?

小智 12

我认为问题在于您没有获得相关程序的依赖项,因为即使您已经运行./configure,也只有名为makefile.inand的文件makefile.am,而应该有Makefile一个没有扩展名的文件。

如果你在./configure没有依赖的情况下运行,它不会生成一个 makefile,然后运行 ​​make 会给出你得到的错误:

make: *** No targets specified and no makefile found. Stop.
Run Code Online (Sandbox Code Playgroud)

因此,通过查看下载中包含的自述文件来下载程序的构建依赖项,或者如果程序源在存储库中并且您已启用源存储库,请运行

sudo apt-get build-dep program
Run Code Online (Sandbox Code Playgroud)

获得依赖项后,./configure再次运行,现在 make 和 make install 应该可以工作,因为会有一个正确的Makefile生成。

(您可能还需要安装build-essential包含基本编译工具的包)