1. Overview of make 1.1 How to Read This Manual 1.2 Problems and Bugs 2. An Introduction to Makefiles 2.1 What a Rule Looks Like 2.2 A Simple Makefile 2.3 How make Processes a Makefile 2.4 Variables Make Makefiles Simpler 2.5 Letting make Deduce the Commands 2.6 Another Style of Makefile 2.7 Rules for Cleaning the Directory 3. Writing Makefiles 3.1 What Makefiles Contain 3.2 What Name to Give Your Makefile 3.3 Including Other Makefiles 3.4 The Variable MAKEFILES 3.5 The Variable MAKEFILE_LIST 3.6 Other Special Variables 3.7 How Makefiles Are Remade 3.8 Overriding Part of Another Makefile 3.9 How make Reads a Makefile 4. Writing Rules 4.1 Rule Example 4.2 Rule Syntax 4.3 Types of Prerequisites 4.4 Using Wildcard Characters in File Names 4.4.1 Wildcard Examples 4.4.2 Pitfalls of Using Wildcards 4.4.3 The Function wildcard 4.5 Searching Directories for Prerequisites 4.5.1 VPATH: Search Path for All Prerequisites 4.5.2 The vpath Directive 4.5.3 How Directory Searches are Performed 4.5.4 Writing Shell Commands with Directory Search 4.5.5 Directory Search and Implicit Rules 4.5.6 Directory Search for Link Libraries 4.6 Phony Targets 4.7 Rules without Commands or Prerequisites 4.8 Empty Target Files to Record Events 4.9 Special Built-in Target Names 4.10 Multiple Targets in a Rule 4.11 Multiple Rules for One Target 4.12 Static Pattern Rules 4.12.1 Syntax of Static Pattern Rules 4.12.2 Static Pattern Rules versus Implicit Rules 4.13 Double-Colon Rules 4.14 Generating Prerequisites Automatically 5. Writing the Commands in Rules 5.1 Command Echoing 5.2 Command Execution 5.3 Parallel Execution 5.4 Errors in Commands 5.5 Interrupting or Killing make 5.6 Recursive Use of make 5.6.1 How the MAKE Variable Works 5.6.2 Communicating Variables to a Sub-make 5.6.3 Communicating Options to a Sub-make 5.6.4 The `--print-directory' Option 5.7 Defining Canned Command Sequences 5.8 Using Empty Commands 6. How to Use Variables 6.1 Basics of Variable References 6.2 The Two Flavors of Variables 6.3 Advanced Features for Reference to Variables 6.3.1 Substitution References 6.3.2 Computed Variable Names 6.4 How Variables Get Their Values 6.5 Setting Variables 6.6 Appending More Text to Variables 6.7 The override Directive 6.8 Defining Variables Verbatim 6.9 Variables from the Environment 6.10 Target-specific Variable Values 6.11 Pattern-specific Variable Values 7. Conditional Parts of Makefiles 7.1 Example of a Conditional 7.2 Syntax of Conditionals 7.3 Conditionals that Test Flags 8. Functions for Transforming Text 8.1 Function Call Syntax 8.2 Functions for String Substitution and Analysis 8.3 Functions for File Names 8.4 The foreach Function 8.5 The if Function 8.6 The call Function 8.7 The value Function 8.8 The eval Function 8.9 The origin Function 8.10 The shell Function 8.11 Functions That Control Make 9. How to Run make 9.1 Arguments to Specify the Makefile 9.2 Arguments to Specify the Goals 9.3 Instead of Executing the Commands 9.4 Avoiding Recompilation of Some Files 9.5 Overriding Variables 9.6 Testing the Compilation of a Program 9.7 Summary of Options 10. Using Implicit Rules 10.1 Using Implicit Rules 10.2 Catalogue of Implicit Rules 10.3 Variables Used by Implicit Rules 10.4 Chains of Implicit Rules 10.5 Defining and Redefining Pattern Rules 10.5.1 Introduction to Pattern Rules 10.5.2 Pattern Rule Examples 10.5.3 Automatic Variables 10.5.4 How Patterns Match 10.5.5 Match-Anything Pattern Rules 10.5.6 Canceling Implicit Rules 10.6 Defining Last-Resort Default Rules 10.7 Old-Fashioned Suffix Rules 10.8 Implicit Rule Search Algorithm 11. Using make to Update Archive Files 11.1 Archive Members as Targets 11.2 Implicit Rule for Archive Member Targets 11.2.1 Updating Archive Symbol Directories 11.3 Dangers When Using Archives 11.4 Suffix Rules for Archive Files 12. Features of GNU make 13. Incompatibilities and Missing Features 14. Makefile Conventions 14.1 General Conventions for Makefiles 14.2 Utilities in Makefiles 14.3 Variables for Specifying Commands 14.4 Variables for Installation Directories 14.5 Standard Targets for Users 14.6 Install Command Categories A. Quick Reference B. Errors Generated by Make C. Complex Makefile Example D. GNU Free Documentation License D.1 ADDENDUM: How to use this License for your documents Index of Concepts Index of Functions, Variables, & Directives
make
1.1 How to Read This Manual 1.2 Problems and Bugs
2.1 What a Rule Looks Like 2.2 A Simple Makefile 2.3 How make Processes a Makefile 2.4 Variables Make Makefiles Simpler 2.5 Letting make Deduce the Commands 2.6 Another Style of Makefile 2.7 Rules for Cleaning the Directory
3.1 What Makefiles Contain 3.2 What Name to Give Your Makefile 3.3 Including Other Makefiles 3.4 The Variable MAKEFILES 3.5 The Variable MAKEFILE_LIST 3.6 Other Special Variables 3.7 How Makefiles Are Remade 3.8 Overriding Part of Another Makefile 3.9 How make Reads a Makefile
MAKEFILES
MAKEFILE_LIST
4.1 Rule Example 4.2 Rule Syntax 4.3 Types of Prerequisites 4.4 Using Wildcard Characters in File Names 4.4.1 Wildcard Examples 4.4.2 Pitfalls of Using Wildcards 4.4.3 The Function wildcard 4.5 Searching Directories for Prerequisites 4.5.1 VPATH: Search Path for All Prerequisites 4.5.2 The vpath Directive 4.5.3 How Directory Searches are Performed 4.5.4 Writing Shell Commands with Directory Search 4.5.5 Directory Search and Implicit Rules 4.5.6 Directory Search for Link Libraries 4.6 Phony Targets 4.7 Rules without Commands or Prerequisites 4.8 Empty Target Files to Record Events 4.9 Special Built-in Target Names 4.10 Multiple Targets in a Rule 4.11 Multiple Rules for One Target 4.12 Static Pattern Rules 4.12.1 Syntax of Static Pattern Rules 4.12.2 Static Pattern Rules versus Implicit Rules 4.13 Double-Colon Rules 4.14 Generating Prerequisites Automatically
4.4.1 Wildcard Examples 4.4.2 Pitfalls of Using Wildcards 4.4.3 The Function wildcard
wildcard
4.5.1 VPATH: Search Path for All Prerequisites 4.5.2 The vpath Directive 4.5.3 How Directory Searches are Performed 4.5.4 Writing Shell Commands with Directory Search 4.5.5 Directory Search and Implicit Rules 4.5.6 Directory Search for Link Libraries
VPATH
vpath
4.12.1 Syntax of Static Pattern Rules 4.12.2 Static Pattern Rules versus Implicit Rules
5.1 Command Echoing 5.2 Command Execution 5.3 Parallel Execution 5.4 Errors in Commands 5.5 Interrupting or Killing make 5.6 Recursive Use of make 5.6.1 How the MAKE Variable Works 5.6.2 Communicating Variables to a Sub-make 5.6.3 Communicating Options to a Sub-make 5.6.4 The `--print-directory' Option 5.7 Defining Canned Command Sequences 5.8 Using Empty Commands
5.6.1 How the MAKE Variable Works 5.6.2 Communicating Variables to a Sub-make 5.6.3 Communicating Options to a Sub-make 5.6.4 The `--print-directory' Option
MAKE
6.1 Basics of Variable References 6.2 The Two Flavors of Variables 6.3 Advanced Features for Reference to Variables 6.3.1 Substitution References 6.3.2 Computed Variable Names 6.4 How Variables Get Their Values 6.5 Setting Variables 6.6 Appending More Text to Variables 6.7 The override Directive 6.8 Defining Variables Verbatim 6.9 Variables from the Environment 6.10 Target-specific Variable Values 6.11 Pattern-specific Variable Values
6.3.1 Substitution References 6.3.2 Computed Variable Names
override
7.1 Example of a Conditional 7.2 Syntax of Conditionals 7.3 Conditionals that Test Flags
8.1 Function Call Syntax 8.2 Functions for String Substitution and Analysis 8.3 Functions for File Names 8.4 The foreach Function 8.5 The if Function 8.6 The call Function 8.7 The value Function 8.8 The eval Function 8.9 The origin Function 8.10 The shell Function 8.11 Functions That Control Make
foreach
if
call
value
eval
origin
shell
9.1 Arguments to Specify the Makefile 9.2 Arguments to Specify the Goals 9.3 Instead of Executing the Commands 9.4 Avoiding Recompilation of Some Files 9.5 Overriding Variables 9.6 Testing the Compilation of a Program 9.7 Summary of Options
10.1 Using Implicit Rules 10.2 Catalogue of Implicit Rules 10.3 Variables Used by Implicit Rules 10.4 Chains of Implicit Rules 10.5 Defining and Redefining Pattern Rules 10.5.1 Introduction to Pattern Rules 10.5.2 Pattern Rule Examples 10.5.3 Automatic Variables 10.5.4 How Patterns Match 10.5.5 Match-Anything Pattern Rules 10.5.6 Canceling Implicit Rules 10.6 Defining Last-Resort Default Rules 10.7 Old-Fashioned Suffix Rules 10.8 Implicit Rule Search Algorithm
10.5.1 Introduction to Pattern Rules 10.5.2 Pattern Rule Examples 10.5.3 Automatic Variables 10.5.4 How Patterns Match 10.5.5 Match-Anything Pattern Rules 10.5.6 Canceling Implicit Rules
11.1 Archive Members as Targets 11.2 Implicit Rule for Archive Member Targets 11.2.1 Updating Archive Symbol Directories 11.3 Dangers When Using Archives 11.4 Suffix Rules for Archive Files
11.2.1 Updating Archive Symbol Directories
14.1 General Conventions for Makefiles 14.2 Utilities in Makefiles 14.3 Variables for Specifying Commands 14.4 Variables for Installation Directories 14.5 Standard Targets for Users 14.6 Install Command Categories
D.1 ADDENDUM: How to use this License for your documents