autotools automake - What are and

tutorial example (5)

These two files are mostly seen in open source projects.

What are they for, and how do they work?


DEVELOPER runs these:

1) autoconf - creates shippable configure script (which the installer will run to make the Makefile)
2) automake - creates shippable (which configure will later read to make the Makefile)

INSTALLER runs these:

1) ./configure - creates the Makefile (from
2) make - creates the application (from the Makefile just created).
3) sudo make install - installs the application - By default the files are (often) installed into /usr/local.


DEVELOPER runs these: -> autoconf -> configure (script) <---- Note! is depreciated. -> autoconf -> configure (script) <---- Now use / (*.ac = autoconf) -> automake -> / (*.am = automake)

INSTALLER runs these: -> configure -> Makefile (*.in = input file)

Makefile -> make -> (the new software in your downloads or temporary directory)
Makefile -> make install -> (puts new software in system directory)

"Autoconf is an extensible package of M4 macros that produce shell scripts to automatically configure software source code packages. These scripts can adapt the packages to many kinds of UNIX-like systems without manual user intervention. Autoconf creates a configuration script for a package from a template file that lists the operating system features that the package can use, in the form of M4 macro calls."

"Automake is a tool for automatically generating files compliant with the GNU Coding Standards. Automake requires the use of Autoconf."


Interesting facts:
The main used to build LibreOffice is over 12k lines of code, (but there are also 57 other files in subfolders.)
From this my generated configure is over 41k lines of code.
While the and Makefile are both only 493 lines of code.
(But, there are also 768 more's in subfolders.) is a programmer-defined file and is used by automake to generate the file (the .am stands for automake). The configure script typically seen in source tarballs will use the to generate a Makefile.

The configure script itself is generated from a programmer-defined file named either or (deprecated). I prefer .ac (for autoconf) since it differentiates it from the generated files and that way I can have rules such as make dist-clean which runs rm -f *.in. Since it is a generated file, it is not typically stored in a revision system such as Git, SVN, Mercurial or CVS, rather the .ac file would be.

Read more on GNU Autotools. Read about make and Makefile first, then learn about automake, autoconf, libtool, etc.

Simple example

Shamelessly adapted from: and tested on Ubuntu 14.04 Automake 1.14.1.

dist_doc_DATA =

Some doc.

AC_INIT([automake_hello_world], [1.0], [[email protected]])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])


bin_PROGRAMS = autotools_hello_world
autotools_hello_world_SOURCES = main.c


#include <config.h>
#include <stdio.h>

int main (void) {
  puts ("Hello world from " PACKAGE_STRING);
  return 0;


autoreconf --install
mkdir build
cd build
sudo make install
sudo make uninstall

This outputs:

Hello world from automake_hello_world 1.0


  • autoreconf --install generates several template files which should be tracked by Git, including It only needs to be run the first time.

  • make install installs:

    • the binary to /usr/local/bin
    • to /usr/local/share/doc/automake_hello_world

On GitHub for you to try it out.

reference : -- a user input file to automake -- a user input file to autoconf

autoconf generates configure from

automake gererates from

configure generates Makefile from

For ex:

$] sudo autoconf
configure ... 
$] sudo ./configure
Makefile is probably to be used with automake.



you might also just want to try

make -f

Since this is the product of running automake

makefile autotools automake