Questions tagged [automake]

Automake is a tool provided by GNU for the purpose of automating the generation of portable, configurable Makefiles.

Automake is a tool for automatically generating Makefile.ins from files called Makefile.am. Each Makefile.am is basically a series of make variable definitions, with rules being thrown in occasionally. The generated Makefile.ins are compliant with the GNU Makefile standards.

The GNU Makefile Standards Document (see Makefile Conventions) is long, complicated, and subject to change. The goal of Automake is to remove the burden of Makefile maintenance from the back of the individual GNU maintainer (and put it on the back of the Automake maintainers).

The typical Automake input file is simply a series of variable definitions. Each such file is processed to create a Makefile.in. There should generally be one Makefile.am per directory of a project.

Automake does constrain a project in certain ways; for instance, it assumes that the project uses Autoconf (see Introduction), and enforces certain restrictions on the configure.ac contents.

For more details, take a look into automake manual

1092 questions
435
votes
4 answers

What are Makefile.am and Makefile.in?

These two files are mostly seen in open source projects. What are they for, and how do they work?
Mask
  • 33,129
  • 48
  • 101
  • 125
127
votes
11 answers

How to overcome "'aclocal-1.15' is missing on your system" warning?

Im trying to run a c++ program on github. (available at the following link https://github.com/mortehu/text-classifier) I have a mac, and am trying to run it in the terminal. I think I have downloaded autoconf and automake but am not sure. To run the…
Liam Flynn
  • 2,009
  • 3
  • 17
  • 16
96
votes
5 answers

Directory structure for a C++ library

I am working on a C++ library. Ultimately, I would like to make it publicly available for multiple platforms (Linux and Windows at least), along with some examples and Python bindings. Work is progressing nicely, but at the moment the project is…
TC.
  • 4,133
  • 3
  • 31
  • 33
85
votes
5 answers

How to write multiple conditions in Makefile.am with "else if"

I want to compile my project with autoconf/automake. There are 2 conditions defined in my configure.ac AM_CONDITIONAL(HAVE_CLIENT, test $enable-client -eq 1) AM_CONDITIONAL(HAVE_SERVER, test $enable-server -eq 1) I want to separate _LIBS from these…
Wind
  • 851
  • 1
  • 6
  • 3
82
votes
4 answers

GNU autotools: Debug/Release targets?

I've been looking for this for a while: I'm currently converting a medium-size program to autotools, coming from an Eclipse-based method (with makefiles) I'm always used to having a "debug" build, with all debug symbols and no optimizations, and a…
cpf
  • 1,461
  • 2
  • 15
  • 26
60
votes
5 answers

Build 32bit on 64 bit Linux using an automake configure script?

I'm using a 64bit system but want a set of 32bit binaries. What options must I pass to a configure script to generate a 32bit/x86 makefile?
Jack Nock
  • 14,703
  • 5
  • 22
  • 18
46
votes
1 answer

Append compile flags to CFLAGS and CXXFLAGS while configuration/make

The project that I am trying to build has default flags CFLAGS = -Wall -g -O2 CXXFLAGS = -g -O2 I need to append a flag -w to both these variables (to remove: 'consider all warnings as errors') I have a method to work it out, give make…
Vigneshwaren
  • 1,273
  • 2
  • 15
  • 24
37
votes
2 answers

What is the difference between LDADD and LIBADD?

I'm trying to setup an automake project that uses a mix of libtool libraries and exectuables, and I'm having a hard time grokking the automake documentation, esp. as relates to telling the compiler to link against. So can someone explain the…
Dave
  • 7,555
  • 8
  • 46
  • 88
34
votes
2 answers

Automake error './ltmain.sh' not found

I've installed mingw and msys by using mingw-get-setup.exe. I've also installed Autotools(autoconf, automake,m4,libtool) into C:\/opt/autotools. When I run automake, the following error always occurs: configure.ac:11: error: required file…
user1345414
  • 3,745
  • 9
  • 36
  • 56
33
votes
1 answer

Any difference between configure.ac and configure.in, and Makefile.am and Makefile.in?

I have seen both in different things I have configured. What I the difference? Is it notable to use only one? Or does it not matter which one to use?
Mohit Deshpande
  • 53,877
  • 76
  • 193
  • 251
33
votes
1 answer

gcov: producing .gcda output from shared library?

Is it possible to produce gcov data files (.gcda files) by running an executable linked to a shared library built with the --coverage option? Basically, I have the main library consisting of multiple c++ files compiled into one shared library and…
deuberger
  • 3,578
  • 6
  • 31
  • 33
31
votes
7 answers

Default compiler flags with Autotools

I want to know how to set default compiler/linker/etc. flags if I use Autoconf/Automake combo. For example, the default compiler flag is "-O2 -g" if I don't set anything. I can just override it with something else, for example if I want to…
petersohn
  • 11,292
  • 13
  • 61
  • 98
29
votes
3 answers

Automake generating binaries to bin/ instead of in src/

I searched for the answer to this question but couldn't find any good. Maybe they're old and something has changed, so I ask again. I have a directory structure as: my_project src bin I want that, when I do make in the root dir, the binaries are…
Vitor Baptista
  • 2,016
  • 1
  • 23
  • 28
28
votes
1 answer

How to create a shared library (.so) in an automake script?

Given some source file test.cpp I would like to create a shared library libtest.so . I am trying to do this within the scope of an automake file however I cannot seem to get this to work. For example under g++ I do the following: g++ -shared -fPIC…
skimon
  • 1,149
  • 2
  • 13
  • 26
22
votes
1 answer

how to set include paths with autotools

I'm working on a C++ project that uses autoconf & automake, and I'm struggling to correctly set up the include paths in *CPPFLAGS. I've read about 3 hours worth of documents, and I can't figure it out yet. I'm not looking for a hack, but for the…
Matei David
  • 2,322
  • 3
  • 23
  • 36
1
2 3
72 73