automake
Generate Makefiles from `configure.ac`
SYNOPSIS
automake [OPTION]... [TEMPLATE]...
Common usage:
automake [--add-missing] [--foreign] [--gnu] [directory]
PARAMETERS
--add-missing
Automatically adds any missing standard GNU files (e.g., install-sh, missing, mkinstalldirs) required by the generated Makefile.in.
--foreign
Relaxes the strict GNU coding standards enforcement. This allows automake to generate Makefiles for packages that do not fully conform to GNU standards.
--gnu
Enforces strict GNU coding standards. This is the default behavior if neither --foreign nor --gnits is specified.
--amdir=directory
Specifies an alternative directory where automake should look for its data files (e.g., standard Makefile snippets).
--copy
When creating generated files, automake will copy them instead of creating symbolic links. This can be useful in environments where symlinks are problematic.
--force
Forces automake to regenerate the output files (Makefile.in, etc.) even if they appear to be up-to-date. Useful for ensuring a clean regeneration.
--no-force
Prevents automake from regenerating output files if they are already up-to-date. This is the default behavior, often used with build systems that manage dependencies.
--verbose
Prints more detailed messages about the operations automake is performing, which can be helpful for debugging.
--warnings=category
Controls the types of warnings issued by automake. category can be 'all', 'none', or a comma-separated list of specific warning types.
--help
Displays a brief help message summarizing automake's options and exits.
--version
Prints the version information of automake and exits.
DESCRIPTION
automake is a fundamental tool within the GNU Build System (Autotools) designed to automate the generation of Makefile.in files from simpler Makefile.am input files. Its primary goal is to streamline the process of creating portable Makefiles that adhere to GNU coding standards, making software easier to compile across various Unix-like systems. It works in conjunction with autoconf, which handles system configuration. Developers write a high-level Makefile.am specifying the components of their project (source files, headers, libraries, executables, etc.), and automake interprets this to produce a Makefile.in. This intermediate file is then processed by the configure script (generated by autoconf) to create the final system-specific Makefile. By abstracting away much of the complexity of manual Makefile writing, automake helps ensure consistency, portability, and adherence to established build practices for open-source projects.
CAVEATS
While automake significantly simplifies Makefile creation for portable software, it is part of the larger Autotools suite, which can present a steep learning curve. Mastering the entire toolchain (autoconf, automake, libtool, etc.) requires understanding their intricate interactions. The generated Makefiles can be extensive and complex, making direct debugging challenging without a solid grasp of Autotools' underlying mechanisms. For very small or simple projects, the initial overhead of setting up and managing Autotools might be considered disproportionate to the benefits.
TYPICAL AUTOTOOLS WORKFLOW WITH AUTOMAKE
The standard workflow for using automake within the Autotools suite typically involves several steps to prepare a project for compilation:
1. Create configure.ac (for autoconf) and Makefile.am files for your project.
2. Run aclocal to generate aclocal.m4 from your m4 macros.
3. Run autoconf to generate the primary configure script.
4. Run automake to process your Makefile.am files and generate Makefile.in files.
5. Optionally, run libtoolize if your project utilizes libtool for shared library management.
6. Finally, users of your software will execute ./configure in the build directory, followed by make to compile and install the project.
MAKEFILE.AM: THE INPUT
The Makefile.am file is the crucial input to automake. It provides a high-level, human-readable description of the project's structure, specifying components like source files, executables, libraries, data files, and their intended installation paths using a simplified and consistent syntax. automake then takes this compact definition and expands it into a comprehensive Makefile.in. This generated file includes all the intricate rules required for compilation, linking, installation, distribution (e.g., `make dist`), and cleanup, ensuring strict adherence to GNU standards. This abstraction layer is a key feature that makes automake a powerful tool for maintaining highly portable and standard-compliant software projects.
HISTORY
automake is an integral component of the GNU Build System, popularly known as Autotools, which began its development in the early 1990s. Its primary motivation was to standardize and simplify the arduous process of compiling software across diverse Unix-like operating systems. Developed to complement autoconf, automake specifically addressed the complexity inherent in writing and maintaining portable Makefiles. Before automake, developers often had to manually craft complex Makefile.in files filled with numerous conditional statements. automake revolutionized this by abstracting the process, allowing developers to define their build rules in a much simpler Makefile.am format. This format is then intelligently translated into the appropriate Makefile.in, strictly adhering to GNU coding standards. Its continuous evolution underscores its importance in fostering robust and portable software development within the open-source ecosystem.
SEE ALSO
autoconf(1), aclocal(1), make(1), libtool(1), autoreconf(1)