ch20_01.htm
来自「unix基础教程」· HTM 代码 · 共 89 行
HTM
89 行
<html><head><title>The make Utility (UNIX in a Nutshell: System V Edition)</title><link rel="stylesheet" type="text/css" href="../style/style1.css" /><meta name="DC.Creator" content="Arnold Robbins" /><meta name="DC.Format" content="text/xml" scheme="MIME" /><meta name="DC.Language" content="en-US" /><meta name="DC.Publisher" content="O'Reilly & Associates, Inc." /><meta name="DC.Source" scheme="ISBN" content="1-56592-427-4" /><meta name="DC.Subject.Keyword" content="stuff" /><meta name="DC.Title" content="UNIX in a Nutshell: System V Edition" /><meta name="DC.Type" content="Text.Monograph" /></head><body bgcolor="#ffffff"><img src="gifs/smbanner.gif" usemap="#banner-map" border="0" alt="Book Home" /><map name="banner-map"><area shape="rect" coords="1,-2,616,66" href="index.htm" alt="Book Title" /><area shape="rect" coords="629,-11,726,25" href="jobjects/fsearch.htm" alt="Search this book" /></map><div class="navbar"><table width="684" border="0"><tr><td align="left" valign="top" width="228"><a href="ch19_05.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0" /></a></td><td align="center" valign="top" width="228" /><td align="right" valign="top" width="228"><a href="ch20_02.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0" /></a></td></tr></table></div><h1 class="chapter">Chapter 20. The make Utility</h1><div class="htmltoc"><h4 class="tochead">Contents:</h4><p><a href="ch20_01.htm#sect1">Conceptual Overview</a><br /><a href="ch20_02.htm">Command-Line Syntax</a><br /><a href="ch20_03.htm">Description File Lines</a><br /><a href="ch20_04.htm">Macros</a><br /><a href="ch20_05.htm">Special Target Names</a><br /><a href="ch20_06.htm">Writing Command Lines</a><br /><a href="ch20_07.htm">Sample Default Macros, Suffixes, and Rules</a><br /></p></div><p><a name="unut-ch-20-ix-make-utility" />This chapter presents the following topics:</p><ul><li><p>Conceptual overview</p></li><li><p>Command-line syntax</p></li><li><p>Description file lines</p></li><li><p>Macros</p></li><li><p>Special target names</p></li><li><p>Writing command lines</p></li><li><p>Sample default macros, suffixes, and rules</p></li></ul><p>For more information, see<em class="citetitle">Managing Projects with make</em>, listed in the <a href="biblio.htm">Bibliography</a>.</p><div class="sect1"><a name="unut-ch-20-sect-1" /><h2 class="sect1"><a name="sect1" />20.1. Conceptual Overview</h2><p>The <tt class="literal">make</tt> program generates a sequence of commands forexecution by the Unix shell. It uses a table of file dependenciesprovided by the programmer, and, with this information, can performupdating tasks automatically for the user. It can keep track of thesequence of commands that create certain files, and the list of filesor programs that require other files to be current before they canoperate efficiently. When a program is changed, <tt class="literal">make</tt> cancreate the proper files with a minimum of effort.</p><p>Each statement of a dependency is called a <em class="emphasis">rule</em>.Rules define one or more <em class="emphasis">targets</em>, which are thefiles to be generated, and the files they depend upon, the<em class="emphasis">prerequisites</em> or <em class="emphasis">dependencies</em>.For example, <tt class="literal">prog.o</tt> would be a target thatdepends upon <tt class="literal">prog.c</tt>; each time you update<tt class="literal">prog.c</tt>, <tt class="literal">prog.o</tt> must beregenerated.It is this task that <tt class="literal">make</tt> automates, and it is acriticalone for large programs that have many pieces.</p><p>This chapter covers the SVR4 <tt class="literal">make</tt>.Many Unix vendors have enhanced <tt class="literal">make</tt> indifferent, and often incompatible, ways.Check your local documentation for the final word.</p><p>On Solaris, <tt class="literal">/usr/lib/svr4.make</tt>is the generic SVR4 version of <tt class="literal">make</tt>.If you set USE_SVR4_MAKE in the environment,<tt class="literal">/usr/ccs/bin/make</tt> or<tt class="literal">/usr/xpg4/bin/make</tt> runsthis version.</p></div><hr width="684" align="left" /><div class="navbar"><table width="684" border="0"><tr><td align="left" valign="top" width="228"><a href="ch19_05.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0" /></a></td><td align="center" valign="top" width="228"><a href="index.htm"><img src="../gifs/txthome.gif" alt="Home" border="0" /></a></td><td align="right" valign="top" width="228"><a href="ch20_02.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0" /></a></td></tr><tr><td align="left" valign="top" width="228">19.5. Alphabetical Summary of Commands</td><td align="center" valign="top" width="228"><a href="index/index.htm"><img src="../gifs/index.gif" alt="Book Index" border="0" /></a></td><td align="right" valign="top" width="228">20.2. Command-Line Syntax</td></tr></table></div><hr width="684" align="left" /><img src="../gifs/navbar.gif" usemap="#library-map" border="0" alt="Library Navigation Links" /><p><p><font size="-1"><a href="copyrght.htm">Copyright © 2003</a> O'Reilly & Associates. All rights reserved.</font></p><map name="library-map"><area shape="rect" coords="1,0,88,96" href="../index.htm"><area shape="rect" coords="90,0,165,96" href="../upt/index.htm"><area shape="rect" coords="168,1,253,107" href="../mac/index.htm"><area shape="rect" coords="255,0,335,97" href="../korn/index.htm"><area shape="rect" coords="337,0,415,109" href="../unixnut/index.htm"><area shape="rect" coords="417,0,512,122" href="../sedawk/index.htm"><area shape="rect" coords="514,0,605,105" href="../lunix/index.htm"><area shape="rect" coords="611,2,694,121" href="../vi/index.htm"> </map></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?