23

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.am and Makefile.in.

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

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

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

CashCow
  • 30,981
  • 5
  • 61
  • 92
sara
  • 3,824
  • 9
  • 43
  • 71

4 Answers4

25

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

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

./configure

If not, then run:

autoreconf

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

After that, you should have a configure script that you can run.

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

make
Lee Netherton
  • 21,347
  • 12
  • 68
  • 102
  • 2
    As I said, you will need to have the Autotools suite installed to run that command. Have a look here: http://sourceware.org/autobook/autobook/autobook_274.html – Lee Netherton Nov 17 '10 at 10:15
  • i installed. now it says that it needs configure.in or configure.ac – sara Nov 17 '10 at 10:29
  • Well it seems that perhaps all of the 'developer' parts of the source are not there. Are you sure there isn't a `configure` file in the directory? (If there is but it just not executable, you can always run it with `sh configure`) – Lee Netherton Nov 17 '10 at 10:37
  • 1
    Also, you could try running `autoscan` to see if that creates you a usable `configure.in` file. My guess is that you may have to edit it though to make it usable. – Lee Netherton Nov 17 '10 at 10:40
  • `autoreconf` can be installed with `sudo apt install autoconf` – Boris Verkhovskiy Feb 19 '21 at 23:11
12

What has been left out:

  • Makefile.am are transformed to Makefile.in using automake.
  • Makefile.in are transformed to Makefile by running configure.

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

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

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

user502515
  • 4,346
  • 24
  • 20
3

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

./configure

make

and optionally, to install:

sudo make install

or su -c "make install"

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

subhacom
  • 868
  • 10
  • 24
1

Makefile.am is probably to be used with automake.

try:

automake

you might also just want to try

make -f Makefile.in

Since this is the product of running automake

Daren Thomas
  • 67,947
  • 40
  • 154
  • 200