The Unix make utility was designed to automate the building of executable files from source code files. It is especially useful in projects where changes are made to different source code files and in projects that need to build or maintain different versions of an executable system. GNU make is a widely used implementation of the original design, and very likely will remain so for years to come. This book is an expert, detailed review of the features and facilities of make, together with superb advice on how to get the most benefits from it.
The files used to store the instructions that control an execution of make are known as makefiles. Although simple makefiles are easy to understand and simple to create, subtleties, complexities, and power are lurking just beneath the surface, and even very short files can be challenging to understand and difficult to debug. Also, makefiles for complex systems can run into the hundreds of lines. So, the need for a thorough understanding and eagle-eyed dissection of minutiae is paramount. This book is a huge help in that respect.
This is not an elementary introduction to make. Graham-Cumming assumes that the reader is proficient in the basics. If not, the reader would be well advised to become proficient at that level as soon as possible, since otherwise large portions of the book, and the benefits that can be derived from it, may remain out of reach. Physically, the book is rather small: 235 pages of subject matter (including an 11-page index) and 16 pages of introductory material (including the preface and table of contents). Intellectually, however, the book is hefty, and reading it, unless you are already a make expert, is slow going indeed. The book is not hard to read; in fact, just the opposite: it is very well written and easy to read. The material, however, is hard to digest. But to go beyond the apprentice level, the material needs to be digested. So, reading this book will likely be a slow process. The rewards, though, can be immense.
The book’s six chapters address the basics, debugging makefiles, building/rebuilding, pitfalls and problem solving, pushing the envelope of make, and the GNU Make Standard Library (GMSL). The five-page “Contents in Detail” may well be more useful than the index once the reader becomes familiar with the book and is looking for specific information.
One of the outstanding features of the book is the pedagogical technique the author uses throughout. As expected, he includes code of sample makefiles, which are mostly very small and include the minimum information relevant to the discussion. When needed, these makefiles are annotated with line numbers; line numbers guide the accompanying detailed explanation of the content. The content, in turn, is explained not just line by line, but component by component within a line if needed. In addition, the result of running the makefile on appropriate input is given explicitly, so the reader never has to guess the outcome. Under such careful guidance, I often found that makefile code that initially appeared impenetrable soon became crystal clear.
The book covers a great deal of ground. I found chapter 2, on debugging makefiles, the most interesting and useful. Depending on the reader’s current interests and needs, one may find that the climax of the book lies somewhere else. But I would not be surprised if the reader prefers one section now, another one in the future. If one really wants to think outside the box, one may want to dig into chapter 5, “Pushing the Envelope,” where Graham-Cumming shows how to extend make by connecting it to external routines written in C or Guile, and taking make into territory that even the author acknowledges it was not designed for.
Many developers will find this book to be a welcome addition to their basic reference set, and will turn to it again and again in the future. I found the book impressive and recommend it highly.
More reviews about this item: Amazon