\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}{9} \secentry {Including Other Makefiles}{3}{3}{10} \secentry {The Variable \code {MAKEFILES}}{3}{4}{11} \secentry {How Makefiles Are Remade}{3}{5}{11} \secentry {Overriding Part of Another Makefile}{3}{6}{13} \chapentry {Writing Rules}{4}{15} \secentry {Rule Syntax}{4}{1}{15} \secentry {Using Wildcard Characters in File Names}{4}{2}{16} \subsecentry {Wildcard Examples}{4}{2}{1}{16} \subsecentry {Pitfalls of Using Wildcards}{4}{2}{2}{17} \subsecentry {The Function \code {wildcard}}{4}{2}{3}{17} \secentry {Searching Directories for Dependencies}{4}{3}{18} \subsecentry {\code {VPATH}: Search Path for All Dependencies}{4}{3}{1}{18} \subsecentry {The \code {vpath} Directive}{4}{3}{2}{19} \subsecentry {How Directory Searches are Performed}{4}{3}{3}{20} \subsecentry {Writing Shell Commands with Directory Search}{4}{3}{4}{21} \subsecentry {Directory Search and Implicit Rules}{4}{3}{5}{21} \subsecentry {Directory Search for Link Libraries}{4}{3}{6}{21} \secentry {Phony Targets}{4}{4}{22} \secentry {Rules without Commands or Dependencies}{4}{5}{23} \secentry {Empty Target Files to Record Events}{4}{6}{24} \secentry {Special Built-in Target Names}{4}{7}{24} \secentry {Multiple Targets in a Rule}{4}{8}{26} \secentry {Multiple Rules for One Target}{4}{9}{26} \secentry {Static Pattern Rules}{4}{10}{27} \subsecentry {Syntax of Static Pattern Rules}{4}{10}{1}{27} \subsecentry {Static Pattern Rules versus Implicit Rules}{4}{10}{2}{29} \secentry {Double-Colon Rules}{4}{11}{29} \secentry {Generating Dependencies Automatically}{4}{12}{30} \chapentry {Writing the Commands in Rules}{5}{33} \secentry {Command Echoing}{5}{1}{33} \secentry {Command Execution}{5}{2}{33} \secentry {Parallel Execution}{5}{3}{35} \secentry {Errors in Commands}{5}{4}{36} \secentry {Interrupting or Killing \code {make}}{5}{5}{37} \secentry {Recursive Use of \code {make}}{5}{6}{37} \subsecentry {How the \code {MAKE} Variable Works}{5}{6}{1}{38} \subsecentry {Communicating Variables to a Sub-\code {make}}{5}{6}{2}{38} \subsecentry {Communicating Options to a Sub-\code {make}}{5}{6}{3}{40} \subsecentry {The \samp {--print-directory} Option}{5}{6}{4}{42} \secentry {Defining Canned Command Sequences}{5}{7}{42} \secentry {Using Empty Commands}{5}{8}{43} \chapentry {How to Use Variables}{6}{45} \secentry {Basics of Variable References}{6}{1}{45} \secentry {The Two Flavors of Variables}{6}{2}{46} \secentry {Advanced Features for Reference to Variables}{6}{3}{48} \subsecentry {Substitution References}{6}{3}{1}{48} \subsecentry {Computed Variable Names}{6}{3}{2}{49} \secentry {How Variables Get Their Values}{6}{4}{51} \secentry {Setting Variables}{6}{5}{51} \secentry {Appending More Text to Variables}{6}{6}{52} \secentry {The \code {override} Directive}{6}{7}{53} \secentry {Defining Variables Verbatim}{6}{8}{54} \secentry {Variables from the Environment}{6}{9}{55} \secentry {Target-specific Variable Values}{6}{10}{55} \secentry {Pattern-specific Variable Values}{6}{11}{56} \chapentry {Conditional Parts of Makefiles}{7}{59} \secentry {Example of a Conditional}{7}{1}{59} \secentry {Syntax of Conditionals}{7}{2}{60} \secentry {Conditionals that Test Flags}{7}{3}{62} \chapentry {Functions for Transforming Text}{8}{63} \secentry {Function Call Syntax}{8}{1}{63} \secentry {Functions for String Substitution and Analysis}{8}{2}{64} \secentry {Functions for File Names}{8}{3}{66} \secentry {The \code {foreach} Function}{8}{4}{69} \secentry {The \code {origin} Function}{8}{5}{70} \secentry {The \code {shell} Function}{8}{6}{71} \chapentry {How to Run \code {make}}{9}{73} \secentry {Arguments to Specify the Makefile}{9}{1}{73} \secentry {Arguments to Specify the Goals}{9}{2}{73} \secentry {Instead of Executing the Commands}{9}{3}{75} \secentry {Avoiding Recompilation of Some Files}{9}{4}{76} \secentry {Overriding Variables}{9}{5}{77} \secentry {Testing the Compilation of a Program}{9}{6}{77} \secentry {Summary of Options}{9}{7}{78} \chapentry {Using Implicit Rules}{10}{83} \secentry {Using Implicit Rules}{10}{1}{83} \secentry {Catalogue of Implicit Rules}{10}{2}{84} \secentry {Variables Used by Implicit Rules}{10}{3}{87} \secentry {Chains of Implicit Rules}{10}{4}{89} \secentry {Defining and Redefining Pattern Rules}{10}{5}{90} \subsecentry {Introduction to Pattern Rules}{10}{5}{1}{90} \subsecentry {Pattern Rule Examples}{10}{5}{2}{91} \subsecentry {Automatic Variables}{10}{5}{3}{92} \subsecentry {How Patterns Match}{10}{5}{4}{94} \subsecentry {Match-Anything Pattern Rules}{10}{5}{5}{94} \subsecentry {Canceling Implicit Rules}{10}{5}{6}{95} \secentry {Defining Last-Resort Default Rules}{10}{6}{96} \secentry {Old-Fashioned Suffix Rules}{10}{7}{96} \secentry {Implicit Rule Search Algorithm}{10}{8}{98} \chapentry {Using \code {make} to Update Archive Files}{11}{101} \secentry {Archive Members as Targets}{11}{1}{101} \secentry {Implicit Rule for Archive Member Targets}{11}{2}{101} \subsecentry {Updating Archive Symbol Directories}{11}{2}{1}{102} \secentry {Dangers When Using Archives}{11}{3}{102} \secentry {Suffix Rules for Archive Files}{11}{4}{103} \chapentry {Features of GNU \code {make}}{12}{105} \chapentry {Incompatibilities and Missing Features}{13}{109} \chapentry {Makefile Conventions}{14}{111} \secentry {General Conventions for Makefiles}{14}{1}{111} \secentry {Utilities in Makefiles}{14}{2}{112} \secentry {Variables for Specifying Commands}{14}{3}{113} \secentry {Variables for Installation Directories}{14}{4}{114} \secentry {Standard Targets for Users}{14}{5}{117} \secentry {Install Command Categories}{14}{6}{121} \chapentry {Quick Reference}{Appendix{} \char65}{123} \chapentry {Errors Generated by Make}{Appendix{} \char66}{129} \chapentry {Complex Makefile Example}{Appendix{} \char67}{131} \unnumbchapentry {Index of Concepts}{137} \unnumbchapentry {Index of Functions, Variables, & Directives}{145}