GNU Make
A Program for Directing Recompilation
Edition 0.47, for
make
Version 3.72 Beta.
November 1994
Richard M. Stallman and Roland McGrath
Overview of
make
How to Read This Manual
Problems and Bugs
An Introduction to Makefiles
What a Rule Looks Like
A Simple Makefile
How
make
Processes a Makefile
Variables Make Makefiles Simpler
Letting
make
Deduce the Commands
Another Style of Makefile
Rules for Cleaning the Directory
Writing Makefiles
What Makefiles Contain
What Name to Give Your Makefile
Including Other Makefiles
The Variable
MAKEFILES
How Makefiles Are Remade
Overriding Part of Another Makefile
Writing Rules
Rule Syntax
Using Wildcard Characters in File Names
Wildcard Examples
Pitfalls of Using Wildcards
The Function
wildcard
Searching Directories for Dependencies
VPATH
: Search Path for All Dependencies
The
vpath
Directive
Writing Shell Commands with Directory Search
Directory Search and Implicit Rules
Directory Search for Link Libraries
Phony Targets
Rules without Commands or Dependencies
Empty Target Files to Record Events
Special Built-in Target Names
Multiple Targets in a Rule
Multiple Rules for One Target
Static Pattern Rules
Syntax of Static Pattern Rules
Static Pattern Rules versus Implicit Rules
Double-Colon Rules
Generating Dependencies Automatically
Writing the Commands in Rules
Command Echoing
Command Execution
Parallel Execution
Errors in Commands
Interrupting or Killing
make
Recursive Use of
make
How the
MAKE
Variable Works
Communicating Variables to a Sub-
make
Communicating Options to a Sub-
make
The
`--print-directory'
Option
Defining Canned Command Sequences
Using Empty Commands
How to Use Variables
Basics of Variable References
The Two Flavors of Variables
Advanced Features for Reference to Variables
Substitution References
Computed Variable Names
How Variables Get Their Values
Setting Variables
Appending More Text to Variables
The
override
Directive
Defining Variables Verbatim
Variables from the Environment
Conditional Parts of Makefiles
Example of a Conditional
Syntax of Conditionals
Conditionals that Test Flags
Functions for Transforming Text
Function Call Syntax
Functions for String Substitution and Analysis
Functions for File Names
The
foreach
Function
The
origin
Function
The
shell
Function
How to Run
make
Arguments to Specify the Makefile
Arguments to Specify the Goals
Instead of Executing the Commands
Avoiding Recompilation of Some Files
Overriding Variables
Testing the Compilation of a Program
Summary of Options
Using Implicit Rules
Using Implicit Rules
Catalogue of Implicit Rules
Variables Used by Implicit Rules
Chains of Implicit Rules
Defining and Redefining Pattern Rules
Introduction to Pattern Rules
Pattern Rule Examples
Automatic Variables
How Patterns Match
Match-Anything Pattern Rules
Canceling Implicit Rules
Defining Last-Resort Default Rules
Old-Fashioned Suffix Rules
Implicit Rule Search Algorithm
Using
make
to Update Archive Files
Archive Members as Targets
Implicit Rule for Archive Member Targets
Updating Archive Symbol Directories
Dangers When Using Archives
Suffix Rules for Archive Files
Features of GNU
make
Incompatibilities and Missing Features
Makefile Conventions
General Conventions for Makefiles
Utilities in Makefiles
Standard Targets for Users
Variables for Specifying Commands
Variables for Installation Directories
Quick Reference
Complex Makefile Example
Index of Concepts
Index of Functions, Variables, & Directives