man: fix issues found by makewhatis -p
[unleashed.git] / share / man / man1 / dmake.1
blobbfb993710abd4f4aa0041cb944dc306cdacc5fdb
1 '\" te
2 .\" Copyright 1989 AT&T 
3 .\" Portions Copyright (c) 1992, X/Open Company Limited  All Rights Reserved
4 .\" Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved  
5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at 
6 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
8 .\"  This notice shall appear on any product containing this material.
9 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
10 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
11 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
12 .TH MAKE 1 "Jun 24, 2015"
13 .SH NAME
14 dmake \- maintain, update, and regenerate related programs and files
15 .SH SYNOPSIS
16 .LP
17 .nf
18 \fB/usr/bin/dmake\fR [\fB-d\fR] [\fB-dd\fR] [\fB-D\fR] [\fB-DD\fR] [\fB-e\fR]
19      [\fB-i\fR] [\fB-j\fR \FImaxjobs\fR] [\fB-k\fR]  [\fB-m\fR \fI{serial | parallel}\fR]
20      [\fB-n\fR] [\fB-p\fR] [\fB-P\fR] [\fB-q\fR] [\fB-r\fR] [\fB-s\fR] [\fB-S\fR] [\fB-t\fR] [\fB-V\fR] 
21      [\fB-f\fR \fImakefile\fR]... [\fB-K\fR \fIstatefile\fR]... [\fItarget\fR]... 
22      [\fImacro\fR = \fIvalue\fR...]
23 .fi
25 .LP
26 .SH DESCRIPTION
27 .LP
28 The \fBmake\fR utility executes a list of shell commands associated with each
29 \fItarget\fR, typically to create or update a file of the same name.
30 \fImakefile\fR contains entries that describe how to bring a target up to date
31 with respect to those on which it depends, which are called \fIdependencies\fR.
32 Since each dependency is a target, it can have dependencies of its own.
33 Targets, dependencies, and sub-dependencies comprise a tree structure that
34 \fBmake\fR traces when deciding whether or not to rebuild a \fItarget\fR.
35 .sp
36 .LP
37 The \fBmake\fR utility recursively checks each \fItarget\fR against its
38 dependencies, beginning with the first target entry in \fImakefile\fR if no
39 \fItarget\fR argument is supplied on the command line. If, after processing all
40 of its dependencies, a target file is found either to be missing, or to be
41 older than any of its dependencies, \fBmake\fR rebuilds it. Optionally with
42 this version of \fBmake\fR, a target can be treated as out-of-date when the
43 commands used to generate it have changed since the last time the target was
44 built.
45 .sp
46 .LP
47 To build a given target, \fBmake\fR executes the list of commands, called a
48 \fIrule\fR. This rule can be listed explicitly in the target's makefile entry,
49 or it can be supplied implicitly by \fBmake\fR.
50 .sp
51 .LP
52 If no \fItarget\fR is specified on the command line, \fBmake\fR uses the first
53 target defined in \fImakefile\fR.
54 .sp
55 .LP
56 If a \fItarget\fR has no makefile entry, or if its entry has no rule,
57 \fBmake\fR attempts to derive a rule by each of the following methods, in turn,
58 until a suitable rule is found. Each method is described under Usage below.
59 .RS +4
60 .TP
61 .ie t \(bu
62 .el o
63 Pattern matching rules.
64 .RE
65 .RS +4
66 .TP
67 .ie t \(bu
68 .el o
69 Implicit rules, read in from a user-supplied makefile.
70 .RE
71 .RS +4
72 .TP
73 .ie t \(bu
74 .el o
75 Standard implicit rules (also known as suffix rules), typically read in from
76 the file \fB/usr/share/lib/make/make.rules\fR.
77 .RE
78 .RS +4
79 .TP
80 .ie t \(bu
81 .el o
82 \fBSCCS\fR retrieval. \fBmake\fR retrieves the most recent version from the
83 \fBSCCS\fR history file (if any).  See the description of the
84 \fB\&.SCCS_GET:\fR special-function target for details.
85 .RE
86 .RS +4
87 .TP
88 .ie t \(bu
89 .el o
90 The rule from the \fB\&.DEFAULT:\fR target entry, if there is such an entry in
91 the makefile.
92 .RE
93 .sp
94 .LP
95 If there is no makefile entry for a \fItarget\fR, if no rule can be derived for
96 building it, and if no file by that name is present, \fBmake\fR issues an error
97 message and halts.
98 .SH OPTIONS
99 .LP
100 The following options are supported:
102 .ne 2
104 \fB\fB-d\fR\fR
106 .RS 16n
107 Displays the reasons why \fBmake\fR chooses to rebuild a target. \fBmake\fR
108 displays any and all dependencies that are newer. In addition, \fBmake\fR
109 displays options read in from the \fBMAKEFLAGS\fR environment variable.
113 .ne 2
115 \fB\fB-dd\fR\fR
117 .RS 16n
118 Displays the dependency check and processing in vast detail.
122 .ne 2
124 \fB\fB-D\fR\fR
126 .RS 16n
127 Displays the text of the makefiles read in.
131 .ne 2
133 \fB\fB-DD\fR\fR
135 .RS 16n
136 Displays the text of the makefiles, \fBmake.rules\fR file, the state file, and
137 all hidden-dependency reports.
141 .ne 2
143 \fB\fB-e\fR\fR
145 .RS 16n
146 Environment variables override assignments within makefiles.
150 .ne 2
152 \fB\fB-f\fR \fImakefile\fR\fR
154 .RS 16n
155 Uses the description file \fImakefile\fR. A \fB\(mi\fR as the \fImakefile\fR
156 argument denotes the standard input. The contents of \fImakefile\fR, when
157 present, override the standard set of implicit rules and predefined macros.
158 When more than one \fB-f\fR \fImakefile\fR argument pair appears, \fBmake\fR
159 uses the concatenation of those files, in order of appearance.
161 When no \fImakefile\fR is specified, \fB/usr/bin/dmake\fR tries the following in
162 sequence, except when in POSIX mode (see \fB\&.POSIX\fR in Usage):
163 .RS +4
165 .ie t \(bu
166 .el o
167 If there is a file named \fBmakefile\fR in the working directory, \fBmake\fR
168 uses that file. If, however, there is an \fBSCCS\fR history file
169 (\fBSCCS/s.makefile\fR) which is newer, \fBmake\fR attempts to retrieve and use
170 the most recent version.
172 .RS +4
174 .ie t \(bu
175 .el o
176 In the absence of the above file(s), if a file named \fBMakefile\fR is present
177 in the working directory, \fBmake\fR attempts to use it.  If there is an
178 \fBSCCS\fR history file (\fBSCCS/s.Makefile\fR) that is newer, \fBmake\fR
179 attempts to retrieve and use the most recent version.
181 When no \fImakefile\fR is specified, \fB/usr/bin/dmake\fR in POSIX mode and
182 tries the following files in sequence:
183 .RS +4
185 .ie t \(bu
186 .el o
187 \fB\&./makefile\fR, \fB\&./Makefile\fR
189 .RS +4
191 .ie t \(bu
192 .el o
193 \fBs.makefile\fR, \fBSCCS/s.makefile\fR
195 .RS +4
197 .ie t \(bu
198 .el o
199 \fBs.Makefile\fR, \fBSCCS/s.Makefile\fR
204 .ne 2
206 \fB\fB-i\fR\fR
208 .RS 16n
209 Ignores error codes returned by commands.  Equivalent to the special-function
210 target \fB\&.IGNORE:\fR.
214 .ne 2
216 \fB-j\fR \fImaxjobs\fR
218 .RS 16n
219 Specify the maximum number of jobs that each instance of \fBmake\fR will invoke.
223 .ne 2
225 \fB\fB-k\fR\fR
227 .RS 16n
228 When a nonzero error status is returned by a rule, or when \fBmake\fR cannot
229 find a rule, abandons work on the current target, but continues with other
230 dependency branches that do not depend on it.
234 .ne 2
236 \fB\fB-K\fR \fIstatefile\fR\fR
238 .RS 16n
239 Uses the state file \fIstatefile\fR. A \fB\(mi\fR as the \fIstatefile\fR
240 argument denotes the standard input. The contents of \fIstatefile\fR, when
241 present, override the standard set of implicit rules and predefined macros.
242 When more than one \fB-K\fR \fIstatefile\fR argument pair appears, \fBmake\fR
243 uses the concatenation of those files, in order of appearance. (See also
244 \fB\&.KEEP_STATE\fR  and \fB\&.KEEP_STATE_FILE\fR in the Special-Function
245 Targets section).
249 .ne 2
251 \fB-m\fR \fI{serial | parallel}\fR
253 .RS 16n
254 Specify whether \fBmake\fR should execute jobs serially or in parallel.  The
255 default for \fBmake\fR is to run serially unless \fB-j\fR is specified.  The
256 default is for \fBdmake\fR is to run in parallel.
260 .ne 2
262 \fB\fB-n\fR\fR
264 .RS 16n
265 No execution mode. Prints commands, but does not execute them. Even lines
266 beginning with an \fB@\fR are printed. However, if a command line contains a
267 reference to the \fB$(MAKE)\fR macro, that line is always executed (see the
268 discussion of \fBMAKEFLAGS\fR in Reading Makefiles and the Environment). When
269 in POSIX mode, lines beginning with a "\fB+\fR" are executed.
273 .ne 2
275 \fB\fB-p\fR\fR
277 .RS 16n
278 Prints out the complete set of macro definitions and target descriptions.
282 .ne 2
284 \fB\fB-P\fR\fR
286 .RS 16n
287 Merely reports dependencies, rather than building them.
291 .ne 2
293 \fB\fB-q\fR\fR
295 .RS 16n
296 Question mode. \fBmake\fR returns a zero or nonzero status code depending on
297 whether or not the target file is up to date. When in POSIX mode, lines
298 beginning with a "\fB+\fR" are executed.
302 .ne 2
304 \fB\fB-r\fR\fR
306 .RS 16n
307 Does not read in the default makefile \fB/usr/share/lib/make/make.rules\fR.
311 .ne 2
313 \fB\fB-s\fR\fR
315 .RS 16n
316 Silent mode. Does not print command lines before executing them. Equivalent to
317 the special-function target \fB\&.SILENT:\fR.
321 .ne 2
323 \fB\fB-S\fR\fR
325 .RS 16n
326 Undoes the effect of the \fB-k\fR option. Stops processing when a non-zero exit
327 status is returned by a command.
331 .ne 2
333 \fB\fB-t\fR\fR
335 .RS 16n
336 Touches the target files (bringing them up to date) rather than performing
337 their rules. \fBWarning:\fR This can be \fBdangerous\fR when files are
338 maintained by more than one person. When the \fB\&.KEEP_STATE:\fR target
339 appears in the makefile, this option updates the state file just as if the
340 rules had been performed. When in POSIX mode, lines beginning with a "\fB+\fR"
341 are executed.
345 .ne 2
347 \fB\fB-V\fR\fR
349 .RS 16n
350 Puts \fBmake\fR into SysV mode. Refer to \fBsysV-make\fR(1) for respective
351 details.
354 .SH OPERANDS
356 The following operands are supported:
358 .ne 2
360 \fB\fItarget\fR\fR
362 .RS 15n
363 Target names, as defined in Usage.
367 .ne 2
369 \fB\fImacro\fR\fB=\fR\fIvalue\fR\fR
371 .RS 15n
372 Macro definition. This definition overrides any regular definition for the
373 specified macro within the makefile itself, or in the environment. However,
374 this definition can still be overridden by conditional macro assignments.
377 .SH USAGE
379 The usage of \fBmake\fR is described below:
380 .SS "Reading Makefiles and the Environment"
382 When \fBmake\fR first starts, it reads the \fBMAKEFLAGS\fR environment variable
383 to obtain any of the following options specified present in its value:
384 \fB-d\fR, \fB-D\fR, \fB-e\fR, \fB-i\fR, \fB-k\fR, \fB-n\fR, \fB-p\fR, \fB-q\fR,
385 \fB-r\fR, \fB-s\fR, \fB-S\fR, or \fB-t\fR. Due to the implementation of POSIX.2
386 (see \fBPOSIX.2\fR(5), the \fBMAKEFLAGS\fR values contains a leading \fB\(mi\fR
387 character. The \fBmake\fR utility then reads the command line for additional
388 options, which also take effect.
391 Next, \fBmake\fR reads in a default makefile that typically contains predefined
392 macro definitions, target entries for implicit rules, and additional rules,
393 such as the rule for retrieving \fBSCCS\fR files. If present, \fBmake\fR uses
394 the file \fBmake.rules\fR in the current directory; otherwise it reads the file
395 \fB/usr/share/lib/make/make.rules\fR, which contains the standard definitions
396 and rules. Use the directive:
398 .in +2
400 \fBinclude /usr/share/lib/make/make.rules\fR
402 .in -2
407 in your local \fBmake.rules\fR file to include them.
410 Next, \fBmake\fR imports variables from the environment (unless the \fB-e\fR
411 option is in effect), and treats them as defined macros. Because \fBmake\fR
412 uses the most recent definition it encounters, a macro definition in the
413 makefile normally overrides an environment variable of the same name. When
414 \fB-e\fR is in effect, however, environment variables are read in \fBafter\fR
415 all makefiles have been read. In that case, the environment variables take
416 precedence over definitions in the makefile.
419 Next, \fBmake\fR reads any makefiles you specify with \fB-f\fR, or one of
420 \fBmakefile\fR or \fBMakefile\fR as described above and then the state file, in
421 the local directory if it exists. If the makefile contains a
422 \fB\&.KEEP_STATE_FILE\fR target, then it reads the state file that follows the
423 target. Refer to special target \fB\&.KEEP_STATE_FILE\fR for details.
426 Next (after reading the environment if \fB-e\fR is in effect), \fBmake\fR reads
427 in any macro definitions supplied as command line arguments. These override
428 macro definitions in the makefile and the environment both, but only for the
429 \fBmake\fR command itself.
432 \fBmake\fR exports environment variables, using the most recently defined
433 value. Macro definitions supplied on the command line are not normally
434 exported, unless the macro is also an environment variable.
437 \fBmake\fR does not export macros defined in the makefile. If an environment
438 variable is set, and a macro with the same name is defined on the command line,
439 \fBmake\fR exports its value as defined on the command line. Unless \fB-e\fR is
440 in effect, macro definitions within the makefile take precedence over those
441 imported from the environment.
444 The macros \fBMAKEFLAGS\fR, \fBMAKE\fR, \fBSHELL\fR, \fBHOST_ARCH\fR,
445 \fBHOST_MACH\fR, and \fBTARGET_MACH\fR are special cases. See Special-Purpose
446 Macros below for details.
447 .SS "Makefile Target Entries"
449 A target entry has the following format:
451 .in +2
453        \fItarget\fR [\fB:\fR|\fB::\fR] [\fIdependency\fR] ... [\fB;\fR \fBcommand\fR] ... 
454                       [\fBcommand\fR] 
455                       ...
457 .in -2
461 The first line contains the name of a target, or a space-separated list of
462 target names, terminated with a colon or double colon. If a list of targets is
463 given, this is equivalent to having a separate entry of the same form for each
464 target. The colon(s) can be followed by a \fIdependency\fR, or a dependency
465 list. \fBmake\fR checks this list before building the target. The dependency
466 list can be terminated with a semicolon (\fB;\fR), which in turn can be
467 followed by a single Bourne shell command. Subsequent lines in the target entry
468 begin with a \fBTAB\fR and contain Bourne shell commands. These commands
469 comprise the rule for building the target.
472 Shell commands can be continued across input lines by escaping the
473 \fBNEWLINE\fR with a backslash (\fB\e\fR). The continuing line must also start
474 with a \fBTAB\fR.
477 To rebuild a target, \fBmake\fR expands macros, strips off initial \fBTAB\fR
478 characters and either executes the command directly (if it contains no shell
479 metacharacters), or passes each command line to a Bourne shell for execution.
482 The first \fInon-empty\fR line that does not begin with a \fBTAB\fR or \fB#\fR
483 begins another target or macro definition.
484 .SS "Special Characters"
486 Special characters are defined below.
487 .SS "\fIGlobal\fR"
488 .ne 2
490 \fB\fB#\fR\fR
492 .RS 20n
493 Start a comment. The comment ends at the next \fBNEWLINE\fR. If the \fB#\fR
494 follows the \fBTAB\fR in a command line, that line is passed to the shell
495 (which also treats \fB#\fR as the start of a comment).
499 .ne 2
501 \fB\fBinclude\fR \fIfilename\fR\fR
503 .RS 20n
504 If the word \fBinclude\fR appears as the first seven letters of a line and is
505 followed by a \fBSPACE\fR or \fBTAB\fR, the string that follows is taken as a
506 filename to interpolate at that line. \fBinclude\fR files can be nested to a
507 depth of no more than 38 nested makefiles . If \fIfilename\fR is a macro
508 reference, it is expanded.
511 .SS "\fITargets and Dependencies\fR"
512 .ne 2
514 \fB\fB:\fR\fR
516 .sp .6
517 .RS 4n
518 Target list terminator. Words following the colon are added to the dependency
519 list for the target or targets. If a target is named in more than one
520 colon-terminated target entry, the dependencies for all its entries are added
521 to form that target's complete dependency list.
525 .ne 2
527 \fB\fB::\fR\fR
529 .sp .6
530 .RS 4n
531 Target terminator for alternate dependencies. When used in place of a \fB:\fR
532 the double-colon allows a target to be checked and updated with respect to
533 alternate dependency lists. When the target is out-of-date with respect to
534 dependencies listed in the first alternate, it is built according to the rule
535 for that entry. When out-of-date with respect to dependencies in another
536 alternate, it is built according the rule in that other entry. Implicit rules
537 do not apply to double-colon targets; you must supply a rule for each entry. If
538 no dependencies are specified, the rule is always performed.
542 .ne 2
544 \fB\fItarget\fR [\fB+\fR \fItarget\fR.\|.\|.\|] \fB:\fR\fR
546 .sp .6
547 .RS 4n
548 Target group. The rule in the target entry builds all the indicated targets as
549 a group. It is normally performed only once per \fBmake\fR run, but is checked
550 for command dependencies every time a target in the group is encountered in the
551 dependency scan.
555 .ne 2
557 \fB\fB%\fR\fR
559 .sp .6
560 .RS 4n
561 Pattern matching wild card metacharacter.  Like the \fB*\fR shell wild card,
562 \fB%\fR matches any string of zero or more characters in a target name or
563 dependency, in the target portion of a conditional macro definition, or within
564 a pattern replacement macro reference. Notice that only one \fB%\fR can appear
565 in a target, dependency-name, or pattern-replacement macro reference.
569 .ne 2
571 \fB\fB\&./\fR\fIpathname\fR\fR
573 .sp .6
574 .RS 4n
575 \fBmake\fR ignores the leading \fB\&./\fR characters from targets with names
576 given as pathnames relative to "dot," the working directory.
579 .SS "\fIMacros\fR"
580 .ne 2
582 \fB\fB=\fR\fR
584 .RS 9n
585 Macro definition. The word to the left of this character is the macro name;
586 words to the right comprise its value. Leading and trailing white space
587 characters are stripped from the value. A word break following the \fB=\fR is
588 implied.
592 .ne 2
594 \fB\fB$\fR\fR
596 .RS 9n
597 Macro reference. The following character, or the parenthesized or bracketed
598 string, is interpreted as a macro reference: \fBmake\fR expands the reference
599 (including the \fB$\fR) by replacing it with the macro's value.
603 .ne 2
605 \fB\fB( )\fR\fR
609 \fB\fB{ }\fR\fR
611 .RS 9n
612 Macro-reference name delimiters. A parenthesized or bracketed word appended to
613 a \fB$\fR is taken as the name of the macro being referred to. Without the
614 delimiters, \fBmake\fR recognizes only the first character as the macro name.
618 .ne 2
620 \fB\fB$$\fR\fR
622 .RS 9n
623 A reference to the dollar-sign macro, the value of which is the character
624 \fB$\fR. Used to pass variable expressions beginning with \fB$\fR to the shell,
625 to refer to environment variables which are expanded by the shell, or to delay
626 processing of dynamic macros within the dependency list of a target, until that
627 target is actually processed.
631 .ne 2
633 \fB\fB\e$\fR\fR
635 .RS 9n
636 Escaped dollar-sign character.  Interpreted as a literal dollar sign within a
637 rule.
641 .ne 2
643 \fB\fB+=\fR\fR
645 .RS 9n
646 When used in place of \fB=\fR, appends a string to a macro definition (must be
647 surrounded by white space, unlike \fB=\fR).
651 .ne 2
653 \fB\fB:=\fR\fR
655 .RS 9n
656 Conditional macro assignment. When preceded by a list of targets with explicit
657 target entries, the macro definition that follows takes effect when processing
658 only those targets, and their dependencies.
662 .ne 2
664 \fB\fB:sh\fR \fB=\fR\fR
666 .RS 9n
667 Define the value of a macro to be the output of a command (see Command
668 Substitutions below).
672 .ne 2
674 \fB\fB:sh\fR\fR
676 .RS 9n
677 In a macro reference, execute the command stored in the macro, and replace the
678 reference with the output of that command (see \fBCommand Substitutions\fR
679 below).
682 .SS "\fIRules\fR"
683 .ne 2
685 \fB\fB+\fR\fR
687 .RS 8n
688 \fBmake\fR always executes the commands preceded by a "\fB+\fR", even when
689 \fB-n\fR is specified.
693 .ne 2
695 \fB\fB\(mi\fR\fR
697 .RS 8n
698 \fBmake\fR ignores any nonzero error code returned by a command line for which
699 the first non-\fBTAB\fR character is a \fB\(mi\fR\&. This character is not
700 passed to the shell as part of the command line. \fBmake\fR normally terminates
701 when a command returns nonzero status, unless the \fB-i\fR or \fB-k\fR options,
702 or the \fB\&.IGNORE:\fR special-function target is in effect.
706 .ne 2
708 \fB\fB@\fR\fR
710 .RS 8n
711 If the first non-\fBTAB\fR character is a \fB@\fR, \fBmake\fR does not print
712 the command line before executing it. This character is not passed to the
713 shell.
717 .ne 2
719 \fB\fB?\fR\fR
721 .RS 8n
722 Escape command-dependency checking. Command lines starting with this character
723 are not subject to command dependency checking.
727 .ne 2
729 \fB\fB!\fR\fR
731 .RS 8n
732 Force command-dependency checking. Command-dependency checking is applied to
733 command lines for which it would otherwise be suppressed. This checking is
734 normally suppressed for lines that contain references to the \fB?\fR dynamic
735 macro (for example, \fB$?\fR).
737 When any combination of \fB+\fR, \fB\(mi\fR, \fB@\fR, \fB?\fR, or \fB!\fR
738 appear as the first characters after the \fBTAB\fR, all that are present apply.
739 None are passed to the shell.
742 .SS "Special-Function Targets"
744 When incorporated in a makefile, the following target names perform
745 special-functions:
747 .ne 2
749 \fB\fB\&.DEFAULT:\fR\fR
751 .RS 23n
752 If it has an entry in the makefile, the rule for this target is used to process
753 a target when there is no other entry for it, no rule for building it, and no
754 \fBSCCS\fR history file from which to retrieve a current version. \fBmake\fR
755 ignores any dependencies for this target.
759 .ne 2
761 \fB\fB\&.DONE:\fR\fR
763 .RS 23n
764 If defined in the makefile, \fBmake\fR processes this target and its
765 dependencies after all other targets are built.  This target is also performed
766 when \fBmake\fR halts with an error, unless the \fB\&.FAILED\fR target is
767 defined.
771 .ne 2
773 \fB\fB\&.FAILED:\fR\fR
775 .RS 23n
776 This target, along with its dependencies, is performed instead of \fB\&.DONE\fR
777 when defined in the makefile and \fBmake\fR halts with an error.
781 .ne 2
783 \fB\fB\&.GET_POSIX:\fR\fR
785 .RS 23n
786 This target contains the rule for retrieving the current version of an
787 \fBSCCS\fR file from its history file in the current working directory.
788 \fBmake\fR uses this rule when it is running in POSIX mode.
792 .ne 2
794 \fB\fB\&.IGNORE:\fR\fR
796 .RS 23n
797 Ignore errors.  When this target appears in the makefile, \fBmake\fR ignores
798 non-zero error codes returned from commands. When used in POSIX mode,
799 \fB\&.IGNORE\fR could be followed by target names only, for which the errors is
800 ignored.
804 .ne 2
806 \fB\fB\&.INIT:\fR\fR
808 .RS 23n
809 If defined in the makefile, this target and its dependencies are built before
810 any other targets are processed.
814 .ne 2
816 \fB\fB\&.KEEP_STATE:\fR\fR
818 .RS 23n
819 If this target is in effect, \fBmake\fR updates the state file,
820 \fB\&.make.state\fR, in the current directory.  This target also activates
821 command dependencies, and hidden dependency checks. If either the
822 \fB\&.KEEP_STATE:\fR target appears in the makefile, or the environment
823 variable \fBKEEP_STATE\fR is set (\fBsetenv KEEP_STATE\fR), \fBmake\fR rebuilds
824 everything in order to collect dependency information, even if all the targets
825 were up to date due to previous \fBmake\fR runs. See also the Environment
826 Variables section.  This target has no effect if used in POSIX mode.
830 .ne 2
832 \fB\fB\&.KEEP_STATE_FILE:\fR\fR
834 .RS 23n
835 This target has no effect if used in POSIX mode. This target implies
836 \fB\&.KEEP_STATE\fR. If the target is followed by a filename, \fBmake\fR uses
837 it as the state file. If the target is followed by a directory name, \fBmake\fR
838 looks for a \fB\&.make.state\fR file in that directory. If the target is not
839 followed by any name, \fBmake\fR looks for \fB\&.make.state\fR file in the
840 current working directory.
844 .ne 2
846 \fB\fB\&.MAKE_VERSION:\fR\fR
848 .RS 23n
849 A target-entry of the form:
851 .in +2
853 \&.MAKE_VERSION:  VERSION\(mi\fInumber\fR
855 .in -2
857 enables version checking. If the version of \fBmake\fR differs from the version
858 indicated by a string like \fBVERSION-1.0\fR, \fBmake\fR issues a warning
859 message.
863 .ne 2
865 \fB\fB\&.NO_PARALLEL:\fR\fR
867 .RS 23n
868 Dependencies of this target will be executed serially.
872 .ne 2
874 \fB\fB\&.PARALLEL:\fR\fR
876 .RS 23n
877 Dependencies of this target will be executed in parallel.
881 .ne 2
883 \fB\fB\&.POSIX:\fR\fR
885 .RS 23n
886 This target enables POSIX mode.
890 .ne 2
892 \fB\fB\&.PRECIOUS:\fR\fR
894 .RS 23n
895 List of files not to delete. \fBmake\fR does not remove any of the files listed
896 as dependencies for this target when interrupted. \fBmake\fR normally removes
897 the current target when it receives an interrupt. When used in POSIX mode, if
898 the target is not followed by a list of files, all the file are assumed
899 precious.
903 .ne 2
905 \fB\fB\&.SCCS_GET:\fR\fR
907 .RS 23n
908 This target contains the rule for retrieving the current version of an
909 \fBSCCS\fR file from its history file. To suppress automatic retrieval, add an
910 entry for this target with an empty rule to your makefile.
914 .ne 2
916 \fB\fB\&.SCCS_GET_POSIX:\fR\fR
918 .RS 23n
919 This target contains the rule for retrieving the current version of an
920 \fBSCCS\fR file from its history file. \fBmake\fR uses this rule when it is
921 running in POSIX mode.
925 .ne 2
927 \fB\fB\&.SILENT:\fR\fR
929 .RS 23n
930 Run silently. When this target appears in the makefile, \fBmake\fR does not
931 echo commands before executing them. When used in POSIX mode, it could be
932 followed by target names, and only those are executed silently.
936 .ne 2
938 \fB\fB\&.SUFFIXES:\fR\fR
940 .RS 23n
941 The suffixes list for selecting implicit rules (see The Suffixes List).
945 .ne 2
947 \fB\fB\&.WAIT:\fR\fR
949 .RS 23n
950 In a dependency list, wait until any dependency preceding this has completed
951 before moving on to any dependency following it.
954 .SS "\fIClearing Special Targets\fR"
956 In this version of \fBmake\fR, you can clear the definition of the following
957 special targets by supplying entries for them with no dependencies and no rule:
960 \fB\&.DEFAULT, .SCCS_GET,  and .SUFFIXES\fR
961 .SS "Command Dependencies"
963 When the \fB\&.KEEP_STATE:\fR target is effective, \fBmake\fR checks the
964 command for building a target against the state file. If the command has
965 changed since the last \fBmake\fR run, \fBmake\fR rebuilds the target.
966 .SS "Hidden Dependencies"
968 When the \fB\&.KEEP_STATE:\fR target is effective, \fBmake\fR reads reports
969 from \fBcpp\fR(1) and other compilation processors for any "hidden" files, such
970 as \fB#include\fR files. If the target is out of date with respect to any of
971 these files, \fBmake\fR rebuilds it.
972 .SS "Macros"
974 Entries of the form
976 .in +2
978 \fImacro\fR\fB=\fR\fIvalue\fR
980 .in -2
984 define macros. \fImacro\fR is the name of the macro, and \fIvalue\fR, which
985 consists of all characters up to a comment character or unescaped
986 \fBNEWLINE\fR, is the value. \fBmake\fR strips both leading and trailing white
987 space in accepting the value.
990 Subsequent references to the macro, of the forms: \fB$(\fR\fIname\fR\fB)\fR or
991 \fB${\fR\fIname\fR\fB}\fR are replaced by \fIvalue\fR. The parentheses or
992 brackets can be omitted in a reference to a macro with a single-character name.
995 Macro references can contain references to other macros, in which case nested
996 references are expanded first.
997 .SS "\fISuffix Replacement Macro References\fR"
999 Substitutions within macros can be made as follows:
1001 .in +2
1003      \fB$(\fR\fIname\fR\fB:\fR\fIstring1\fR\fB=\fR\fIstring2\fR\fB)\fR
1005 .in -2
1009 where \fIstring1\fR is either a suffix, or a word to be replaced in the macro
1010 definition, and \fIstring2\fR is the replacement suffix or word. Words in a
1011 macro value are separated by \fBSPACE\fR, \fBTAB\fR, and escaped \fBNEWLINE\fR
1012 characters.
1013 .SS "\fIPattern Replacement Macro References\fR"
1015 Pattern matching replacements can also be applied to macros, with a reference
1016 of the form:
1018 .in +2
1020      \fB$(\fR\fIname\fR\fB:\fR \fIop\fR\fB%\fR\fIos\fR\fB=\fR \fInp\fR\fB%\fR\fIns\fR\fB)\fR
1022 .in -2
1026 where \fIop\fR is the existing (old) prefix and \fIos\fR is the existing (old)
1027 suffix, \fInp\fR and \fIns\fR are the new prefix and new suffix, respectively,
1028 and the pattern matched by \fB%\fR (a string of zero or more characters), is
1029 carried forward from the value being replaced. For example:
1031 .in +2
1033 \fBPROGRAM=fabricate 
1034 DEBUG= $(PROGRAM:%=tmp/%\(mig)\fR
1036 .in -2
1041 sets the value of \fBDEBUG\fR to \fBtmp/fabricate\(mig\fR.
1044 Notice that pattern replacement macro references cannot be used in the
1045 dependency list of a pattern matching rule; the \fB%\fR characters are not
1046 evaluated independently. Also, any number of \fB%\fR metacharacters can appear
1047 after the equal-sign.
1048 .SS "\fIAppending to a Macro\fR"
1050 Words can be appended to macro values as follows:
1052 .in +2
1054      \fImacro\fR \fB+=\fR \fIword .\|.\|.\fR
1056 .in -2
1058 .SS "Special-Purpose Macros"
1060 When the \fBMAKEFLAGS\fR variable is present in the environment, \fBmake\fR
1061 takes options from it, in combination with options entered on the command line.
1062 \fBmake\fR retains this combined value as the \fBMAKEFLAGS\fR macro, and
1063 exports it automatically to each command or shell it invokes.
1066 Notice that flags passed by way of \fBMAKEFLAGS\fR are only displayed when the
1067 \fB-d\fR, or \fB-dd\fR options are in effect.
1070 The \fBMAKE\fR macro is another special case. It has the value \fBmake\fR by
1071 default, and temporarily overrides the \fB-n\fR option for any line in which it
1072 is referred to. This allows nested invocations of \fBmake\fR written as:
1074 .in +2
1076      \fB$(MAKE)\fR .\|.\|. 
1078 .in -2
1082 to run recursively, with the \fB-n\fR flag in effect for all commands but
1083 \fBmake\fR. This lets you use \fBmake\fR \fB-n\fR to test an entire hierarchy
1084 of makefiles.
1087 For compatibility with the 4.2 \fBBSD\fR \fBmake\fR, the \fBMFLAGS\fR macro is
1088 set from the \fBMAKEFLAGS\fR variable by prepending a \fB-\fR\&. \fBMFLAGS\fR
1089 is not exported automatically.
1092 The \fBSHELL\fR macro, when set to a single-word value such as
1093 \fB/usr/bin/csh\fR, indicates the name of an alternate shell to use. The
1094 default is \fB/bin/sh\fR. Notice that \fBmake\fR executes commands that contain
1095 no shell metacharacters itself. Built-in commands, such as \fBdirs\fR in the C
1096 shell, are not recognized unless the command line includes a metacharacter (for
1097 instance, a semicolon). This macro is neither imported from, nor exported to
1098 the environment, regardless of \fB-e\fR. To be sure it is set properly, you
1099 must define this macro within every makefile that requires it.
1102 The syntax of the \fBVPATH\fR macro is:
1104 .in +2
1106      \fBVPATH\fR = [ \fIpathname\fR [ : \fIpathname\fR ] ... ]
1108 .in -2
1112 \fBVPATH\fR specifies a list of directories to search for the files, which are
1113 targets or dependencies, when \fBmake\fR is executed.  \fBVPATH\fR is also used
1114 in order to search for the \fBinclude\fR files mentioned in the particular
1115 makefile.
1118 When processing a target or a dependency or an include directive, \fBmake\fR
1119 checks the existence of the file with the same name in the current directory.
1120 If the file is found to be missing, \fBmake\fR searches for this file in the
1121 list of directories presented in \fBVPATH\fR (like the \fBPATH\fR variable in
1122 the shell). Unlike the \fBPATH\fR variable, \fBVPATH\fR is used in order to
1123 search for the files with relative pathnames. When \fBmake\fR attempts to apply
1124 implicit rules to the target, it also searches for the dependency files using
1125 \fBVPATH\fR.
1128 When the file is found using \fBVPATH\fR, internal macros \fB$@\fR, \fB@<\fR,
1129 \fB$?\fR, \fB$*\fR, and their alternative forms (with \fBD\fR or \fBF\fR
1130 appended) are set in accordance with the name derived from \fBVPATH\fR. For
1131 instance, if the target \fBsubdir/foo.o\fR is found in the directory
1132 \fB/aaa/bbb\fR using \fBVPATH\fR, then the value of the internal macro \fB$@\fR
1133 for this target is \fB/aaa/bbb/subdir/foo.o\fR.
1136 If a target or a dependency file is found using \fBVPATH\fR, then any
1137 occurrences of the word that is the same as the target name in the subsequent
1138 rules are replaced with the actual name of the target derived from \fBVPATH\fR.
1141 For example:
1143 .in +2
1145 \fBVPATH=./subdir
1146 file.o : file.c
1147          cc -c file.c -o file.o\fR
1149 .in -2
1154 If \fBfile.c\fR is found in \fB\&./subdir\fR, then the command
1156 .in +2
1158 \fBcc -c ./subdir/file.c -o file.o\fR
1160 .in -2
1165 are executed.
1168 The following macros are provided for use with cross-compilation:
1170 .ne 2
1172 \fB\fBHOST_ARCH\fR\fR
1174 .RS 15n
1175 The processor type of the host system. By default, this is the output of the
1176 \fBuname\fR(1) command with the \fB\(mip\fR option, prepended with
1177 \fB-\fR\&. Under normal circumstances, this value should never be altered by
1178 the user.
1182 .ne 2
1184 \fB\fBHOST_MACH\fR\fR
1186 .RS 15n
1187 The machine architecture of the host system. By default, this is the output of
1188 the \fBuname\fR(1) command with \fB\(mim\fR option, prepended with
1189 \fB\(mi\fR\&. Under normal circumstances, this value should never be altered
1190 by the user.
1194 .ne 2
1196 \fB\fBTARGET_ARCH\fR\fR
1198 .RS 15n
1199 The processor type of the target system. By default, the output of
1200 \fBuname\fR with the \fB\(mip\fR option, prepended with \fB\(mi\fR\&.
1203 .SS "Dynamic Macros"
1205 There are several dynamically maintained macros that are useful as
1206 abbreviations within rules. They are shown here as references; if you were to
1207 define them, \fBmake\fR would simply override the definition.
1209 .ne 2
1211 \fB\fB$*\fR\fR
1213 .RS 6n
1214 The basename of the current target, derived as if selected for use with an
1215 implicit rule.
1219 .ne 2
1221 \fB\fB$<\fR\fR
1223 .RS 6n
1224 The name of a dependency file, derived as if selected for use with an implicit
1225 rule.
1229 .ne 2
1231 \fB\fB$@\fR\fR
1233 .RS 6n
1234 The name of the current target. This is the only dynamic macro whose value is
1235 strictly determined when used in a dependency list. (In which case it takes the
1236 form \fB$$@\fR.)
1240 .ne 2
1242 \fB\fB$?\fR\fR
1244 .RS 6n
1245 The list of dependencies that are newer than the target. Command-dependency
1246 checking is automatically suppressed for lines that contain this macro, just as
1247 if the command had been prefixed with a \fB?\fR. See the description of
1248 \fB?\fR, under \fBSpecial Character\fR Rules above. You can force this check
1249 with the \fB!\fR command-line prefix.
1253 .ne 2
1255 \fB\fB$%\fR\fR
1257 .RS 6n
1258 The name of the library member being processed. (See Library Maintenance
1259 below.)
1264 To refer to the \fB$@\fR dynamic macro within a dependency list, precede the
1265 reference with an additional \fB$\fR character (as in, \fB$$@\fR). Because
1266 \fBmake\fR assigns \fB$<\fR and \fB$*\fR as it would for implicit rules
1267 (according to the suffixes list and the directory contents), they can be
1268 unreliable when used within explicit target entries.
1271 These macros can be modified to apply either to the filename part, or the
1272 directory part of the strings they stand for, by adding an upper case \fBF\fR
1273 or \fBD\fR, respectively (and enclosing the resulting name in parentheses or
1274 braces). Thus, \fB$(@D)\fR refers to the directory part of the string \fB$@\fR;
1275 if there is no directory part, \fB\&.\fR is assigned. \fB$(@F)\fR refers to the
1276 filename part.
1277 .SS "Conditional Macro Definitions"
1279 A macro definition of the form:
1281 .in +2
1283 \fItarget-list\fR \fB:=\fR \fImacro\fR \fB=\fR \fIvalue\fR
1285 .in -2
1289 indicates that when processing any of the targets listed \fIand their
1290 dependencies\fR, \fImacro\fR is to be set to the \fIvalue\fR supplied. Notice
1291 that if a conditional macro is referred to in a dependency list, the \fB$\fR
1292 must be delayed (use \fB$$\fR instead). Also, \fItarget-list\fR can contain a
1293 \fB%\fR pattern, in which case the macro is conditionally defined for all
1294 targets encountered that match the pattern. A pattern replacement reference can
1295 be used within the \fIvalue\fR.
1298 You can temporarily append to a macros value with a conditional definition of
1299 the form:
1301 .in +2
1303 \fItarget-list\fR \fB:=\fR \fImacro\fR \fB+=\fR \fIvalue\fR
1305 .in -2
1307 .SS "Predefined Macros"
1309 \fBmake\fR supplies the macros shown in the table that follows for compilers
1310 and their options, host architectures, and other commands. Unless these macros
1311 are read in as environment variables, their values are not exported by
1312 \fBmake\fR. If you run \fBmake\fR with any of these set in the environment, it
1313 is a good idea to add commentary to the makefile to indicate what value each is
1314 expected to take. If \fB-r\fR is in effect, \fBmake\fR does not read the
1315 default makefile (\fB\&./make.rules\fR or \fB/usr/share/lib/make/make.rules\fR)
1316 in which these macro definitions are supplied.
1321 box;
1322 cw(1i) | cw(1.17i) | cw(3.33i)
1323 cw(1i) | cw(1.17i) | cw(3.33i) .
1324 \fITable of Predefined Macros\fR
1326 \fIUse\fR       \fIMacro\fR     \fIDefault Value\fR
1328 Library \fBAR\fR        \fBar\fR
1329 Archives        \fBARFLAGS\fR   \fBrv\fR
1331                 
1332 Assembler       \fBAS\fR        \fBas\fR
1333 Commands        \fBASFLAGS\fR   
1334         \fBCOMPILE.s\fR \fB$(AS) $(ASFLAGS)\fR
1335         \fBCOMPILE.S\fR \fB$(CC) $(ASFLAGS) $(CPPFLAGS)\fR \fB-c\fR
1337                 
1338 C       \fBCC\fR        \fBcc\fR
1339 Compiler        \fBCFLAGS\fR    
1340 Commands        \fBCPPFLAGS\fR  
1341         \fBCOMPILE.c\fR \fB$(CC) $(CFLAGS) $(CPPFLAGS)\fR \fB-c\fR
1342         \fBLINK.c\fR    \fB$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)\fR
1344                 
1345 C++     \fBCCC\fR       \fBCC\fR
1346 Compiler        \fBCCFLAGS\fR   \fBCFLAGS\fR
1347 Commands        \fBCPPFLAGS\fR  
1348         \fBCOMPILE.cc\fR        \fB$(CCC) $(CCFLAGS) $(CPPFLAGS)\fR \fB-c\fR
1349         \fBLINK.cc\fR   \fB$(CCC) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)\fR
1350         \fBCOMPILE.C\fR \fB$(CCC) $(CCFLAGS) $(CPPFLAGS)\fR \fB-c\fR
1351         \fBLINK.C\fR    \fB$(CCC) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)\fR
1353                 
1354 FORTRAN 77      \fBFC\fR        \fBf77\fR
1355 Compiler        \fBFFLAGS\fR    
1356 Commands        \fBCOMPILE.f\fR \fB$(FC) $(FFLAGS)\fR \fB-c\fR
1357         \fBLINK.f\fR    \fB$(FC) $(FFLAGS) $(LDFLAGS)\fR
1358         \fBCOMPILE.F\fR \fB$(FC) $(FFLAGS) $(CPPFLAGS)\fR \fB-c\fR
1359         \fBLINK.F\fR    \fB$(FC) $(FFLAGS) $(CPPFLAGS) $(LDFLAGS)\fR
1361                 
1362 FORTRAN 90      \fBFC\fR        \fBf90\fR
1363 Compiler        \fBF90FLAGS\fR  
1364 Commands        \fBCOMPILE.f90\fR       \fB$(F90C) $(F90FLAGS)\fR \fB-c\fR
1365         \fBLINK.f90\fR  \fB$(F90C) $(F90FLAGS) $(LDFLAGS)\fR
1366         \fBCOMPILE.ftn\fR       \fB$(F90C) $(F90FLAGS) $(CPPFLAGS)\fR \fB-c\fR
1367         \fBLINK.ftn\fR  T{
1368 \fB$(F90C) $(F90FLAGS) $(CPPFLAGS) $(LDFLAGS)\fR
1371                 
1372 Link Editor     \fBLD\fR        \fBld\fR
1373 Command \fBLDFLAGS\fR   
1375                 
1376 lex     \fBLEX\fR       \fBlex\fR
1377 Command \fBLFLAGS\fR    
1378         \fBLEX.l\fR     \fB$(LEX) $(LFLAGS)\fR \fB-t\fR
1380                 
1381 lint    \fBLINT\fR      \fBlint\fR
1382 Command \fBLINTFLAGS\fR 
1383         \fBLINT.c\fR    \fB$(LINT) $(LINTFLAGS) $(CPPFLAGS)\fR
1385                 
1386 Modula 2        \fBM2C\fR       \fBm2c\fR
1387 Commands        \fBM2FLAGS\fR   
1388         \fBMODFLAGS\fR  
1389         \fBDEFFLAGS\fR  
1390         \fBCOMPILE.def\fR       \fB$(M2C) $(M2FLAGS) $(DEFFLAGS)\fR
1391         \fBCOMPILE.mod\fR       \fB$(M2C) $(M2FLAGS) $(MODFLAGS)\fR
1393                 
1394 Pascal  \fBPC\fR        \fBpc\fR
1395 Compiler        \fBPFLAGS\fR    
1396 Commands        \fBCOMPILE.p\fR \fB$(PC) $(PFLAGS) $(CPPFLAGS)\fR \fB-c\fR
1397         \fBLINK.p\fR    \fB$(PC) $(PFLAGS) $(CPPFLAGS) $(LDFLAGS)\fR
1399                 
1400 Ratfor  \fBRFLAGS\fR    
1401 Compilation     \fBCOMPILE.r\fR \fB$(FC) $(FFLAGS) $(RFLAGS)\fR \fB-c\fR
1402 Commands        \fBLINK.r\fR    \fB$(FC) $(FFLAGS) $(RFLAGS) $(LDFLAGS)\fR
1404                 
1405 rm Command      \fBRM\fR        \fBrm\fR \fB-f\fR
1407                 
1408 sccs    \fBSCCSFLAGS\fR 
1409 Command \fBSCCSGETFLAGS\fR      \fB-s\fR
1411                 
1412 yacc    \fBYACC\fR      \fByacc\fR
1413 Command \fBYFLAGS\fR    
1414         \fBYACC.y\fR    \fB$(YACC) $(YFLAGS)\fR
1416                 
1417 Suffixes List   \fBSUFFIXES\fR  T{
1418 \fB\&.o .c .c~ .cc .cc~ .y .y~ .l .l~ .s .s~ .sh .sh~ .S .S~ .ln .h .h~ .f .f~ .F .F~  .mod .mod~ .sym .def .def~ .p .p~ .r .r~ .cps .cps~ .C .C~ .Y .Y~ .L .L .f90 .f90~ .ftn .ftn~\fR
1422 .SS "Implicit Rules"
1424 When a target has no entry in the makefile, \fBmake\fR attempts to determine
1425 its class (if any) and apply the rule for that class. An implicit rule
1426 describes how to build any target of a given class, from an associated
1427 dependency file. The class of a target can be determined either by a pattern,
1428 or by a suffix; the corresponding dependency file (with the same basename) from
1429 which such a target might be built. In addition to a predefined set of implicit
1430 rules, \fBmake\fR allows you to define your own, either by pattern, or by
1431 suffix.
1432 .SS "\fIPattern Matching Rules\fR"
1434 A target entry of the form:
1436 .in +2
1438 \fItp\fR\fB%\fR\fIts\fR:\|\fIdp\fR\fB%\fR\fIds\fR
1439      \fIrule\fR
1441 .in -2
1446 is a pattern matching rule, in which \fItp\fR is a target prefix, \fIts\fR is a
1447 target suffix, \fIdp\fR is a dependency prefix, and \fIds\fR is a dependency
1448 suffix (any of which can be null). The \fB%\fR stands for a basename of zero or
1449 more characters that is matched in the target, and is used to construct the
1450 name of a dependency. When \fBmake\fR encounters a match in its search for an
1451 implicit rule, it uses the rule in that target entry to build the target from
1452 the dependency file. Pattern-matching implicit rules typically make use of the
1453 \fB$@\fR and \fB$<\fR dynamic macros as placeholders for the target and
1454 dependency names. Other, regular dependencies can occur in the dependency list;
1455 however, none of the regular dependencies can contain \fB%\fR. An entry of the
1456 form:
1458 .in +2
1460 \fItp\fR%\fIts\fR:\|[\fIdependency .\|.\|.\fR\|] \fIdp\fR%\fIds\fR\|[\fIdependency .\|.\|.\fR\|] 
1461      \fIrule\fR
1463 .in -2
1468 is a valid pattern matching rule.
1469 .SS "\fISuffix Rules\fR"
1471 When no pattern matching rule applies, \fBmake\fR checks the target name to see
1472 if it ends with a suffix in the known suffixes list. If so, \fBmake\fR checks
1473 for any suffix rules, as well as a dependency file with same root and another
1474 recognized suffix, from which to build it.
1477 The target entry for a suffix rule takes the form:
1479 .in +2
1481 \fIDsTs\fR: \fIrule\fR
1483 .in -2
1488 where \fITs\fR is the suffix of the target, \fIDs\fR is the suffix of the
1489 dependency file, and \fIrule\fR is the rule for building a target in the class.
1490 Both \fIDs\fR and \fITs\fR must appear in the suffixes list. (A suffix need not
1491 begin with a \fB\&.\fR to be recognized.)
1494 A suffix rule with only one suffix describes how to build a target having a
1495 null (or no) suffix from a dependency file with the indicated suffix. For
1496 instance, the \fB\&.c\fR rule could be used to build an executable program
1497 named \fBfile\fR from a C source file named \fBfile.c\fR. If a target with a
1498 null suffix has an explicit dependency, \fBmake\fR omits the search for a
1499 suffix rule.
1504 box;
1505 cw(1.57i) |cw(3.93i) 
1506 cw(1.57i) |cw(3.93i) .
1508 \fITable of Standard Implicit (Suffix) Rules for Assembly Files\fR
1511 \fIImplicit Rule Name\fR        \fICommand Line\fR
1513 \fB\&.s.o\fR    \fB$(COMPILE.s)\fR \fB-o\fR \fB$@ $<\fR
1515         
1516 \fB\&.s.a\fR    \fB$(COMPILE.s)\fR \fB-o\fR \fB$% $<\fR
1517         \fB$(AR) $(ARFLAGS) $@ $%\fR
1518         \fB$(RM) $%\fR
1520         
1521 \fB\&.s~.o\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.s\fR
1522         \fB$(COMPILE.s)\fR \fB-o\fR \fB$@ $*.s\fR
1524         
1525 \fB\&.S.o\fR    \fB$(COMPILE.S)\fR \fB-o\fR \fB$@ $<\fR
1527         
1528 \fB\&.S.a\fR    \fB$(COMPILE.S)\fR \fB-o\fR \fB$% $<\fR
1529         \fB$(AR) $(ARFLAGS) $@ $%\fR
1530         \fB$(RM) $%\fR
1532         
1533 \fB\&.S~.o\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.S\fR
1534         \fB$(COMPILE.S)\fR \fB-o\fR \fB$@ $*.S\fR
1536         
1537 \fB\&.S~.a\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.S\fR
1538         \fB$(COMPILE.S)\fR \fB-o\fR \fB$% $*.S\fR
1539         \fB$(AR) $(ARFLAGS) $@ $%\fR
1540         \fB$(RM) $%\fR
1547 box;
1548 cw(1.57i) |cw(3.93i) 
1549 cw(1.57i) |cw(3.93i) .
1551 \fITable of Standard Implicit (Suffix) Rules for C Files\fR
1554 \fIImplicit Rule Name\fR        \fICommand Line\fR
1556 \fB\&.c\fR      \fB$(LINK.c)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR
1558         
1559 \fB\&.c.ln\fR   \fB$(LINT.c) $(OUTPUT_OPTION)\fR \fB-i\fR \fB$<\fR
1561         
1562 \fB\&.c.o\fR    \fB$(COMPILE.c) $(OUTPUT_OPTION) $<\fR
1564         
1565 \fB\&.c.a\fR    \fB$(COMPILE.c)\fR \fB-o\fR \fB$% $<\fR
1566         \fB$(AR) $(ARFLAGS) $@ $%\fR
1567         \fB$(RM) $%\fR
1569         
1570 \fB\&.c~\fR     \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.c\fR
1571         \fB$(CC) $(CFLAGS) $(LDFLAGS)\fR \fB-o\fR \fB$@ $*.c\fR
1573         
1574 \fB\&.c~.o\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.c\fR
1575         \fB$(CC) $(CFLAGS)\fR \fB-c\fR \fB$*.c\fR
1577         
1578 \fB\&.c~.ln\fR  \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.c\fR
1579         \fB$(LINT.c) $(OUTPUT_OPTION)\fR \fB-c\fR \fB$*.c\fR
1581         
1582 \fB\&.c~.a\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.c\fR
1583         \fB$(COMPILE.c)\fR \fB-o\fR \fB$% $*.c\fR
1584         \fB$(AR) $(ARFLAGS) $@ $%\fR
1585         \fB$(RM) $%\fR
1592 box;
1593 cw(1.57i) |cw(3.93i) 
1594 cw(1.57i) |cw(3.93i) .
1596 \fITable of Standard Implicit (Suffix) Rules for C++ Files\fR
1599 \fIImplicit Rule Name\fR        \fICommand Line\fR
1601 \fB\&.cc\fR     \fB$(LINK.cc)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR
1603         
1604 \fB\&.cc.o\fR   \fB$(COMPILE.cc) $(OUTPUT_OPTION) $<\fR
1606         
1607 \fB\&.cc.a\fR   \fB$(COMPILE.cc)\fR \fB-o\fR \fB$% $<\fR
1608         \fB$(AR) $(ARFLAGS) $@ $%\fR
1609         \fB$(RM) $%\fR
1611         
1612 \fB\&.cc~\fR    \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.cc\fR
1613         \fB$(LINK.cc)\fR \fB-o\fR \fB$@ $*.cc $(LDLIBS)\fR
1615         
1616 \fB\&.cc.o\fR   \fB$(COMPILE.cc) $(OUTPUT_OPTION) $<\fR
1618         
1619 \fB\&.cc~.o\fR  \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.cc\fR
1620         \fB$(COMPILE.cc) $(OUTPUT_OPTION) $*.cc\fR
1622         
1623 \fB\&.cc.a\fR   \fB$(COMPILE.cc)\fR \fB-o\fR \fB$% $<\fR
1624         \fB$(AR) $(ARFLAGS) $@ $%\fR
1625         \fB$(RM) $%\fR
1627         
1628 \fB\&.cc~.a\fR  \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.cc\fR
1629         \fB$(COMPILE.cc)\fR \fB-o\fR \fB$% $*.cc\fR
1630         \fB$(AR) $(ARFLAGS) $@ $%\fR
1631         \fB$(RM) $%\fR
1633         
1634 \fB\&.C\fR      \fB$(LINK.C)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR
1636         
1637 \fB\&.C~\fR     \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.C\fR
1638         \fB$(LINK.C)\fR \fB-o\fR \fB$@ $*.C $(LDLIBS)\fR
1640         
1641 \fB\&.C.o\fR    \fB$(COMPILE.C) $(OUTPUT_OPTION) $<\fR
1643         
1644 \fB\&.C~.o\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.C\fR
1645         \fB$(COMPILE.C) $(OUTPUT_OPTION) $*.C\fR
1647         
1648 \fB\&.C.a\fR    \fB$(COMPILE.C)\fR \fB-o\fR \fB$% $<\fR
1649         \fB$(AR) $(ARFLAGS) $@ $%\fR
1650         \fB$(RM) $%\fR
1652         
1653 \fB\&.C~.a\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.C\fR
1654         \fB$(COMPILE.C)\fR \fB-o\fR \fB$% $*.C\fR
1655         \fB$(AR) $(ARFLAGS) $@ $%\fR
1656         \fB$(RM) $%\fR
1663 box;
1664 cw(1.57i) |cw(3.93i) 
1665 cw(1.57i) |cw(3.93i) .
1667 \fITable of Standard Implicit (Suffix) Rules for FORTRAN 77 Files\fR
1670 \fIImplicit Rule Name\fR        \fICommand Line\fR
1672 \fB\&.f\fR      \fB$(LINK.f)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR
1674         
1675 \fB\&.f.o\fR    \fB$(COMPILE.f) $(OUTPUT_OPTION) $<\fR
1677         
1678 \fB\&.f.a\fR    \fB$(COMPILE.f)\fR \fB-o\fR \fB$% $<\fR
1679         \fB$(AR) $(ARFLAGS) $@ $%\fR
1680         \fB$(RM) $%\fR
1682         
1683 \fB\&.f\fR      \fB$(LINK.f)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR
1685         
1686 \fB\&.f~\fR     \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.f\fR
1687         \fB$(FC) $(FFLAGS) $(LDFLAGS)\fR \fB-o\fR \fB$@ $*.f\fR
1689         
1690 \fB\&.f~.o\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.f\fR
1691         \fB$(FC) $(FFLAGS)\fR \fB-c\fR \fB$*.f\fR
1693         
1694 \fB\&.f~.a\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.f\fR
1695         \fB$(COMPILE.f)\fR \fB-o\fR \fB$% $*.f\fR
1696         \fB$(AR) $(ARFLAGS) $@ $%\fR
1697         \fB$(RM) $%\fR
1699         
1700 \fB\&.F\fR      \fB$(LINK.F)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR
1702         
1703 \fB\&.F.o\fR    \fB$(COMPILE.F) $(OUTPUT_OPTION) $<\fR
1705         
1706 \fB\&.F.a\fR    \fB$(COMPILE.F)\fR \fB-o\fR \fB$% $<\fR
1707         \fB$(AR) $(ARFLAGS) $@ $%\fR
1708         \fB$(RM) $%\fR
1710         
1711 \fB\&.F~\fR     \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.F\fR
1712         \fB$(FC) $(FFLAGS) $(LDFLAGS)\fR \fB-o\fR \fB$@ $*.F\fR
1714         
1715 \fB\&.F~.o\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.F\fR
1716         \fB$(FC) $(FFLAGS)\fR \fB-c\fR \fB$*.F\fR
1718         
1719 \fB\&.F~.a\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.F\fR
1720         \fB$(COMPILE.F)\fR \fB-o\fR \fB$% $*.F\fR
1721         \fB$(AR) $(ARFLAGS) $@ $%\fR
1722         \fB$(RM) $%\fR
1729 box;
1730 cw(1.57i) |cw(3.93i) 
1731 cw(1.57i) |cw(3.93i) .
1733 \fITable of Standard Implicit (Suffix) Rules for FORTRAN 90 Files\fR
1736 \fIImplicit Rule Name\fR        \fICommand Line\fR
1738 \fB\&.f90\fR    \fB$(LINK.f90)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR
1740         
1741 \fB\&.f90~\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.f90\fR
1742         \fB$(LINK.f90)\fR \fB-o\fR \fB$@ $*.f90 $(LDLIBS)\fR
1744         
1745 \fB\&.f90.o\fR  \fB$(COMPILE.f90) $(OUTPUT_OPTION) $<\fR
1747         
1748 \fB\&.f90~.o\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.f90\fR
1749         \fB$(COMPILE.f90) $(OUTPUT_OPTION) $*.f90\fR
1751         
1752 \fB\&.f90.a\fR  \fB$(COMPILE.f90)\fR \fB-o\fR \fB$% $<\fR
1753         \fB$(AR) $(ARFLAGS) $@ $%\fR
1754         \fB$(RM) $%\fR
1756         
1757 \fB\&.f90~.a\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.f90\fR
1758         \fB$(COMPILE.f90)\fR \fB-o\fR \fB$% $*.f90\fR
1759         \fB$(AR) $(ARFLAGS) $@ $%\fR
1760         \fB$(RM) $%\fR
1762         
1763 \fB\&.ftn\fR    \fB$(LINK.ftn)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR
1765         
1766 \fB\&.ftn~\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.ftn\fR
1767         \fB$(LINK.ftn)\fR \fB-o\fR \fB$@ $*.ftn $(LDLIBS)\fR
1769         
1770 \fB\&.ftn.o\fR  \fB$(COMPILE.ftn) $(OUTPUT_OPTION) $<\fR
1772         
1773 \fB\&.ftn~.o\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.ftn\fR
1774         \fB$(COMPILE.ftn) $(OUTPUT_OPTION) $*.ftn\fR
1776         
1777 \fB\&.ftn.a\fR  \fB$(COMPILE.ftn)\fR \fB-o\fR \fB$% $<\fR
1778         \fB$(AR) $(ARFLAGS) $@ $%\fR
1779         \fB$(RM) $%\fR
1781         
1782 \fB\&.ftn~.a\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.ftn\fR
1783         \fB$(COMPILE.ftn)\fR \fB-o\fR \fB$% $*.ftn\fR
1784         \fB$(AR) $(ARFLAGS) $@ $%\fR
1785         \fB$(RM) $%\fR
1792 box;
1793 cw(1.57i) |cw(3.93i) 
1794 cw(1.57i) |cw(3.93i) .
1796 \fITable of Standard Implicit (Suffix) Rules for lex Files\fR
1799 \fIImplicit Rule Name\fR        \fICommand Line\fR
1801 \fB\&.l\fR      \fB$(RM) $*.c\fR
1802         \fB$(LEX.l) $< > $*.c\fR
1803         \fB$(LINK.c)\fR \fB-o\fR \fB$@ $*.c $(LDLIBS)\fR
1804         \fB$(RM) $*.c\fR
1806         
1807 \fB\&.l.c\fR    \fB$(RM) $@\fR
1808         \fB$(LEX.l) $< > $@\fR
1810         
1811 \fB\&.l.ln\fR   \fB$(RM) $*.c\fR
1812         \fB$(LEX.l) $< > $*.c\fR
1813         \fB$(LINT.c)\fR \fB-o\fR \fB$@\fR \fB-i\fR \fB$*.c\fR
1814         \fB$(RM) $*.c\fR
1816         
1817 \fB\&.l.o\fR    \fB$(RM) $*.c\fR
1818         \fB$(LEX.l) $< > $*.c\fR
1819         \fB$(COMPILE.c)\fR \fB-o\fR \fB$@ $*.c\fR
1820         \fB$(RM) $*.c\fR
1822         
1823 \fB\&.l~\fR     \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.l\fR
1824         \fB$(LEX) $(LFLAGS) $*.l\fR
1825         \fB$(CC) $(CFLAGS)\fR \fB-c\fR \fBlex.yy.c\fR
1826         \fBrm\fR \fB-f\fR \fBlex.yy.c\fR
1827         \fBmv lex.yy.c $@\fR
1829         
1830 \fB\&.l~.c\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.l\fR
1831         \fB$(LEX) $(LFLAGS) $*.l\fR
1832         \fBmv lex.yy.c $@\fR
1834         
1835 \fB\&.l~.ln\fR  \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.l\fR
1836         \fB$(RM) $*.c\fR
1837         \fB$(LEX.l) $*.l > $*.c\fR
1838         \fB$(LINT.c)\fR \fB-o\fR \fB$@\fR \fB-i\fR \fB$*.c\fR
1839         \fB$(RM) $*.c\fR
1841         
1842 \fB\&.l~.o\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.l\fR
1843         \fB$(LEX) $(LFLAGS) $*.l\fR
1844         \fB$(CC) $(CFLAGS)\fR \fB-c\fR \fBlex.yy.c\fR
1845         \fBrm\fR \fB-f\fR \fBlex.yy.c\fR
1846         \fBmv lex.yy.c $@\fR
1853 box;
1854 cw(1.57i) |cw(3.93i) 
1855 cw(1.57i) |cw(3.93i)  .
1857 \fITable of Standard Implicit (Suffix) Rules for Modula 2 Files\fR
1860 \fIImplicit Rule Name\fR        \fICommand Line\fR
1862 \fB\&.mod\fR    \fB$(COMPILE.mod)\fR \fB-o\fR \fB$@\fR \fB-e\fR \fB$@ $<\fR
1864         
1865 \fB\&.mod.o\fR  \fB$(COMPILE.mod)\fR \fB-o\fR \fB$@ $<\fR
1867         
1868 \fB\&.def.sym\fR        \fB$(COMPILE.def)\fR \fB-o\fR \fB$@ $<\fR
1870         
1871 \fB\&.def~.sym\fR       \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.def\fR
1872         \fB$(COMPILE.def)\fR \fB-o\fR\fB$@ $*.def\fR
1874         
1875 \fB\&.mod~\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.mod\fR
1876         \fB$(COMPILE.mod)\fR \fB-o\fR \fB$@\fR \fB-e\fR \fB$@ $*.mod\fR
1878         
1879 \fB\&.mod~.o\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.mod\fR
1880         \fB$(COMPILE.mod)\fR \fB-o\fR \fB$@ $*.mod\fR
1882         
1883 \fB\&.mod~.a\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.mod\fR
1884         \fB$(COMPILE.mod)\fR \fB-o\fR \fB$% $*.mod\fR
1885         \fB$(AR) $(ARFLAGS) $@ $%\fR
1886         \fB$(RM) $%\fR
1893 box;
1894 cw(1.57i) |cw(3.93i) 
1895 cw(1.57i) |cw(3.93i) .
1897 \fITable of Standard Implicit (Suffix) Rules for NeWS Files\fR
1900 \fIImplicit Rule Name\fR        \fICommand Line\fR
1902 \fB\&.cps.h\fR  \fBcps $*.cps\fR
1904 \fB\&.cps~.h\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.cps\fR
1905         \fB$(CPS) $(CPSFLAGS) $*.cps\fR
1912 box;
1913 cw(1.57i) |cw(3.93i) 
1914 cw(1.57i) |cw(3.93i) .
1916 \fITable of Standard Implicit (Suffix) Rules for Pascal Files\fR
1919 \fIImplicit Rule Name\fR        \fICommand Line\fR
1921 \fB\&.p\fR      \fB$(LINK.p)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR
1923         
1924 \fB\&.p.o\fR    \fB$(COMPILE.p) $(OUTPUT_OPTION) $<\fR
1926         
1927 \fB\&.p~\fR     \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.p\fR
1928         \fB$(LINK.p)\fR \fB-o\fR \fB$@ $*.p $(LDLIBS)\fR
1930         
1931 \fB\&.p~.o\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.p\fR
1932         \fB$(COMPILE.p) $(OUTPUT_OPTION) $*.p\fR
1934         
1935 \fB\&.p~.a\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.p\fR
1936         \fB$(COMPILE.p)\fR \fB-o\fR \fB$% $*.p\fR
1937         \fB$(AR) $(ARFLAGS) $@ $%\fR
1938         \fB$(RM) $%\fR
1945 box;
1946 cw(1.57i) |cw(3.93i) 
1947 cw(1.57i) |cw(3.93i) .
1949 \fITable of Standard Implicit (Suffix) Rules for Ratfor Files\fR
1952 \fIImplicit Rule Name\fR        \fICommand Line\fR
1954 \fB\&.r\fR      \fB$(LINK.r)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR
1956         
1957 \fB\&.r.o\fR    \fB$(COMPILE.r) $(OUTPUT_OPTION) $<\fR
1959         
1960 \fB\&.r.a\fR    \fB$(COMPILE.r)\fR \fB-o\fR \fB$% $<\fR
1961         \fB$(AR) $(ARFLAGS) $@ $%\fR
1962         \fB$(RM) $%\fR
1964         
1965 \fB\&.r~\fR     \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.r\fR
1966         \fB$(LINK.r)\fR \fB-o\fR \fB$@ $*.r $(LDLIBS)\fR
1968         
1969 \fB\&.r~.o\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.r\fR
1970         \fB$(COMPILE.r) $(OUTPUT_OPTION) $*.r\fR
1972         
1973 \fB\&.r~.a\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.r\fR
1974         \fB$(COMPILE.r)\fR \fB-o\fR \fB$% $*.r\fR
1975         \fB$(AR) $(ARFLAGS) $@ $%\fR
1976         \fB$(RM) $%\fR
1983 box;
1984 cw(1.57i) |cw(3.93i) 
1985 cw(1.57i) |cw(3.93i) .
1987 \fITable of Standard Implicit (Suffix) Rules for SCCS Files\fR
1990 \fIImplicit Rule Name\fR        \fICommand Line\fR
1992 \fB\&.SCCS_GET\fR       T{
1993 \fBsccs $(SCCSFLAGS) get $(SCCSGETFLAGS) $@\fR \fB-G\fR\fB$@\fR
1995         
1997         
1998 \fB\&.SCCS_GET_POSIX\fR \fBsccs $(SCCSFLAGS) get $(SCCSGETFLAGS) $@\fR
2000         
2001 \fB\&.GET_POSIX\fR      \fB$(GET) $(GFLAGS) s.$@\fR
2008 box;
2009 cw(1.57i) |cw(3.93i) 
2010 cw(1.57i) |cw(3.93i) .
2012 \fITable of Standard Implicit (Suffix) Rules for Shell Scripts\fR
2015 \fIImplicit Rule Name\fR        \fICommand Line\fR
2017 \fB\&.sh\fR     \fBcat $< >$@\fR
2018         \fBchmod +x $@\fR
2020         
2021 \fB\&.sh~\fR    \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.sh\fR
2022         \fBcp $*.sh $@\fR
2023         \fBchmod a+x $@\fR
2030 box;
2031 cw(1.57i) |cw(3.93i) 
2032 cw(1.57i) |cw(3.93i) .
2034 \fITable of Standard Implicit (Suffix) Rules for yacc Files\fR
2037 \fIImplicit Rule Name\fR        \fICommand Line\fR
2039 \fB\&.y\fR      \fB$(YACC.y) $<\fR
2040         \fB$(LINK.c)\fR \fB-o\fR \fB$@ y.tab.c $(LDLIBS)\fR
2041         \fB$(RM) y.tab.c\fR
2043         
2044 \fB\&.y.c\fR    \fB$(YACC.y) $<\fR
2045         \fBmv y.tab.c $@\fR
2047         
2048 \fB\&.y.ln\fR   \fB$(YACC.y) $<\fR
2049         \fB$(LINT.c)\fR \fB-o\fR \fB$@\fR \fB-i\fR \fBy.tab.c\fR
2050         \fB$(RM) y.tab.c\fR
2052         
2053 \fB\&.y.o\fR    \fB$(YACC.y) $<\fR
2054         \fB$(COMPILE.c)\fR \fB-o\fR \fB$@ y.tab.c\fR
2055         \fB$(RM) y.tab.c\fR
2057         
2058 \fB\&.y~\fR     \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.y\fR
2059         \fB$(YACC) $(YFLAGS) $*.y\fR
2060         \fB$(COMPILE.c)\fR \fB-o\fR \fB$@ y.tab.c\fR
2061         \fB$(RM) y.tab.c\fR
2063         
2064 \fB\&.y~.c\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.y\fR
2065         \fB$(YACC) $(YFLAGS) $*.y\fR
2066         \fBmv y.tab.c $@\fR
2068         
2069 \fB\&.y~.ln\fR  \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.y\fR
2070         \fB$(YACC.y) $*.y\fR
2071         \fB$(LINT.c)\fR \fB-o\fR \fB$@\fR \fB-i\fR \fBy.tab.c\fR
2072         \fB$(RM) y.tab.c\fR
2074         
2075 \fB\&.y~.o\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.y\fR
2076         \fB$(YACC) $(YFLAGS) $*.y\fR
2077         \fB$(CC) $(CFLAGS)\fR \fB-c\fR \fBy.tab.c\fR
2078         \fBrm\fR \fB-f\fR \fBy.tab.c\fR
2079         \fBmv y.tab.o $@\fR
2084 \fBmake\fR reads in the standard set of implicit rules from the file
2085 \fB/usr/share/lib/make/make.rules\fR, unless \fB-r\fR is in effect, or there is
2086 a \fBmake.rules\fR file in the local directory that does not \fBinclude\fR that
2087 file.
2088 .SS "The Suffixes List"
2090 The suffixes list is given as the list of dependencies for the
2091 \fB\&.SUFFIXES:\fR special-function target. The default list is contained in
2092 the \fBSUFFIXES\fR macro (See \fITable of Predefined Macros\fR for the standard
2093 list of suffixes). You can define additional \fB\&.SUFFIXES:\fR targets; a
2094 \fB\&.SUFFIXES\fR target with no dependencies clears the list of suffixes.
2095 Order is significant within the list; \fBmake\fR selects a rule that
2096 corresponds to the target's suffix and the first dependency-file suffix found
2097 in the list. To place suffixes at the head of the list, clear the list and
2098 replace it with the new suffixes, followed by the default list:
2100 .in +2
2102    .SUFFIXES:
2103    .SUFFIXES: \fIsuffixes\fR $(SUFFIXES)
2105 .in -2
2109 A tilde (\fB~\fR) indicates that if a dependency file with the indicated suffix
2110 (minus the ~) is under \fBSCCS\fR its most recent version should be retrieved,
2111 if necessary, before the target is processed.
2112 .SS "Library Maintenance"
2114 A target name  of the form:
2116 .in +2
2118    \fIlib\fR(\fImember ...\fR)
2120 .in -2
2124 refers to a member, or a space-separated list of members, in an \fBar\fR(1)
2125 library.
2128 The dependency of the library member on the corresponding file must be given as
2129 an explicit entry in the makefile. This can be handled by a pattern matching
2130 rule of the form:
2132 .in +2
2134    \fIlib\fR(%\fI\&.s\fR): %\fI\&.s\fR
2136 .in -2
2140 where \fI\&.s\fR is the suffix of the member; this suffix is typically
2141 \fB\&.o\fR for object libraries.
2144 A target name of the form:
2146 .in +2
2148    \fIlib\fR((\fIsymbol\fR)) 
2150 .in -2
2154 refers to the member of a randomized object library that defines the entry
2155 point named \fIsymbol\fR.
2156 .SS "Command Execution"
2158 Command lines are executed one at a time, \fIeach by its own process or
2159 shell\fR. Shell commands, notably \fBcd\fR, are ineffectual across an unescaped
2160 \fBNEWLINE\fR in the makefile. A line is printed (after macro expansion) just
2161 before being executed. This is suppressed if it starts with a \fB@\fR, if there
2162 is a \fB\&.SILENT:\fR entry in the makefile, or if \fBmake\fR is run with the
2163 \fB-s\fR option. Although the \fB-n\fR option specifies printing without
2164 execution, lines containing the macro \fB$(MAKE)\fR are executed regardless,
2165 and lines containing the \fB@\fR special character are printed. The \fB-t\fR
2166 (touch) option updates the modification date of a file without executing any
2167 rules. This can be dangerous when sources are maintained by more than one
2168 person.
2171 \fBmake\fR invokes the shell with the \fB-e\fR (exit-on-errors) argument. Thus,
2172 with semicolon-separated command sequences, execution of the later commands
2173 depends on the success of the former. This behavior can be overridden by
2174 starting the command line with a \fB\|-\fR, or by writing a shell script that
2175 returns a non-zero status only as it finds appropriate.
2176 .SS "Bourne Shell Constructs"
2178 To use the Bourne shell \fBif\fR control structure for branching, use a command
2179 line of the form:
2181 .in +2
2183 if \fIexpression\fR ; \e
2184 then \fIcommand\fR ; \e
2185      ... ; \e
2186 else \fIcommand\fR; \e
2187      ... ; \e
2188 fi 
2190 .in -2
2194 Although composed of several input lines, the escaped \fBNEWLINE\fR characters
2195 insure that \fBmake\fR treats them all as one (shell) command line.
2198 To use the Bourne shell \fBfor\fR control structure for loops, use a command
2199 line of the form:
2201 .in +2
2203 for \fIvar\fR in \fIlist\fR ; \e
2204 do \fIcommand\fR; \e
2205      ... \fB; \e\fRdone
2207 .in -2
2211 To refer to a shell variable, use a double-dollar-sign (\fB$$\fR). This
2212 prevents expansion of the dollar-sign by \fBmake\fR.
2213 .SS "Command Substitutions"
2215 To incorporate the standard output of a shell command in a macro, use a
2216 definition of the form:
2218 .in +2
2220    \fIMACRO\|\fR:sh =\fIcommand\fR
2222 .in -2
2226 The command is executed only once, standard error output is discarded, and
2227 \fBNEWLINE\fR characters are replaced with \fBSPACE\fRs. If the command has a
2228 non-zero exit status, \fBmake\fR halts with an error.
2231 To capture the output of a shell command in a macro reference, use a reference
2232 of the form:
2234 .in +2
2236 $(\fIMACRO\|\fR:sh) 
2238 .in -2
2242 where \fIMACRO\fR is the name of a macro containing a valid Bourne shell
2243 command line. In this case, the command is executed whenever the reference is
2244 evaluated. As with shell command substitutions, the reference is replaced with
2245 the standard output of the command. If the command has a non-zero exit status,
2246 \fBmake\fR halts with an error.
2249 In contrast to commands in rules, the command is not subject for macro
2250 substitution; therefore, a dollar sign (\fB$\fR) need not be replaced with a
2251 double dollar sign (\fB$$\fR).
2252 .SS "\fISignals\fR"
2254 \fBINT\fR, \fBSIGTERM\fR, and \fBQUIT\fR signals received from the keyboard
2255 halt \fBmake\fR and remove the target file being processed unless that target
2256 is in the dependency list for \fB\&.PRECIOUS:\fR.
2257 .SH EXAMPLES
2259 \fBExample 1 \fRDefining dependencies
2262 This makefile says that \fBpgm\fR depends on two files \fBa.o\fR and \fBb.o\fR,
2263 and that they in turn depend on their corresponding source files (\fBa.c\fR and
2264 \fBb.c\fR) along with a common file \fBincl.h\fR:
2267 .in +2
2269 pgm:  a.o  b.o
2270      $(LINK.c) -o $@a.o  b.o
2271 a.o:  incl.h  a.c
2272      cc -c a.c
2273 b.o:  incl.h  b.c
2274      cc -c b.c 
2276 .in -2
2279 \fBExample 2 \fRUsing implicit rules
2282 The following makefile uses implicit rules to express the same dependencies:
2285 .in +2
2287 pgm:  a.o  b.o
2288      cc  a.o  b.o -o pgm
2289 a.o  b.o:  incl.h
2291 .in -2
2293 .SH ENVIRONMENT VARIABLES
2295 See \fBenviron\fR(5) for descriptions of the following environment variables
2296 that affect the execution of \fBmake\fR: \fBLANG\fR, \fBLC_ALL\fR,
2297 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
2300 .ne 2
2302 \fBDMAKE_MAX_JOBS\fR
2304 .RS 17n
2305 The maximum number of jobs that each instance of \fBmake\fR should run.
2309 .ne 2
2311 \fBDMAKE_ADJUST_MAX_JOBS\fR
2313 .RS 17n
2314 If \fBYES\fR adjust the maximum number of jobs each instance of \fBmake\fR
2315 runs based on system load.  If \fBNO\fR do not
2319 .ne 2
2321 \fBDMAKE_OUTPUT_MODE\fR
2323 .RS 17n
2324 Adjusts the format of output from \fBmake\fR when executing jobs in parallel.
2326 If the value is \fBTEXT1\fR \fBmake\fR will print the hostname and the command
2327 executed once when the job begins, and again preceding any output from that
2328 job.
2330 If the value is \fBTEXT2\fR \fBmake\fR will only print the command and its
2331 output only once, when execution is complete.
2335 .ne 2
2337 \fBDMAKE_MODE\fR
2339 .RS 17n
2340 Specify whether jobs should be executed in serial, or parallel.  Equivalent to
2341 passing the \fB-m\FR option.
2345 .ne 2
2347 \fB\fBKEEP_STATE\fR\fR
2349 .RS 17n
2350 This environment variable has the same effect as the .KEEP_STATE:
2351 special-function target. It enables command dependencies, hidden dependencies
2352 and writing of the state file.
2356 .ne 2
2358 \fB\fBUSE_SVR4_MAKE\fR\fR
2360 .RS 17n
2361 This environment variable causes \fBmake\fR to invoke the generic System V
2362 version of \fBmake\fR (\fB/usr/lib/svr4.make\fR). See \fBsysV-make\fR(1).
2366 .ne 2
2368 \fB\fBMAKEFLAGS\fR\fR
2370 .RS 17n
2371 This variable is interpreted as a character string representing a series of
2372 option characters to be used as the default options. The implementation accepts
2373 both of the following formats (but need not accept them when intermixed):
2374 .RS +4
2377 The characters are option letters without the leading hyphens or blank
2378 character separation used on a command line.
2380 .RS +4
2383 The characters are formatted in a manner similar to a portion of the
2384 \fBmake\fR command line: options are preceded by hyphens and
2385 blank-character-separated. The \fImacro=name\fR macro definition operands can
2386 also be included. The difference between the contents of \fBMAKEFLAGS\fR and
2387 the command line is that the contents of the variable is not subjected to the
2388 word expansions associated with parsing the command line values. See
2389 \fBwordexp\fR(3C).
2391 When the command-line options \fB-f\fR or \fB-p\fR are used, they take effect
2392 regardless of whether they also appear in \fBMAKEFLAGS\fR. If they otherwise
2393 appear in \fBMAKEFLAGS\fR, the result is undefined.
2395 The \fBMAKEFLAGS\fR variable is accessed from the environment before the
2396 makefile is read. At that time, all of the options (except \fB-f\fR and
2397 \fB-p\fR) and command-line macros not already included in \fBMAKEFLAGS\fR are
2398 added to the \fBMAKEFLAGS\fR macro. The \fBMAKEFLAGS\fR macro is passed into
2399 the environment as an environment variable for all child processes. If the
2400 \fBMAKEFLAGS\fR macro is subsequently set by the makefile, it replaces the
2401 \fBMAKEFLAGS\fR variable currently found in the environment.
2405 .ne 2
2407 \fB\fBPROJECTDIR\fR\fR
2409 .RS 17n
2410 Provides a directory to be used to search for SCCS files not found in the
2411 current  directory. In all of the following cases, the search for SCCS files is
2412 made in  the directory SCCS in the identified directory. If the value of
2413 \fBPROJECTDIR\fR begins with a slash, it shall be considered an absolute
2414 pathname. Otherwise, the value of \fBPROJECTDIR\fR is treated as a user name
2415 and that user's initial working directory shall be examined for a subdirectory
2416 \fBsrc\fR or \fBsource\fR. If such a directory is found, it shall be used.
2417 Otherwise, the value is used as a relative pathname.
2419 If \fBPROJECTDIR\fR is not set or has a null value, the search for SCCS files
2420 shall be made in the directory SCCS in the current directory. The setting of
2421 \fBPROJECTDIR\fR affects all files listed in the remainder of this utility
2422 description for files  with a component named SCCS.
2425 .SH EXIT STATUS
2427 When the \fB-q\fR option is specified, the \fBmake\fR utility exits with one of
2428 the following values:
2430 .ne 2
2432 \fB\fB0\fR\fR
2434 .RS 6n
2435 Successful completion.
2439 .ne 2
2441 \fB\fB1\fR\fR
2443 .RS 6n
2444 The target was not up-to-date.
2448 .ne 2
2450 \fB\fB>1\fR\fR
2452 .RS 6n
2453 An error occurred.
2458 When the \fB-q\fR option is not specified, the \fBmake\fR utility exits with
2459 one of the following values:
2461 .ne 2
2463 \fB\fB0\fR\fR
2465 .RS 6n
2466 Successful completion
2470 .ne 2
2472 \fB\fB>0\fR\fR
2474 .RS 6n
2475 An error occurred
2478 .SH FILES
2479 .ne 2
2481 \fB\fBmakefile\fR\fR
2485 \fB\fBMakefile\fR\fR
2487 .sp .6
2488 .RS 4n
2489 current version(s) of \fBmake\fR description file
2493 .ne 2
2495 \fB\fBs.makefile\fR\fR
2499 \fB\fBs.Makefile\fR\fR
2501 .sp .6
2502 .RS 4n
2503 \fBSCCS\fR history files for the above makefile(s) in the current directory
2507 .ne 2
2509 \fB\fBSCCS/s.makefile\fR\fR
2513 \fB\fBSCCS/s.Makefile\fR\fR
2515 .sp .6
2516 .RS 4n
2517 \fBSCCS\fR history files for the above makefile(s)
2521 .ne 2
2523 \fB\fBmake.rules\fR\fR
2525 .sp .6
2526 .RS 4n
2527 default file for user-defined targets, macros, and implicit rules
2531 .ne 2
2533 \fB\fB/usr/share/lib/make/make.rules\fR\fR
2535 .sp .6
2536 .RS 4n
2537 makefile for standard implicit rules and macros (not read if \fBmake.rules\fR
2542 .ne 2
2544 \fB\fB\&.make.state\fR\fR
2546 .sp .6
2547 .RS 4n
2548 state file in the local directory
2551 .SH SEE ALSO
2553 \fBar\fR(1), \fBcd\fR(1), \fBcpp\fR(1), \fBlex\fR(1),
2554 \fBsccs-get\fR(1), \fBsh\fR(1), \fBsysV-make\fR(1),
2555 \fByacc\fR(1), \fBwordexp\fR(3C), \fBpasswd\fR(4), \fBattributes\fR(5),
2556 \fBenviron\fR(5), \fBPOSIX.2\fR(5), \fBstandards\fR(5)
2559 \fISolaris Advanced User\&'s Guide\fR
2560 .SH DIAGNOSTICS
2561 .ne 2
2563 \fB\fBDon't know how to make target \fItarget\fR\fR\fR
2565 .sp .6
2566 .RS 4n
2567 There is no makefile entry for \fItarget\fR, and none of \fBmake\fR's implicit
2568 rules apply (there is no dependency file with a suffix in the suffixes list, or
2569 the target's suffix is not in the list).
2573 .ne 2
2575 \fB\fB***\fR \fItarget\fR \fBremoved.\fR\fR
2577 .sp .6
2578 .RS 4n
2579 \fBmake\fR was interrupted while building \fItarget\fR. Rather than leaving a
2580 partially-completed version that is newer than its dependencies, \fBmake\fR
2581 removes the file named \fItarget\fR.
2585 .ne 2
2587 \fB\fB***\fR \fItarget\fR \fBnot removed.\fR\fR
2589 .sp .6
2590 .RS 4n
2591 \fBmake\fR was interrupted while building \fItarget\fR and \fItarget\fR was not
2592 present in the directory.
2596 .ne 2
2598 \fB\fB***\fR \fItarget\fR \fBcould not be removed,\fR \fIreason\fR\fR
2600 .sp .6
2601 .RS 4n
2602 \fBmake\fR was interrupted while building \fItarget\fR, which was not removed
2603 for the indicated reason.
2607 .ne 2
2609 \fB\fBRead of include file\fR \fBfile\fR \fBfailed\fR\fR
2611 .sp .6
2612 .RS 4n
2613 The makefile indicated in an \fBinclude\fR directive was not found, or was
2614 inaccessible.
2618 .ne 2
2620 \fB\fBLoop detected when expanding macro value\fR \fImacro\fR\fB\&'\fR\fR
2622 .sp .6
2623 .RS 4n
2624 A reference to the macro being defined was found in the definition.
2628 .ne 2
2630 \fB\fBCould not write state file\fR \fIfile\fR\fB\fR\fR
2632 .sp .6
2633 .RS 4n
2634 You used the \fB\&.KEEP_STATE:\fR target, but do not have write permission on
2635 the state file.
2639 .ne 2
2641 \fB\fB***Error code\fR \fIn\fR\fR
2643 .sp .6
2644 .RS 4n
2645 The previous shell command returned a nonzero error code.
2649 .ne 2
2651 \fB\fB***\fR \fIsignal message\fR\fR
2653 .sp .6
2654 .RS 4n
2655 The previous shell command was aborted due to a signal. If \fB- core dumped\fR
2656 appears after the message, a \fBcore\fR file was created.
2660 .ne 2
2662 \fB\fBConditional macro conflict encountered\fR\fR
2664 .sp .6
2665 .RS 4n
2666 Displayed only when \fB-d\fR is in effect, this message indicates that two or
2667 more parallel targets currently being processed depend on a target which is
2668 built differently for each by virtue of conditional macros. Since the target
2669 cannot simultaneously satisfy both dependency relationships, it is conflicted.
2672 .SH BUGS
2674 Some commands return nonzero status inappropriately; to overcome this
2675 difficulty, prefix the offending command line in the rule with a \fB\(mi\fR\&.
2678 Filenames with the characters \fB=\fR, \fB:\fR, or \fB@\fR, do not work.
2681 You cannot build \fBfile.o\fR from \fBlib(file.o)\fR.
2684 Options supplied by \fBMAKEFLAGS\fR should be reported for nested \fBmake\fR
2685 commands. Use the \fB-d\fR option to find out what options the nested command
2686 picks up from \fBMAKEFLAGS\fR.
2689 This version of \fBmake\fR is incompatible in certain respects with previous
2690 versions:
2691 .RS +4
2693 .ie t \(bu
2694 .el o
2695 The \fB-d\fR option output is much briefer in this version. \fB-dd\fR now
2696 produces the equivalent voluminous output.
2698 .RS +4
2700 .ie t \(bu
2701 .el o
2702 \fBmake\fR attempts to derive values for the dynamic macros \fB$*\fR, \fB$<\fR,
2703 and \fB$?\fR, while processing explicit targets. It uses the same method as for
2704 implicit rules; in some cases this can lead either to unexpected values, or to
2705 an empty value being assigned. (Actually, this was true for earlier versions as
2706 well, even though the documentation stated otherwise.)
2708 .RS +4
2710 .ie t \(bu
2711 .el o
2712 \fBmake\fR no longer searches for \fBSCCS\fR history (\fBs\fR.) files.
2714 .RS +4
2716 .ie t \(bu
2717 .el o
2718 Suffix replacement in macro references are now applied after the macro is
2719 expanded.
2723 There is no guarantee that makefiles created for this version of \fBmake\fR
2724 work with earlier versions.
2727 If there is no \fBmake.rules\fR file in the current directory, and the file
2728 \fB/usr/share/lib/make/make.rules\fR is missing, \fBmake\fR stops before
2729 processing any targets. To force \fBmake\fR to run anyway, create an empty
2730 \fBmake.rules\fR file in the current directory.
2733 Once a dependency is made, \fBmake\fR assumes the dependency file is present
2734 for the remainder of the run. If a rule subsequently removes that file and
2735 future targets depend on its existence, unexpected errors can result.
2738 When hidden dependency checking is in effect, the \fB$?\fR macro's value
2739 includes the names of hidden dependencies.  This can lead to improper filename
2740 arguments to commands when \fB$?\fR is used in a rule.
2743 Pattern replacement macro references cannot be used in the dependency list of a
2744 pattern matching rule.
2747 Unlike previous versions, this version of \fBmake\fR strips a leading
2748 \fB\&./\fR from the value of the \fB$@\fR dynamic macro.
2751 With automatic \fBSCCS\fR retrieval, this version of \fBmake\fR does not
2752 support tilde suffix rules.
2755 The only dynamic macro whose value is strictly determined when used in a
2756 dependency list is \fB$@\fR (takes the form \fB$$@\fR).
2759 \fBmake\fR invokes the shell with the \fB-e\fR argument. This cannot be
2760 inferred from the syntax of the rule alone.