A PRIMER ON THE MAKE UTILITY
In the modern world of Integrated Development Environments, we
forget what really goes into compiling a large code project. This
article should be a refresher on (or teach for the first time) the
basics of makefiles, the most underrated part of any code project.
In a compiled language, the makefile is arguably the most important part of any programming project. To compile your project, you first have to compile each source file into an
object file, which in turn needs to be
linked with system libraries into the
final executable file. Each command
can have a considerable number of
arguments added in. That’s a lot of
typing and a lot of potential for mistakes.
The more source files you have, the
more complex the compilation process
becomes, unless you use makefiles.
Most Linux users have at least a cursory
knowledge of make and makefiles
(because that’s how we build software
packages for our systems), but not
much more than that. Most developers
probably don’t have too much in-depth
experience with makefiles, because
most Integrated Development
Environments (IDEs) have the capability
76 | SEPTEMBER 2011 WWW.LINUXJOURNAL.COM
of managing makefiles for them.
Although this is convenient most of
the time, knowing more about how make
works and what goes into makefiles
can help you troubleshoot compilation
errors down the road.