1 .TH MAKE 1 "22 August 1989" "GNU" "LOCAL USER COMMANDS"
3 make \- GNU make utility to maintain groups of programs
9 ] [ options ] ... [ targets ] ...
11 This man page is an extract of the documentation of GNU
13 It is updated only occasionally, because the GNU project does not use nroff.
14 For complete, current documentation, refer to the Info file
16 which is made from the Texinfo source file
22 utility is to determine automatically which
23 pieces of a large program need to be recompiled, and issue the commands to
25 The manual describes the GNU implementation of
27 which was written by Richard Stallman and Roland McGrath, and is
28 currently maintained by Paul Smith.
29 Our examples show C programs, since they are most common, but you can use
31 with any programming language whose compiler can be run with a
35 is not limited to programs.
36 You can use it to describe any task where some files must be
37 updated automatically from others whenever the others change.
41 you must write a file called the
43 that describes the relationships among files in your program, and the
44 states the commands for updating each file.
45 In a program, typically the executable file is updated from object
46 files, which are in turn made by compiling source files.
48 Once a suitable makefile exists, each time you change some source files,
49 this simple shell command:
55 suffices to perform all necessary recompilations.
58 program uses the makefile data base and the last-modification times
59 of the files to decide which of the files need to be updated.
60 For each of those files, it issues the commands recorded in the data base.
63 executes commands in the
70 is typically a program.
75 will look for the makefiles
82 Normally you should call your makefile either
88 because it appears prominently near the beginning of a directory
89 listing, right near other important files such as
91 The first name checked,
93 is not recommended for most makefiles.
94 You should use this name if you have a makefile that is specific to GNU
96 and will not be understood by other versions of
100 is `\-', the standard input is read.
103 updates a target if it depends on prerequisite files
104 that have been modified since the target was last modified,
105 or if the target does not exist.
110 These options are ignored for compatibility with other versions of
113 .BR \-B , " \-\-always\-make"
114 Unconditionally make all targets.
116 \fB\-C\fR \fIdir\fR, \fB\-\-directory\fR=\fIdir\fR
119 before reading the makefiles or doing anything else.
122 options are specified, each is interpreted relative to the
128 This is typically used with recursive invocations of
132 Print debugging information in addition to normal processing.
133 The debugging information says which files are being considered for
134 remaking, which file-times are being compared and with what results,
135 which files actually need to be remade, which implicit rules are
136 considered and which are applied---everything interesting about how
140 .BI \-\-debug "[=FLAGS]"
141 Print debugging information in addition to normal processing.
144 are omitted, then the behavior is the same as if
150 for all debugging output (same as using
155 for more verbose basic debugging,
157 for showing implicit rules,
159 for details on invocation of commands, and
161 for debugging while remaking makefiles.
163 .BR \-e , " \-\-environment\-overrides"
164 Give variables taken from the environment precedence
165 over variables from makefiles.
167 \fB\-f\fR \fIfile\fR, \fB\-\-file\fR=\fIfile\fR, \fB\-\-makefile\fR=\fIFILE\fR
172 .BR \-i , " \-\-ignore\-errors"
173 Ignore all errors in commands executed to remake files.
175 \fB\-I\fR \fIdir\fR, \fB\-\-include\-dir\fR=\fIdir\fR
176 Specifies a directory
178 to search for included makefiles.
181 options are used to specify several directories, the directories are
182 searched in the order specified.
183 Unlike the arguments to other flags of
185 directories given with
187 flags may come directly after the flag:
189 is allowed, as well as
191 This syntax is allowed for compatibility with the C
196 \fB\-j\fR [\fIjobs\fR], \fB\-\-jobs\fR[=\fIjobs\fR]
197 Specifies the number of
199 (commands) to run simultaneously.
200 If there is more than one
202 option, the last one is effective.
205 option is given without an argument,
207 will not limit the number of jobs that can run simultaneously.
209 .BR \-k , " \-\-keep\-going"
210 Continue as much as possible after an error.
211 While the target that failed, and those that depend on it, cannot
212 be remade, the other dependencies of these targets can be processed
215 \fB\-l\fR [\fIload\fR], \fB\-\-load\-average\fR[=\fIload\fR]
216 Specifies that no new jobs (commands) should be started if there are
217 others jobs running and the load average is at least
219 (a floating-point number).
220 With no argument, removes a previous load limit.
222 .BR \-L , " \-\-check\-symlink\-times"
223 Use the latest mtime between symlinks and target.
225 .BR \-n , " \-\-just\-print" , " \-\-dry\-run" , " \-\-recon"
226 Print the commands that would be executed, but do not execute them (except in
227 certain circumstances).
229 \fB\-o\fR \fIfile\fR, \fB\-\-old\-file\fR=\fIfile\fR, \fB\-\-assume\-old\fR=\fIfile\fR
230 Do not remake the file
232 even if it is older than its dependencies, and do not remake anything
233 on account of changes in
235 Essentially the file is treated as very old and its rules are ignored.
237 .BR \-p , " \-\-print\-data\-base"
238 Print the data base (rules and variable values) that results from
239 reading the makefiles; then execute as usual or as otherwise
241 This also prints the version information given by the
244 To print the data base without trying to remake any files, use
249 .BR \-q , " \-\-question"
251 Do not run any commands, or print anything; just return an exit status
252 that is zero if the specified targets are already up to date, nonzero
255 .BR \-r , " \-\-no\-builtin\-rules"
256 Eliminate use of the built\-in implicit rules.
257 Also clear out the default list of suffixes for suffix rules.
259 .BR \-R , " \-\-no\-builtin\-variables"
260 Don't define any built\-in variables.
262 .BR \-s , " \-\-silent" , " \-\-quiet"
263 Silent operation; do not print the commands as they are executed.
265 .BR \-S , " \-\-no\-keep\-going" , " \-\-stop"
266 Cancel the effect of the
269 This is never necessary except in a recursive
273 might be inherited from the top-level
275 via MAKEFLAGS or if you set
277 in MAKEFLAGS in your environment.
279 .BR \-t , " \-\-touch"
280 Touch files (mark them up to date without really changing them)
281 instead of running their commands.
282 This is used to pretend that the commands were done, in order to fool
283 future invocations of
286 .BR \-v , " \-\-version"
287 Print the version of the
289 program plus a copyright, a list of authors and a notice that there
292 .BR \-w , " \-\-print\-directory"
293 Print a message containing the working directory
294 before and after other processing.
295 This may be useful for tracking down errors from complicated nests of
300 .B \-\-no\-print\-directory
303 even if it was turned on implicitly.
305 \fB\-W\fR \fIfile\fR, \fB\-\-what\-if\fR=\fIfile\fR, \fB\-\-new\-file\fR=\fIfile\fR, \fB\-\-assume\-new\fR=\fIfile\fR
306 Pretend that the target
308 has just been modified.
311 flag, this shows you what would happen if you were to modify that file.
314 it is almost the same as running a
316 command on the given file before running
318 except that the modification time is changed only in the imagination of
321 .B \-\-warn\-undefined\-variables
322 Warn when an undefined variable is referenced.
326 exits with a status of zero if all makefiles were successfully parsed
327 and no targets that were built failed. A status of one will be returned
332 determines that a target needs to be rebuilt. A status of two will be
333 returned if any errors were encountered.
335 .I "The GNU Make Manual"
337 See the chapter `Problems and Bugs' in
338 .IR "The GNU Make Manual" .
340 This manual page contributed by Dennis Morse of Stanford University.
341 It has been reworked by Roland McGrath. Further updates contributed by
344 Copyright (C) 1992, 1993, 1996, 1999, 2007 Free Software Foundation, Inc.
345 This file is part of GNU
348 GNU Make is free software; you can redistribute it and/or modify it under the
349 terms of the GNU General Public License as published by the Free Software
350 Foundation; either version 3 of the License, or (at your option) any later
353 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
354 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
355 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
357 You should have received a copy of the GNU General Public License along with
358 this program. If not, see
359 .IR http://www.gnu.org/licenses/ .