📄 0310-0311.html
字号:
<HTML>
<HEAD>
<TITLE>Linux Complete Command Reference:User Commands:EarthWeb Inc.-</TITLE>
</HEAD>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!-- ISBN=0672311046 //-->
<!-- TITLE=Linux Complete Command Reference//-->
<!-- AUTHOR=Red Hat//-->
<!-- PUBLISHER=Macmillan Computer Publishing//-->
<!-- IMPRINT=Sams//-->
<!-- CHAPTER=01 //-->
<!-- PAGES=0001-0736 //-->
<!-- UNASSIGNED1 //-->
<!-- UNASSIGNED2 //-->
<P><CENTER>
<a href="0308-0309.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0312-0313.html">Next</A></CENTER></P>
<A NAME="PAGENUM-310"><P>Page 310</P></A>
<P><B>SEE ALSO</B></P>
<!-- CODE SNIP //-->
<PRE>picttoppm(1), pbmtomacp(1), pbm(5)
</PRE>
<!-- END CODE SNIP //-->
<P><B>AUTHOR</B></P>
<P>Copyright " 1988 by Jef Poskanzer. The MacPaint-reading code is copyright
" 1987 by Patrick J. Naughton
(naughton@wind.sun.com).
</P>
<P>29 March 1989
</P>
<H3><A NAME="ch01_ 157">
make
</A></H3>
<P>make—GNU make utility to maintain groups of programs
</P>
<P><B>SYNOPSIS</B></P>
<!-- CODE SNIP //-->
<PRE>make [ _f makefile ] [ option ] ... target ...
</PRE>
<!-- END CODE SNIP //-->
<P><B>Warning</B></P>
<P>This man page is an extract of the documentation of GNU
make. It is updated only occasionally because the GNU
project does not use nroff. For complete, current documentation, refer to the
info file make or the DVI file make.dvi, which are made from the
texinfo source file make.texinfo.
</P>
<P><B>DESCRIPTION</B></P>
<P>The purpose of the make utility is to determine automatically which pieces of a large program need to be recompiled,
and issue the commands to recompile them. This manual page describes the GNU implementation of
make, which was written by Richard Stallman and Roland McGrath. Our EXAMPLES show C programs because they are most common, but you can
use make with any programming language whose compiler can be run with a shell command. In fact,
make is not limited to programs. You can use it to describe any task where some FILES must be updated automatically from others whenever
the others change.
</P>
<P>To prepare to use make, you must write a file called the
makefile that describes the relationships among FILES in your
program and states the commands for updating each file. In a program, typically, the executable file is updated from object
FILES, which are in turn made by compiling source FILES.
</P>
<P>Once a suitable makefile exists, each time you change some source FILES, this simple shell command:
</P>
<!-- CODE SNIP //-->
<PRE>make
</PRE>
<!-- END CODE SNIP //-->
<P>suffices to perform all necessary recompilations. The
make program uses the makefile database and the last-modification
times of the FILES to decide which of the FILES need to be updated. For each of those FILES, it issues the commands recorded in
the database.
</P>
<P>make executes commands in the makefile to update one or more target
names, where name is typically a program. If no _f
option is present, make will look for the makeFILES
GNU-makefile, makefile, and Makefile, in that order.
</P>
<P>Normally you should call your makefile either
makefile or Makefile. (We recommend Makefile because it appears
prominently near the beginning of a directory listing, right near other important FILES such as
README.) The first name checked, GNUmakefile, is not recommended for most makeFILES. You should use this name if you have a makefile that is specific
to GNU make, and will not be understood by other versions of
make. If makefile is _, the standard input is read.
</P>
<P>make updates a target if it depends on prerequisite FILES that have been modified since the target was last modified, or if
the target does not exist.
</P>
<A NAME="PAGENUM-311"><P>Page 311</P></A>
<P><B>OPTIONS</B></P>
<TABLE>
<TR><TD>
-b, _m
</TD><TD>
These OPTIONS are ignored for compatibility with other versions of
make.
</TD></TR><TR><TD>
_C dir
</TD><TD>
Change to directory dir before reading the makeFILES or doing anything else. If multiple
_C OPTIONS are specified, each is interpreted relative to the previous one:
_C / _C etc is equivalent to _C /etc. This is typically used
with recursive invocations of make.
</TD></TR><TR><TD>
_d
</TD><TD>
Print debugging information in addition to normal processing. The debugging information says which FILES
are being considered for remaking, which file times are being compared and with what results, which FILES
actually need to be remade, which implicit rules are considered and which are applied—everything interesting about
how make decides what to do.
</TD></TR><TR><TD>
_e
</TD><TD>
Give variables taken from the ENVIRONMENT precedence over variables from makeFILES.
</TD></TR><TR><TD>
_f file
</TD><TD>
Use file as a makefile.
</TD></TR><TR><TD>
_i
</TD><TD>
Ignore all errors in commands executed to remake FILES.
</TD></TR><TR><TD>
_I dir
</TD><TD>
Specifies a directory dir to search for included makeFILES. If several
_I OPTIONS are used to specify several directories, the directories are searched in the order specified. Unlike the arguments to other flags of
make, directories given with _I flags may come directly after the flag:
_Idir is allowed, as well as _I dir. This syntax is allowed
for compatibility with the C preprocessor's _I flag.
</TD></TR><TR><TD>
_j jobs
</TD><TD>
Specifies the number of jobs (commands) to run simultaneously. If there is more than one
_j option, the last one is effective. If the _j option is given without an argument,
make will not limit the number of jobs that can
run simultaneously.
</TD></TR><TR><TD>
_k
</TD><TD>
Continue as much as possible after an error. Although the target that failed, and those that depend on it,
cannot be remade, the other dependencies of these targets can be processed all the same.
</TD></TR><TR><TD>
-l,
</TD><TD>
Specifies that no new jobs (commands) should be started if there are other jobs running and the load average is at
</TD></TR><TR><TD>
_l load
</TD><TD>
least load (a floating-point number). With no argument, removes a previous load limit.
</TD></TR><TR><TD>
_n
</TD><TD>
Print the commands that would be executed, but do not execute them.
</TD></TR><TR><TD>
_o file
</TD><TD>
Do not remake the file file even if it is older than its dependencies, and do not remake anything because
of changes in file. Essentially, the file is treated as very old and its rules are ignored.
</TD></TR><TR><TD>
_p
</TD><TD>
Print the database (rules and variable values) that results from reading the makeFILES; then execute as usual or
as otherwise specified. This also prints the version information given by the
_v switch (see below). To print the database without trying to remake any FILES, use
make _p _f/dev/null.
</TD></TR><TR><TD>
_q
</TD><TD>
Question mode. Do not run any commands or print anything; just return an exit status that is zero if the
specified targets are already up-to-date, nonzero otherwise.
</TD></TR><TR><TD>
_r
</TD><TD>
Eliminate use of the built-in implicit rules. Also clear out the default list of suffixes for suffix rules.
</TD></TR><TR><TD>
_s
</TD><TD>
Silent operation; do not print the commands as they are executed.
</TD></TR><TR><TD>
_S
</TD><TD>
Cancel the effect of the _k option. This is never necessary except in a recursive make where
_k might be inherited from the top-level make via
MAKEFLAGS or if you set _k in MAKEFLAGS in your ENVIRONMENT.
</TD></TR><TR><TD>
_t
</TD><TD>
Touch FILES (mark them up-to-date without really changing them) instead of running their commands. This
is used to pretend that the commands were done, in order to fool future invocations of
make.
</TD></TR><TR><TD>
_v
</TD><TD>
Print the version of the make program plus a copyright, a list of AUTHORs, and a notice that there is no
warranty. After this information is printed, processing continues normally. To get this information without doing
anything else, use make _v _f/dev/null.
</TD></TR><TR><TD>
_w
</TD><TD>
Print a message containing the working directory before and after other processing. This may be useful
for tracking down errors from complicated nests of recursive
make commands.
</TD></TR><TR><TD>
_W file
</TD><TD>
Pretend that the target file has just been modified. When used with the
_n flag, this shows you what would happen if you were to modify that file. Without
_n, it is almost the same as running a touch command on
the given file before running make, except that the modification time is changed only in the imagination of
make.
</TD></TR></TABLE>
<P><B>SEE ALSO</B></P>
<!-- CODE SNIP //-->
<PRE>/usr/local/doc/gnumake.dvi
</PRE>
<!-- END CODE SNIP //-->
<P>The GNU Make Manual
</P>
<P><CENTER>
<a href="0308-0309.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0312-0313.html">Next</A></CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -