1 .\" Copyright (c) 1990, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" @(#)make.1 8.8 (Berkeley) 6/13/95
36 .Nd maintain program dependencies
39 .Op Fl ABPSXeiknpqrstv
51 .Op Fl x Ar warning_options
52 .Op Ar variable Ns No = Ns Ar value
57 utility is a program designed to simplify the maintenance of other programs.
58 Its input is a list of specifications
59 describing dependency relationships between the generation of
62 First of all, the initial list of specifications will be read
63 from the system makefile,
65 unless inhibited with the
74 the default path to which
75 can be altered via the
85 that can be found in the current directory, object directory (see
87 or search path (see the
90 will be read for the main list of dependency specifications.
91 A different makefile or list of them can be supplied via the
96 can be found in any of the aforesaid locations, it will also be read (see
101 searches for a makefile, its name takes precedence over its location.
104 in the object directory will be favored over
106 in the current directory.
108 The options are as follows:
111 Make archive errors non-fatal, causing
113 to just skip the remainder
114 or all of the archive and continue after printing a message.
116 Try to be backwards compatible by executing a single shell per command and
117 by executing the commands to make the sources of a dependency line in sequence.
118 This is turned on by default unless
121 .It Fl C Ar directory
124 before reading the makefiles or doing anything else.
127 options are specified, each is interpreted relative to the previous one:
128 .Fl C Pa / Fl C Pa etc
134 to be 1, in the global context.
136 Turn on debugging, and specify which portions of
138 are to print debugging information.
141 is one or more of the following:
144 Print all possible debugging information;
145 equivalent to specifying all of the debugging flags.
147 Print debugging information about archive searching and caching.
149 Print debugging information about conditional evaluation.
151 Print debugging information about directory searching and caching.
153 Print debugging information about the execution of for loops.
155 Print the input graph before making anything.
157 Print the input graph after making everything, or before exiting
160 Print debugging information about running multiple shells.
162 Print commands in Makefiles regardless of whether or not they are prefixed
163 by @ or other "quiet" flags.
164 Also known as "loud" behavior.
166 Print debugging information about making targets, including modification
169 Print debugging information about suffix-transformation rules.
171 Print debugging information about target list maintenance.
173 Print debugging information about variable assignment.
176 Specify a variable whose environment value (if any) will override
177 macro assignments within makefiles.
179 Specify that environment values override macro assignments within
180 makefiles for all variables.
182 Specify a makefile to read instead of the default one.
185 is not an absolute pathname,
187 will search for it as described above.
192 standard input is read.
195 options can be supplied,
196 and the makefiles will be read in that order.
197 Unlike the other command-line options,
201 nor pushed down to sub-makes via
203 See below for more details on these variables.
204 .It Fl I Ar directory
205 Specify a directory in which to search for makefiles and included makefiles.
208 options can be specified to form a search path.
209 The system makefile directory (or directories, see the
211 option) is automatically appended at the tail of this path.
213 Ignore non-zero exit of shell commands in the makefile.
214 Equivalent to specifying
216 before each command line in the makefile.
218 Specify the maximum number of jobs that
220 may have running at any one time.
221 Turns compatibility mode off, unless the
223 flag is also specified.
225 Continue processing after errors are encountered, but only on those targets
226 that do not depend on the target whose creation caused the error.
227 .It Fl m Ar directory
228 Specify a directory in which to search for
229 the system makefile and makefiles included via the <...> style.
232 options can be specified to form a search path.
233 This path will override the default system include path,
235 The system include path will always be appended to the search path used
236 for "..."-style inclusions and makefile searches (see the
240 If a file or directory name in the
244 environment variable) starts with the string
248 will search for the specified file or directory named in the remaining part
249 of the argument string.
250 The search starts with the current directory of the Makefile and then works
251 upward towards the root of the filesystem.
252 If the search is successful,
253 then the resulting directory replaces the
258 If used, this feature allows
260 to easily search in the current source tree for customized sys.mk files
266 that are earlier on the command line affect where
270 Display the commands that would have been executed, but do not actually
273 Collate the output of a given job and display it only when the job finishes,
274 instead of mixing the output of parallel jobs together.
275 This option has no effect unless
279 Only print the input graph, not executing any commands.
280 The output is the same as
284 only the builtin rules of
289 For multi-job makes, this will cause file banners not to be generated.
291 Do not execute any commands, but exit 0 if the specified targets are
292 up-to-date and 1, otherwise.
294 Do not process the system makefile.
296 Stop processing when an error is encountered.
298 This is needed to negate the
300 option during recursive builds.
302 Do not echo any commands as they are executed.
303 Equivalent to specifying
305 before each command line in the makefile.
307 Rather than re-building a target as specified in the makefile, create it
308 or update its modification time to make it appear up-to-date.
314 in the global context.
315 Do not build any targets.
316 Multiple instances of this option may be specified;
317 the variables will be printed one per line,
318 with a blank line for each null or undefined variable.
323 then the value will be expanded before printing.
326 Print any extra information.
330 option to print the values of variables,
331 do not recursively expand the values.
332 .It Ar variable Ns No = Ns Ar value
333 Set the value of the variable
337 .It Fl x Ar warning_options
338 Specify extended warning options.
339 This option may be specified several times.
344 in which case the warning is switched off.
345 The currently available options are:
346 .Bl -tag -width indent
348 Warn if anything except blanks and comments follows an
360 There are seven different types of lines in a makefile: file dependency
361 specifications, shell commands, variable assignments, include statements,
362 conditional directives, for loops, and comments.
364 In general, lines may be continued from one line to the next by ending
365 them with a backslash
367 The trailing newline character and initial whitespace on the following
368 line are compressed into a single space.
369 .Sh FILE DEPENDENCY SPECIFICATIONS
370 Dependency lines consist of one or more targets, an operator, and zero
372 This creates a relationship where the targets
375 and are usually created from them.
376 The exact relationship between the target and the source is determined
377 by the operator that separates them.
378 The three operators are as follows:
381 A target is considered out-of-date if its modification time is less than
382 those of any of its sources.
383 Sources for a target accumulate over dependency lines when this operator
385 The target is removed if
389 Targets are always re-created, but not until all sources have been
390 examined and re-created as necessary.
391 Sources for a target accumulate over dependency lines when this operator
393 The target is removed if
397 If no sources are specified, the target is always re-created.
398 Otherwise, a target is considered out-of-date if any of its sources has
399 been modified more recently than the target.
400 Sources for a target do not accumulate over dependency lines when this
402 The target will not be removed if
407 Targets and sources may contain the shell wildcard expressions
418 may only be used as part of the final
419 component of the target or source, and must be used to describe existing
423 need not necessarily be used to describe existing files.
424 Expansion is in directory order, not alphabetically as done in the shell.
426 Each target may have associated with it a series of shell commands, normally
427 used to create the target.
428 Each of the commands in this script
430 be preceded by a tab.
431 While any target may appear on a dependency line, only one of these
432 dependencies may be followed by a creation script, unless the
436 If the first characters of the command line are
441 the command is treated specially.
444 causes the command not to be echoed before it is executed.
447 causes any non-zero exit status of the command line to be ignored.
450 causes the command to be executed even if
452 is specified on the command line.
453 .Sh VARIABLE ASSIGNMENTS
456 are much like variables in the shell, and, by tradition,
457 consist of all upper-case letters.
458 The five operators that can be used to assign values to variables are as
462 Assign the value to the variable.
463 Any previous value is overridden.
465 Append the value to the current value of the variable.
467 Assign the value to the variable if it is not already defined.
469 Assign with expansion, i.e., expand the value before assigning it
471 Normally, expansion is not done until the variable is referenced.
473 Expand the value and pass it to the shell for execution and assign
474 the result to the variable.
475 Any newlines in the result are replaced with spaces.
478 Any whitespace before the assigned
480 is removed; if the value is being appended, a single space is inserted
481 between the previous contents of the variable and the appended value.
483 Variables are expanded by surrounding the variable name with either
488 and preceding it with
491 If the variable name contains only a single letter, the surrounding
492 braces or parentheses are not required.
493 This shorter form is not recommended.
495 Variable substitution occurs at two distinct times, depending on where
496 the variable is being used.
497 Variables in dependency lines are expanded as the line is read.
498 Variables in shell commands are expanded when the shell command is
501 The four different classes of variables (in order of increasing precedence)
504 .It Environment variables
505 Variables defined as part of
509 Variables defined in the makefile or in included makefiles.
510 .It Command line variables
511 Variables defined as part of the command line and variables
514 environment variable or the
518 Variables that are defined specific to a certain target.
521 If the name of an environment variable appears in a makefile
522 on the left-hand side of an assignment,
523 a global variable with the same name is created, and the latter
524 shadows the former as per their relative precedences.
525 The environment is not changed in this case, and the change
526 is not exported to programs executed by
528 However, a command-line variable actually replaces
529 the environment variable of the same name if the latter exists,
530 which is visible to child programs.
532 There are seven local variables in
534 .Bl -tag -width ".ARCHIVE"
536 The list of all sources for this target; also known as
539 The name of the archive file; also known as
542 The name/path of the source from which the target is to be transformed
545 source); also known as
548 The name of the archive member; also known as
551 The list of sources for this target that were deemed out-of-date; also
555 The file prefix of the file, containing only the file portion, no suffix
556 or preceding directory components; also known as
559 The name of the target; also known as
572 are permitted for backward
573 compatibility and are not recommended.
583 permitted for compatibility with
585 makefiles and are not recommended.
587 Four of the local variables may be used in sources on dependency lines
588 because they expand to the proper value for each target on the line.
598 sets or knows about the following internal variables or environment
600 .Bl -tag -width ".Va .MAKEFILE_LIST"
606 expands to a single dollar
612 .Pq Va argv Ns Op 0 .
614 A path to the directory where
621 to the canonical path given by
624 A path to the directory where the targets are built.
627 searches for an alternate directory to place target files.
628 It will attempt to change into this special directory
629 and will search this directory for makefiles
630 not found in the current directory.
631 The following directories are tried in order:
635 ${MAKEOBJDIRPREFIX}/`pwd -P`
646 The first directory that
648 successfully changes into is used.
653 is set in the environment but
655 is unable to change into the corresponding directory,
656 then the current directory is used
657 without checking the remainder of the list.
658 If they are undefined and
660 is unable to change into any of the remaining three directories,
661 then the current directory is used.
666 must be environment variables and should not be set on
674 to the canonical path given by
676 .It Va .MAKEFILE_LIST
679 reads various makefiles, including the default files and any
680 obtained from the command line and
684 directives, their names will be automatically appended to the
687 They are added right before
689 begins to parse them, so that the name of the current makefile is the
690 last word in this variable.
692 The environment variable
694 may initially contain anything that
701 After processing, its contents are stored in the
703 global variable, although any
706 Then all options and variable assignments specified on
708 command line, except for
716 executes a program, it sets
718 in the program's environment to the current value of the
725 environment contains any
727 options, they will not be pushed down to child programs automatically.
730 utility effectively filters out
732 options from the environment and command line although it
733 passes the rest of its options down to sub-makes via
737 When passing macro definitions and flag arguments in the
739 environment variable,
740 space and tab characters are quoted by preceding them with a backslash.
743 variable from the environment,
744 all sequences of a backslash and one of space or tab
745 are replaced just with their second character
746 without causing a word break.
747 Any other occurrences of a backslash are retained.
748 Groups of unquoted space, tab and newline characters cause word
751 Initially, this global variable contains
753 current run-time options from the environment
754 and command line as described above, under
756 By modifying the contents of the
758 global variable, the makefile can alter the contents of the
760 environment variable made available for all programs which
768 is just copied verbatim to
770 in the environment of child programs.
772 Note that any options entered to
774 neither affect the current instance of
776 nor show up in its own copy of
779 However, they do show up in the
781 environment variable of programs executed by
783 On the other hand, a direct assignment to
785 neither affects the current instance of
787 nor is passed down to
792 special target below.
794 This variable is provided for backward compatibility and
795 contains all the options from the
797 environment variable plus any options specified on
804 The parent process-id of
806 .It Va .MAKE.JOB.PREFIX
811 then output for each target is prefixed with a token
813 the first part of which can be controlled via
814 .Va .MAKE.JOB.PREFIX .
817 .Li .MAKE.JOB.PREFIX=${.newline}---${MAKE:T}[${.MAKE.PID}]
818 would produce tokens like
819 .Ql ---make[1234] target ---
821 .Li .MAKE.JOB.PREFIX=---pid[${.MAKE.PID}],ppid[${.MAKE.PPID}]
822 would produce tokens like
823 .Ql ---pid[56789],ppid[1234] target ---
824 making it easier to track the degree of parallelism being achieved.
828 is currently building.
838 Name of the machine architecture
840 is running on, obtained from the
842 environment variable, or through
846 Name of the machine architecture
848 was compiled for, defined at compilation time.
850 Makefiles may assign a colon-delimited list of directories to
852 These directories will be searched for source files by
854 after it has finished parsing all input makefiles.
856 .Ss Variable Modifiers
857 Variable expansion may be modified to select or modify each word of the
860 is whitespace-delimited sequence of characters).
861 The general format of a variable expansion is as follows:
863 .Dl {variable[:modifier[:...]]}
865 Each modifier begins with a colon and one of the following
867 The colon may be escaped with a backslash
871 .It Cm :C No / Ar pattern Xo
876 Modify each word of the value,
877 substituting every match of the extended regular expression
885 Normally, the first occurrence of the pattern in
886 each word of the value is changed.
889 modifier causes the substitution to apply to at most one word; the
891 modifier causes the substitution to apply to as many instances of the
892 search pattern as occur in the word or words it is found in.
897 are orthogonal; the former specifies whether multiple words are
898 potentially affected, the latter whether multiple substitutions can
899 potentially occur within each affected word.
901 Replaces each word in the variable with its suffix.
903 Replaces each word in the variable with everything but the last component.
905 Converts variable to lower-case letters.
907 .It Cm :M Ns Ar pattern
908 Select only those words that match the rest of the modifier.
909 The standard shell wildcard characters
916 The wildcard characters may be escaped with a backslash
918 .It Cm :N Ns Ar pattern
921 but selects all words which do not match
922 the rest of the modifier.
924 Order every word in the variable alphabetically.
926 Quotes every shell meta-character in the variable, so that it can be passed
927 safely through recursive invocations of
930 Replaces each word in the variable with everything but its suffix.
932 .It Cm :S No / Ar old_string Xo
937 Modify the first occurrence of
939 in each word of the variable's value, replacing it with
943 is appended to the last slash of the pattern, all occurrences
944 in each word are replaced.
950 is anchored at the beginning of each word.
953 ends with a dollar sign
955 it is anchored at the end of each word.
962 Any character may be used as a delimiter for the parts of the modifier
964 The anchoring, ampersand, and delimiter characters may be escaped with a
968 Variable expansion occurs in the normal fashion inside both
972 with the single exception that a backslash is used to prevent the expansion
975 not a preceding dollar sign as is usual.
976 .It Ar :old_string=new_string
979 style variable substitution.
980 It must be the last modifier specified.
985 do not contain the pattern matching character
987 then it is assumed that they are
988 anchored at the end of each word, so only suffixes or entire
989 words may be replaced.
997 Replaces each word in the variable with its last component.
999 Converts variable to lower-case letters.
1001 Converts variable to upper-case letters.
1003 Converts variable to upper-case letters.
1006 Remove adjacent duplicate words (like
1009 .Sh DIRECTIVES, CONDITIONALS, AND FOR LOOPS
1010 Directives, conditionals, and for loops reminiscent
1011 of the C programming language are provided in
1013 All such structures are identified by a line beginning with a single
1017 The following directives are supported:
1019 .It Ic .include Ar <file>
1020 .It Ic .include Ar \*qfile\*q
1021 Include the specified makefile.
1022 Variables between the angle brackets
1023 or double quotes are expanded to form the file name.
1025 are used, the included makefile is expected to be in the system
1027 If double quotes are used, the including
1028 makefile's directory and any directories specified using the
1030 option are searched before the system
1032 .It Ic .sinclude Ar <file>
1033 .It Ic .sinclude Ar \*qfile\*q
1036 but silently ignored if the file cannot be found and opened.
1037 .It Ic .undef Ar variable
1038 Un-define the specified global variable.
1039 Only global variables may be un-defined.
1040 .It Ic .error Ar message
1041 Terminate processing of the makefile immediately.
1043 makefile, the line on which the error was encountered and the specified
1044 message are printed to the standard error output and
1046 terminates with exit code 1.
1047 Variables in the message are expanded.
1048 .It Ic .warning Ar message
1049 Emit a warning message.
1050 The filename of the makefile,
1051 the line on which the warning was encountered,
1052 and the specified message are printed to the standard error output.
1053 Variables in the message are expanded.
1056 Conditionals are used to determine which parts of the Makefile
1058 They are used similarly to the conditionals supported
1059 by the C pre-processor.
1060 The following conditionals are supported:
1064 .Oo \&! Oc Ns Ar expression
1065 .Op Ar operator expression ...
1067 Test the value of an expression.
1070 .Oo \&! Oc Ns Ar variable
1071 .Op Ar operator variable ...
1073 Test the value of a variable.
1076 .Oo \&! Oc Ns Ar variable
1077 .Op Ar operator variable ...
1079 Test the value of a variable.
1082 .Oo \&! Oc Ns Ar target
1083 .Op Ar operator target ...
1085 Test the target being built.
1088 .Oo \&! Oc Ns Ar target
1089 .Op Ar operator target ...
1091 Test the target being built.
1093 Reverse the sense of the last conditional.
1096 .Oo \&! Oc Ns Ar expression
1097 .Op Ar operator expression ...
1105 .Oo \&! Oc Ns Ar variable
1106 .Op Ar operator variable ...
1114 .Oo \&! Oc Ns Ar variable
1115 .Op Ar operator variable ...
1123 .Oo \&! Oc Ns Ar target
1124 .Op Ar operator target ...
1132 .Oo \&! Oc Ns Ar target
1133 .Op Ar operator target ...
1140 End the body of the conditional.
1145 may be any one of the following:
1146 .Bl -tag -width "Cm XX"
1153 of higher precedence than
1159 will only evaluate a conditional as far as is necessary to determine
1161 Parentheses may be used to change the order of evaluation.
1162 The boolean operator
1164 may be used to logically negate an entire
1166 It is of higher precedence than
1171 may be any of the following:
1174 Takes a variable name as an argument and evaluates to true if the variable
1177 Takes a target name as an argument and evaluates to true if the target
1178 was specified as part of
1180 command line or was declared the default target (either implicitly or
1183 before the line containing the conditional.
1185 Takes a variable, with possible modifiers, and evaluates to true if
1186 the expansion of the variable would result in an empty string.
1188 Takes a file name as an argument and evaluates to true if the file exists.
1189 The file is searched for on the system search path (see
1192 Takes a target name as an argument and evaluates to true if the target
1198 may also be a numeric or string comparison:
1199 in this case, the left-hand side
1201 a variable expansion, whereas the right-hand side can be a
1202 constant or a variable expansion.
1203 Variable expansion is performed on both sides, after which the resulting
1204 values are compared.
1205 A value is interpreted as hexadecimal if it is
1206 preceded by 0x, otherwise it is decimal; octal numbers are not supported.
1208 String comparison can only use the
1212 operators, whereas numeric values (both integer and floating point)
1213 can also be compared using the
1221 If no relational operator (and right-hand value) are given, an implicit
1224 However be very careful in using this feature especially
1225 when the left-hand side variable expansion returns a string.
1229 is evaluating one of these conditional expressions, and it encounters
1230 a word it does not recognize, either the
1234 expression is applied to it, depending on the form of the conditional.
1242 expression is applied.
1243 Similarly, if the form is
1249 expression is applied.
1251 If the conditional evaluates to true the parsing of the makefile continues
1253 If it evaluates to false, the following lines are skipped.
1254 In both cases this continues until a
1260 For loops are typically used to apply a set of rules to a list of files.
1261 The syntax of a for loop is:
1263 .Bl -tag -width indent -compact
1264 .It Ic .for Ar variable Ic in Ar expression
1271 is evaluated, it is split into words.
1275 is successively set to each word, and substituted in the
1277 inside the body of the for loop.
1279 Comments begin with a hash
1281 character, anywhere but in a shell
1282 command line, and continue to the end of the line.
1286 Ignore any errors from the commands associated with this target, exactly
1287 as if they all were preceded by a dash
1290 Execute the commands associated with this target even if the
1294 options were specified.
1295 Normally used to mark recursive
1300 selects the first target it encounters as the default target to be built
1301 if no target was specified.
1302 This source prevents this target from being selected.
1304 If a target is marked with this attribute and
1306 cannot figure out how to create it, it will ignore this fact and assume
1307 the file is not needed or already exists.
1311 is interrupted, it removes any partially made targets.
1312 This source prevents the target from being removed.
1314 Do not echo any of the commands associated with this target, exactly
1315 as if they all were preceded by an at sign
1318 Turn the target into
1321 When the target is used as a source for another target, the other target
1322 acquires the commands, sources, and attributes (except for
1326 If the target already has commands, the
1328 target's commands are appended
1333 source appears in a dependency line, the sources that precede it are
1334 made before the sources that succeed it in the line.
1336 detected and targets that form loops will be silently ignored.
1339 Special targets may not be included with other targets, i.e., they must be
1340 the only target specified.
1343 Any command lines attached to this target are executed before anything
1348 rule for any target (that was used only as a
1351 cannot figure out any other way to create.
1352 Only the shell script is used.
1355 variable of a target that inherits
1358 to the target's own name.
1360 Any command lines attached to this target are executed after everything
1363 Mark each of the sources with the
1366 If no sources are specified, this is the equivalent of specifying the
1370 A list of suffixes that indicate files that can be included in a source
1372 The suffix must have already been declared with
1374 any suffix so declared will have the directories on its search path (see
1378 special variable, each preceded by a
1384 is interrupted, the commands for this target will be executed.
1386 This does for libraries what
1388 does for include files, except that the flag used is
1391 If no target is specified when
1393 is invoked, this target will be built.
1394 This is always set, either
1395 explicitly, or implicitly when
1397 selects the default target, to give the user a way to refer to the default
1398 target on the command line.
1399 .It Ic .MAKEFILEDEPS
1401 .Dq Remaking Makefiles
1402 functionality, as explained in the
1403 .Sx REMAKING MAKEFILES
1406 This target provides a way to specify flags for
1408 when the makefile is used.
1409 The flags are as if typed to the shell, though the
1415 and variable assignments specified as the source
1416 for this target are also appended to the
1419 Please note the difference between this target and the
1421 internal variable: specifying an option or variable
1422 assignment as the source for this target will affect
1424 the current makefile and all processes that
1428 Same as above, for backward compatibility.
1429 .\" XXX: NOT YET!!!!
1430 .\" .It Ic .NOTPARALLEL
1431 .\" The named targets are executed in non parallel mode. If no targets are
1432 .\" specified, then all targets are executed in non parallel mode.
1434 Disable parallel mode.
1436 Same as above, for compatibility with other
1440 The named targets are made in sequence.
1441 .\" XXX: NOT YET!!!!
1442 .\" .It Ic .PARALLEL
1443 .\" The named targets are executed in parallel mode. If no targets are
1444 .\" specified, then all targets are executed in parallel mode.
1446 The sources are directories which are to be searched for files not
1447 found in the current directory.
1448 If no sources are specified, any previously specified directories are
1450 Where possible, use of
1452 is preferred over use of the
1455 .It Ic .PATH\fIsuffix\fR
1456 The sources are directories which are to be searched for suffixed files
1457 not found in the current directory.
1461 first searches the suffixed search path, before reverting to the default
1462 path if the file is not found there.
1463 This form is required for
1471 attribute to any specified sources.
1472 Targets with this attribute are always
1473 considered to be out of date.
1477 behavior to match the applicable
1480 (Note this disables the
1481 .Dq Remaking Makefiles
1486 attribute to any specified sources.
1487 If no sources are specified, the
1489 attribute is applied to every
1492 Select another shell.
1493 The sources of this target have the format
1494 .Ar key Ns = Ns Ar value .
1498 .Bl -tag -width ".Va hasErrCtl"
1500 Specify the path to the new shell.
1502 Specify the name of the new shell.
1503 This may be either one of the three builtin shells (see below) or any
1506 Specify the shell command to turn echoing off.
1508 Specify the shell command to turn echoing on.
1510 Usually shells print the echo off command before turning echoing off.
1511 This is the exact string that will be printed by the shell and is used
1512 to filter the shell output to remove the echo off command.
1514 The shell option that turns echoing on.
1516 The shell option to turn on error checking.
1517 If error checking is on, the shell should exit if a command returns
1520 True if the shell has error control.
1524 is true then this is the shell command to turn error checking on.
1527 is false then this is a command template to echo commands for which error
1528 checking is disabled.
1529 The template must contain a
1534 is true, this is the shell command to turn error checking off.
1537 is false, this is a command template to execute a command so that errors
1539 The template must contain a
1542 This is a string of meta characters of the shell.
1544 This is a string holding all the shell's builtin commands separated by blanks.
1549 strings are used in compat mode.
1550 When a command line contains neither a meta
1551 character nor starts with a shell builtin, it is executed directly without
1553 When one of these strings (or both) is empty all commands are executed
1558 environment variable before executing any command.
1559 This is useful for the Korn-shell
1563 Values that are strings must be surrounded by double quotes.
1564 Boolean values are specified as
1568 (in either case) to mean true.
1569 Any other value is taken to mean false.
1571 There are several uses of the
1576 Selecting one of the builtin shells.
1577 This is done by just specifying the name of the shell with the
1580 It is also possible to modify the parameters of the builtin shell by just
1581 specifying other keywords (except for
1584 Using another executable for one of the builtin shells.
1585 This is done by specifying the path to the executable with the
1588 If the last component is the same as the name of the builtin shell, no
1589 name needs to be specified; if it is different, the name must be given:
1590 .Bd -literal -offset indent
1591 \&.SHELL: path="/usr/local/bin/sh"
1594 selects the builtin shell
1596 but will execute it from
1597 .Pa /usr/local/bin/sh .
1598 Like in the previous case, it is possible to modify parameters of the builtin
1599 shell by just specifying them.
1601 Using an entirely different shell.
1602 This is done by specifying all keywords.
1605 The builtin shells are
1616 it is unwise to specify
1617 .Va name Ns = Ns Qq Li ksh
1618 without also specifying a path.
1622 attribute to any specified sources.
1623 If no sources are specified, the
1625 attribute is applied to every
1626 command in the file.
1628 Each source specifies a suffix to
1630 If no sources are specified, any previous specified suffixes are deleted.
1632 Each source specifies a warning flag as previously described for the
1634 command line option.
1635 Warning flags specified on the command line take precedence over flags
1636 specified in the makefile.
1637 Also, command line warning flags are pushed to sub-makes through the
1639 environment variables so that a warning flag specified on the command
1640 line will influence all sub-makes.
1641 Several flags can be specified on a single
1643 target by separating them with blanks.
1645 .Sh REMAKING MAKEFILES
1646 If the special target
1648 exists in the Makefile,
1651 .Dq Remaking Makefiles
1653 After reading Makefile and all the files that are included using
1657 directives (source Makefiles)
1659 considers each source Makefile as a target and tries to rebuild it.
1660 Both explicit and implicit rules are checked and all source Makefiles
1661 are updated if necessary. If any of the source Makefiles were rebuilt,
1663 restarts from clean state.
1665 To prevent infinite loops the following source Makefile targets are ignored:
1669 targets that have no prerequisites
1680 targets without prerequisites and without commands
1683 When remaking a source Makefile options
1689 (no exec) do not take effect, unless source Makefile is specified
1690 explicitly as a target in
1694 Additionally, system makefiles and
1696 are not considered as Makefiles that can be rebuilt.
1700 utility uses the following environment variables, if they exist:
1705 .Ev MAKEOBJDIRPREFIX ,
1709 .Bl -tag -width /usr/share/doc/psd/12.make -compact
1711 list of dependencies
1713 list of dependencies
1715 list of dependencies
1720 .It Pa /usr/share/mk
1721 default system makefile directory
1722 .It Pa /usr/share/doc/psd/12.make
1726 .Ev MAKEOBJDIRPREFIX
1728 .It Pa /etc/make.conf
1733 List all included makefiles in order visited:
1735 .Dl "make -V .MAKEFILE_LIST | tr \e\ \e\en"
1743 This was removed for
1746 The internal variable
1748 is set to the same value as
1750 support for this may be removed in the future.
1756 modifiers are deprecated
1759 and the more portable (among Pmake decedents)
1763 should be used instead.
1765 Most of the more esoteric features of
1767 should probably be avoided for greater compatibility.
1772 .%T "PMake - A Tutorial"
1775 .Pa /usr/share/doc/psd/12.make
1779 command appeared in PWB UNIX.
1781 The determination of
1783 is contorted to the point of absurdity.
1785 In the presence of several
1789 silently ignores all but the first.
1792 is not set to the default target when
1794 is invoked without a target name and no
1796 special target exists.
1800 in a test is very simple-minded.
1801 Currently, the only form that works is
1802 .Ql .if ${VAR} op something .
1803 For instance, you should write tests as
1804 .Ql .if ${VAR} == "string"
1805 not the other way around, which would give you an error.
1807 For loops are expanded before tests, so a fragment such as:
1808 .Bd -literal -offset indent
1809 \&.for ARCH in ${SHARED_ARCHS}
1810 \&.if ${ARCH} == ${MACHINE}
1816 will not work, and should be rewritten as:
1817 .Bd -literal -offset indent
1818 \&.for ARCH in ${SHARED_ARCHS}
1819 \&.if ${MACHINE} == ${ARCH}
1825 The parsing code is broken with respect to handling a semicolon
1826 after a colon, so a fragment like this will fail:
1827 .Bd -literal -offset indent
1831 \&.for h in ${HDRS:S;^;${.CURDIR}/;}
1836 A trailing backslash in a variable value defined on the command line causes
1837 the delimiting space in the
1839 environment variable to be preceded by that backslash.
1840 That causes a submake to not treat that space as a word delimiter.
1841 Fixing this requires a larger rewrite of the code handling command line
1842 macros and assignments to