VirtualBox

source: kBuild/vendor/gnumake/2005-05-16/make.1@ 501

Last change on this file since 501 was 54, checked in by (none), 21 years ago

This commit was manufactured by cvs2svn to create branch 'GNU'.

  • Property svn:eol-style set to native
File size: 7.3 KB
Line 
1.TH MAKE 1L "22 August 1989" "GNU" "LOCAL USER COMMANDS"
2.SH NAME
3make \- GNU make utility to maintain groups of programs
4.SH SYNOPSIS
5.B "make "
6[
7.B \-f
8.I makefile
9] [ option ] ...
10target ...
11.SH WARNING
12This man page is an extract of the documentation of
13.I GNU make .
14It is updated only occasionally, because the GNU project does not use nroff.
15For complete, current documentation, refer to the Info file
16.B make.info
17which is made from the Texinfo source file
18.BR make.texinfo .
19.SH DESCRIPTION
20.LP
21The purpose of the
22.I make
23utility is to determine automatically which
24pieces of a large program need to be recompiled, and issue the commands to
25recompile them.
26The manual describes the GNU implementation of
27.IR make ,
28which was written by Richard Stallman and Roland McGrath.
29Our examples show C programs, since they are most common, but you can use
30.I make
31with any programming language whose compiler can be run with a
32shell command.
33In fact,
34.I make
35is not limited to programs.
36You can use it to describe any task where some files must be
37updated automatically from others whenever the others change.
38.LP
39To prepare to use
40.IR make ,
41you must write a file called the
42.I makefile
43that describes the relationships among files in your program, and the
44states the commands for updating each file.
45In a program, typically the executable file is updated from object
46files, which are in turn made by compiling source files.
47.LP
48Once a suitable makefile exists, each time you change some source files,
49this simple shell command:
50.sp 1
51.RS
52.B make
53.RE
54.sp 1
55suffices to perform all necessary recompilations.
56The
57.I make
58program uses the makefile data base and the last-modification times
59of the files to decide which of the files need to be updated.
60For each of those files, it issues the commands recorded in the data base.
61.LP
62.I make
63executes commands in the
64.I makefile
65to update
66one or more target
67.IR names ,
68where
69.I name
70is typically a program.
71If no
72.B \-f
73option is present,
74.I make
75will look for the makefiles
76.IR GNUmakefile ,
77.IR makefile ,
78and
79.IR Makefile ,
80in that order.
81.LP
82Normally you should call your makefile either
83.I makefile
84or
85.IR Makefile .
86(We recommend
87.I Makefile
88because it appears prominently near the beginning of a directory
89listing, right near other important files such as
90.IR README .)
91The first name checked,
92.IR GNUmakefile ,
93is not recommended for most makefiles.
94You should use this name if you have a makefile that is specific to GNU
95.IR make ,
96and will not be understood by other versions of
97.IR make .
98If
99.I makefile
100is `\-', the standard input is read.
101.LP
102.I make
103updates a target if it depends on prerequisite files
104that have been modified since the target was last modified,
105or if the target does not exist.
106.SH OPTIONS
107.sp 1
108.TP 0.5i
109.B \-b
110.TP 0.5i
111.B \-m
112These options are ignored for compatibility with other versions of
113.IR make .
114.TP 0.5i
115.BI "\-C " dir
116Change to directory
117.I dir
118before reading the makefiles or doing anything else.
119If multiple
120.B \-C
121options are specified, each is interpreted relative to the
122previous one:
123.BR "\-C " /
124.BR "\-C " etc
125is equivalent to
126.BR "\-C " /etc.
127This is typically used with recursive invocations of
128.IR make .
129.TP 0.5i
130.B \-d
131Print debugging information in addition to normal processing.
132The debugging information says which files are being considered for
133remaking, which file-times are being compared and with what results,
134which files actually need to be remade, which implicit rules are
135considered and which are applied---everything interesting about how
136.I make
137decides what to do.
138.TP 0.5i
139.B \-e
140Give variables taken from the environment precedence
141over variables from makefiles.
142.TP 0.5i
143.BI "\-f " file
144Use
145.I file
146as a makefile.
147.TP 0.5i
148.B \-i
149Ignore all errors in commands executed to remake files.
150.TP 0.5i
151.BI "\-I " dir
152Specifies a directory
153.I dir
154to search for included makefiles.
155If several
156.B \-I
157options are used to specify several directories, the directories are
158searched in the order specified.
159Unlike the arguments to other flags of
160.IR make ,
161directories given with
162.B \-I
163flags may come directly after the flag:
164.BI \-I dir
165is allowed, as well as
166.BI "\-I " dir.
167This syntax is allowed for compatibility with the C
168preprocessor's
169.B \-I
170flag.
171.TP 0.5i
172.BI "\-j " jobs
173Specifies the number of jobs (commands) to run simultaneously.
174If there is more than one
175.B \-j
176option, the last one is effective.
177If the
178.B \-j
179option is given without an argument,
180.IR make
181will not limit the number of jobs that can run simultaneously.
182.TP 0.5i
183.B \-k
184Continue as much as possible after an error.
185While the target that failed, and those that depend on it, cannot
186be remade, the other dependencies of these targets can be processed
187all the same.
188.TP 0.5i
189.B \-l
190.TP 0.5i
191.BI "\-l " load
192Specifies that no new jobs (commands) should be started if there are
193others jobs running and the load average is at least
194.I load
195(a floating-point number).
196With no argument, removes a previous load limit.
197.TP 0.5i
198.B \-n
199Print the commands that would be executed, but do not execute them.
200.TP 0.5i
201.BI "\-o " file
202Do not remake the file
203.I file
204even if it is older than its dependencies, and do not remake anything
205on account of changes in
206.IR file .
207Essentially the file is treated as very old and its rules are ignored.
208.TP 0.5i
209.B \-p
210Print the data base (rules and variable values) that results from
211reading the makefiles; then execute as usual or as otherwise
212specified.
213This also prints the version information given by the
214.B \-v
215switch (see below).
216To print the data base without trying to remake any files, use
217.B make
218.B \-p
219.BI \-f /dev/null.
220.TP 0.5i
221.B \-q
222``Question mode''.
223Do not run any commands, or print anything; just return an exit status
224that is zero if the specified targets are already up to date, nonzero
225otherwise.
226.TP 0.5i
227.B \-r
228Eliminate use of the built-in implicit rules.
229Also clear out the default list of suffixes for suffix rules.
230.TP 0.5i
231.B \-s
232Silent operation; do not print the commands as they are executed.
233.TP 0.5i
234.B \-S
235Cancel the effect of the
236.B \-k
237option.
238This is never necessary except in a recursive
239.I make
240where
241.B \-k
242might be inherited from the top-level
243.I make
244via MAKEFLAGS or if you set
245.B \-k
246in MAKEFLAGS in your environment.
247.TP 0.5i
248.B \-t
249Touch files (mark them up to date without really changing them)
250instead of running their commands.
251This is used to pretend that the commands were done, in order to fool
252future invocations of
253.IR make .
254.TP 0.5i
255.B \-v
256Print the version of the
257.I make
258program plus a copyright, a list of authors and a notice that there
259is no warranty.
260.TP 0.5i
261.B \-w
262Print a message containing the working directory
263before and after other processing.
264This may be useful for tracking down errors from complicated nests of
265recursive
266.I make
267commands.
268.TP 0.5i
269.BI "\-W " file
270Pretend that the target
271.I file
272has just been modified.
273When used with the
274.B \-n
275flag, this shows you what would happen if you were to modify that file.
276Without
277.BR \-n ,
278it is almost the same as running a
279.I touch
280command on the given file before running
281.IR make ,
282except that the modification time is changed only in the imagination of
283.IR make .
284.SH "SEE ALSO"
285.I "The GNU Make Manual"
286.SH BUGS
287See the chapter `Problems and Bugs' in
288.I "The GNU Make Manual" .
289.SH AUTHOR
290This manual page contributed by Dennis Morse of Stanford University.
291It has been reworked by Roland McGrath.
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette