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