\chapentry{Overview of \code {make}}{1}{1} \secentry{How to Read This Manual}{1}{1}{1} \secentry{Problems and Bugs}{1}{2}{1} \chapentry{An Introduction to Makefiles}{2}{3} \secentry{What a Rule Looks Like}{2}{1}{3} \secentry{A Simple Makefile}{2}{2}{4} \secentry{How \code {make} Processes a Makefile}{2}{3}{5} \secentry{Variables Make Makefiles Simpler}{2}{4}{6} \secentry{Letting \code {make} Deduce the Commands}{2}{5}{7} \secentry{Another Style of Makefile}{2}{6}{7} \secentry{Rules for Cleaning the Directory}{2}{7}{8} \chapentry{Writing Makefiles}{3}{9} \secentry{What Makefiles Contain}{3}{1}{9} \secentry{What Name to Give Your Makefile}{3}{2}{10} \secentry{Including Other Makefiles}{3}{3}{10} \secentry{The Variable \code {MAKEFILES}}{3}{4}{11} \secentry{The Variable \code {MAKEFILE_LIST}}{3}{5}{12} \secentry{Other Special Variables}{3}{6}{12} \secentry{How Makefiles Are Remade}{3}{7}{12} \secentry{Overriding Part of Another Makefile}{3}{8}{14} \secentry{How \code {make} Reads a Makefile}{3}{9}{14} \chapentry{Writing Rules}{4}{17} \secentry{Rule Syntax}{4}{1}{17} \secentry{Types of Prerequisites}{4}{2}{18} \secentry{Using Wildcard Characters in File Names}{4}{3}{18} \subsecentry{Wildcard Examples}{4}{3}{1}{19} \subsecentry{Pitfalls of Using Wildcards}{4}{3}{2}{19} \subsecentry{The Function \code {wildcard}}{4}{3}{3}{20} \secentry{Searching Directories for Prerequisites}{4}{4}{20} \subsecentry{\code {VPATH}: Search Path for All Prerequisites}{4}{4}{1}{21} \subsecentry{The \code {vpath} Directive}{4}{4}{2}{21} \subsecentry{How Directory Searches are Performed}{4}{4}{3}{22} \subsecentry{Writing Shell Commands with Directory Search}{4}{4}{4}{23} \subsecentry{Directory Search and Implicit Rules}{4}{4}{5}{23} \subsecentry{Directory Search for Link Libraries}{4}{4}{6}{24} \secentry{Phony Targets}{4}{5}{24} \secentry{Rules without Commands or Prerequisites}{4}{6}{27} \secentry{Empty Target Files to Record Events}{4}{7}{27} \secentry{Special Built-in Target Names}{4}{8}{27} \secentry{Multiple Targets in a Rule}{4}{9}{30} \secentry{Multiple Rules for One Target}{4}{10}{30} \secentry{Static Pattern Rules}{4}{11}{31} \subsecentry{Syntax of Static Pattern Rules}{4}{11}{1}{31} \subsecentry{Static Pattern Rules versus Implicit Rules}{4}{11}{2}{33} \secentry{Double-Colon Rules}{4}{12}{33} \secentry{Generating Prerequisites Automatically}{4}{13}{34} \chapentry{Writing the Commands in Rules}{5}{37} \secentry{Command Echoing}{5}{1}{37} \secentry{Command Execution}{5}{2}{37} \secentry{Parallel Execution}{5}{3}{39} \secentry{Errors in Commands}{5}{4}{40} \secentry{Interrupting or Killing \code {make}}{5}{5}{41} \secentry{Recursive Use of \code {make}}{5}{6}{41} \subsecentry{How the \code {MAKE} Variable Works}{5}{6}{1}{42} \subsecentry{Communicating Variables to a Sub-\code {make}}{5}{6}{2}{42} \subsecentry{Communicating Options to a Sub-\code {make}}{5}{6}{3}{44} \subsecentry{The \samp {--print-directory} Option}{5}{6}{4}{46} \secentry{Defining Canned Command Sequences}{5}{7}{46} \secentry{Using Empty Commands}{5}{8}{47} \chapentry{How to Use Variables}{6}{49} \secentry{Basics of Variable References}{6}{1}{49} \secentry{The Two Flavors of Variables}{6}{2}{50} \secentry{Advanced Features for Reference to Variables}{6}{3}{52} \subsecentry{Substitution References}{6}{3}{1}{52} \subsecentry{Computed Variable Names}{6}{3}{2}{53} \secentry{How Variables Get Their Values}{6}{4}{55} \secentry{Setting Variables}{6}{5}{55} \secentry{Appending More Text to Variables}{6}{6}{56} \secentry{The \code {override} Directive}{6}{7}{57} \secentry{Defining Variables Verbatim}{6}{8}{58} \secentry{Variables from the Environment}{6}{9}{59} \secentry{Target-specific Variable Values}{6}{10}{59} \secentry{Pattern-specific Variable Values}{6}{11}{60} \chapentry{Conditional Parts of Makefiles}{7}{61} \secentry{Example of a Conditional}{7}{1}{61} \secentry{Syntax of Conditionals}{7}{2}{62} \secentry{Conditionals that Test Flags}{7}{3}{64} \chapentry{Functions for Transforming Text}{8}{65} \secentry{Function Call Syntax}{8}{1}{65} \secentry{Functions for String Substitution and Analysis}{8}{2}{66} \secentry{Functions for File Names}{8}{3}{69} \secentry{The \code {foreach} Function}{8}{4}{71} \secentry{The \code {if} Function}{8}{5}{72} \secentry{The \code {call} Function}{8}{6}{72} \secentry{The \code {value} Function}{8}{7}{73} \secentry{The \code {eval} Function}{8}{8}{74} \secentry{The \code {origin} Function}{8}{9}{75} \secentry{The \code {shell} Function}{8}{10}{76} \secentry{Functions That Control Make}{8}{11}{77} \chapentry{How to Run \code {make}}{9}{79} \secentry{Arguments to Specify the Makefile}{9}{1}{79} \secentry{Arguments to Specify the Goals}{9}{2}{79} \secentry{Instead of Executing the Commands}{9}{3}{81} \secentry{Avoiding Recompilation of Some Files}{9}{4}{82} \secentry{Overriding Variables}{9}{5}{83} \secentry{Testing the Compilation of a Program}{9}{6}{83} \secentry{Summary of Options}{9}{7}{84} \chapentry{Using Implicit Rules}{10}{89} \secentry{Using Implicit Rules}{10}{1}{89} \secentry{Catalogue of Implicit Rules}{10}{2}{90} \secentry{Variables Used by Implicit Rules}{10}{3}{93} \secentry{Chains of Implicit Rules}{10}{4}{95} \secentry{Defining and Redefining Pattern Rules}{10}{5}{96} \subsecentry{Introduction to Pattern Rules}{10}{5}{1}{97} \subsecentry{Pattern Rule Examples}{10}{5}{2}{97} \subsecentry{Automatic Variables}{10}{5}{3}{98} \subsecentry{How Patterns Match}{10}{5}{4}{100} \subsecentry{Match-Anything Pattern Rules}{10}{5}{5}{101} \subsecentry{Canceling Implicit Rules}{10}{5}{6}{102} \secentry{Defining Last-Resort Default Rules}{10}{6}{102} \secentry{Old-Fashioned Suffix Rules}{10}{7}{103} \secentry{Implicit Rule Search Algorithm}{10}{8}{104} \chapentry{Using \code {make} to Update Archive Files}{11}{107} \secentry{Archive Members as Targets}{11}{1}{107} \secentry{Implicit Rule for Archive Member Targets}{11}{2}{107} \subsecentry{Updating Archive Symbol Directories}{11}{2}{1}{108} \secentry{Dangers When Using Archives}{11}{3}{108} \secentry{Suffix Rules for Archive Files}{11}{4}{109} \chapentry{Features of GNU \code {make}}{12}{111} \chapentry{Incompatibilities and Missing Features}{13}{115} \chapentry{Makefile Conventions}{14}{117} \secentry{General Conventions for Makefiles}{14}{1}{117} \secentry{Utilities in Makefiles}{14}{2}{118} \secentry{Variables for Specifying Commands}{14}{3}{119} \secentry{Variables for Installation Directories}{14}{4}{120} \secentry{Standard Targets for Users}{14}{5}{123} \secentry{Install Command Categories}{14}{6}{127} \appendixentry{Quick Reference}{A}{131} \appendixentry{Errors Generated by Make}{B}{137} \appendixentry{Complex Makefile Example}{C}{141} \appendixentry{GNU Free Documentation License}{D}{147} \secentry{ADDENDUM: How to use this License for your documents}{D}{1}{153} \unnumbchapentry{Index of Concepts}{155} \unnumbchapentry{Index of Functions, Variables, & Directives}{163}