101
C
HAPTER
4
Using GNU
make
ll serious software projects are built in pieces by many developers.
These pieces consist of source code and header files, libraries and
different tools. To combine these pieces into a product is a process com-
monly known as a
build
. The GNU
make
utility is one of the many avail-
able utilities used to build these software projects. Large software projects
often have hundreds and even thousands of files. Compiling these files
and linking them into final executable product files is done by a careful
and well-defined automated process. This automated process, also known
as the
software build
process, is controlled by the
make
utility through
makefiles
. The
make
utility reads one or more of these makefiles contain-
ing information about how to build a project. Makefiles contain different
types of information, including variables, control structures and rules to
compile and link source files, build libraries and so on. In the most com-
mon makefiles, rules are present to remove object and executable files
from the source code directory to clean it up, if required. These rules are
enforced based upon time stamps on different files. For example, if an
existing object file is newer than the corresponding source code file, it is
not recompiled. However if the object file is older than the source file, it
shows that someone modified the source file after the object file was last
built. In such a case,
make
detects it and rebuilds the object file. Depend-
ing upon the requirements of a project, someone can create different types
of rules and commands to build software projects.
A
Next Page >>
<< Previous Page
Back to the Table of Contents