Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 419
sara Avatar asked Nov 17 '10 09:11

sara


People also ask

What do I do with a makefile am?

Makefile.am is a programmer-defined file and is used by automake to generate the Makefile.in file (the . am stands for automake). The configure script typically seen in source tarballs will use the Makefile.in to generate a Makefile .

How do I make am file?

To create an m-file, choose New from the File menu and select Script. This procedure brings up a text editor window in which you can enter MATLAB commands. To save the m-file, simply go to the File menu and choose Save (remember to save it with the '. m' extension).

What is the difference between makefile and makefile am?

A Makefile.am has the same syntax as an ordinary Makefile . When automake processes a Makefile.am it copies the entire file into the output Makefile.in (that will be later turned into Makefile by configure ) but will react to certain variable definitions by generating some build rules and other variables.

How do I run Makefiles on Windows?

First step: download mingw32-make.exe from mingw installer, or please check mingw/bin folder first whether mingw32-make.exe exists or not, else than install it, rename it to make.exe . After renaming it to make.exe , just go and run this command in the directory where makefile is located.


2 Answers

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 
like image 103
Lee Netherton Avatar answered Sep 21 '22 14:09

Lee Netherton


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.

like image 36
user502515 Avatar answered Sep 24 '22 14:09

user502515