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. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)make.1 8.8 (Berkeley) 6/13/95
40 .Nd maintain program dependencies
43 .Op Fl ABPSXeiknpqrstv
55 .Op Fl x Ar warning_options
56 .Op Ar variable Ns No = Ns Ar value
61 utility is a program designed to simplify the maintenance of other programs.
62 Its input is a list of specifications
63 describing dependency relationships between the generation of
66 First of all, the initial list of specifications will be read
67 from the system makefile,
69 unless inhibited with the
78 the default path to which
79 can be altered via the
89 that can be found in the current directory, object directory (see
91 or search path (see the
94 will be read for the main list of dependency specifications.
95 A different makefile or list of them can be supplied via the
100 can be found in any of the aforesaid locations, it will also be read (see
105 searches for a makefile, its name takes precedence over its location.
108 in the object directory will be favored over
110 in the current directory.
112 The options are as follows:
115 Make archive errors non-fatal, causing
117 to just skip the remainder
118 or all of the archive and continue after printing a message.
120 Try to be backwards compatible by executing a single shell per command and
121 by executing the commands to make the sources of a dependency line in sequence.
122 This is turned on by default unless
125 .It Fl C Ar directory
128 before reading the makefiles or doing anything else.
131 options are specified, each is interpreted relative to the previous one:
132 .Fl C Pa / Fl C Pa etc
138 to be 1, in the global context.
140 Turn on debugging, and specify which portions of
142 are to print debugging information.
145 is one or more of the following:
148 Print all possible debugging information;
149 equivalent to specifying all of the debugging flags.
151 Print debugging information about archive searching and caching.
153 Print debugging information about conditional evaluation.
155 Print debugging information about directory searching and caching.
157 Print debugging information about the execution of for loops.
159 Print the input graph before making anything.
161 Print the input graph after making everything, or before exiting
164 Print debugging information about running multiple shells.
166 Print commands in Makefiles regardless of whether or not they are prefixed
167 by @ or other "quiet" flags.
168 Also known as "loud" behavior.
170 Print debugging information about making targets, including modification
173 Print debugging information about suffix-transformation rules.
175 Print debugging information about target list maintenance.
177 Print debugging information about variable assignment.
180 Specify a variable whose environment value (if any) will override
181 macro assignments within makefiles.
183 Specify that environment values override macro assignments within
184 makefiles for all variables.
186 Specify a makefile to read instead of the default one.
189 is not an absolute pathname,
191 will search for it as described above.
196 standard input is read.
199 options can be supplied,
200 and the makefiles will be read in that order.
201 Unlike the other command-line options,
205 nor pushed down to sub-makes via
207 See below for more details on these variables.
208 .It Fl I Ar directory
209 Specify a directory in which to search for makefiles and included makefiles.
212 options can be specified to form a search path.
213 The system makefile directory (or directories, see the
215 option) is automatically appended at the tail of this path.
217 Ignore non-zero exit of shell commands in the makefile.
218 Equivalent to specifying
220 before each command line in the makefile.
222 Specify the maximum number of jobs that
224 may have running at any one time.
225 Turns compatibility mode off, unless the
227 flag is also specified.
229 Continue processing after errors are encountered, but only on those targets
230 that do not depend on the target whose creation caused the error.
231 .It Fl m Ar directory
232 Specify a directory in which to search for
233 the system makefile and makefiles included via the <...> style.
236 options can be specified to form a search path.
237 This path will override the default system include path,
239 The system include path will always be appended to the search path used
240 for "..."-style inclusions and makefile searches (see the
244 If a file or directory name in the
248 environment variable) starts with the string
252 will search for the specified file or directory named in the remaining part
253 of the argument string.
254 The search starts with the current directory of the Makefile and then works
255 upward towards the root of the filesystem.
256 If the search is successful,
257 then the resulting directory replaces the
262 If used, this feature allows
264 to easily search in the current source tree for customized sys.mk files
270 that are earlier on the command line affect where
274 Display the commands that would have been executed, but do not actually
277 Collate the output of a given job and display it only when the job finishes,
278 instead of mixing the output of parallel jobs together.
279 This option has no effect unless
283 Only print the input graph, not executing any commands.
284 The output is the same as
288 only the builtin rules of
293 For multi-job makes, this will cause file banners not to be generated.
295 Do not execute any commands, but exit 0 if the specified targets are
296 up-to-date and 1, otherwise.
298 Do not process the system makefile.
300 Stop processing when an error is encountered.
302 This is needed to negate the
304 option during recursive builds.
306 Do not echo any commands as they are executed.
307 Equivalent to specifying
309 before each command line in the makefile.
311 Rather than re-building a target as specified in the makefile, create it
312 or update its modification time to make it appear up-to-date.
318 in the global context.
319 Do not build any targets.
320 Multiple instances of this option may be specified;
321 the variables will be printed one per line,
322 with a blank line for each null or undefined variable.
327 then the value will be expanded before printing.
330 Print any extra information.
334 option to print the values of variables,
335 do not recursively expand the values.
336 .It Ar variable Ns No = Ns Ar value
337 Set the value of the variable
341 .It Fl x Ar warning_options
342 Specify extended warning options.
343 This option may be specified several times.
348 in which case the warning is switched off.
349 The currently available options are:
350 .Bl -tag -width indent
352 Warn if anything except blanks and comments follows an
364 There are seven different types of lines in a makefile: file dependency
365 specifications, shell commands, variable assignments, include statements,
366 conditional directives, for loops, and comments.
368 In general, lines may be continued from one line to the next by ending
369 them with a backslash
371 The trailing newline character and initial whitespace on the following
372 line are compressed into a single space.
373 .Sh FILE DEPENDENCY SPECIFICATIONS
374 Dependency lines consist of one or more targets, an operator, and zero
376 This creates a relationship where the targets
379 and are usually created from them.
380 The exact relationship between the target and the source is determined
381 by the operator that separates them.
382 The three operators are as follows:
385 A target is considered out-of-date if its modification time is less than
386 those of any of its sources.
387 Sources for a target accumulate over dependency lines when this operator
389 The target is removed if
393 Targets are always re-created, but not until all sources have been
394 examined and re-created as necessary.
395 Sources for a target accumulate over dependency lines when this operator
397 The target is removed if
401 If no sources are specified, the target is always re-created.
402 Otherwise, a target is considered out-of-date if any of its sources has
403 been modified more recently than the target.
404 Sources for a target do not accumulate over dependency lines when this
406 The target will not be removed if
411 Targets and sources may contain the shell wildcard expressions
422 may only be used as part of the final
423 component of the target or source, and must be used to describe existing
427 need not necessarily be used to describe existing files.
428 Expansion is in directory order, not alphabetically as done in the shell.
430 Each target may have associated with it a series of shell commands, normally
431 used to create the target.
432 Each of the commands in this script
434 be preceded by a tab.
435 While any target may appear on a dependency line, only one of these
436 dependencies may be followed by a creation script, unless the
440 If the first characters of the command line are
445 the command is treated specially.
448 causes the command not to be echoed before it is executed.
451 causes any non-zero exit status of the command line to be ignored.
454 causes the command to be executed even if
456 is specified on the command line.
457 .Sh VARIABLE ASSIGNMENTS
460 are much like variables in the shell, and, by tradition,
461 consist of all upper-case letters.
462 The five operators that can be used to assign values to variables are as
466 Assign the value to the variable.
467 Any previous value is overridden.
469 Append the value to the current value of the variable.
471 Assign the value to the variable if it is not already defined.
473 Assign with expansion, i.e., expand the value before assigning it
475 Normally, expansion is not done until the variable is referenced.
477 Expand the value and pass it to the shell for execution and assign
478 the result to the variable.
479 Any newlines in the result are replaced with spaces.
482 Any whitespace before the assigned
484 is removed; if the value is being appended, a single space is inserted
485 between the previous contents of the variable and the appended value.
487 Variables are expanded by surrounding the variable name with either
492 and preceding it with
495 If the variable name contains only a single letter, the surrounding
496 braces or parentheses are not required.
497 This shorter form is not recommended.
499 Variable substitution occurs at two distinct times, depending on where
500 the variable is being used.
501 Variables in dependency lines are expanded as the line is read.
502 Variables in shell commands are expanded when the shell command is
505 The four different classes of variables (in order of increasing precedence)
508 .It Environment variables
509 Variables defined as part of
513 Variables defined in the makefile or in included makefiles.
514 .It Command line variables
515 Variables defined as part of the command line and variables
518 environment variable or the
522 Variables that are defined specific to a certain target.
525 If the name of an environment variable appears in a makefile
526 on the left-hand side of an assignment,
527 a global variable with the same name is created, and the latter
528 shadows the former as per their relative precedences.
529 The environment is not changed in this case, and the change
530 is not exported to programs executed by
532 However, a command-line variable actually replaces
533 the environment variable of the same name if the latter exists,
534 which is visible to child programs.
536 There are seven local variables in
538 .Bl -tag -width ".ARCHIVE"
540 The list of all sources for this target; also known as
543 The name of the archive file; also known as
546 The name/path of the source from which the target is to be transformed
549 source); also known as
552 The name of the archive member; also known as
555 The list of sources for this target that were deemed out-of-date; also
559 The file prefix of the file, containing only the file portion, no suffix
560 or preceding directory components; also known as
563 The name of the target; also known as
576 are permitted for backward
577 compatibility and are not recommended.
587 permitted for compatibility with
589 makefiles and are not recommended.
591 Four of the local variables may be used in sources on dependency lines
592 because they expand to the proper value for each target on the line.
602 sets or knows about the following internal variables or environment
604 .Bl -tag -width ".Va .MAKEFILE_LIST"
610 expands to a single dollar
616 .Pq Va argv Ns Op 0 .
618 A path to the directory where
625 to the canonical path given by
628 A path to the directory where the targets are built.
631 searches for an alternate directory to place target files.
632 It will attempt to change into this special directory
633 and will search this directory for makefiles
634 not found in the current directory.
635 The following directories are tried in order:
639 ${MAKEOBJDIRPREFIX}/`pwd -P`
650 The first directory that
652 successfully changes into is used.
657 is set in the environment but
659 is unable to change into the corresponding directory,
660 then the current directory is used
661 without checking the remainder of the list.
662 If they are undefined and
664 is unable to change into any of the remaining three directories,
665 then the current directory is used.
670 must be environment variables and should not be set on
678 to the canonical path given by
680 .It Va .MAKEFILE_LIST
683 reads various makefiles, including the default files and any
684 obtained from the command line and
688 directives, their names will be automatically appended to the
691 They are added right before
693 begins to parse them, so that the name of the current makefile is the
694 last word in this variable.
696 The environment variable
698 may initially contain anything that
705 After processing, its contents are stored in the
707 global variable, although any
710 Then all options and variable assignments specified on
712 command line, except for
720 executes a program, it sets
722 in the program's environment to the current value of the
729 environment contains any
731 options, they will not be pushed down to child programs automatically.
734 utility effectively filters out
736 options from the environment and command line although it
737 passes the rest of its options down to sub-makes via
741 When passing macro definitions and flag arguments in the
743 environment variable,
744 space and tab characters are quoted by preceding them with a backslash.
747 variable from the environment,
748 all sequences of a backslash and one of space or tab
749 are replaced just with their second character
750 without causing a word break.
751 Any other occurrences of a backslash are retained.
752 Groups of unquoted space, tab and newline characters cause word
755 Initially, this global variable contains
757 current run-time options from the environment
758 and command line as described above, under
760 By modifying the contents of the
762 global variable, the makefile can alter the contents of the
764 environment variable made available for all programs which
772 is just copied verbatim to
774 in the environment of child programs.
776 Note that any options entered to
778 neither affect the current instance of
780 nor show up in its own copy of
783 However, they do show up in the
785 environment variable of programs executed by
787 On the other hand, a direct assignment to
789 neither affects the current instance of
791 nor is passed down to
796 special target below.
798 This variable is provided for backward compatibility and
799 contains all the options from the
801 environment variable plus any options specified on
808 The parent process-id of
810 .It Va .MAKE.JOB.PREFIX
815 then output for each target is prefixed with a token
817 the first part of which can be controlled via
818 .Va .MAKE.JOB.PREFIX .
821 .Li .MAKE.JOB.PREFIX=${.newline}---${MAKE:T}[${.MAKE.PID}]
822 would produce tokens like
823 .Ql ---make[1234] target ---
825 .Li .MAKE.JOB.PREFIX=---pid[${.MAKE.PID}],ppid[${.MAKE.PPID}]
826 would produce tokens like
827 .Ql ---pid[56789],ppid[1234] target ---
828 making it easier to track the degree of parallelism being achieved.
832 is currently building.
842 Name of the machine architecture
844 is running on, obtained from the
846 environment variable, or through
850 Name of the machine architecture
852 was compiled for, defined at compilation time.
854 Makefiles may assign a colon-delimited list of directories to
856 These directories will be searched for source files by
858 after it has finished parsing all input makefiles.
860 .Ss Variable Modifiers
861 Variable expansion may be modified to select or modify each word of the
864 is whitespace-delimited sequence of characters).
865 The general format of a variable expansion is as follows:
867 .Dl {variable[:modifier[:...]]}
869 Each modifier begins with a colon and one of the following
871 The colon may be escaped with a backslash
875 .It Cm :C No / Ar pattern Xo
880 Modify each word of the value,
881 substituting every match of the extended regular expression
889 Normally, the first occurrence of the pattern in
890 each word of the value is changed.
893 modifier causes the substitution to apply to at most one word; the
895 modifier causes the substitution to apply to as many instances of the
896 search pattern as occur in the word or words it is found in.
901 are orthogonal; the former specifies whether multiple words are
902 potentially affected, the latter whether multiple substitutions can
903 potentially occur within each affected word.
905 Replaces each word in the variable with its suffix.
907 Replaces each word in the variable with everything but the last component.
909 Converts variable to lower-case letters.
911 .It Cm :M Ns Ar pattern
912 Select only those words that match the rest of the modifier.
913 The standard shell wildcard characters
920 The wildcard characters may be escaped with a backslash
922 .It Cm :N Ns Ar pattern
925 but selects all words which do not match
926 the rest of the modifier.
928 Order every word in the variable alphabetically.
930 Quotes every shell meta-character in the variable, so that it can be passed
931 safely through recursive invocations of
934 Replaces each word in the variable with everything but its suffix.
936 .It Cm :S No / Ar old_string Xo
941 Modify the first occurrence of
943 in each word of the variable's value, replacing it with
947 is appended to the last slash of the pattern, all occurrences
948 in each word are replaced.
954 is anchored at the beginning of each word.
957 ends with a dollar sign
959 it is anchored at the end of each word.
966 Any character may be used as a delimiter for the parts of the modifier
968 The anchoring, ampersand, and delimiter characters may be escaped with a
972 Variable expansion occurs in the normal fashion inside both
976 with the single exception that a backslash is used to prevent the expansion
979 not a preceding dollar sign as is usual.
980 .It Ar :old_string=new_string
983 style variable substitution.
984 It must be the last modifier specified.
989 do not contain the pattern matching character
991 then it is assumed that they are
992 anchored at the end of each word, so only suffixes or entire
993 words may be replaced.
1001 Replaces each word in the variable with its last component.
1003 Converts variable to lower-case letters.
1005 Converts variable to upper-case letters.
1007 Converts variable to upper-case letters.
1010 Remove adjacent duplicate words (like
1013 .Sh DIRECTIVES, CONDITIONALS, AND FOR LOOPS
1014 Directives, conditionals, and for loops reminiscent
1015 of the C programming language are provided in
1017 All such structures are identified by a line beginning with a single
1021 The following directives are supported:
1023 .It Ic .include Ar <file>
1024 .It Ic .include Ar \*qfile\*q
1025 Include the specified makefile.
1026 Variables between the angle brackets
1027 or double quotes are expanded to form the file name.
1029 are used, the included makefile is expected to be in the system
1031 If double quotes are used, the including
1032 makefile's directory and any directories specified using the
1034 option are searched before the system
1036 .It Ic .sinclude Ar <file>
1037 .It Ic .sinclude Ar \*qfile\*q
1040 but silently ignored if the file cannot be found and opened.
1041 .It Ic .undef Ar variable
1042 Un-define the specified global variable.
1043 Only global variables may be un-defined.
1044 .It Ic .error Ar message
1045 Terminate processing of the makefile immediately.
1047 makefile, the line on which the error was encountered and the specified
1048 message are printed to the standard error output and
1050 terminates with exit code 1.
1051 Variables in the message are expanded.
1052 .It Ic .warning Ar message
1053 Emit a warning message.
1054 The filename of the makefile,
1055 the line on which the warning was encountered,
1056 and the specified message are printed to the standard error output.
1057 Variables in the message are expanded.
1060 Conditionals are used to determine which parts of the Makefile
1062 They are used similarly to the conditionals supported
1063 by the C pre-processor.
1064 The following conditionals are supported:
1068 .Oo \&! Oc Ns Ar expression
1069 .Op Ar operator expression ...
1071 Test the value of an expression.
1074 .Oo \&! Oc Ns Ar variable
1075 .Op Ar operator variable ...
1077 Test the value of a variable.
1080 .Oo \&! Oc Ns Ar variable
1081 .Op Ar operator variable ...
1083 Test the value of a variable.
1086 .Oo \&! Oc Ns Ar target
1087 .Op Ar operator target ...
1089 Test the target being built.
1092 .Oo \&! Oc Ns Ar target
1093 .Op Ar operator target ...
1095 Test the target being built.
1097 Reverse the sense of the last conditional.
1100 .Oo \&! Oc Ns Ar expression
1101 .Op Ar operator expression ...
1109 .Oo \&! Oc Ns Ar variable
1110 .Op Ar operator variable ...
1118 .Oo \&! Oc Ns Ar variable
1119 .Op Ar operator variable ...
1127 .Oo \&! Oc Ns Ar target
1128 .Op Ar operator target ...
1136 .Oo \&! Oc Ns Ar target
1137 .Op Ar operator target ...
1144 End the body of the conditional.
1149 may be any one of the following:
1150 .Bl -tag -width "Cm XX"
1157 of higher precedence than
1163 will only evaluate a conditional as far as is necessary to determine
1165 Parentheses may be used to change the order of evaluation.
1166 The boolean operator
1168 may be used to logically negate an entire
1170 It is of higher precedence than
1175 may be any of the following:
1178 Takes a variable name as an argument and evaluates to true if the variable
1181 Takes a target name as an argument and evaluates to true if the target
1182 was specified as part of
1184 command line or was declared the default target (either implicitly or
1187 before the line containing the conditional.
1189 Takes a variable, with possible modifiers, and evaluates to true if
1190 the expansion of the variable would result in an empty string.
1192 Takes a file name as an argument and evaluates to true if the file exists.
1193 The file is searched for on the system search path (see
1196 Takes a target name as an argument and evaluates to true if the target
1202 may also be a numeric or string comparison:
1203 in this case, the left-hand side
1205 a variable expansion, whereas the right-hand side can be a
1206 constant or a variable expansion.
1207 Variable expansion is performed on both sides, after which the resulting
1208 values are compared.
1209 A value is interpreted as hexadecimal if it is
1210 preceded by 0x, otherwise it is decimal; octal numbers are not supported.
1212 String comparison can only use the
1216 operators, whereas numeric values (both integer and floating point)
1217 can also be compared using the
1225 If no relational operator (and right-hand value) are given, an implicit
1228 However be very careful in using this feature especially
1229 when the left-hand side variable expansion returns a string.
1233 is evaluating one of these conditional expressions, and it encounters
1234 a word it does not recognize, either the
1238 expression is applied to it, depending on the form of the conditional.
1246 expression is applied.
1247 Similarly, if the form is
1253 expression is applied.
1255 If the conditional evaluates to true the parsing of the makefile continues
1257 If it evaluates to false, the following lines are skipped.
1258 In both cases this continues until a
1264 For loops are typically used to apply a set of rules to a list of files.
1265 The syntax of a for loop is:
1267 .Bl -tag -width indent -compact
1268 .It Ic .for Ar variable Ic in Ar expression
1275 is evaluated, it is split into words.
1279 is successively set to each word, and substituted in the
1281 inside the body of the for loop.
1283 Comments begin with a hash
1285 character, anywhere but in a shell
1286 command line, and continue to the end of the line.
1290 Ignore any errors from the commands associated with this target, exactly
1291 as if they all were preceded by a dash
1294 Execute the commands associated with this target even if the
1298 options were specified.
1299 Normally used to mark recursive
1304 selects the first target it encounters as the default target to be built
1305 if no target was specified.
1306 This source prevents this target from being selected.
1308 If a target is marked with this attribute and
1310 cannot figure out how to create it, it will ignore this fact and assume
1311 the file is not needed or already exists.
1315 is interrupted, it removes any partially made targets.
1316 This source prevents the target from being removed.
1318 Do not echo any of the commands associated with this target, exactly
1319 as if they all were preceded by an at sign
1322 Turn the target into
1325 When the target is used as a source for another target, the other target
1326 acquires the commands, sources, and attributes (except for
1330 If the target already has commands, the
1332 target's commands are appended
1337 source appears in a dependency line, the sources that precede it are
1338 made before the sources that succeed it in the line.
1340 detected and targets that form loops will be silently ignored.
1343 Special targets may not be included with other targets, i.e., they must be
1344 the only target specified.
1347 Any command lines attached to this target are executed before anything
1352 rule for any target (that was used only as a
1355 cannot figure out any other way to create.
1356 Only the shell script is used.
1359 variable of a target that inherits
1362 to the target's own name.
1364 Any command lines attached to this target are executed after everything
1367 Mark each of the sources with the
1370 If no sources are specified, this is the equivalent of specifying the
1374 A list of suffixes that indicate files that can be included in a source
1376 The suffix must have already been declared with
1378 any suffix so declared will have the directories on its search path (see
1382 special variable, each preceded by a
1388 is interrupted, the commands for this target will be executed.
1390 This does for libraries what
1392 does for include files, except that the flag used is
1395 If no target is specified when
1397 is invoked, this target will be built.
1398 This is always set, either
1399 explicitly, or implicitly when
1401 selects the default target, to give the user a way to refer to the default
1402 target on the command line.
1403 .It Ic .MAKEFILEDEPS
1405 .Dq Remaking Makefiles
1406 functionality, as explained in the
1407 .Sx REMAKING MAKEFILES
1410 This target provides a way to specify flags for
1412 when the makefile is used.
1413 The flags are as if typed to the shell, though the
1419 and variable assignments specified as the source
1420 for this target are also appended to the
1423 Please note the difference between this target and the
1425 internal variable: specifying an option or variable
1426 assignment as the source for this target will affect
1428 the current makefile and all processes that
1432 Same as above, for backward compatibility.
1433 .\" XXX: NOT YET!!!!
1434 .\" .It Ic .NOTPARALLEL
1435 .\" The named targets are executed in non parallel mode. If no targets are
1436 .\" specified, then all targets are executed in non parallel mode.
1438 Disable parallel mode.
1440 Same as above, for compatibility with other
1444 The named targets are made in sequence.
1445 .\" XXX: NOT YET!!!!
1446 .\" .It Ic .PARALLEL
1447 .\" The named targets are executed in parallel mode. If no targets are
1448 .\" specified, then all targets are executed in parallel mode.
1450 The sources are directories which are to be searched for files not
1451 found in the current directory.
1452 If no sources are specified, any previously specified directories are
1454 Where possible, use of
1456 is preferred over use of the
1459 .It Ic .PATH\fIsuffix\fR
1460 The sources are directories which are to be searched for suffixed files
1461 not found in the current directory.
1465 first searches the suffixed search path, before reverting to the default
1466 path if the file is not found there.
1467 This form is required for
1475 attribute to any specified sources.
1476 Targets with this attribute are always
1477 considered to be out of date.
1481 behavior to match the applicable
1484 (Note this disables the
1485 .Dq Remaking Makefiles
1490 attribute to any specified sources.
1491 If no sources are specified, the
1493 attribute is applied to every
1496 Select another shell.
1497 The sources of this target have the format
1498 .Ar key Ns = Ns Ar value .
1502 .Bl -tag -width ".Va hasErrCtl"
1504 Specify the path to the new shell.
1506 Specify the name of the new shell.
1507 This may be either one of the three builtin shells (see below) or any
1510 Specify the shell command to turn echoing off.
1512 Specify the shell command to turn echoing on.
1514 Usually shells print the echo off command before turning echoing off.
1515 This is the exact string that will be printed by the shell and is used
1516 to filter the shell output to remove the echo off command.
1518 The shell option that turns echoing on.
1520 The shell option to turn on error checking.
1521 If error checking is on, the shell should exit if a command returns
1524 True if the shell has error control.
1528 is true then this is the shell command to turn error checking on.
1531 is false then this is a command template to echo commands for which error
1532 checking is disabled.
1533 The template must contain a
1538 is true, this is the shell command to turn error checking off.
1541 is false, this is a command template to execute a command so that errors
1543 The template must contain a
1546 This is a string of meta characters of the shell.
1548 This is a string holding all the shell's builtin commands separated by blanks.
1553 strings are used in compat mode.
1554 When a command line contains neither a meta
1555 character nor starts with a shell builtin, it is executed directly without
1557 When one of these strings (or both) is empty all commands are executed
1562 environment variable before executing any command.
1563 This is useful for the Korn-shell
1567 Values that are strings must be surrounded by double quotes.
1568 Boolean values are specified as
1572 (in either case) to mean true.
1573 Any other value is taken to mean false.
1575 There are several uses of the
1580 Selecting one of the builtin shells.
1581 This is done by just specifying the name of the shell with the
1584 It is also possible to modify the parameters of the builtin shell by just
1585 specifying other keywords (except for
1588 Using another executable for one of the builtin shells.
1589 This is done by specifying the path to the executable with the
1592 If the last component is the same as the name of the builtin shell, no
1593 name needs to be specified; if it is different, the name must be given:
1594 .Bd -literal -offset indent
1595 \&.SHELL: path="/usr/local/bin/sh"
1598 selects the builtin shell
1600 but will execute it from
1601 .Pa /usr/local/bin/sh .
1602 Like in the previous case, it is possible to modify parameters of the builtin
1603 shell by just specifying them.
1605 Using an entirely different shell.
1606 This is done by specifying all keywords.
1609 The builtin shells are
1620 it is unwise to specify
1621 .Va name Ns = Ns Qq Li ksh
1622 without also specifying a path.
1626 attribute to any specified sources.
1627 If no sources are specified, the
1629 attribute is applied to every
1630 command in the file.
1632 Each source specifies a suffix to
1634 If no sources are specified, any previous specified suffixes are deleted.
1636 Each source specifies a warning flag as previously described for the
1638 command line option.
1639 Warning flags specified on the command line take precedence over flags
1640 specified in the makefile.
1641 Also, command line warning flags are pushed to sub-makes through the
1643 environment variables so that a warning flag specified on the command
1644 line will influence all sub-makes.
1645 Several flags can be specified on a single
1647 target by separating them with blanks.
1649 .Sh REMAKING MAKEFILES
1650 If the special target
1652 exists in the Makefile,
1655 .Dq Remaking Makefiles
1657 After reading Makefile and all the files that are included using
1661 directives (source Makefiles)
1663 considers each source Makefile as a target and tries to rebuild it.
1664 Both explicit and implicit rules are checked and all source Makefiles
1665 are updated if necessary. If any of the source Makefiles were rebuilt,
1667 restarts from clean state.
1669 To prevent infinite loops the following source Makefile targets are ignored:
1673 targets that have no prerequisites
1684 targets without prerequisites and without commands
1687 When remaking a source Makefile options
1693 (no exec) do not take effect, unless source Makefile is specified
1694 explicitly as a target in
1698 Additionally, system makefiles and
1700 are not considered as Makefiles that can be rebuilt.
1704 utility uses the following environment variables, if they exist:
1709 .Ev MAKEOBJDIRPREFIX ,
1713 .Bl -tag -width /usr/share/doc/psd/12.make -compact
1715 list of dependencies
1717 list of dependencies
1719 list of dependencies
1724 .It Pa /usr/share/mk
1725 default system makefile directory
1726 .It Pa /usr/share/doc/psd/12.make
1730 .Ev MAKEOBJDIRPREFIX
1732 .It Pa /etc/make.conf
1737 List all included makefiles in order visited:
1739 .Dl "make -V .MAKEFILE_LIST | tr \e\ \e\en"
1747 This was removed for
1750 The internal variable
1752 is set to the same value as
1754 support for this may be removed in the future.
1760 modifiers will be deprecated
1763 and the more portable (among Pmake decedents)
1767 should be used instead.
1769 Most of the more esoteric features of
1771 should probably be avoided for greater compatibility.
1776 .%T "PMake - A Tutorial"
1779 .Pa /usr/share/doc/psd/12.make
1783 command appeared in PWB UNIX.
1785 The determination of
1787 is contorted to the point of absurdity.
1789 In the presence of several
1793 silently ignores all but the first.
1796 is not set to the default target when
1798 is invoked without a target name and no
1800 special target exists.
1804 in a test is very simple-minded.
1805 Currently, the only form that works is
1806 .Ql .if ${VAR} op something .
1807 For instance, you should write tests as
1808 .Ql .if ${VAR} == "string"
1809 not the other way around, which would give you an error.
1811 For loops are expanded before tests, so a fragment such as:
1812 .Bd -literal -offset indent
1813 \&.for ARCH in ${SHARED_ARCHS}
1814 \&.if ${ARCH} == ${MACHINE}
1820 will not work, and should be rewritten as:
1821 .Bd -literal -offset indent
1822 \&.for ARCH in ${SHARED_ARCHS}
1823 \&.if ${MACHINE} == ${ARCH}
1829 The parsing code is broken with respect to handling a semicolon
1830 after a colon, so a fragment like this will fail:
1831 .Bd -literal -offset indent
1835 \&.for h in ${HDRS:S;^;${.CURDIR}/;}
1840 A trailing backslash in a variable value defined on the command line causes
1841 the delimiting space in the
1843 environment variable to be preceded by that backslash.
1844 That causes a submake to not treat that space as a word delimiter.
1845 Fixing this requires a larger rewrite of the code handling command line
1846 macros and assignments to