make \- maintain program groups
makefile ] [ option ] ...
option is present, `makefile' and `Makefile' are
is `\-', the standard input is taken.
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.
contains a sequence of entries that specify dependencies.
The first line of an entry is a
blank-separated list of targets, then a colon,
then a list of prerequisite files.
Text following a semicolon, and all following lines
that begin with a tab, are shell commands
to be executed to update the target.
Sharp and newline surround comments.
The following makefile says that `pgm' depends on two
files `a.o' and `b.o', and that they in turn depend on
`.c' files and a common file `incl'.
Subsequent appearances of
is a single character, the parentheses are optional.
infers prerequisites for files for which
gives no construction commands.
`.c' file may be inferred as prerequisite for a `.o' file
and be compiled to produce the `.o' file.
Thus the preceding example can be done more briefly:
Prerequisites are inferred according to selected suffixes
listed as the `prerequisites' for the special name `.SUFFIXES';
multiple lists accumulate;
an empty list clears what came before.
Order is significant; the first possible name for which both
a file and a rule as described in the next paragraph exist
\&.SUFFIXES: .out .o .c .e .r .f .y .l .s
The rule to create a file with suffix
that depends on a similarly named file with suffix
In such an entry, the special macro $* stands for
the target name with suffix deleted, $@ for the full target name,
$< for the complete list of prerequisites,
$? for the list of prerequisites that are out of date.
For example, a rule for making
optimized `.o' files from `.c' files is
\&.c.o: ; cc \-c \-O \-o $@ $*.c
Certain macros are used by the default inference rules
to communicate optional arguments to
any resulting compilations.
In particular, `CFLAGS' is used for
options, `LFLAGS' and `YFLAGS' for
Command lines are executed one at a time, each by its
A line is printed when it is executed unless
the special target `.SILENT'
or the first character of the command is `@'.
Commands returning nonzero status (see
the special target `.IGNORE' is in
or the command begins with
Interrupt and quit cause the target to be deleted
unless the target depends on the special name `.PRECIOUS'.
Equivalent to the special entry `.IGNORE:'.
When a command returns nonzero status,
abandon work on the current entry, but
continue on branches that do not depend on the current entry.
Trace and print, but do not execute the commands
needed to update the targets.
Touch, i.e. update the modified date of targets, without
Equivalent to an initial special entry `.SUFFIXES:'
Equivalent to the special entry
Make \- A Program for Maintaining Computer Programs
Some commands return nonzero status inappropriately.
to overcome the difficulty.
Commands that are directly executed by the shell,
are ineffectual across newlines in