Files
2024-02-19 00:25:23 -05:00

206 lines
11 KiB
HTML

<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.54
from ../texi/make.texinfo on 19 July 2000 -->
<TITLE>GNU make - Table of Contents</TITLE>
</HEAD>
<BODY>
<H1>GNU Make</H1>
<H2>A Program for Directing Recompilation</H2>
<H2>GNU <CODE>make</CODE> Version 3.79</H2>
<H2>April 2000</H2>
<ADDRESS>Richard M. Stallman and Roland McGrath</ADDRESS>
<P>
<P><HR><P>
</P>
<P>
The GNU <CODE>make</CODE> utility automatically determines which pieces of a
large program need to be recompiled, and issues the commands to
recompile them.
</P>
<P>
This edition of the <CITE>GNU Make Manual</CITE>,
last updated 04 April 2000,
documents GNU <CODE>make</CODE> Version 3.79.
</P>
<P>
This manual describes <CODE>make</CODE> and contains the following chapters:
</P>
<UL>
<LI><A NAME="TOC1" HREF="make_1.html#SEC1">Overview of <CODE>make</CODE></A>
<UL>
<LI><A NAME="TOC2" HREF="make_1.html#SEC2">How to Read This Manual</A>
<LI><A NAME="TOC3" HREF="make_1.html#SEC3">Problems and Bugs</A>
</UL>
<LI><A NAME="TOC4" HREF="make_2.html#SEC4">An Introduction to Makefiles</A>
<UL>
<LI><A NAME="TOC5" HREF="make_2.html#SEC5">What a Rule Looks Like</A>
<LI><A NAME="TOC6" HREF="make_2.html#SEC6">A Simple Makefile</A>
<LI><A NAME="TOC7" HREF="make_2.html#SEC7">How <CODE>make</CODE> Processes a Makefile</A>
<LI><A NAME="TOC8" HREF="make_2.html#SEC8">Variables Make Makefiles Simpler</A>
<LI><A NAME="TOC9" HREF="make_2.html#SEC9">Letting <CODE>make</CODE> Deduce the Commands</A>
<LI><A NAME="TOC10" HREF="make_2.html#SEC10">Another Style of Makefile</A>
<LI><A NAME="TOC11" HREF="make_2.html#SEC11">Rules for Cleaning the Directory</A>
</UL>
<LI><A NAME="TOC12" HREF="make_3.html#SEC12">Writing Makefiles</A>
<UL>
<LI><A NAME="TOC13" HREF="make_3.html#SEC13">What Makefiles Contain</A>
<LI><A NAME="TOC14" HREF="make_3.html#SEC14">What Name to Give Your Makefile</A>
<LI><A NAME="TOC15" HREF="make_3.html#SEC15">Including Other Makefiles</A>
<LI><A NAME="TOC16" HREF="make_3.html#SEC16">The Variable <CODE>MAKEFILES</CODE></A>
<LI><A NAME="TOC17" HREF="make_3.html#SEC17">How Makefiles Are Remade</A>
<LI><A NAME="TOC18" HREF="make_3.html#SEC18">Overriding Part of Another Makefile</A>
<LI><A NAME="TOC19" HREF="make_3.html#SEC19">How <CODE>make</CODE> Reads a Makefile</A>
</UL>
<LI><A NAME="TOC20" HREF="make_4.html#SEC20">Writing Rules</A>
<UL>
<LI><A NAME="TOC21" HREF="make_4.html#SEC21">Rule Syntax</A>
<LI><A NAME="TOC22" HREF="make_4.html#SEC22">Using Wildcard Characters in File Names</A>
<UL>
<LI><A NAME="TOC23" HREF="make_4.html#SEC23">Wildcard Examples</A>
<LI><A NAME="TOC24" HREF="make_4.html#SEC24">Pitfalls of Using Wildcards</A>
<LI><A NAME="TOC25" HREF="make_4.html#SEC25">The Function <CODE>wildcard</CODE></A>
</UL>
<LI><A NAME="TOC26" HREF="make_4.html#SEC26">Searching Directories for Prerequisites</A>
<UL>
<LI><A NAME="TOC27" HREF="make_4.html#SEC27"><CODE>VPATH</CODE>: Search Path for All Prerequisites</A>
<LI><A NAME="TOC28" HREF="make_4.html#SEC28">The <CODE>vpath</CODE> Directive</A>
<LI><A NAME="TOC29" HREF="make_4.html#SEC29">How Directory Searches are Performed</A>
<LI><A NAME="TOC30" HREF="make_4.html#SEC30">Writing Shell Commands with Directory Search</A>
<LI><A NAME="TOC31" HREF="make_4.html#SEC31">Directory Search and Implicit Rules</A>
<LI><A NAME="TOC32" HREF="make_4.html#SEC32">Directory Search for Link Libraries</A>
</UL>
<LI><A NAME="TOC33" HREF="make_4.html#SEC33">Phony Targets</A>
<LI><A NAME="TOC34" HREF="make_4.html#SEC34">Rules without Commands or Prerequisites</A>
<LI><A NAME="TOC35" HREF="make_4.html#SEC35">Empty Target Files to Record Events</A>
<LI><A NAME="TOC36" HREF="make_4.html#SEC36">Special Built-in Target Names</A>
<LI><A NAME="TOC37" HREF="make_4.html#SEC37">Multiple Targets in a Rule</A>
<LI><A NAME="TOC38" HREF="make_4.html#SEC38">Multiple Rules for One Target</A>
<LI><A NAME="TOC39" HREF="make_4.html#SEC39">Static Pattern Rules</A>
<UL>
<LI><A NAME="TOC40" HREF="make_4.html#SEC40">Syntax of Static Pattern Rules</A>
<LI><A NAME="TOC41" HREF="make_4.html#SEC41">Static Pattern Rules versus Implicit Rules</A>
</UL>
<LI><A NAME="TOC42" HREF="make_4.html#SEC42">Double-Colon Rules</A>
<LI><A NAME="TOC43" HREF="make_4.html#SEC43">Generating Prerequisites Automatically</A>
</UL>
<LI><A NAME="TOC44" HREF="make_5.html#SEC44">Writing the Commands in Rules</A>
<UL>
<LI><A NAME="TOC45" HREF="make_5.html#SEC45">Command Echoing</A>
<LI><A NAME="TOC46" HREF="make_5.html#SEC46">Command Execution</A>
<LI><A NAME="TOC47" HREF="make_5.html#SEC47">Parallel Execution</A>
<LI><A NAME="TOC48" HREF="make_5.html#SEC48">Errors in Commands</A>
<LI><A NAME="TOC49" HREF="make_5.html#SEC49">Interrupting or Killing <CODE>make</CODE></A>
<LI><A NAME="TOC50" HREF="make_5.html#SEC50">Recursive Use of <CODE>make</CODE></A>
<UL>
<LI><A NAME="TOC51" HREF="make_5.html#SEC51">How the <CODE>MAKE</CODE> Variable Works</A>
<LI><A NAME="TOC52" HREF="make_5.html#SEC52">Communicating Variables to a Sub-<CODE>make</CODE></A>
<LI><A NAME="TOC53" HREF="make_5.html#SEC53">Communicating Options to a Sub-<CODE>make</CODE></A>
<LI><A NAME="TOC54" HREF="make_5.html#SEC54">The <SAMP>`--print-directory'</SAMP> Option</A>
</UL>
<LI><A NAME="TOC55" HREF="make_5.html#SEC55">Defining Canned Command Sequences</A>
<LI><A NAME="TOC56" HREF="make_5.html#SEC56">Using Empty Commands</A>
</UL>
<LI><A NAME="TOC57" HREF="make_6.html#SEC57">How to Use Variables</A>
<UL>
<LI><A NAME="TOC58" HREF="make_6.html#SEC58">Basics of Variable References</A>
<LI><A NAME="TOC59" HREF="make_6.html#SEC59">The Two Flavors of Variables</A>
<LI><A NAME="TOC60" HREF="make_6.html#SEC60">Advanced Features for Reference to Variables</A>
<UL>
<LI><A NAME="TOC61" HREF="make_6.html#SEC61">Substitution References</A>
<LI><A NAME="TOC62" HREF="make_6.html#SEC62">Computed Variable Names</A>
</UL>
<LI><A NAME="TOC63" HREF="make_6.html#SEC63">How Variables Get Their Values</A>
<LI><A NAME="TOC64" HREF="make_6.html#SEC64">Setting Variables</A>
<LI><A NAME="TOC65" HREF="make_6.html#SEC65">Appending More Text to Variables</A>
<LI><A NAME="TOC66" HREF="make_6.html#SEC66">The <CODE>override</CODE> Directive</A>
<LI><A NAME="TOC67" HREF="make_6.html#SEC67">Defining Variables Verbatim</A>
<LI><A NAME="TOC68" HREF="make_6.html#SEC68">Variables from the Environment</A>
<LI><A NAME="TOC69" HREF="make_6.html#SEC69">Target-specific Variable Values</A>
<LI><A NAME="TOC70" HREF="make_6.html#SEC70">Pattern-specific Variable Values</A>
</UL>
<LI><A NAME="TOC71" HREF="make_7.html#SEC71">Conditional Parts of Makefiles</A>
<UL>
<LI><A NAME="TOC72" HREF="make_7.html#SEC72">Example of a Conditional</A>
<LI><A NAME="TOC73" HREF="make_7.html#SEC73">Syntax of Conditionals</A>
<LI><A NAME="TOC74" HREF="make_7.html#SEC74">Conditionals that Test Flags</A>
</UL>
<LI><A NAME="TOC75" HREF="make_8.html#SEC75">Functions for Transforming Text</A>
<UL>
<LI><A NAME="TOC76" HREF="make_8.html#SEC76">Function Call Syntax</A>
<LI><A NAME="TOC77" HREF="make_8.html#SEC77">Functions for String Substitution and Analysis</A>
<LI><A NAME="TOC78" HREF="make_8.html#SEC78">Functions for File Names</A>
<LI><A NAME="TOC79" HREF="make_8.html#SEC79">The <CODE>foreach</CODE> Function</A>
<LI><A NAME="TOC80" HREF="make_8.html#SEC80">The <CODE>if</CODE> Function</A>
<LI><A NAME="TOC81" HREF="make_8.html#SEC81">The <CODE>call</CODE> Function</A>
<LI><A NAME="TOC82" HREF="make_8.html#SEC82">The <CODE>origin</CODE> Function</A>
<LI><A NAME="TOC83" HREF="make_8.html#SEC83">The <CODE>shell</CODE> Function</A>
<LI><A NAME="TOC84" HREF="make_8.html#SEC84">Functions That Control Make</A>
</UL>
<LI><A NAME="TOC85" HREF="make_9.html#SEC85">How to Run <CODE>make</CODE></A>
<UL>
<LI><A NAME="TOC86" HREF="make_9.html#SEC86">Arguments to Specify the Makefile</A>
<LI><A NAME="TOC87" HREF="make_9.html#SEC87">Arguments to Specify the Goals</A>
<LI><A NAME="TOC88" HREF="make_9.html#SEC88">Instead of Executing the Commands</A>
<LI><A NAME="TOC89" HREF="make_9.html#SEC89">Avoiding Recompilation of Some Files</A>
<LI><A NAME="TOC90" HREF="make_9.html#SEC90">Overriding Variables</A>
<LI><A NAME="TOC91" HREF="make_9.html#SEC91">Testing the Compilation of a Program</A>
<LI><A NAME="TOC92" HREF="make_9.html#SEC92">Summary of Options</A>
</UL>
<LI><A NAME="TOC93" HREF="make_10.html#SEC93">Using Implicit Rules</A>
<UL>
<LI><A NAME="TOC94" HREF="make_10.html#SEC94">Using Implicit Rules</A>
<LI><A NAME="TOC95" HREF="make_10.html#SEC95">Catalogue of Implicit Rules</A>
<LI><A NAME="TOC96" HREF="make_10.html#SEC96">Variables Used by Implicit Rules</A>
<LI><A NAME="TOC97" HREF="make_10.html#SEC97">Chains of Implicit Rules</A>
<LI><A NAME="TOC98" HREF="make_10.html#SEC98">Defining and Redefining Pattern Rules</A>
<UL>
<LI><A NAME="TOC99" HREF="make_10.html#SEC99">Introduction to Pattern Rules</A>
<LI><A NAME="TOC100" HREF="make_10.html#SEC100">Pattern Rule Examples</A>
<LI><A NAME="TOC101" HREF="make_10.html#SEC101">Automatic Variables</A>
<LI><A NAME="TOC102" HREF="make_10.html#SEC102">How Patterns Match</A>
<LI><A NAME="TOC103" HREF="make_10.html#SEC103">Match-Anything Pattern Rules</A>
<LI><A NAME="TOC104" HREF="make_10.html#SEC104">Canceling Implicit Rules</A>
</UL>
<LI><A NAME="TOC105" HREF="make_10.html#SEC105">Defining Last-Resort Default Rules</A>
<LI><A NAME="TOC106" HREF="make_10.html#SEC106">Old-Fashioned Suffix Rules</A>
<LI><A NAME="TOC107" HREF="make_10.html#SEC107">Implicit Rule Search Algorithm</A>
</UL>
<LI><A NAME="TOC108" HREF="make_11.html#SEC108">Using <CODE>make</CODE> to Update Archive Files</A>
<UL>
<LI><A NAME="TOC109" HREF="make_11.html#SEC109">Archive Members as Targets</A>
<LI><A NAME="TOC110" HREF="make_11.html#SEC110">Implicit Rule for Archive Member Targets</A>
<UL>
<LI><A NAME="TOC111" HREF="make_11.html#SEC111">Updating Archive Symbol Directories</A>
</UL>
<LI><A NAME="TOC112" HREF="make_11.html#SEC112">Dangers When Using Archives</A>
<LI><A NAME="TOC113" HREF="make_11.html#SEC113">Suffix Rules for Archive Files</A>
</UL>
<LI><A NAME="TOC114" HREF="make_12.html#SEC114">Features of GNU <CODE>make</CODE></A>
<LI><A NAME="TOC115" HREF="make_13.html#SEC115">Incompatibilities and Missing Features</A>
<LI><A NAME="TOC116" HREF="make_14.html#SEC116">Makefile Conventions</A>
<UL>
<LI><A NAME="TOC117" HREF="make_14.html#SEC117">General Conventions for Makefiles</A>
<LI><A NAME="TOC118" HREF="make_14.html#SEC118">Utilities in Makefiles</A>
<LI><A NAME="TOC119" HREF="make_14.html#SEC119">Variables for Specifying Commands</A>
<LI><A NAME="TOC120" HREF="make_14.html#SEC120">Variables for Installation Directories</A>
<LI><A NAME="TOC121" HREF="make_14.html#SEC121">Standard Targets for Users</A>
<LI><A NAME="TOC122" HREF="make_14.html#SEC122">Install Command Categories</A>
</UL>
<LI><A NAME="TOC123" HREF="make_15.html#SEC123">Quick Reference</A>
<LI><A NAME="TOC124" HREF="make_16.html#SEC124">Errors Generated by Make</A>
<LI><A NAME="TOC125" HREF="make_17.html#SEC125">Complex Makefile Example</A>
<LI><A NAME="TOC126" HREF="make_18.html#SEC126">Index of Concepts</A>
<LI><A NAME="TOC127" HREF="make_19.html#SEC127">Index of Functions, Variables, &#38; Directives</A>
</UL>
<P><HR><P>
This document was generated on 19 July 2000 using the
<A HREF="http://wwwcn.cern.ch/dci/texi2html/">texi2html</A>
translator version 1.54.</P>
</BODY>
</HTML>