1MAKE(1)                          User Commands                         MAKE(1)
2
3
4

NAME

6       make - GNU make utility to maintain groups of programs
7

SYNOPSIS

9       make [OPTION]... [TARGET]...
10

DESCRIPTION

12       The  make  utility will determine automatically which pieces of a large
13       program need to be recompiled, and  issue  the  commands  to  recompile
14       them.   The  manual describes the GNU implementation of make, which was
15       written by Richard Stallman and Roland McGrath, and is currently  main‐
16       tained  by  Paul  Smith.   Our examples show C programs, since they are
17       very common, but you can use make with any programming  language  whose
18       compiler can be run with a shell command.  In fact, make is not limited
19       to programs.  You can use it to describe any task where some files must
20       be updated automatically from others whenever the others change.
21
22       To  prepare to use make, you must write a file called the makefile that
23       describes the relationships among files in your program, and the states
24       the  commands for updating each file.  In a program, typically the exe‐
25       cutable file is updated from object files, which are in  turn  made  by
26       compiling source files.
27
28       Once  a  suitable  makefile  exists,  each  time you change some source
29       files, this simple shell command:
30
31              make
32
33       suffices to perform all necessary  recompilations.   The  make  program
34       uses  the  makefile  description and the last-modification times of the
35       files to decide which of the files need to be  updated.   For  each  of
36       those files, it issues the commands recorded in the makefile.
37
38       make  executes  commands  in  the makefile to update one or more target
39       names, where name is typically a program.  If no -f option is  present,
40       make  will  look for the makefiles GNUmakefile, makefile, and Makefile,
41       in that order.
42
43       Normally you should call your makefile  either  makefile  or  Makefile.
44       (We  recommend  Makefile because it appears prominently near the begin‐
45       ning of a directory listing, right near other important files  such  as
46       README.)   The  first name checked, GNUmakefile, is not recommended for
47       most makefiles.  You should use this name if you have a  makefile  that
48       is  specific  to GNU make, and will not be understood by other versions
49       of make.  If makefile is '-', the standard input is read.
50
51       make updates a target if it depends on  prerequisite  files  that  have
52       been modified since the target was last modified, or if the target does
53       not exist.
54

OPTIONS

56       -b, -m
57            These options are ignored for compatibility with other versions of
58            make.
59
60       -B, --always-make
61            Unconditionally make all targets.
62
63       -C dir, --directory=dir
64            Change to directory dir before reading the makefiles or doing any‐
65            thing else.  If multiple -C options are specified, each is  inter‐
66            preted  relative to the previous one: -C / -C etc is equivalent to
67            -C /etc.  This is typically used  with  recursive  invocations  of
68            make.
69
70       -d   Print debugging information in addition to normal processing.  The
71            debugging information says which files are  being  considered  for
72            remaking,  which  file-times  are  being  compared  and  with what
73            results, which files actually need to be  remade,  which  implicit
74            rules  are considered and which are applied---everything interest‐
75            ing about how make decides what to do.
76
77       --debug[=FLAGS]
78            Print debugging information in addition to normal processing.   If
79            the  FLAGS are omitted, then the behavior is the same as if -d was
80            specified.  FLAGS may be a for all debugging output (same as using
81            -d),  b for basic debugging, v for more verbose basic debugging, i
82            for showing implicit rules, j for details on  invocation  of  com‐
83            mands,  and  m  for  debugging while remaking makefiles.  Use n to
84            disable all previous debugging flags.
85
86       -e, --environment-overrides
87            Give variables taken from the environment  precedence  over  vari‐
88            ables from makefiles.
89
90       -E string, --eval string
91            Interpret string using the eval function, before parsing any make‐
92            files.
93
94       -f file, --file=file, --makefile=FILE
95            Use file as a makefile.
96
97       -i, --ignore-errors
98            Ignore all errors in commands executed to remake files.
99
100       -I dir, --include-dir=dir
101            Specifies a directory dir to search for  included  makefiles.   If
102            several  -I  options  are used to specify several directories, the
103            directories are searched in the order specified.  Unlike the argu‐
104            ments  to other flags of make, directories given with -I flags may
105            come directly after the flag: -Idir is allowed, as well as -I dir.
106            This syntax is allowed for compatibility with the C preprocessor's
107            -I flag.
108
109       -j [jobs], --jobs[=jobs]
110            Specifies the number of jobs (commands) to run simultaneously.  If
111            there  is  more than one -j option, the last one is effective.  If
112            the -j option is given without an argument, make  will  not  limit
113            the number of jobs that can run simultaneously.
114
115       -k, --keep-going
116            Continue  as  much  as  possible after an error.  While the target
117            that failed, and those that depend on it, cannot  be  remade,  the
118            other dependencies of these targets can be processed all the same.
119
120       -l [load], --load-average[=load]
121            Specifies  that  no new jobs (commands) should be started if there
122            are others jobs running and the load average is at least  load  (a
123            floating-point number).  With no argument, removes a previous load
124            limit.
125
126       -L, --check-symlink-times
127            Use the latest mtime between symlinks and target.
128
129       -n, --just-print, --dry-run, --recon
130            Print the commands that would be executed, but do not execute them
131            (except in certain circumstances).
132
133       -o file, --old-file=file, --assume-old=file
134            Do not remake the file file even if it is older than its dependen‐
135            cies, and do not remake anything on account of  changes  in  file.
136            Essentially  the  file  is  treated  as very old and its rules are
137            ignored.
138
139       -O[type], --output-sync[=type]
140            When running multiple jobs in parallel with -j, ensure the  output
141            of  each  job  is collected together rather than interspersed with
142            output from other jobs.  If type is not specified or is target the
143            output from the entire recipe for each target is grouped together.
144            If type is line the output from each command line within a  recipe
145            is  grouped  together.   If  type is recurse output from an entire
146            recursive make is grouped together.  If type is none  output  syn‐
147            chronization is disabled.
148
149       -p, --print-data-base
150            Print  the data base (rules and variable values) that results from
151            reading the makefiles; then execute as usual or as otherwise spec‐
152            ified.   This  also prints the version information given by the -v
153            switch (see below).  To print the  data  base  without  trying  to
154            remake any files, use make -p -f/dev/null.
155
156       -q, --question
157            ``Question  mode''.   Do  not run any commands, or print anything;
158            just return an exit status that is zero if the  specified  targets
159            are already up to date, nonzero otherwise.
160
161       -r, --no-builtin-rules
162            Eliminate  use of the built-in implicit rules.  Also clear out the
163            default list of suffixes for suffix rules.
164
165       -R, --no-builtin-variables
166            Don't define any built-in variables.
167
168       -s, --silent, --quiet
169            Silent operation; do not print the commands as they are executed.
170
171       --no-silent
172            Cancel the effect of the -s option.
173
174       -S, --no-keep-going, --stop
175            Cancel the effect of the -k option.
176
177       -t, --touch
178            Touch files (mark them up to date without  really  changing  them)
179            instead  of  running their commands.  This is used to pretend that
180            the commands were done, in order to  fool  future  invocations  of
181            make.
182
183       --trace
184            Information  about  the disposition of each target is printed (why
185            the target is being rebuilt and what commands are run  to  rebuild
186            it).
187
188       -v, --version
189            Print  the version of the make program plus a copyright, a list of
190            authors and a notice that there is no warranty.
191
192       -w, --print-directory
193            Print a message containing the working directory before and  after
194            other  processing.   This  may  be useful for tracking down errors
195            from complicated nests of recursive make commands.
196
197       --no-print-directory
198            Turn off -w, even if it was turned on implicitly.
199
200       -W file, --what-if=file, --new-file=file, --assume-new=file
201            Pretend that the target file has just been  modified.   When  used
202            with  the -n flag, this shows you what would happen if you were to
203            modify that file.  Without -n, it is almost the same as running  a
204            touch  command  on the given file before running make, except that
205            the modification time is changed only in the imagination of make.
206
207       --warn-undefined-variables
208            Warn when an undefined variable is referenced.
209

EXIT STATUS

211       GNU make exits with a status of zero if all makefiles were successfully
212       parsed  and no targets that were built failed.  A status of one will be
213       returned if the -q flag was used and  make  determines  that  a  target
214       needs  to  be  rebuilt.  A status of two will be returned if any errors
215       were encountered.
216

SEE ALSO

218       The full documentation for make is maintained as a Texinfo manual.   If
219       the  info  and  make  programs are properly installed at your site, the
220       command
221
222              info make
223
224       should give you access to the complete manual.
225

BUGS

227       See the chapter ``Problems and Bugs'' in The GNU Make Manual.
228

AUTHOR

230       This manual page contributed by Dennis Morse  of  Stanford  University.
231       Further updates contributed by Mike Frysinger.  It has been reworked by
232       Roland McGrath.  Maintained by Paul Smith.
233
235       Copyright © 1992-1993, 1996-2020 Free Software Foundation,  Inc.   This
236       file is part of GNU make.
237
238       GNU  Make  is  free  software; you can redistribute it and/or modify it
239       under the terms of the GNU General Public License as published  by  the
240       Free  Software Foundation; either version 3 of the License, or (at your
241       option) any later version.
242
243       GNU Make is distributed in the hope that it will be useful, but WITHOUT
244       ANY  WARRANTY;  without even the implied warranty of MERCHANTABILITY or
245       FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General  Public  License
246       for more details.
247
248       You should have received a copy of the GNU General Public License along
249       with this program.  If not, see http://www.gnu.org/licenses/.
250
251
252
253GNU                            28 February 2016                        MAKE(1)
Impressum