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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4203208/
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-08-05 00:00:15  来源:igfitidea点击:

Can't run Makefile.am, what should I do?

c++linuxmakefileautotools

提问by sara

I got a C project to compile and run in Linux. It is a very big project with many subdirectories. Inside the parent directory there are files Makefile.amand Makefile.in.

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

I tried running make -f Makefile.am, and got the following error:

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

make: Nothing to be done for `Makefile.am'.

What does it mean? How do I accomplish my task?

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

回答by Daren Thomas

Makefile.amis probably to be used with automake.

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

try:

尝试:

automake

you might also just want to try

你可能也只是想尝试

make -f Makefile.in

Since this is the product of running automake

由于这是运行 automake 的产物

回答by subhacom

To supplement what has already been said: Search for a script called configurein the project directory. If it is there, building the project will be:

补充已经说过的内容:在项目目录中搜索名为configure的脚本。如果存在,则构建项目将是:

./configure

。/配置

make

制作

and optionally, to install:

并可选择安装:

sudo make install

须藤制作安装

or su -c "make install"

或 su -c "make install"

Even if there is no configurescript. there might be one autogen.sh. Run this script to generate the configure script and do as above.

即使没有配置脚本。可能有一个autogen.sh。运行此脚本以生成配置脚本并执行上述操作。

回答by Lee Netherton

These files are used with the Autotoolssuite. Makefile.am files are compiled to Makefiles using automake.

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

Have a look to see if there is a configurescript in the directory. If there is, then type:

查看目录中是否有configure脚本。如果有,则输入:

./configure

If not, then run:

如果没有,则运行:

autoreconf

in the directory, which should create the configurescript (you will need to have the Autotools suite installed to run this).

在应该创建configure脚本的目录中(您需要安装 Autotools 套件才能运行它)。

After that, you should have a configurescript that you can run.

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

After the configure is complete, you should have a normal Makefile in the directory, and will be able to run

配置完成后,目录下应该有一个正常的Makefile了,就可以运行了

make

回答by user502515

What has been left out:

遗漏了什么:

  • Makefile.am are transformed to Makefile.in using automake.
  • Makefile.in are transformed to Makefile by running configure.
  • Makefile.am 使用 automake 转换为 Makefile.in。
  • Makefile.in 通过运行 configure 转换为 Makefile。

Neither of these (Makefile.{am,in}) are supposed to be used with make -f.

这些 (Makefile.{am,in}) 都不应该与make -f.

If the tarball already ships with configure, just run that and make. If it does not, run ./autogen.shor bootstrap(*). If that does not exist, use autoreconfinstead.

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

(*) autogen/bootstrap: A convenience script added by developers that shouldjust call autoreconf. Unfortunately there are some people that eschew autoreconf and unnecessarily call all the lowlevel commands themselves.

(*)AUTOGEN /自举:由开发商添加了一个方便的脚本应该只是调用autoreconf。不幸的是,有些人避开 autoreconf 并不必要地自己调用所有低级命令。