GNU Automake is a programming tool that produces portable makefiles for use by the make program, used in compiling software. It is made by the Free Software Foundation as one of GNU programs, and is part of the GNU build system . The makefiles produced follow the GNU Coding Standards .
It is written in the Perl programming language and must be used with GNU autoconf . Automake contains the following commands:
aclocal , however, is a general-purpose program that can be useful to autoconf users. The GNU Compiler Collection , for example, uses aclocal even though its makefile is hand written.
Like Autoconf, Automake can be quite hard to deal with because it is not entirely backwards compatible . For example, a project created with automake 1.4 will not necessarily work with automake 1.9.
Automake aims to allow the programmer to write a makefile in a higher-level language, rather than having to write the whole makefile manually. In simple cases, it suffices to give:
From this information, Automake generates a makefile that allows the user to:
Dependency generation
Automake also takes care of automatically generating[ 1] the dependency information, so that when a source file is modified, the next invocation of the make command will know which source files need to be recompiled. If the compiler allows it, Automake tries to make the dependency system dynamic: whenever a source file is compiled, that file's dependencies are updated by asking the compiler to regenerate the file's dependency list. In other words, dependency tracking is a side effect of the compilation process.
This attempts to avoid the problem with some static dependency systems, where the dependencies are detected only once when the programmer starts working on the project.[ 2] In such a case, if a source file gains a new dependency (e.g., if the programmer adds a new #include directive in a C source file), then a discrepancy is introduced between the real dependencies and those that are used by the compilation system. The programmer should then regenerate the dependencies, but runs the risk of forgetting to do so.
In the general case, automake generates dependencies via the bundled depcomp script, which will invoke the compiler appropriately or fall back to makedepend . If the compiler is a sufficiently recent version of gcc , however, automake will inline the dependency generation code to call gcc directly.
Libtool
Automake can also help with the compilation of libraries by automatically generating makefiles that will invoke GNU Libtool . The programmer is thus exempted from having to know how to call Libtool directly, and the project benefits from the use of a portable library creation tool.