GNU Make Reference Manual
For GNU Make Version 4.1
The Make program is indispensable to maintainers of free software systems. The GNU Make manual, written by the program's original authors, is the definitive tutorial. It also includes an introductory chapter for novice users. The Make utility automates the process of compilation; it is especially useful when the source files of large programs change. It is a small program with a lot of power.
This book will show you:
- How to write your own makefiles
- Make's rule syntax and how to write your own rules
- How the Make utility can be configured to automatically put binary and source files in the right places.
- How to use make to create archive files automatically
- Define, set and use Make's variables
- How Make uses targets so that you can broaden or narrow Make's recompilation efforts on demand.
- And much more!
Why Read This Book
You will learn how to wield GNU Make as the backbone of reproducible, efficient build systems for firmware, embedded Linux, and cross-compiled toolchains — directly from the tool’s original author. This manual is both a practical tutorial for writing working makefiles and an authoritative reference to master rules, variables, functions, and portability issues so your builds scale cleanly as projects grow.
Who Will Benefit
Embedded/firmware engineers, build and release engineers, and systems integrators who need reliable, portable build automation for cross-compilation, embedded Linux images, or complex multi-language projects.
Level: Intermediate — Prerequisites: Familiarity with the command line, basic software compilation concepts (how source files become binaries), and a working knowledge of C/C++ or other compiled languages; shell scripting experience is helpful but not required.
Key Takeaways
- Write robust makefiles using explicit rules, pattern rules, and implicit rules to automate compilation and linking across targets
- Manage variables, automatic variables, and functions to create configurable, reusable build recipes and cross-compilation flows
- Optimize and parallelize builds safely (including use of .PHONY, order-only prerequisites, and -j) to reduce CI and local build times
- Debug and diagnose makefile behavior using tracing, debugging options, and remaking strategies to resolve dependency issues and rebuild correctness
- Integrate make into larger workflows: create archives, install targets, include files, and interact with toolchains used for embedded Linux, Buildroot/Yocto, and firmware packaging
Topics Covered
- Introduction and Overview of GNU Make
- Invoking Make: Command-Line Options and Environment
- How Make Reads Makefiles and Remakes Targets
- Rules and Recipes: Writing Explicit and Implicit Rules
- Variables: Definitions, Assignment Forms, and Overrides
- Automatic Variables, Functions, and Text Manipulation
- Pattern Rules, Suffix Rules, and Implicit Rule Mechanisms
- Special Targets (.PHONY, .DEFAULT, .PRECIOUS) and Order-Only Prerequisites
- Directives and Conditionals: include, ifeq/ifneq, and shell evaluation
- Remaking Makefiles, Debugging, and Diagnostics
- Parallel Execution, Jobserver, and Portability Considerations
- Installing, Archiving, and Interaction with Toolchains
- Advanced Topics: Custom Functions, Recursive Make, and Integration with Other Build Systems
- Appendices: Compatibility Notes, Built-in Rules, and Reference Index
Languages, Platforms & Tools
How It Compares
Compared with O'Reilly’s 'Managing Projects with GNU Make' which is more example-driven, Stallman’s GNU Make Reference Manual is the definitive, authoritative specification and reference for GNU Make behaviors and edge cases.













