-->

Previous | Table of Contents | Next

Page 310

SEE ALSO

picttoppm(1), pbmtomacp(1), pbm(5)

AUTHOR

Copyright " 1988 by Jef Poskanzer. The MacPaint-reading code is copyright " 1987 by Patrick J. Naughton (naughton@wind.sun.com).

29 March 1989

make

make—GNU make utility to maintain groups of programs

SYNOPSIS

make [ _f makefile ] [ option ] ... target ...

Warning

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.

DESCRIPTION

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.

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.

Once a suitable makefile exists, each time you change some source FILES, this simple shell command:

make

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.

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.

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.

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.

Page 311

OPTIONS

-b, _m These OPTIONS are ignored for compatibility with other versions of make.
_C dir 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.
_d 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.
_e Give variables taken from the ENVIRONMENT precedence over variables from makeFILES.
_f file Use file as a makefile.
_i Ignore all errors in commands executed to remake FILES.
_I dir 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.
_j jobs 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.
_k 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.
-l, Specifies that no new jobs (commands) should be started if there are other jobs running and the load average is at
_l load least load (a floating-point number). With no argument, removes a previous load limit.
_n Print the commands that would be executed, but do not execute them.
_o file 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.
_p 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.
_q 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.
_r Eliminate use of the built-in implicit rules. Also clear out the default list of suffixes for suffix rules.
_s Silent operation; do not print the commands as they are executed.
_S 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.
_t 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.
_v 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.
_w 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.
_W file 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.

SEE ALSO

/usr/local/doc/gnumake.dvi

The GNU Make Manual

Previous | Table of Contents | Next