getconf: don't include xpg4 bits, gcc7 includes xpg6 bits for us
[unleashed.git] / share / man / man1 / dmake.1
blob658c69b4364a90e0ec59d2abc488b29c4a8ef433
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
30 .\"
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
35 .\"
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 .\"
42 .\"
43 .\" Copyright 1989 AT&T
44 .\" Portions Copyright (c) 1992, X/Open Company Limited  All Rights Reserved
45 .\" Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved
46 .\"
47 .TH MAKE 1 "Jun 24, 2015"
48 .SH NAME
49 dmake \- maintain, update, and regenerate related programs and files
50 .SH SYNOPSIS
51 .LP
52 .nf
53 \fB/usr/bin/dmake\fR [\fB-d\fR] [\fB-dd\fR] [\fB-D\fR] [\fB-DD\fR] [\fB-e\fR]
54      [\fB-i\fR] [\fB-j\fR \fImaxjobs\fR] [\fB-k\fR]  [\fB-m\fR \fI{serial | parallel}\fR]
55      [\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]
56      [\fB-f\fR \fImakefile\fR]... [\fB-K\fR \fIstatefile\fR]... [\fItarget\fR]...
57      [\fImacro\fR = \fIvalue\fR...]
58 .fi
60 .LP
61 .SH DESCRIPTION
62 .LP
63 The \fBmake\fR utility executes a list of shell commands associated with each
64 \fItarget\fR, typically to create or update a file of the same name.
65 \fImakefile\fR contains entries that describe how to bring a target up to date
66 with respect to those on which it depends, which are called \fIdependencies\fR.
67 Since each dependency is a target, it can have dependencies of its own.
68 Targets, dependencies, and sub-dependencies comprise a tree structure that
69 \fBmake\fR traces when deciding whether or not to rebuild a \fItarget\fR.
70 .sp
71 .LP
72 The \fBmake\fR utility recursively checks each \fItarget\fR against its
73 dependencies, beginning with the first target entry in \fImakefile\fR if no
74 \fItarget\fR argument is supplied on the command line. If, after processing all
75 of its dependencies, a target file is found either to be missing, or to be
76 older than any of its dependencies, \fBmake\fR rebuilds it. Optionally with
77 this version of \fBmake\fR, a target can be treated as out-of-date when the
78 commands used to generate it have changed since the last time the target was
79 built.
80 .sp
81 .LP
82 To build a given target, \fBmake\fR executes the list of commands, called a
83 \fIrule\fR. This rule can be listed explicitly in the target's makefile entry,
84 or it can be supplied implicitly by \fBmake\fR.
85 .sp
86 .LP
87 If no \fItarget\fR is specified on the command line, \fBmake\fR uses the first
88 target defined in \fImakefile\fR.
89 .sp
90 .LP
91 If a \fItarget\fR has no makefile entry, or if its entry has no rule,
92 \fBmake\fR attempts to derive a rule by each of the following methods, in turn,
93 until a suitable rule is found. Each method is described under Usage below.
94 .RS +4
95 .TP
96 .ie t \(bu
97 .el o
98 Pattern matching rules.
99 .RE
100 .RS +4
102 .ie t \(bu
103 .el o
104 Implicit rules, read in from a user-supplied makefile.
106 .RS +4
108 .ie t \(bu
109 .el o
110 Standard implicit rules (also known as suffix rules), typically read in from
111 the file \fB/usr/share/lib/make/make.rules\fR.
113 .RS +4
115 .ie t \(bu
116 .el o
117 \fBSCCS\fR retrieval. \fBmake\fR retrieves the most recent version from the
118 \fBSCCS\fR history file (if any).  See the description of the
119 \fB\&.SCCS_GET:\fR special-function target for details.
121 .RS +4
123 .ie t \(bu
124 .el o
125 The rule from the \fB\&.DEFAULT:\fR target entry, if there is such an entry in
126 the makefile.
130 If there is no makefile entry for a \fItarget\fR, if no rule can be derived for
131 building it, and if no file by that name is present, \fBmake\fR issues an error
132 message and halts.
133 .SH OPTIONS
135 The following options are supported:
137 .ne 2
139 \fB\fB-d\fR\fR
141 .RS 16n
142 Displays the reasons why \fBmake\fR chooses to rebuild a target. \fBmake\fR
143 displays any and all dependencies that are newer. In addition, \fBmake\fR
144 displays options read in from the \fBMAKEFLAGS\fR environment variable.
148 .ne 2
150 \fB\fB-dd\fR\fR
152 .RS 16n
153 Displays the dependency check and processing in vast detail.
157 .ne 2
159 \fB\fB-D\fR\fR
161 .RS 16n
162 Displays the text of the makefiles read in.
166 .ne 2
168 \fB\fB-DD\fR\fR
170 .RS 16n
171 Displays the text of the makefiles, \fBmake.rules\fR file, the state file, and
172 all hidden-dependency reports.
176 .ne 2
178 \fB\fB-e\fR\fR
180 .RS 16n
181 Environment variables override assignments within makefiles.
185 .ne 2
187 \fB\fB-f\fR \fImakefile\fR\fR
189 .RS 16n
190 Uses the description file \fImakefile\fR. A \fB\(mi\fR as the \fImakefile\fR
191 argument denotes the standard input. The contents of \fImakefile\fR, when
192 present, override the standard set of implicit rules and predefined macros.
193 When more than one \fB-f\fR \fImakefile\fR argument pair appears, \fBmake\fR
194 uses the concatenation of those files, in order of appearance.
196 When no \fImakefile\fR is specified, \fB/usr/bin/dmake\fR tries the following in
197 sequence, except when in POSIX mode (see \fB\&.POSIX\fR in Usage):
198 .RS +4
200 .ie t \(bu
201 .el o
202 If there is a file named \fBmakefile\fR in the working directory, \fBmake\fR
203 uses that file. If, however, there is an \fBSCCS\fR history file
204 (\fBSCCS/s.makefile\fR) which is newer, \fBmake\fR attempts to retrieve and use
205 the most recent version.
207 .RS +4
209 .ie t \(bu
210 .el o
211 In the absence of the above file(s), if a file named \fBMakefile\fR is present
212 in the working directory, \fBmake\fR attempts to use it.  If there is an
213 \fBSCCS\fR history file (\fBSCCS/s.Makefile\fR) that is newer, \fBmake\fR
214 attempts to retrieve and use the most recent version.
216 When no \fImakefile\fR is specified, \fB/usr/bin/dmake\fR in POSIX mode and
217 tries the following files in sequence:
218 .RS +4
220 .ie t \(bu
221 .el o
222 \fB\&./makefile\fR, \fB\&./Makefile\fR
224 .RS +4
226 .ie t \(bu
227 .el o
228 \fBs.makefile\fR, \fBSCCS/s.makefile\fR
230 .RS +4
232 .ie t \(bu
233 .el o
234 \fBs.Makefile\fR, \fBSCCS/s.Makefile\fR
239 .ne 2
241 \fB\fB-i\fR\fR
243 .RS 16n
244 Ignores error codes returned by commands.  Equivalent to the special-function
245 target \fB\&.IGNORE:\fR.
249 .ne 2
251 \fB-j\fR \fImaxjobs\fR
253 .RS 16n
254 Specify the maximum number of jobs that each instance of \fBmake\fR will invoke.
258 .ne 2
260 \fB\fB-k\fR\fR
262 .RS 16n
263 When a nonzero error status is returned by a rule, or when \fBmake\fR cannot
264 find a rule, abandons work on the current target, but continues with other
265 dependency branches that do not depend on it.
269 .ne 2
271 \fB\fB-K\fR \fIstatefile\fR\fR
273 .RS 16n
274 Uses the state file \fIstatefile\fR. A \fB\(mi\fR as the \fIstatefile\fR
275 argument denotes the standard input. The contents of \fIstatefile\fR, when
276 present, override the standard set of implicit rules and predefined macros.
277 When more than one \fB-K\fR \fIstatefile\fR argument pair appears, \fBmake\fR
278 uses the concatenation of those files, in order of appearance. (See also
279 \fB\&.KEEP_STATE\fR  and \fB\&.KEEP_STATE_FILE\fR in the Special-Function
280 Targets section).
284 .ne 2
286 \fB-m\fR \fI{serial | parallel}\fR
288 .RS 16n
289 Specify whether \fBmake\fR should execute jobs serially or in parallel.  The
290 default for \fBmake\fR is to run serially unless \fB-j\fR is specified.  The
291 default is for \fBdmake\fR is to run in parallel.
295 .ne 2
297 \fB\fB-n\fR\fR
299 .RS 16n
300 No execution mode. Prints commands, but does not execute them. Even lines
301 beginning with an \fB@\fR are printed. However, if a command line contains a
302 reference to the \fB$(MAKE)\fR macro, that line is always executed (see the
303 discussion of \fBMAKEFLAGS\fR in Reading Makefiles and the Environment). When
304 in POSIX mode, lines beginning with a "\fB+\fR" are executed.
308 .ne 2
310 \fB\fB-p\fR\fR
312 .RS 16n
313 Prints out the complete set of macro definitions and target descriptions.
317 .ne 2
319 \fB\fB-P\fR\fR
321 .RS 16n
322 Merely reports dependencies, rather than building them.
326 .ne 2
328 \fB\fB-q\fR\fR
330 .RS 16n
331 Question mode. \fBmake\fR returns a zero or nonzero status code depending on
332 whether or not the target file is up to date. When in POSIX mode, lines
333 beginning with a "\fB+\fR" are executed.
337 .ne 2
339 \fB\fB-r\fR\fR
341 .RS 16n
342 Does not read in the default makefile \fB/usr/share/lib/make/make.rules\fR.
346 .ne 2
348 \fB\fB-s\fR\fR
350 .RS 16n
351 Silent mode. Does not print command lines before executing them. Equivalent to
352 the special-function target \fB\&.SILENT:\fR.
356 .ne 2
358 \fB\fB-S\fR\fR
360 .RS 16n
361 Undoes the effect of the \fB-k\fR option. Stops processing when a non-zero exit
362 status is returned by a command.
366 .ne 2
368 \fB\fB-t\fR\fR
370 .RS 16n
371 Touches the target files (bringing them up to date) rather than performing
372 their rules. \fBWarning:\fR This can be \fBdangerous\fR when files are
373 maintained by more than one person. When the \fB\&.KEEP_STATE:\fR target
374 appears in the makefile, this option updates the state file just as if the
375 rules had been performed. When in POSIX mode, lines beginning with a "\fB+\fR"
376 are executed.
380 .ne 2
382 \fB\fB-V\fR\fR
384 .RS 16n
385 Puts \fBmake\fR into SysV mode. Refer to \fBsysV-make\fR(1) for respective
386 details.
389 .SH OPERANDS
391 The following operands are supported:
393 .ne 2
395 \fB\fItarget\fR\fR
397 .RS 15n
398 Target names, as defined in Usage.
402 .ne 2
404 \fB\fImacro\fR\fB=\fR\fIvalue\fR\fR
406 .RS 15n
407 Macro definition. This definition overrides any regular definition for the
408 specified macro within the makefile itself, or in the environment. However,
409 this definition can still be overridden by conditional macro assignments.
412 .SH USAGE
414 The usage of \fBmake\fR is described below:
415 .SS "Reading Makefiles and the Environment"
417 When \fBmake\fR first starts, it reads the \fBMAKEFLAGS\fR environment variable
418 to obtain any of the following options specified present in its value:
419 \fB-d\fR, \fB-D\fR, \fB-e\fR, \fB-i\fR, \fB-k\fR, \fB-n\fR, \fB-p\fR, \fB-q\fR,
420 \fB-r\fR, \fB-s\fR, \fB-S\fR, or \fB-t\fR. Due to the implementation of POSIX.2
421 (see \fBPOSIX.2\fR(5), the \fBMAKEFLAGS\fR values contains a leading \fB\(mi\fR
422 character. The \fBmake\fR utility then reads the command line for additional
423 options, which also take effect.
426 Next, \fBmake\fR reads in a default makefile that typically contains predefined
427 macro definitions, target entries for implicit rules, and additional rules,
428 such as the rule for retrieving \fBSCCS\fR files. If present, \fBmake\fR uses
429 the file \fBmake.rules\fR in the current directory; otherwise it reads the file
430 \fB/usr/share/lib/make/make.rules\fR, which contains the standard definitions
431 and rules. Use the directive:
433 .in +2
435 \fBinclude /usr/share/lib/make/make.rules\fR
437 .in -2
442 in your local \fBmake.rules\fR file to include them.
445 Next, \fBmake\fR imports variables from the environment (unless the \fB-e\fR
446 option is in effect), and treats them as defined macros. Because \fBmake\fR
447 uses the most recent definition it encounters, a macro definition in the
448 makefile normally overrides an environment variable of the same name. When
449 \fB-e\fR is in effect, however, environment variables are read in \fBafter\fR
450 all makefiles have been read. In that case, the environment variables take
451 precedence over definitions in the makefile.
454 Next, \fBmake\fR reads any makefiles you specify with \fB-f\fR, or one of
455 \fBmakefile\fR or \fBMakefile\fR as described above and then the state file, in
456 the local directory if it exists. If the makefile contains a
457 \fB\&.KEEP_STATE_FILE\fR target, then it reads the state file that follows the
458 target. Refer to special target \fB\&.KEEP_STATE_FILE\fR for details.
461 Next (after reading the environment if \fB-e\fR is in effect), \fBmake\fR reads
462 in any macro definitions supplied as command line arguments. These override
463 macro definitions in the makefile and the environment both, but only for the
464 \fBmake\fR command itself.
467 \fBmake\fR exports environment variables, using the most recently defined
468 value. Macro definitions supplied on the command line are not normally
469 exported, unless the macro is also an environment variable.
472 \fBmake\fR does not export macros defined in the makefile. If an environment
473 variable is set, and a macro with the same name is defined on the command line,
474 \fBmake\fR exports its value as defined on the command line. Unless \fB-e\fR is
475 in effect, macro definitions within the makefile take precedence over those
476 imported from the environment.
479 The macros \fBMAKEFLAGS\fR, \fBMAKE\fR, \fBSHELL\fR, \fBHOST_ARCH\fR,
480 \fBHOST_MACH\fR, and \fBTARGET_MACH\fR are special cases. See Special-Purpose
481 Macros below for details.
482 .SS "Makefile Target Entries"
484 A target entry has the following format:
486 .in +2
488        \fItarget\fR [\fB:\fR|\fB::\fR] [\fIdependency\fR] ... [\fB;\fR \fBcommand\fR] ...
489                       [\fBcommand\fR]
490                       ...
492 .in -2
496 The first line contains the name of a target, or a space-separated list of
497 target names, terminated with a colon or double colon. If a list of targets is
498 given, this is equivalent to having a separate entry of the same form for each
499 target. The colon(s) can be followed by a \fIdependency\fR, or a dependency
500 list. \fBmake\fR checks this list before building the target. The dependency
501 list can be terminated with a semicolon (\fB;\fR), which in turn can be
502 followed by a single Bourne shell command. Subsequent lines in the target entry
503 begin with a \fBTAB\fR and contain Bourne shell commands. These commands
504 comprise the rule for building the target.
507 Shell commands can be continued across input lines by escaping the
508 \fBNEWLINE\fR with a backslash (\fB\e\fR). The continuing line must also start
509 with a \fBTAB\fR.
512 To rebuild a target, \fBmake\fR expands macros, strips off initial \fBTAB\fR
513 characters and either executes the command directly (if it contains no shell
514 metacharacters), or passes each command line to a Bourne shell for execution.
517 The first \fInon-empty\fR line that does not begin with a \fBTAB\fR or \fB#\fR
518 begins another target or macro definition.
519 .SS "Special Characters"
521 Special characters are defined below.
522 .SS "\fIGlobal\fR"
523 .ne 2
525 \fB\fB#\fR\fR
527 .RS 20n
528 Start a comment. The comment ends at the next \fBNEWLINE\fR. If the \fB#\fR
529 follows the \fBTAB\fR in a command line, that line is passed to the shell
530 (which also treats \fB#\fR as the start of a comment).
534 .ne 2
536 \fB\fBinclude\fR \fIfilename\fR\fR
538 .RS 20n
539 If the word \fBinclude\fR appears as the first seven letters of a line and is
540 followed by a \fBSPACE\fR or \fBTAB\fR, the string that follows is taken as a
541 filename to interpolate at that line. \fBinclude\fR files can be nested to a
542 depth of no more than 38 nested makefiles. If \fIfilename\fR is a macro
543 reference, it is expanded.
546 .SS "\fITargets and Dependencies\fR"
547 .ne 2
549 \fB\fB:\fR\fR
551 .sp .6
552 .RS 4n
553 Target list terminator. Words following the colon are added to the dependency
554 list for the target or targets. If a target is named in more than one
555 colon-terminated target entry, the dependencies for all its entries are added
556 to form that target's complete dependency list.
560 .ne 2
562 \fB\fB::\fR\fR
564 .sp .6
565 .RS 4n
566 Target terminator for alternate dependencies. When used in place of a \fB:\fR
567 the double-colon allows a target to be checked and updated with respect to
568 alternate dependency lists. When the target is out-of-date with respect to
569 dependencies listed in the first alternate, it is built according to the rule
570 for that entry. When out-of-date with respect to dependencies in another
571 alternate, it is built according the rule in that other entry. Implicit rules
572 do not apply to double-colon targets; you must supply a rule for each entry. If
573 no dependencies are specified, the rule is always performed.
577 .ne 2
579 \fB\fItarget\fR [\fB+\fR \fItarget\fR.\|.\|.\|] \fB:\fR\fR
581 .sp .6
582 .RS 4n
583 Target group. The rule in the target entry builds all the indicated targets as
584 a group. It is normally performed only once per \fBmake\fR run, but is checked
585 for command dependencies every time a target in the group is encountered in the
586 dependency scan.
590 .ne 2
592 \fB\fB%\fR\fR
594 .sp .6
595 .RS 4n
596 Pattern matching wild card metacharacter.  Like the \fB*\fR shell wild card,
597 \fB%\fR matches any string of zero or more characters in a target name or
598 dependency, in the target portion of a conditional macro definition, or within
599 a pattern replacement macro reference. Notice that only one \fB%\fR can appear
600 in a target, dependency-name, or pattern-replacement macro reference.
604 .ne 2
606 \fB\fB\&./\fR\fIpathname\fR\fR
608 .sp .6
609 .RS 4n
610 \fBmake\fR ignores the leading \fB\&./\fR characters from targets with names
611 given as pathnames relative to "dot," the working directory.
614 .SS "\fIMacros\fR"
615 .ne 2
617 \fB\fB=\fR\fR
619 .RS 9n
620 Macro definition. The word to the left of this character is the macro name;
621 words to the right comprise its value. Leading and trailing white space
622 characters are stripped from the value. A word break following the \fB=\fR is
623 implied.
627 .ne 2
629 \fB\fB$\fR\fR
631 .RS 9n
632 Macro reference. The following character, or the parenthesized or bracketed
633 string, is interpreted as a macro reference: \fBmake\fR expands the reference
634 (including the \fB$\fR) by replacing it with the macro's value.
638 .ne 2
640 \fB\fB( )\fR\fR
644 \fB\fB{ }\fR\fR
646 .RS 9n
647 Macro-reference name delimiters. A parenthesized or bracketed word appended to
648 a \fB$\fR is taken as the name of the macro being referred to. Without the
649 delimiters, \fBmake\fR recognizes only the first character as the macro name.
653 .ne 2
655 \fB\fB$$\fR\fR
657 .RS 9n
658 A reference to the dollar-sign macro, the value of which is the character
659 \fB$\fR. Used to pass variable expressions beginning with \fB$\fR to the shell,
660 to refer to environment variables which are expanded by the shell, or to delay
661 processing of dynamic macros within the dependency list of a target, until that
662 target is actually processed.
666 .ne 2
668 \fB\fB\e$\fR\fR
670 .RS 9n
671 Escaped dollar-sign character.  Interpreted as a literal dollar sign within a
672 rule.
676 .ne 2
678 \fB\fB+=\fR\fR
680 .RS 9n
681 When used in place of \fB=\fR, appends a string to a macro definition (must be
682 surrounded by white space, unlike \fB=\fR).
686 .ne 2
688 \fB\fB:=\fR\fR
690 .RS 9n
691 Conditional macro assignment. When preceded by a list of targets with explicit
692 target entries, the macro definition that follows takes effect when processing
693 only those targets, and their dependencies.
697 .ne 2
699 \fB\fB:sh\fR \fB=\fR\fR
701 .RS 9n
702 Define the value of a macro to be the output of a command (see Command
703 Substitutions below).
707 .ne 2
709 \fB\fB:sh\fR\fR
711 .RS 9n
712 In a macro reference, execute the command stored in the macro, and replace the
713 reference with the output of that command (see \fBCommand Substitutions\fR
714 below).
717 .SS "\fIRules\fR"
718 .ne 2
720 \fB\fB+\fR\fR
722 .RS 8n
723 \fBmake\fR always executes the commands preceded by a "\fB+\fR", even when
724 \fB-n\fR is specified.
728 .ne 2
730 \fB\fB\(mi\fR\fR
732 .RS 8n
733 \fBmake\fR ignores any nonzero error code returned by a command line for which
734 the first non-\fBTAB\fR character is a \fB\(mi\fR\&. This character is not
735 passed to the shell as part of the command line. \fBmake\fR normally terminates
736 when a command returns nonzero status, unless the \fB-i\fR or \fB-k\fR options,
737 or the \fB\&.IGNORE:\fR special-function target is in effect.
741 .ne 2
743 \fB\fB@\fR\fR
745 .RS 8n
746 If the first non-\fBTAB\fR character is a \fB@\fR, \fBmake\fR does not print
747 the command line before executing it. This character is not passed to the
748 shell.
752 .ne 2
754 \fB\fB?\fR\fR
756 .RS 8n
757 Escape command-dependency checking. Command lines starting with this character
758 are not subject to command dependency checking.
762 .ne 2
764 \fB\fB!\fR\fR
766 .RS 8n
767 Force command-dependency checking. Command-dependency checking is applied to
768 command lines for which it would otherwise be suppressed. This checking is
769 normally suppressed for lines that contain references to the \fB?\fR dynamic
770 macro (for example, \fB$?\fR).
772 When any combination of \fB+\fR, \fB\(mi\fR, \fB@\fR, \fB?\fR, or \fB!\fR
773 appear as the first characters after the \fBTAB\fR, all that are present apply.
774 None are passed to the shell.
777 .SS "Special-Function Targets"
779 When incorporated in a makefile, the following target names perform
780 special-functions:
782 .ne 2
784 \fB\fB\&.DEFAULT:\fR\fR
786 .RS 23n
787 If it has an entry in the makefile, the rule for this target is used to process
788 a target when there is no other entry for it, no rule for building it, and no
789 \fBSCCS\fR history file from which to retrieve a current version. \fBmake\fR
790 ignores any dependencies for this target.
794 .ne 2
796 \fB\fB\&.DONE:\fR\fR
798 .RS 23n
799 If defined in the makefile, \fBmake\fR processes this target and its
800 dependencies after all other targets are built.  This target is also performed
801 when \fBmake\fR halts with an error, unless the \fB\&.FAILED\fR target is
802 defined.
806 .ne 2
808 \fB\fB\&.FAILED:\fR\fR
810 .RS 23n
811 This target, along with its dependencies, is performed instead of \fB\&.DONE\fR
812 when defined in the makefile and \fBmake\fR halts with an error.
816 .ne 2
818 \fB\fB\&.GET_POSIX:\fR\fR
820 .RS 23n
821 This target contains the rule for retrieving the current version of an
822 \fBSCCS\fR file from its history file in the current working directory.
823 \fBmake\fR uses this rule when it is running in POSIX mode.
827 .ne 2
829 \fB\fB\&.IGNORE:\fR\fR
831 .RS 23n
832 Ignore errors.  When this target appears in the makefile, \fBmake\fR ignores
833 non-zero error codes returned from commands. When used in POSIX mode,
834 \fB\&.IGNORE\fR could be followed by target names only, for which the errors is
835 ignored.
839 .ne 2
841 \fB\fB\&.INIT:\fR\fR
843 .RS 23n
844 If defined in the makefile, this target and its dependencies are built before
845 any other targets are processed.
849 .ne 2
851 \fB\fB\&.KEEP_STATE:\fR\fR
853 .RS 23n
854 If this target is in effect, \fBmake\fR updates the state file,
855 \fB\&.make.state\fR, in the current directory.  This target also activates
856 command dependencies, and hidden dependency checks. If either the
857 \fB\&.KEEP_STATE:\fR target appears in the makefile, or the environment
858 variable \fBKEEP_STATE\fR is set (\fBsetenv KEEP_STATE\fR), \fBmake\fR rebuilds
859 everything in order to collect dependency information, even if all the targets
860 were up to date due to previous \fBmake\fR runs. See also the Environment
861 Variables section.  This target has no effect if used in POSIX mode.
865 .ne 2
867 \fB\fB\&.KEEP_STATE_FILE:\fR\fR
869 .RS 23n
870 This target has no effect if used in POSIX mode. This target implies
871 \fB\&.KEEP_STATE\fR. If the target is followed by a filename, \fBmake\fR uses
872 it as the state file. If the target is followed by a directory name, \fBmake\fR
873 looks for a \fB\&.make.state\fR file in that directory. If the target is not
874 followed by any name, \fBmake\fR looks for \fB\&.make.state\fR file in the
875 current working directory.
879 .ne 2
881 \fB\fB\&.MAKE_VERSION:\fR\fR
883 .RS 23n
884 A target-entry of the form:
886 .in +2
888 \&.MAKE_VERSION:  VERSION\(mi\fInumber\fR
890 .in -2
892 enables version checking. If the version of \fBmake\fR differs from the version
893 indicated by a string like \fBVERSION-1.0\fR, \fBmake\fR issues a warning
894 message.
898 .ne 2
900 \fB\fB\&.NO_PARALLEL:\fR\fR
902 .RS 23n
903 Dependencies of this target will be executed serially.
907 .ne 2
909 \fB\fB\&.PARALLEL:\fR\fR
911 .RS 23n
912 Dependencies of this target will be executed in parallel.
916 .ne 2
918 \fB\fB\&.POSIX:\fR\fR
920 .RS 23n
921 This target enables POSIX mode.
925 .ne 2
927 \fB\fB\&.PRECIOUS:\fR\fR
929 .RS 23n
930 List of files not to delete. \fBmake\fR does not remove any of the files listed
931 as dependencies for this target when interrupted. \fBmake\fR normally removes
932 the current target when it receives an interrupt. When used in POSIX mode, if
933 the target is not followed by a list of files, all the file are assumed
934 precious.
938 .ne 2
940 \fB\fB\&.SCCS_GET:\fR\fR
942 .RS 23n
943 This target contains the rule for retrieving the current version of an
944 \fBSCCS\fR file from its history file. To suppress automatic retrieval, add an
945 entry for this target with an empty rule to your makefile.
949 .ne 2
951 \fB\fB\&.SCCS_GET_POSIX:\fR\fR
953 .RS 23n
954 This target contains the rule for retrieving the current version of an
955 \fBSCCS\fR file from its history file. \fBmake\fR uses this rule when it is
956 running in POSIX mode.
960 .ne 2
962 \fB\fB\&.SILENT:\fR\fR
964 .RS 23n
965 Run silently. When this target appears in the makefile, \fBmake\fR does not
966 echo commands before executing them. When used in POSIX mode, it could be
967 followed by target names, and only those are executed silently.
971 .ne 2
973 \fB\fB\&.SUFFIXES:\fR\fR
975 .RS 23n
976 The suffixes list for selecting implicit rules (see The Suffixes List).
980 .ne 2
982 \fB\fB\&.WAIT:\fR\fR
984 .RS 23n
985 In a dependency list, wait until any dependency preceding this has completed
986 before moving on to any dependency following it.
989 .SS "\fIClearing Special Targets\fR"
991 In this version of \fBmake\fR, you can clear the definition of the following
992 special targets by supplying entries for them with no dependencies and no rule:
995 \fB\&.DEFAULT, .SCCS_GET,  and .SUFFIXES\fR
996 .SS "Command Dependencies"
998 When the \fB\&.KEEP_STATE:\fR target is effective, \fBmake\fR checks the
999 command for building a target against the state file. If the command has
1000 changed since the last \fBmake\fR run, \fBmake\fR rebuilds the target.
1001 .SS "Hidden Dependencies"
1003 When the \fB\&.KEEP_STATE:\fR target is effective, \fBmake\fR reads reports
1004 from \fBcpp\fR(1) and other compilation processors for any "hidden" files, such
1005 as \fB#include\fR files. If the target is out of date with respect to any of
1006 these files, \fBmake\fR rebuilds it.
1007 .SS "Macros"
1009 Entries of the form
1011 .in +2
1013 \fImacro\fR\fB=\fR\fIvalue\fR
1015 .in -2
1019 define macros. \fImacro\fR is the name of the macro, and \fIvalue\fR, which
1020 consists of all characters up to a comment character or unescaped
1021 \fBNEWLINE\fR, is the value. \fBmake\fR strips both leading and trailing white
1022 space in accepting the value.
1025 Subsequent references to the macro, of the forms: \fB$(\fR\fIname\fR\fB)\fR or
1026 \fB${\fR\fIname\fR\fB}\fR are replaced by \fIvalue\fR. The parentheses or
1027 brackets can be omitted in a reference to a macro with a single-character name.
1030 Macro references can contain references to other macros, in which case nested
1031 references are expanded first.
1032 .SS "\fISuffix Replacement Macro References\fR"
1034 Substitutions within macros can be made as follows:
1036 .in +2
1038      \fB$(\fR\fIname\fR\fB:\fR\fIstring1\fR\fB=\fR\fIstring2\fR\fB)\fR
1040 .in -2
1044 where \fIstring1\fR is either a suffix, or a word to be replaced in the macro
1045 definition, and \fIstring2\fR is the replacement suffix or word. Words in a
1046 macro value are separated by \fBSPACE\fR, \fBTAB\fR, and escaped \fBNEWLINE\fR
1047 characters.
1048 .SS "\fIPattern Replacement Macro References\fR"
1050 Pattern matching replacements can also be applied to macros, with a reference
1051 of the form:
1053 .in +2
1055      \fB$(\fR\fIname\fR\fB:\fR \fIop\fR\fB%\fR\fIos\fR\fB=\fR \fInp\fR\fB%\fR\fIns\fR\fB)\fR
1057 .in -2
1061 where \fIop\fR is the existing (old) prefix and \fIos\fR is the existing (old)
1062 suffix, \fInp\fR and \fIns\fR are the new prefix and new suffix, respectively,
1063 and the pattern matched by \fB%\fR (a string of zero or more characters), is
1064 carried forward from the value being replaced. For example:
1066 .in +2
1068 \fBPROGRAM=fabricate
1069 DEBUG= $(PROGRAM:%=tmp/%\(mig)\fR
1071 .in -2
1076 sets the value of \fBDEBUG\fR to \fBtmp/fabricate\(mig\fR.
1079 Notice that pattern replacement macro references cannot be used in the
1080 dependency list of a pattern matching rule; the \fB%\fR characters are not
1081 evaluated independently. Also, any number of \fB%\fR metacharacters can appear
1082 after the equal-sign.
1083 .SS "\fIAppending to a Macro\fR"
1085 Words can be appended to macro values as follows:
1087 .in +2
1089      \fImacro\fR \fB+=\fR \fIword .\|.\|.\fR
1091 .in -2
1093 .SS "Special-Purpose Macros"
1095 When the \fBMAKEFLAGS\fR variable is present in the environment, \fBmake\fR
1096 takes options from it, in combination with options entered on the command line.
1097 \fBmake\fR retains this combined value as the \fBMAKEFLAGS\fR macro, and
1098 exports it automatically to each command or shell it invokes.
1101 Notice that flags passed by way of \fBMAKEFLAGS\fR are only displayed when the
1102 \fB-d\fR, or \fB-dd\fR options are in effect.
1105 The \fBMAKE\fR macro is another special case. It has the value \fBmake\fR by
1106 default, and temporarily overrides the \fB-n\fR option for any line in which it
1107 is referred to. This allows nested invocations of \fBmake\fR written as:
1109 .in +2
1111      \fB$(MAKE)\fR .\|.\|.
1113 .in -2
1117 to run recursively, with the \fB-n\fR flag in effect for all commands but
1118 \fBmake\fR. This lets you use \fBmake\fR \fB-n\fR to test an entire hierarchy
1119 of makefiles.
1122 For compatibility with the 4.2 \fBBSD\fR \fBmake\fR, the \fBMFLAGS\fR macro is
1123 set from the \fBMAKEFLAGS\fR variable by prepending a \fB-\fR\&. \fBMFLAGS\fR
1124 is not exported automatically.
1127 The \fBSHELL\fR macro, when set to a single-word value such as
1128 \fB/usr/bin/csh\fR, indicates the name of an alternate shell to use. The
1129 default is \fB/bin/sh\fR. Notice that \fBmake\fR executes commands that contain
1130 no shell metacharacters itself. Built-in commands, such as \fBdirs\fR in the C
1131 shell, are not recognized unless the command line includes a metacharacter (for
1132 instance, a semicolon). This macro is neither imported from, nor exported to
1133 the environment, regardless of \fB-e\fR. To be sure it is set properly, you
1134 must define this macro within every makefile that requires it.
1137 The syntax of the \fBVPATH\fR macro is:
1139 .in +2
1141      \fBVPATH\fR = [ \fIpathname\fR [ : \fIpathname\fR ] ... ]
1143 .in -2
1147 \fBVPATH\fR specifies a list of directories to search for the files, which are
1148 targets or dependencies, when \fBmake\fR is executed.  \fBVPATH\fR is also used
1149 in order to search for the \fBinclude\fR files mentioned in the particular
1150 makefile.
1153 When processing a target or a dependency or an include directive, \fBmake\fR
1154 checks the existence of the file with the same name in the current directory.
1155 If the file is found to be missing, \fBmake\fR searches for this file in the
1156 list of directories presented in \fBVPATH\fR (like the \fBPATH\fR variable in
1157 the shell). Unlike the \fBPATH\fR variable, \fBVPATH\fR is used in order to
1158 search for the files with relative pathnames. When \fBmake\fR attempts to apply
1159 implicit rules to the target, it also searches for the dependency files using
1160 \fBVPATH\fR.
1163 When the file is found using \fBVPATH\fR, internal macros \fB$@\fR, \fB@<\fR,
1164 \fB$?\fR, \fB$*\fR, and their alternative forms (with \fBD\fR or \fBF\fR
1165 appended) are set in accordance with the name derived from \fBVPATH\fR. For
1166 instance, if the target \fBsubdir/foo.o\fR is found in the directory
1167 \fB/aaa/bbb\fR using \fBVPATH\fR, then the value of the internal macro \fB$@\fR
1168 for this target is \fB/aaa/bbb/subdir/foo.o\fR.
1171 If a target or a dependency file is found using \fBVPATH\fR, then any
1172 occurrences of the word that is the same as the target name in the subsequent
1173 rules are replaced with the actual name of the target derived from \fBVPATH\fR.
1176 For example:
1178 .in +2
1180 \fBVPATH=./subdir
1181 file.o : file.c
1182          cc -c file.c -o file.o\fR
1184 .in -2
1189 If \fBfile.c\fR is found in \fB\&./subdir\fR, then the command
1191 .in +2
1193 \fBcc -c ./subdir/file.c -o file.o\fR
1195 .in -2
1200 are executed.
1203 The following macros are provided for use with cross-compilation:
1205 .ne 2
1207 \fB\fBHOST_ARCH\fR\fR
1209 .RS 15n
1210 The processor type of the host system. By default, this is the output of the
1211 \fBuname\fR(1) command with the \fB\(mip\fR option, prepended with
1212 \fB-\fR\&. Under normal circumstances, this value should never be altered by
1213 the user.
1217 .ne 2
1219 \fB\fBHOST_MACH\fR\fR
1221 .RS 15n
1222 The machine architecture of the host system. By default, this is the output of
1223 the \fBuname\fR(1) command with \fB\(mim\fR option, prepended with
1224 \fB\(mi\fR\&. Under normal circumstances, this value should never be altered
1225 by the user.
1229 .ne 2
1231 \fB\fBTARGET_ARCH\fR\fR
1233 .RS 15n
1234 The processor type of the target system. By default, the output of
1235 \fBuname\fR with the \fB\(mip\fR option, prepended with \fB\(mi\fR\&.
1238 .SS "Dynamic Macros"
1240 There are several dynamically maintained macros that are useful as
1241 abbreviations within rules. They are shown here as references; if you were to
1242 define them, \fBmake\fR would simply override the definition.
1244 .ne 2
1246 \fB\fB$*\fR\fR
1248 .RS 6n
1249 The basename of the current target, derived as if selected for use with an
1250 implicit rule.
1254 .ne 2
1256 \fB\fB$<\fR\fR
1258 .RS 6n
1259 The name of a dependency file, derived as if selected for use with an implicit
1260 rule.
1264 .ne 2
1266 \fB\fB$@\fR\fR
1268 .RS 6n
1269 The name of the current target. This is the only dynamic macro whose value is
1270 strictly determined when used in a dependency list. (In which case it takes the
1271 form \fB$$@\fR.)
1275 .ne 2
1277 \fB\fB$?\fR\fR
1279 .RS 6n
1280 The list of dependencies that are newer than the target. Command-dependency
1281 checking is automatically suppressed for lines that contain this macro, just as
1282 if the command had been prefixed with a \fB?\fR. See the description of
1283 \fB?\fR, under \fBSpecial Character\fR Rules above. You can force this check
1284 with the \fB!\fR command-line prefix.
1288 .ne 2
1290 \fB\fB$%\fR\fR
1292 .RS 6n
1293 The name of the library member being processed. (See Library Maintenance
1294 below.)
1299 To refer to the \fB$@\fR dynamic macro within a dependency list, precede the
1300 reference with an additional \fB$\fR character (as in, \fB$$@\fR). Because
1301 \fBmake\fR assigns \fB$<\fR and \fB$*\fR as it would for implicit rules
1302 (according to the suffixes list and the directory contents), they can be
1303 unreliable when used within explicit target entries.
1306 These macros can be modified to apply either to the filename part, or the
1307 directory part of the strings they stand for, by adding an upper case \fBF\fR
1308 or \fBD\fR, respectively (and enclosing the resulting name in parentheses or
1309 braces). Thus, \fB$(@D)\fR refers to the directory part of the string \fB$@\fR;
1310 if there is no directory part, \fB\&.\fR is assigned. \fB$(@F)\fR refers to the
1311 filename part.
1312 .SS "Conditional Macro Definitions"
1314 A macro definition of the form:
1316 .in +2
1318 \fItarget-list\fR \fB:=\fR \fImacro\fR \fB=\fR \fIvalue\fR
1320 .in -2
1324 indicates that when processing any of the targets listed \fIand their
1325 dependencies\fR, \fImacro\fR is to be set to the \fIvalue\fR supplied. Notice
1326 that if a conditional macro is referred to in a dependency list, the \fB$\fR
1327 must be delayed (use \fB$$\fR instead). Also, \fItarget-list\fR can contain a
1328 \fB%\fR pattern, in which case the macro is conditionally defined for all
1329 targets encountered that match the pattern. A pattern replacement reference can
1330 be used within the \fIvalue\fR.
1333 You can temporarily append to a macros value with a conditional definition of
1334 the form:
1336 .in +2
1338 \fItarget-list\fR \fB:=\fR \fImacro\fR \fB+=\fR \fIvalue\fR
1340 .in -2
1342 .SS "Predefined Macros"
1344 \fBmake\fR supplies the macros shown in the table that follows for compilers
1345 and their options, host architectures, and other commands. Unless these macros
1346 are read in as environment variables, their values are not exported by
1347 \fBmake\fR. If you run \fBmake\fR with any of these set in the environment, it
1348 is a good idea to add commentary to the makefile to indicate what value each is
1349 expected to take. If \fB-r\fR is in effect, \fBmake\fR does not read the
1350 default makefile (\fB\&./make.rules\fR or \fB/usr/share/lib/make/make.rules\fR)
1351 in which these macro definitions are supplied.
1356 box;
1357 cw(1i) | cw(1.17i) | cw(3.33i)
1358 cw(1i) | cw(1.17i) | cw(3.33i) .
1359 \fITable of Predefined Macros\fR
1361 \fIUse\fR       \fIMacro\fR     \fIDefault Value\fR
1363 Library \fBAR\fR        \fBar\fR
1364 Archives        \fBARFLAGS\fR   \fBrv\fR
1367 Assembler       \fBAS\fR        \fBas\fR
1368 Commands        \fBASFLAGS\fR
1369         \fBCOMPILE.s\fR \fB$(AS) $(ASFLAGS)\fR
1370         \fBCOMPILE.S\fR \fB$(CC) $(ASFLAGS) $(CPPFLAGS)\fR \fB-c\fR
1373 C       \fBCC\fR        \fBcc\fR
1374 Compiler        \fBCFLAGS\fR
1375 Commands        \fBCPPFLAGS\fR
1376         \fBCOMPILE.c\fR \fB$(CC) $(CFLAGS) $(CPPFLAGS)\fR \fB-c\fR
1377         \fBLINK.c\fR    \fB$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)\fR
1380 C++     \fBCCC\fR       \fBCC\fR
1381 Compiler        \fBCCFLAGS\fR   \fBCFLAGS\fR
1382 Commands        \fBCPPFLAGS\fR
1383         \fBCOMPILE.cc\fR        \fB$(CCC) $(CCFLAGS) $(CPPFLAGS)\fR \fB-c\fR
1384         \fBLINK.cc\fR   \fB$(CCC) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)\fR
1385         \fBCOMPILE.C\fR \fB$(CCC) $(CCFLAGS) $(CPPFLAGS)\fR \fB-c\fR
1386         \fBLINK.C\fR    \fB$(CCC) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)\fR
1389 FORTRAN 77      \fBFC\fR        \fBf77\fR
1390 Compiler        \fBFFLAGS\fR
1391 Commands        \fBCOMPILE.f\fR \fB$(FC) $(FFLAGS)\fR \fB-c\fR
1392         \fBLINK.f\fR    \fB$(FC) $(FFLAGS) $(LDFLAGS)\fR
1393         \fBCOMPILE.F\fR \fB$(FC) $(FFLAGS) $(CPPFLAGS)\fR \fB-c\fR
1394         \fBLINK.F\fR    \fB$(FC) $(FFLAGS) $(CPPFLAGS) $(LDFLAGS)\fR
1397 FORTRAN 90      \fBFC\fR        \fBf90\fR
1398 Compiler        \fBF90FLAGS\fR
1399 Commands        \fBCOMPILE.f90\fR       \fB$(F90C) $(F90FLAGS)\fR \fB-c\fR
1400         \fBLINK.f90\fR  \fB$(F90C) $(F90FLAGS) $(LDFLAGS)\fR
1401         \fBCOMPILE.ftn\fR       \fB$(F90C) $(F90FLAGS) $(CPPFLAGS)\fR \fB-c\fR
1402         \fBLINK.ftn\fR  T{
1403 \fB$(F90C) $(F90FLAGS) $(CPPFLAGS) $(LDFLAGS)\fR
1407 Link Editor     \fBLD\fR        \fBld\fR
1408 Command \fBLDFLAGS\fR
1411 lex     \fBLEX\fR       \fBlex\fR
1412 Command \fBLFLAGS\fR
1413         \fBLEX.l\fR     \fB$(LEX) $(LFLAGS)\fR \fB-t\fR
1416 lint    \fBLINT\fR      \fBlint\fR
1417 Command \fBLINTFLAGS\fR
1418         \fBLINT.c\fR    \fB$(LINT) $(LINTFLAGS) $(CPPFLAGS)\fR
1421 Modula 2        \fBM2C\fR       \fBm2c\fR
1422 Commands        \fBM2FLAGS\fR
1423         \fBMODFLAGS\fR
1424         \fBDEFFLAGS\fR
1425         \fBCOMPILE.def\fR       \fB$(M2C) $(M2FLAGS) $(DEFFLAGS)\fR
1426         \fBCOMPILE.mod\fR       \fB$(M2C) $(M2FLAGS) $(MODFLAGS)\fR
1429 Pascal  \fBPC\fR        \fBpc\fR
1430 Compiler        \fBPFLAGS\fR
1431 Commands        \fBCOMPILE.p\fR \fB$(PC) $(PFLAGS) $(CPPFLAGS)\fR \fB-c\fR
1432         \fBLINK.p\fR    \fB$(PC) $(PFLAGS) $(CPPFLAGS) $(LDFLAGS)\fR
1435 Ratfor  \fBRFLAGS\fR
1436 Compilation     \fBCOMPILE.r\fR \fB$(FC) $(FFLAGS) $(RFLAGS)\fR \fB-c\fR
1437 Commands        \fBLINK.r\fR    \fB$(FC) $(FFLAGS) $(RFLAGS) $(LDFLAGS)\fR
1440 rm Command      \fBRM\fR        \fBrm\fR \fB-f\fR
1443 sccs    \fBSCCSFLAGS\fR
1444 Command \fBSCCSGETFLAGS\fR      \fB-s\fR
1447 yacc    \fBYACC\fR      \fByacc\fR
1448 Command \fBYFLAGS\fR
1449         \fBYACC.y\fR    \fB$(YACC) $(YFLAGS)\fR
1452 Suffixes List   \fBSUFFIXES\fR  T{
1453 \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
1457 .SS "Implicit Rules"
1459 When a target has no entry in the makefile, \fBmake\fR attempts to determine
1460 its class (if any) and apply the rule for that class. An implicit rule
1461 describes how to build any target of a given class, from an associated
1462 dependency file. The class of a target can be determined either by a pattern,
1463 or by a suffix; the corresponding dependency file (with the same basename) from
1464 which such a target might be built. In addition to a predefined set of implicit
1465 rules, \fBmake\fR allows you to define your own, either by pattern, or by
1466 suffix.
1467 .SS "\fIPattern Matching Rules\fR"
1469 A target entry of the form:
1471 .in +2
1473 \fItp\fR\fB%\fR\fIts\fR:\|\fIdp\fR\fB%\fR\fIds\fR
1474      \fIrule\fR
1476 .in -2
1481 is a pattern matching rule, in which \fItp\fR is a target prefix, \fIts\fR is a
1482 target suffix, \fIdp\fR is a dependency prefix, and \fIds\fR is a dependency
1483 suffix (any of which can be null). The \fB%\fR stands for a basename of zero or
1484 more characters that is matched in the target, and is used to construct the
1485 name of a dependency. When \fBmake\fR encounters a match in its search for an
1486 implicit rule, it uses the rule in that target entry to build the target from
1487 the dependency file. Pattern-matching implicit rules typically make use of the
1488 \fB$@\fR and \fB$<\fR dynamic macros as placeholders for the target and
1489 dependency names. Other, regular dependencies can occur in the dependency list;
1490 however, none of the regular dependencies can contain \fB%\fR. An entry of the
1491 form:
1493 .in +2
1495 \fItp\fR%\fIts\fR:\|[\fIdependency .\|.\|.\fR\|] \fIdp\fR%\fIds\fR\|[\fIdependency .\|.\|.\fR\|]
1496      \fIrule\fR
1498 .in -2
1503 is a valid pattern matching rule.
1504 .SS "\fISuffix Rules\fR"
1506 When no pattern matching rule applies, \fBmake\fR checks the target name to see
1507 if it ends with a suffix in the known suffixes list. If so, \fBmake\fR checks
1508 for any suffix rules, as well as a dependency file with same root and another
1509 recognized suffix, from which to build it.
1512 The target entry for a suffix rule takes the form:
1514 .in +2
1516 \fIDsTs\fR: \fIrule\fR
1518 .in -2
1523 where \fITs\fR is the suffix of the target, \fIDs\fR is the suffix of the
1524 dependency file, and \fIrule\fR is the rule for building a target in the class.
1525 Both \fIDs\fR and \fITs\fR must appear in the suffixes list. (A suffix need not
1526 begin with a \fB\&.\fR to be recognized.)
1529 A suffix rule with only one suffix describes how to build a target having a
1530 null (or no) suffix from a dependency file with the indicated suffix. For
1531 instance, the \fB\&.c\fR rule could be used to build an executable program
1532 named \fBfile\fR from a C source file named \fBfile.c\fR. If a target with a
1533 null suffix has an explicit dependency, \fBmake\fR omits the search for a
1534 suffix rule.
1539 box;
1540 cw(1.57i) |cw(3.93i)
1541 cw(1.57i) |cw(3.93i) .
1543 \fITable of Standard Implicit (Suffix) Rules for Assembly Files\fR
1546 \fIImplicit Rule Name\fR        \fICommand Line\fR
1548 \fB\&.s.o\fR    \fB$(COMPILE.s)\fR \fB-o\fR \fB$@ $<\fR
1551 \fB\&.s.a\fR    \fB$(COMPILE.s)\fR \fB-o\fR \fB$% $<\fR
1552         \fB$(AR) $(ARFLAGS) $@ $%\fR
1553         \fB$(RM) $%\fR
1556 \fB\&.s~.o\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.s\fR
1557         \fB$(COMPILE.s)\fR \fB-o\fR \fB$@ $*.s\fR
1560 \fB\&.S.o\fR    \fB$(COMPILE.S)\fR \fB-o\fR \fB$@ $<\fR
1563 \fB\&.S.a\fR    \fB$(COMPILE.S)\fR \fB-o\fR \fB$% $<\fR
1564         \fB$(AR) $(ARFLAGS) $@ $%\fR
1565         \fB$(RM) $%\fR
1568 \fB\&.S~.o\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.S\fR
1569         \fB$(COMPILE.S)\fR \fB-o\fR \fB$@ $*.S\fR
1572 \fB\&.S~.a\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.S\fR
1573         \fB$(COMPILE.S)\fR \fB-o\fR \fB$% $*.S\fR
1574         \fB$(AR) $(ARFLAGS) $@ $%\fR
1575         \fB$(RM) $%\fR
1582 box;
1583 cw(1.57i) |cw(3.93i)
1584 cw(1.57i) |cw(3.93i) .
1586 \fITable of Standard Implicit (Suffix) Rules for C Files\fR
1589 \fIImplicit Rule Name\fR        \fICommand Line\fR
1591 \fB\&.c\fR      \fB$(LINK.c)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR
1594 \fB\&.c.ln\fR   \fB$(LINT.c) $(OUTPUT_OPTION)\fR \fB-i\fR \fB$<\fR
1597 \fB\&.c.o\fR    \fB$(COMPILE.c) $(OUTPUT_OPTION) $<\fR
1600 \fB\&.c.a\fR    \fB$(COMPILE.c)\fR \fB-o\fR \fB$% $<\fR
1601         \fB$(AR) $(ARFLAGS) $@ $%\fR
1602         \fB$(RM) $%\fR
1605 \fB\&.c~\fR     \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.c\fR
1606         \fB$(CC) $(CFLAGS) $(LDFLAGS)\fR \fB-o\fR \fB$@ $*.c\fR
1609 \fB\&.c~.o\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.c\fR
1610         \fB$(CC) $(CFLAGS)\fR \fB-c\fR \fB$*.c\fR
1613 \fB\&.c~.ln\fR  \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.c\fR
1614         \fB$(LINT.c) $(OUTPUT_OPTION)\fR \fB-c\fR \fB$*.c\fR
1617 \fB\&.c~.a\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.c\fR
1618         \fB$(COMPILE.c)\fR \fB-o\fR \fB$% $*.c\fR
1619         \fB$(AR) $(ARFLAGS) $@ $%\fR
1620         \fB$(RM) $%\fR
1627 box;
1628 cw(1.57i) |cw(3.93i)
1629 cw(1.57i) |cw(3.93i) .
1631 \fITable of Standard Implicit (Suffix) Rules for C++ Files\fR
1634 \fIImplicit Rule Name\fR        \fICommand Line\fR
1636 \fB\&.cc\fR     \fB$(LINK.cc)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR
1639 \fB\&.cc.o\fR   \fB$(COMPILE.cc) $(OUTPUT_OPTION) $<\fR
1642 \fB\&.cc.a\fR   \fB$(COMPILE.cc)\fR \fB-o\fR \fB$% $<\fR
1643         \fB$(AR) $(ARFLAGS) $@ $%\fR
1644         \fB$(RM) $%\fR
1647 \fB\&.cc~\fR    \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.cc\fR
1648         \fB$(LINK.cc)\fR \fB-o\fR \fB$@ $*.cc $(LDLIBS)\fR
1651 \fB\&.cc.o\fR   \fB$(COMPILE.cc) $(OUTPUT_OPTION) $<\fR
1654 \fB\&.cc~.o\fR  \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.cc\fR
1655         \fB$(COMPILE.cc) $(OUTPUT_OPTION) $*.cc\fR
1658 \fB\&.cc.a\fR   \fB$(COMPILE.cc)\fR \fB-o\fR \fB$% $<\fR
1659         \fB$(AR) $(ARFLAGS) $@ $%\fR
1660         \fB$(RM) $%\fR
1663 \fB\&.cc~.a\fR  \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.cc\fR
1664         \fB$(COMPILE.cc)\fR \fB-o\fR \fB$% $*.cc\fR
1665         \fB$(AR) $(ARFLAGS) $@ $%\fR
1666         \fB$(RM) $%\fR
1669 \fB\&.C\fR      \fB$(LINK.C)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR
1672 \fB\&.C~\fR     \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.C\fR
1673         \fB$(LINK.C)\fR \fB-o\fR \fB$@ $*.C $(LDLIBS)\fR
1676 \fB\&.C.o\fR    \fB$(COMPILE.C) $(OUTPUT_OPTION) $<\fR
1679 \fB\&.C~.o\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.C\fR
1680         \fB$(COMPILE.C) $(OUTPUT_OPTION) $*.C\fR
1683 \fB\&.C.a\fR    \fB$(COMPILE.C)\fR \fB-o\fR \fB$% $<\fR
1684         \fB$(AR) $(ARFLAGS) $@ $%\fR
1685         \fB$(RM) $%\fR
1688 \fB\&.C~.a\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.C\fR
1689         \fB$(COMPILE.C)\fR \fB-o\fR \fB$% $*.C\fR
1690         \fB$(AR) $(ARFLAGS) $@ $%\fR
1691         \fB$(RM) $%\fR
1698 box;
1699 cw(1.57i) |cw(3.93i)
1700 cw(1.57i) |cw(3.93i) .
1702 \fITable of Standard Implicit (Suffix) Rules for FORTRAN 77 Files\fR
1705 \fIImplicit Rule Name\fR        \fICommand Line\fR
1707 \fB\&.f\fR      \fB$(LINK.f)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR
1710 \fB\&.f.o\fR    \fB$(COMPILE.f) $(OUTPUT_OPTION) $<\fR
1713 \fB\&.f.a\fR    \fB$(COMPILE.f)\fR \fB-o\fR \fB$% $<\fR
1714         \fB$(AR) $(ARFLAGS) $@ $%\fR
1715         \fB$(RM) $%\fR
1718 \fB\&.f\fR      \fB$(LINK.f)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR
1721 \fB\&.f~\fR     \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.f\fR
1722         \fB$(FC) $(FFLAGS) $(LDFLAGS)\fR \fB-o\fR \fB$@ $*.f\fR
1725 \fB\&.f~.o\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.f\fR
1726         \fB$(FC) $(FFLAGS)\fR \fB-c\fR \fB$*.f\fR
1729 \fB\&.f~.a\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.f\fR
1730         \fB$(COMPILE.f)\fR \fB-o\fR \fB$% $*.f\fR
1731         \fB$(AR) $(ARFLAGS) $@ $%\fR
1732         \fB$(RM) $%\fR
1735 \fB\&.F\fR      \fB$(LINK.F)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR
1738 \fB\&.F.o\fR    \fB$(COMPILE.F) $(OUTPUT_OPTION) $<\fR
1741 \fB\&.F.a\fR    \fB$(COMPILE.F)\fR \fB-o\fR \fB$% $<\fR
1742         \fB$(AR) $(ARFLAGS) $@ $%\fR
1743         \fB$(RM) $%\fR
1746 \fB\&.F~\fR     \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.F\fR
1747         \fB$(FC) $(FFLAGS) $(LDFLAGS)\fR \fB-o\fR \fB$@ $*.F\fR
1750 \fB\&.F~.o\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.F\fR
1751         \fB$(FC) $(FFLAGS)\fR \fB-c\fR \fB$*.F\fR
1754 \fB\&.F~.a\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.F\fR
1755         \fB$(COMPILE.F)\fR \fB-o\fR \fB$% $*.F\fR
1756         \fB$(AR) $(ARFLAGS) $@ $%\fR
1757         \fB$(RM) $%\fR
1764 box;
1765 cw(1.57i) |cw(3.93i)
1766 cw(1.57i) |cw(3.93i) .
1768 \fITable of Standard Implicit (Suffix) Rules for FORTRAN 90 Files\fR
1771 \fIImplicit Rule Name\fR        \fICommand Line\fR
1773 \fB\&.f90\fR    \fB$(LINK.f90)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR
1776 \fB\&.f90~\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.f90\fR
1777         \fB$(LINK.f90)\fR \fB-o\fR \fB$@ $*.f90 $(LDLIBS)\fR
1780 \fB\&.f90.o\fR  \fB$(COMPILE.f90) $(OUTPUT_OPTION) $<\fR
1783 \fB\&.f90~.o\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.f90\fR
1784         \fB$(COMPILE.f90) $(OUTPUT_OPTION) $*.f90\fR
1787 \fB\&.f90.a\fR  \fB$(COMPILE.f90)\fR \fB-o\fR \fB$% $<\fR
1788         \fB$(AR) $(ARFLAGS) $@ $%\fR
1789         \fB$(RM) $%\fR
1792 \fB\&.f90~.a\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.f90\fR
1793         \fB$(COMPILE.f90)\fR \fB-o\fR \fB$% $*.f90\fR
1794         \fB$(AR) $(ARFLAGS) $@ $%\fR
1795         \fB$(RM) $%\fR
1798 \fB\&.ftn\fR    \fB$(LINK.ftn)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR
1801 \fB\&.ftn~\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.ftn\fR
1802         \fB$(LINK.ftn)\fR \fB-o\fR \fB$@ $*.ftn $(LDLIBS)\fR
1805 \fB\&.ftn.o\fR  \fB$(COMPILE.ftn) $(OUTPUT_OPTION) $<\fR
1808 \fB\&.ftn~.o\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.ftn\fR
1809         \fB$(COMPILE.ftn) $(OUTPUT_OPTION) $*.ftn\fR
1812 \fB\&.ftn.a\fR  \fB$(COMPILE.ftn)\fR \fB-o\fR \fB$% $<\fR
1813         \fB$(AR) $(ARFLAGS) $@ $%\fR
1814         \fB$(RM) $%\fR
1817 \fB\&.ftn~.a\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.ftn\fR
1818         \fB$(COMPILE.ftn)\fR \fB-o\fR \fB$% $*.ftn\fR
1819         \fB$(AR) $(ARFLAGS) $@ $%\fR
1820         \fB$(RM) $%\fR
1827 box;
1828 cw(1.57i) |cw(3.93i)
1829 cw(1.57i) |cw(3.93i) .
1831 \fITable of Standard Implicit (Suffix) Rules for lex Files\fR
1834 \fIImplicit Rule Name\fR        \fICommand Line\fR
1836 \fB\&.l\fR      \fB$(RM) $*.c\fR
1837         \fB$(LEX.l) $< > $*.c\fR
1838         \fB$(LINK.c)\fR \fB-o\fR \fB$@ $*.c $(LDLIBS)\fR
1839         \fB$(RM) $*.c\fR
1842 \fB\&.l.c\fR    \fB$(RM) $@\fR
1843         \fB$(LEX.l) $< > $@\fR
1846 \fB\&.l.ln\fR   \fB$(RM) $*.c\fR
1847         \fB$(LEX.l) $< > $*.c\fR
1848         \fB$(LINT.c)\fR \fB-o\fR \fB$@\fR \fB-i\fR \fB$*.c\fR
1849         \fB$(RM) $*.c\fR
1852 \fB\&.l.o\fR    \fB$(RM) $*.c\fR
1853         \fB$(LEX.l) $< > $*.c\fR
1854         \fB$(COMPILE.c)\fR \fB-o\fR \fB$@ $*.c\fR
1855         \fB$(RM) $*.c\fR
1858 \fB\&.l~\fR     \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.l\fR
1859         \fB$(LEX) $(LFLAGS) $*.l\fR
1860         \fB$(CC) $(CFLAGS)\fR \fB-c\fR \fBlex.yy.c\fR
1861         \fBrm\fR \fB-f\fR \fBlex.yy.c\fR
1862         \fBmv lex.yy.c $@\fR
1865 \fB\&.l~.c\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.l\fR
1866         \fB$(LEX) $(LFLAGS) $*.l\fR
1867         \fBmv lex.yy.c $@\fR
1870 \fB\&.l~.ln\fR  \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.l\fR
1871         \fB$(RM) $*.c\fR
1872         \fB$(LEX.l) $*.l > $*.c\fR
1873         \fB$(LINT.c)\fR \fB-o\fR \fB$@\fR \fB-i\fR \fB$*.c\fR
1874         \fB$(RM) $*.c\fR
1877 \fB\&.l~.o\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.l\fR
1878         \fB$(LEX) $(LFLAGS) $*.l\fR
1879         \fB$(CC) $(CFLAGS)\fR \fB-c\fR \fBlex.yy.c\fR
1880         \fBrm\fR \fB-f\fR \fBlex.yy.c\fR
1881         \fBmv lex.yy.c $@\fR
1888 box;
1889 cw(1.57i) |cw(3.93i)
1890 cw(1.57i) |cw(3.93i)  .
1892 \fITable of Standard Implicit (Suffix) Rules for Modula 2 Files\fR
1895 \fIImplicit Rule Name\fR        \fICommand Line\fR
1897 \fB\&.mod\fR    \fB$(COMPILE.mod)\fR \fB-o\fR \fB$@\fR \fB-e\fR \fB$@ $<\fR
1900 \fB\&.mod.o\fR  \fB$(COMPILE.mod)\fR \fB-o\fR \fB$@ $<\fR
1903 \fB\&.def.sym\fR        \fB$(COMPILE.def)\fR \fB-o\fR \fB$@ $<\fR
1906 \fB\&.def~.sym\fR       \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.def\fR
1907         \fB$(COMPILE.def)\fR \fB-o\fR\fB$@ $*.def\fR
1910 \fB\&.mod~\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.mod\fR
1911         \fB$(COMPILE.mod)\fR \fB-o\fR \fB$@\fR \fB-e\fR \fB$@ $*.mod\fR
1914 \fB\&.mod~.o\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.mod\fR
1915         \fB$(COMPILE.mod)\fR \fB-o\fR \fB$@ $*.mod\fR
1918 \fB\&.mod~.a\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.mod\fR
1919         \fB$(COMPILE.mod)\fR \fB-o\fR \fB$% $*.mod\fR
1920         \fB$(AR) $(ARFLAGS) $@ $%\fR
1921         \fB$(RM) $%\fR
1928 box;
1929 cw(1.57i) |cw(3.93i)
1930 cw(1.57i) |cw(3.93i) .
1932 \fITable of Standard Implicit (Suffix) Rules for NeWS Files\fR
1935 \fIImplicit Rule Name\fR        \fICommand Line\fR
1937 \fB\&.cps.h\fR  \fBcps $*.cps\fR
1939 \fB\&.cps~.h\fR \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.cps\fR
1940         \fB$(CPS) $(CPSFLAGS) $*.cps\fR
1947 box;
1948 cw(1.57i) |cw(3.93i)
1949 cw(1.57i) |cw(3.93i) .
1951 \fITable of Standard Implicit (Suffix) Rules for Pascal Files\fR
1954 \fIImplicit Rule Name\fR        \fICommand Line\fR
1956 \fB\&.p\fR      \fB$(LINK.p)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR
1959 \fB\&.p.o\fR    \fB$(COMPILE.p) $(OUTPUT_OPTION) $<\fR
1962 \fB\&.p~\fR     \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.p\fR
1963         \fB$(LINK.p)\fR \fB-o\fR \fB$@ $*.p $(LDLIBS)\fR
1966 \fB\&.p~.o\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.p\fR
1967         \fB$(COMPILE.p) $(OUTPUT_OPTION) $*.p\fR
1970 \fB\&.p~.a\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.p\fR
1971         \fB$(COMPILE.p)\fR \fB-o\fR \fB$% $*.p\fR
1972         \fB$(AR) $(ARFLAGS) $@ $%\fR
1973         \fB$(RM) $%\fR
1980 box;
1981 cw(1.57i) |cw(3.93i)
1982 cw(1.57i) |cw(3.93i) .
1984 \fITable of Standard Implicit (Suffix) Rules for Ratfor Files\fR
1987 \fIImplicit Rule Name\fR        \fICommand Line\fR
1989 \fB\&.r\fR      \fB$(LINK.r)\fR \fB-o\fR \fB$@ $< $(LDLIBS)\fR
1992 \fB\&.r.o\fR    \fB$(COMPILE.r) $(OUTPUT_OPTION) $<\fR
1995 \fB\&.r.a\fR    \fB$(COMPILE.r)\fR \fB-o\fR \fB$% $<\fR
1996         \fB$(AR) $(ARFLAGS) $@ $%\fR
1997         \fB$(RM) $%\fR
2000 \fB\&.r~\fR     \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.r\fR
2001         \fB$(LINK.r)\fR \fB-o\fR \fB$@ $*.r $(LDLIBS)\fR
2004 \fB\&.r~.o\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.r\fR
2005         \fB$(COMPILE.r) $(OUTPUT_OPTION) $*.r\fR
2008 \fB\&.r~.a\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.r\fR
2009         \fB$(COMPILE.r)\fR \fB-o\fR \fB$% $*.r\fR
2010         \fB$(AR) $(ARFLAGS) $@ $%\fR
2011         \fB$(RM) $%\fR
2018 box;
2019 cw(1.57i) |cw(3.93i)
2020 cw(1.57i) |cw(3.93i) .
2022 \fITable of Standard Implicit (Suffix) Rules for SCCS Files\fR
2025 \fIImplicit Rule Name\fR        \fICommand Line\fR
2027 \fB\&.SCCS_GET\fR       T{
2028 \fBsccs $(SCCSFLAGS) get $(SCCSGETFLAGS) $@\fR \fB-G\fR\fB$@\fR
2033 \fB\&.SCCS_GET_POSIX\fR \fBsccs $(SCCSFLAGS) get $(SCCSGETFLAGS) $@\fR
2036 \fB\&.GET_POSIX\fR      \fB$(GET) $(GFLAGS) s.$@\fR
2043 box;
2044 cw(1.57i) |cw(3.93i)
2045 cw(1.57i) |cw(3.93i) .
2047 \fITable of Standard Implicit (Suffix) Rules for Shell Scripts\fR
2050 \fIImplicit Rule Name\fR        \fICommand Line\fR
2052 \fB\&.sh\fR     \fBcat $< >$@\fR
2053         \fBchmod +x $@\fR
2056 \fB\&.sh~\fR    \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.sh\fR
2057         \fBcp $*.sh $@\fR
2058         \fBchmod a+x $@\fR
2065 box;
2066 cw(1.57i) |cw(3.93i)
2067 cw(1.57i) |cw(3.93i) .
2069 \fITable of Standard Implicit (Suffix) Rules for yacc Files\fR
2072 \fIImplicit Rule Name\fR        \fICommand Line\fR
2074 \fB\&.y\fR      \fB$(YACC.y) $<\fR
2075         \fB$(LINK.c)\fR \fB-o\fR \fB$@ y.tab.c $(LDLIBS)\fR
2076         \fB$(RM) y.tab.c\fR
2079 \fB\&.y.c\fR    \fB$(YACC.y) $<\fR
2080         \fBmv y.tab.c $@\fR
2083 \fB\&.y.ln\fR   \fB$(YACC.y) $<\fR
2084         \fB$(LINT.c)\fR \fB-o\fR \fB$@\fR \fB-i\fR \fBy.tab.c\fR
2085         \fB$(RM) y.tab.c\fR
2088 \fB\&.y.o\fR    \fB$(YACC.y) $<\fR
2089         \fB$(COMPILE.c)\fR \fB-o\fR \fB$@ y.tab.c\fR
2090         \fB$(RM) y.tab.c\fR
2093 \fB\&.y~\fR     \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.y\fR
2094         \fB$(YACC) $(YFLAGS) $*.y\fR
2095         \fB$(COMPILE.c)\fR \fB-o\fR \fB$@ y.tab.c\fR
2096         \fB$(RM) y.tab.c\fR
2099 \fB\&.y~.c\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.y\fR
2100         \fB$(YACC) $(YFLAGS) $*.y\fR
2101         \fBmv y.tab.c $@\fR
2104 \fB\&.y~.ln\fR  \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.y\fR
2105         \fB$(YACC.y) $*.y\fR
2106         \fB$(LINT.c)\fR \fB-o\fR \fB$@\fR \fB-i\fR \fBy.tab.c\fR
2107         \fB$(RM) y.tab.c\fR
2110 \fB\&.y~.o\fR   \fB$(GET) $(GFLAGS)\fR \fB-p\fR \fB$< > $*.y\fR
2111         \fB$(YACC) $(YFLAGS) $*.y\fR
2112         \fB$(CC) $(CFLAGS)\fR \fB-c\fR \fBy.tab.c\fR
2113         \fBrm\fR \fB-f\fR \fBy.tab.c\fR
2114         \fBmv y.tab.o $@\fR
2119 \fBmake\fR reads in the standard set of implicit rules from the file
2120 \fB/usr/share/lib/make/make.rules\fR, unless \fB-r\fR is in effect, or there is
2121 a \fBmake.rules\fR file in the local directory that does not \fBinclude\fR that
2122 file.
2123 .SS "The Suffixes List"
2125 The suffixes list is given as the list of dependencies for the
2126 \fB\&.SUFFIXES:\fR special-function target. The default list is contained in
2127 the \fBSUFFIXES\fR macro (See \fITable of Predefined Macros\fR for the standard
2128 list of suffixes). You can define additional \fB\&.SUFFIXES:\fR targets; a
2129 \fB\&.SUFFIXES\fR target with no dependencies clears the list of suffixes.
2130 Order is significant within the list; \fBmake\fR selects a rule that
2131 corresponds to the target's suffix and the first dependency-file suffix found
2132 in the list. To place suffixes at the head of the list, clear the list and
2133 replace it with the new suffixes, followed by the default list:
2135 .in +2
2137    .SUFFIXES:
2138    .SUFFIXES: \fIsuffixes\fR $(SUFFIXES)
2140 .in -2
2144 A tilde (\fB~\fR) indicates that if a dependency file with the indicated suffix
2145 (minus the ~) is under \fBSCCS\fR its most recent version should be retrieved,
2146 if necessary, before the target is processed.
2147 .SS "Library Maintenance"
2149 A target name  of the form:
2151 .in +2
2153    \fIlib\fR(\fImember ...\fR)
2155 .in -2
2159 refers to a member, or a space-separated list of members, in an \fBar\fR(1)
2160 library.
2163 The dependency of the library member on the corresponding file must be given as
2164 an explicit entry in the makefile. This can be handled by a pattern matching
2165 rule of the form:
2167 .in +2
2169    \fIlib\fR(%\fI\&.s\fR): %\fI\&.s\fR
2171 .in -2
2175 where \fI\&.s\fR is the suffix of the member; this suffix is typically
2176 \fB\&.o\fR for object libraries.
2179 A target name of the form:
2181 .in +2
2183    \fIlib\fR((\fIsymbol\fR))
2185 .in -2
2189 refers to the member of a randomized object library that defines the entry
2190 point named \fIsymbol\fR.
2191 .SS "Command Execution"
2193 Command lines are executed one at a time, \fIeach by its own process or
2194 shell\fR. Shell commands, notably \fBcd\fR, are ineffectual across an unescaped
2195 \fBNEWLINE\fR in the makefile. A line is printed (after macro expansion) just
2196 before being executed. This is suppressed if it starts with a \fB@\fR, if there
2197 is a \fB\&.SILENT:\fR entry in the makefile, or if \fBmake\fR is run with the
2198 \fB-s\fR option. Although the \fB-n\fR option specifies printing without
2199 execution, lines containing the macro \fB$(MAKE)\fR are executed regardless,
2200 and lines containing the \fB@\fR special character are printed. The \fB-t\fR
2201 (touch) option updates the modification date of a file without executing any
2202 rules. This can be dangerous when sources are maintained by more than one
2203 person.
2206 \fBmake\fR invokes the shell with the \fB-e\fR (exit-on-errors) argument. Thus,
2207 with semicolon-separated command sequences, execution of the later commands
2208 depends on the success of the former. This behavior can be overridden by
2209 starting the command line with a \fB\|-\fR, or by writing a shell script that
2210 returns a non-zero status only as it finds appropriate.
2211 .SS "Bourne Shell Constructs"
2213 To use the Bourne shell \fBif\fR control structure for branching, use a command
2214 line of the form:
2216 .in +2
2218 if \fIexpression\fR ; \e
2219 then \fIcommand\fR ; \e
2220      ... ; \e
2221 else \fIcommand\fR; \e
2222      ... ; \e
2225 .in -2
2229 Although composed of several input lines, the escaped \fBNEWLINE\fR characters
2230 insure that \fBmake\fR treats them all as one (shell) command line.
2233 To use the Bourne shell \fBfor\fR control structure for loops, use a command
2234 line of the form:
2236 .in +2
2238 for \fIvar\fR in \fIlist\fR ; \e
2239 do \fIcommand\fR; \e
2240      ... \fB; \e\fRdone
2242 .in -2
2246 To refer to a shell variable, use a double-dollar-sign (\fB$$\fR). This
2247 prevents expansion of the dollar-sign by \fBmake\fR.
2248 .SS "Command Substitutions"
2250 To incorporate the standard output of a shell command in a macro, use a
2251 definition of the form:
2253 .in +2
2255    \fIMACRO\|\fR:sh =\fIcommand\fR
2257 .in -2
2261 The command is executed only once, standard error output is discarded, and
2262 \fBNEWLINE\fR characters are replaced with \fBSPACE\fRs. If the command has a
2263 non-zero exit status, \fBmake\fR halts with an error.
2266 To capture the output of a shell command in a macro reference, use a reference
2267 of the form:
2269 .in +2
2271 $(\fIMACRO\|\fR:sh)
2273 .in -2
2277 where \fIMACRO\fR is the name of a macro containing a valid Bourne shell
2278 command line. In this case, the command is executed whenever the reference is
2279 evaluated. As with shell command substitutions, the reference is replaced with
2280 the standard output of the command. If the command has a non-zero exit status,
2281 \fBmake\fR halts with an error.
2284 In contrast to commands in rules, the command is not subject for macro
2285 substitution; therefore, a dollar sign (\fB$\fR) need not be replaced with a
2286 double dollar sign (\fB$$\fR).
2287 .SS "\fISignals\fR"
2289 \fBINT\fR, \fBSIGTERM\fR, and \fBQUIT\fR signals received from the keyboard
2290 halt \fBmake\fR and remove the target file being processed unless that target
2291 is in the dependency list for \fB\&.PRECIOUS:\fR.
2292 .SH EXAMPLES
2294 \fBExample 1 \fRDefining dependencies
2297 This makefile says that \fBpgm\fR depends on two files \fBa.o\fR and \fBb.o\fR,
2298 and that they in turn depend on their corresponding source files (\fBa.c\fR and
2299 \fBb.c\fR) along with a common file \fBincl.h\fR:
2302 .in +2
2304 pgm:  a.o  b.o
2305      $(LINK.c) -o $@a.o  b.o
2306 a.o:  incl.h  a.c
2307      cc -c a.c
2308 b.o:  incl.h  b.c
2309      cc -c b.c
2311 .in -2
2314 \fBExample 2 \fRUsing implicit rules
2317 The following makefile uses implicit rules to express the same dependencies:
2320 .in +2
2322 pgm:  a.o  b.o
2323      cc  a.o  b.o -o pgm
2324 a.o  b.o:  incl.h
2326 .in -2
2328 .SH ENVIRONMENT VARIABLES
2330 See \fBenviron\fR(5) for descriptions of the following environment variables
2331 that affect the execution of \fBmake\fR: \fBLANG\fR, \fBLC_ALL\fR,
2332 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
2335 .ne 2
2337 \fBDMAKE_MAX_JOBS\fR
2339 .RS 17n
2340 The maximum number of jobs that each instance of \fBmake\fR should run.
2344 .ne 2
2346 \fBDMAKE_ADJUST_MAX_JOBS\fR
2348 .RS 17n
2349 If \fBYES\fR adjust the maximum number of jobs each instance of \fBmake\fR
2350 runs based on system load.  If \fBNO\fR do not
2354 .ne 2
2356 \fBDMAKE_OUTPUT_MODE\fR
2358 .RS 17n
2359 Adjusts the format of output from \fBmake\fR when executing jobs in parallel.
2361 If the value is \fBTEXT1\fR \fBmake\fR will print the hostname and the command
2362 executed once when the job begins, and again preceding any output from that
2363 job.
2365 If the value is \fBTEXT2\fR \fBmake\fR will only print the command and its
2366 output only once, when execution is complete.
2370 .ne 2
2372 \fBDMAKE_MODE\fR
2374 .RS 17n
2375 Specify whether jobs should be executed in serial, or parallel.  Equivalent to
2376 passing the \fB-m\fR option.
2380 .ne 2
2382 \fB\fBKEEP_STATE\fR\fR
2384 .RS 17n
2385 This environment variable has the same effect as the .KEEP_STATE:
2386 special-function target. It enables command dependencies, hidden dependencies
2387 and writing of the state file.
2391 .ne 2
2393 \fB\fBUSE_SVR4_MAKE\fR\fR
2395 .RS 17n
2396 This environment variable causes \fBmake\fR to invoke the generic System V
2397 version of \fBmake\fR (\fB/usr/lib/svr4.make\fR). See \fBsysV-make\fR(1).
2401 .ne 2
2403 \fB\fBMAKEFLAGS\fR\fR
2405 .RS 17n
2406 This variable is interpreted as a character string representing a series of
2407 option characters to be used as the default options. The implementation accepts
2408 both of the following formats (but need not accept them when intermixed):
2409 .RS +4
2412 The characters are option letters without the leading hyphens or blank
2413 character separation used on a command line.
2415 .RS +4
2418 The characters are formatted in a manner similar to a portion of the
2419 \fBmake\fR command line: options are preceded by hyphens and
2420 blank-character-separated. The \fImacro=name\fR macro definition operands can
2421 also be included. The difference between the contents of \fBMAKEFLAGS\fR and
2422 the command line is that the contents of the variable is not subjected to the
2423 word expansions associated with parsing the command line values. See
2424 \fBwordexp\fR(3C).
2426 When the command-line options \fB-f\fR or \fB-p\fR are used, they take effect
2427 regardless of whether they also appear in \fBMAKEFLAGS\fR. If they otherwise
2428 appear in \fBMAKEFLAGS\fR, the result is undefined.
2430 The \fBMAKEFLAGS\fR variable is accessed from the environment before the
2431 makefile is read. At that time, all of the options (except \fB-f\fR and
2432 \fB-p\fR) and command-line macros not already included in \fBMAKEFLAGS\fR are
2433 added to the \fBMAKEFLAGS\fR macro. The \fBMAKEFLAGS\fR macro is passed into
2434 the environment as an environment variable for all child processes. If the
2435 \fBMAKEFLAGS\fR macro is subsequently set by the makefile, it replaces the
2436 \fBMAKEFLAGS\fR variable currently found in the environment.
2440 .ne 2
2442 \fB\fBPROJECTDIR\fR\fR
2444 .RS 17n
2445 Provides a directory to be used to search for SCCS files not found in the
2446 current  directory. In all of the following cases, the search for SCCS files is
2447 made in  the directory SCCS in the identified directory. If the value of
2448 \fBPROJECTDIR\fR begins with a slash, it shall be considered an absolute
2449 pathname. Otherwise, the value of \fBPROJECTDIR\fR is treated as a user name
2450 and that user's initial working directory shall be examined for a subdirectory
2451 \fBsrc\fR or \fBsource\fR. If such a directory is found, it shall be used.
2452 Otherwise, the value is used as a relative pathname.
2454 If \fBPROJECTDIR\fR is not set or has a null value, the search for SCCS files
2455 shall be made in the directory SCCS in the current directory. The setting of
2456 \fBPROJECTDIR\fR affects all files listed in the remainder of this utility
2457 description for files  with a component named SCCS.
2460 .SH EXIT STATUS
2462 When the \fB-q\fR option is specified, the \fBmake\fR utility exits with one of
2463 the following values:
2465 .ne 2
2467 \fB\fB0\fR\fR
2469 .RS 6n
2470 Successful completion.
2474 .ne 2
2476 \fB\fB1\fR\fR
2478 .RS 6n
2479 The target was not up-to-date.
2483 .ne 2
2485 \fB\fB>1\fR\fR
2487 .RS 6n
2488 An error occurred.
2493 When the \fB-q\fR option is not specified, the \fBmake\fR utility exits with
2494 one of the following values:
2496 .ne 2
2498 \fB\fB0\fR\fR
2500 .RS 6n
2501 Successful completion
2505 .ne 2
2507 \fB\fB>0\fR\fR
2509 .RS 6n
2510 An error occurred
2513 .SH FILES
2514 .ne 2
2516 \fB\fBmakefile\fR\fR
2520 \fB\fBMakefile\fR\fR
2522 .sp .6
2523 .RS 4n
2524 current version(s) of \fBmake\fR description file
2528 .ne 2
2530 \fB\fBs.makefile\fR\fR
2534 \fB\fBs.Makefile\fR\fR
2536 .sp .6
2537 .RS 4n
2538 \fBSCCS\fR history files for the above makefile(s) in the current directory
2542 .ne 2
2544 \fB\fBSCCS/s.makefile\fR\fR
2548 \fB\fBSCCS/s.Makefile\fR\fR
2550 .sp .6
2551 .RS 4n
2552 \fBSCCS\fR history files for the above makefile(s)
2556 .ne 2
2558 \fB\fBmake.rules\fR\fR
2560 .sp .6
2561 .RS 4n
2562 default file for user-defined targets, macros, and implicit rules
2566 .ne 2
2568 \fB\fB/usr/share/lib/make/make.rules\fR\fR
2570 .sp .6
2571 .RS 4n
2572 makefile for standard implicit rules and macros (not read if \fBmake.rules\fR
2577 .ne 2
2579 \fB\fB\&.make.state\fR\fR
2581 .sp .6
2582 .RS 4n
2583 state file in the local directory
2586 .SH SEE ALSO
2588 \fBar\fR(1), \fBcd\fR(1), \fBcpp\fR(1), \fBlex\fR(1),
2589 \fBsccs-get\fR(1), \fBsh\fR(1), \fBsysV-make\fR(1),
2590 \fByacc\fR(1), \fBwordexp\fR(3C), \fBpasswd\fR(4), \fBattributes\fR(5),
2591 \fBenviron\fR(5), \fBPOSIX.2\fR(5), \fBstandards\fR(5)
2594 \fISolaris Advanced User\&'s Guide\fR
2595 .SH DIAGNOSTICS
2596 .ne 2
2598 \fB\fBDon't know how to make target \fItarget\fR\fR\fR
2600 .sp .6
2601 .RS 4n
2602 There is no makefile entry for \fItarget\fR, and none of \fBmake\fR's implicit
2603 rules apply (there is no dependency file with a suffix in the suffixes list, or
2604 the target's suffix is not in the list).
2608 .ne 2
2610 \fB\fB***\fR \fItarget\fR \fBremoved.\fR\fR
2612 .sp .6
2613 .RS 4n
2614 \fBmake\fR was interrupted while building \fItarget\fR. Rather than leaving a
2615 partially-completed version that is newer than its dependencies, \fBmake\fR
2616 removes the file named \fItarget\fR.
2620 .ne 2
2622 \fB\fB***\fR \fItarget\fR \fBnot removed.\fR\fR
2624 .sp .6
2625 .RS 4n
2626 \fBmake\fR was interrupted while building \fItarget\fR and \fItarget\fR was not
2627 present in the directory.
2631 .ne 2
2633 \fB\fB***\fR \fItarget\fR \fBcould not be removed,\fR \fIreason\fR\fR
2635 .sp .6
2636 .RS 4n
2637 \fBmake\fR was interrupted while building \fItarget\fR, which was not removed
2638 for the indicated reason.
2642 .ne 2
2644 \fBRead of include file `\fR\fIfile\fR\fB' failed\fR
2646 .sp .6
2647 .RS 4n
2648 The makefile indicated in an \fBinclude\fR directive was not found or was
2649 inaccessible.
2653 .ne 2
2655 \fBLoop detected when expanding macro value `\fR\fImacro\fR\fB'\fR
2657 .sp .6
2658 .RS 4n
2659 A reference to the macro being defined was found in the definition.
2663 .ne 2
2665 \fBCould not open temporary statefile `\fR\fIfile\fR\fB'\fR
2666 \fBCould not delete old statefile `\fR\fIfile\fR\fB'\fR
2668 .sp .6
2669 .RS 4n
2670 You used the \fB\&.KEEP_STATE:\fR target, but you do not have write permission
2671 on the state file or on a temporary version of the file written first.
2675 .ne 2
2677 \fB\fB***Error code\fR \fIn\fR\fR
2679 .sp .6
2680 .RS 4n
2681 The previous shell command returned a nonzero error code.
2685 .ne 2
2687 \fB\fB***\fR \fIsignal message\fR\fR
2689 .sp .6
2690 .RS 4n
2691 The previous shell command was aborted due to a signal. If \fB- core dumped\fR
2692 appears after the message, a \fBcore\fR file was created.
2696 .ne 2
2698 \fB\fBConditional macro conflict encountered\fR\fR
2700 .sp .6
2701 .RS 4n
2702 Displayed only when \fB-d\fR is in effect, this message indicates that two or
2703 more parallel targets currently being processed depend on a target which is
2704 built differently for each by virtue of conditional macros. Since the target
2705 cannot simultaneously satisfy both dependency relationships, it is conflicted.
2708 .SH BUGS
2710 Some commands return nonzero status inappropriately; to overcome this
2711 difficulty, prefix the offending command line in the rule with a \fB\(mi\fR\&.
2714 Filenames with the characters \fB=\fR, \fB:\fR, or \fB@\fR, do not work.
2717 You cannot build \fBfile.o\fR from \fBlib(file.o)\fR.
2720 Options supplied by \fBMAKEFLAGS\fR should be reported for nested \fBmake\fR
2721 commands. Use the \fB-d\fR option to find out what options the nested command
2722 picks up from \fBMAKEFLAGS\fR.
2725 This version of \fBmake\fR is incompatible in certain respects with previous
2726 versions:
2727 .RS +4
2729 .ie t \(bu
2730 .el o
2731 The \fB-d\fR option output is much briefer in this version. \fB-dd\fR now
2732 produces the equivalent voluminous output.
2734 .RS +4
2736 .ie t \(bu
2737 .el o
2738 \fBmake\fR attempts to derive values for the dynamic macros \fB$*\fR, \fB$<\fR,
2739 and \fB$?\fR, while processing explicit targets. It uses the same method as for
2740 implicit rules; in some cases this can lead either to unexpected values, or to
2741 an empty value being assigned. (Actually, this was true for earlier versions as
2742 well, even though the documentation stated otherwise.)
2744 .RS +4
2746 .ie t \(bu
2747 .el o
2748 \fBmake\fR no longer searches for \fBSCCS\fR history (\fBs\fR.) files.
2750 .RS +4
2752 .ie t \(bu
2753 .el o
2754 Suffix replacement in macro references are now applied after the macro is
2755 expanded.
2759 There is no guarantee that makefiles created for this version of \fBmake\fR
2760 work with earlier versions.
2763 If there is no \fBmake.rules\fR file in the current directory, and the file
2764 \fB/usr/share/lib/make/make.rules\fR is missing, \fBmake\fR stops before
2765 processing any targets. To force \fBmake\fR to run anyway, create an empty
2766 \fBmake.rules\fR file in the current directory.
2769 Once a dependency is made, \fBmake\fR assumes the dependency file is present
2770 for the remainder of the run. If a rule subsequently removes that file and
2771 future targets depend on its existence, unexpected errors can result.
2774 When hidden dependency checking is in effect, the \fB$?\fR macro's value
2775 includes the names of hidden dependencies.  This can lead to improper filename
2776 arguments to commands when \fB$?\fR is used in a rule.
2779 Pattern replacement macro references cannot be used in the dependency list of a
2780 pattern matching rule.
2783 Unlike previous versions, this version of \fBmake\fR strips a leading
2784 \fB\&./\fR from the value of the \fB$@\fR dynamic macro.
2787 With automatic \fBSCCS\fR retrieval, this version of \fBmake\fR does not
2788 support tilde suffix rules.
2791 The only dynamic macro whose value is strictly determined when used in a
2792 dependency list is \fB$@\fR (takes the form \fB$$@\fR).
2795 \fBmake\fR invokes the shell with the \fB-e\fR argument. This cannot be
2796 inferred from the syntax of the rule alone.