📄 ch20_02.htm
字号:
<html><head><title>Command-Line Syntax (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="ch20_01.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_03.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0" /></a></td></tr></table></div><h2 class="sect1">20.2. Command-Line Syntax</h2><blockquote><pre class="code">make [<em class="replaceable"><tt>options</em>] [<em class="replaceable">targets</em>] [<em class="replaceable">macro definitions</tt></em>]</pre></blockquote><a name="IXT-20-123605" /><p>Options, targets, and macro definitions can appear in any order.Macro definitions are typed as:</p><blockquote><pre class="code"><em class="replaceable"><tt>name</em>=<em class="replaceable">string</tt></em></pre></blockquote><p>If no <tt class="literal">makefile</tt> or<tt class="literal">Makefile</tt>exists, <tt class="literal">make</tt> will attempt toextract the most recent version of one from an SCCS file, if one exists.(Some versions also know about RCS.)</p><a name="unut-ch-20-sect-2.1" /><div class="sect2"><h3 class="sect2">20.2.1. Options</h3><dl><dt><tt class="literal">-e</tt></dt><dd>Environment variables override any macros defined in description files.</p></dd><dt><tt class="literal">-f</tt> <tt><em class="replaceable">file</em></tt></dt><dd>Use <em class="emphasis">file</em></tt> as the description file; a filenameof <tt class="literal">-</tt> denotes standard input.<tt class="literal">-f</tt> can be used more than once to concatenatemultiple description files.With no <tt class="literal">-f</tt> option, <tt class="literal">make</tt> firstlooks for a file named <tt class="literal">makefile</tt>,and then one named <tt class="literal">Makefile</tt>.</p></dd><dt><tt class="literal">-i</tt></dt><dd>Ignore error codes from commands (same as <tt class="literal">.IGNORE</tt>).</p></dd><dt><tt class="literal">-k</tt></dt><dd>Abandon the current target when it fails, but keep working with unrelated targets.</p></dd><dt><tt class="literal">-n</tt></dt><dd>Print commands but don't execute (used for testing).<tt class="literal">-n</tt> prints commands even if theybegin with <tt class="literal">@</tt> in the description file.</p><p>Lines that begin with <tt class="literal">$(MAKE)</tt> are anexception.Such lines <em class="emphasis">are</em></tt> executed. However, since the<tt class="literal">-n</tt> is passed to the subsequent <tt class="literal">make</tt>in the MAKEFLAGS environment variable, that <tt class="literal">make</tt>also just prints the commands it executes.This allows you to test out all the <tt class="literal">makefile</tt>files in a whole software hierarchy without actually doing anything.</p></dd><dt><tt class="literal">-p</tt></dt><dd>Print macro definitions, suffixes, and target descriptions. </p></dd><dt><tt class="literal">-q</tt></dt><dd>Query; return 0 if file is up to date; nonzero otherwise. </p></dd><dt><tt class="literal">-r</tt></dt><dd>Do not use the default rules.</p></dd><dt><tt class="literal">-s</tt></dt><dd>Do not display commandlines (same as <tt class="literal">.SILENT</tt>).</p></dd><dt><tt class="literal">-t</tt></dt><dd>Touch the target files, causing them to be updated.</p></dd></dl></div><hr width="684" align="left" /><div class="navbar"><table width="684" border="0"><tr><td align="left" valign="top" width="228"><a href="ch20_01.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_03.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0" /></a></td></tr><tr><td align="left" valign="top" width="228">20. The make Utility</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.3. Description File Lines</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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -