无法运行Makefile.am,我该怎么办?

sar*_*ara 19 c++ linux makefile autotools

我有一个C项目在Linux中编译和运行.这是一个包含许多子目录的非常大的项目.在父目录中有文件Makefile.amMakefile.in.

我试过运行make -f Makefile.am,并得到以下错误:

make: Nothing to be done for `Makefile.am'.
Run Code Online (Sandbox Code Playgroud)

这是什么意思?我如何完成任务?

Lee*_*ton 20

这些文件与Autotools套件一起使用.Makefile.am文件使用automake编译为Makefile .

看一下configure目录中是否有脚本.如果有,则键入:

./configure
Run Code Online (Sandbox Code Playgroud)

如果没有,那么运行:

autoreconf
Run Code Online (Sandbox Code Playgroud)

在目录中,应创建configure脚本(您需要安装Autotools套件才能运行此脚本).

之后,您应该有一个configure可以运行的脚本.

配置完成后,您应该在目录中有一个普通的Makefile,并且能够运行

make
Run Code Online (Sandbox Code Playgroud)

  • 正如我所说,您需要安装Autotools套件才能运行该命令.看看这里:http://sourceware.org/autobook/autobook/autobook_274.html (2认同)

use*_*515 9

遗漏了什么:

  • 使用automake将Makefile.am转换为Makefile.in.
  • 通过运行configure将Makefile.in转换为Makefile.

这两个(Makefile.{am,in})都不应该与之一起使用make -f.

如果tarball已经附带configure,只需运行它并生成.如果没有,请运行./autogen.shbootstrap(*).如果不存在,请autoreconf改用.

(*)autogen/bootstrap:由应该只调用的开发人员添加的便利脚本autoreconf.不幸的是,有些人会避开autoreconf并且不必要地自己调用所有低级命令.


Dar*_*mas 1

Makefile.am可能与automake一起使用。

尝试:

automake
Run Code Online (Sandbox Code Playgroud)

你可能也只是想尝试一下

make -f Makefile.in
Run Code Online (Sandbox Code Playgroud)

由于这是运行automake的产物