automake: GNU Build System
1
1 2.1 Introducing the GNU Build System
1 ====================================
1
1 It is a truth universally acknowledged, that as a developer in
1 possession of a new package, you must be in want of a build system.
1
1 In the Unix world, such a build system is traditionally achieved
1 using the command ‘make’ (⇒Overview (make)Top.). You express the
1 recipe to build your package in a ‘Makefile’. This file is a set of
1 rules to build the files in the package. For instance the program
1 ‘prog’ may be built by running the linker on the files ‘main.o’,
1 ‘foo.o’, and ‘bar.o’; the file ‘main.o’ may be built by running the
1 compiler on ‘main.c’; etc. Each time ‘make’ is run, it reads
1 ‘Makefile’, checks the existence and modification time of the files
1 mentioned, decides what files need to be built (or rebuilt), and runs
1 the associated commands.
1
1 When a package needs to be built on a different platform than the one
1 it was developed on, its ‘Makefile’ usually needs to be adjusted. For
1 instance the compiler may have another name or require more options. In
1 1991, David J. MacKenzie got tired of customizing ‘Makefile’ for the 20
1 platforms he had to deal with. Instead, he handcrafted a little shell
11 script called ‘configure’ to automatically adjust the ‘Makefile’ (⇒
Genesis (autoconf)Genesis.). Compiling his package was now as simple
1 as running ‘./configure && make’.
1
1 Today this process has been standardized in the GNU project. The GNU
11 Coding Standards (⇒The Release Process (standards)Managing
Releases.) explains how each package of the GNU project should have a
1 ‘configure’ script, and the minimal interface it should have. The
1 ‘Makefile’ too should follow some established conventions. The result?
1 A unified build system that makes all packages almost indistinguishable
1 by the installer. In its simplest scenario, all the installer has to do
1 is to unpack the package, run ‘./configure && make && make install’, and
1 repeat with the next package to install.
1
1 We call this build system the “GNU Build System”, since it was grown
1 out of the GNU project. However it is used by a vast number of other
1 packages: following any existing convention has its advantages.
1
1 The Autotools are tools that will create a GNU Build System for your
1 package. Autoconf mostly focuses on ‘configure’ and Automake on
1 ‘Makefile’s. It is entirely possible to create a GNU Build System
1 without the help of these tools. However it is rather burdensome and
1 error-prone. We will discuss this again after some illustration of the
1 GNU Build System in action.
1