Import bmake-20100808:
[pkgsrc.git] / devel / bmake / files / bmake.cat1
1 MAKE(1)                 NetBSD General Commands Manual                 MAKE(1)
2
3 N\bNA\bAM\bME\bE
4      b\bbm\bma\bak\bke\be -- maintain program dependencies
5
6 S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
7      b\bbm\bma\bak\bke\be [-\b-B\bBe\bei\bik\bkN\bNn\bnq\bqr\brs\bst\btW\bWX\bX] [-\b-C\bC _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by] [-\b-D\bD _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be] [-\b-d\bd _\bf_\bl_\ba_\bg_\bs]
8            [-\b-f\bf _\bm_\ba_\bk_\be_\bf_\bi_\bl_\be] [-\b-I\bI _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by] [-\b-J\bJ _\bp_\br_\bi_\bv_\ba_\bt_\be] [-\b-j\bj _\bm_\ba_\bx_\b__\bj_\bo_\bb_\bs]
9            [-\b-m\bm _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by] [-\b-T\bT _\bf_\bi_\bl_\be] [-\b-V\bV _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be] [_\bv_\ba_\br_\bi_\ba_\bb_\bl_\be_\b=_\bv_\ba_\bl_\bu_\be]
10            [_\bt_\ba_\br_\bg_\be_\bt _\b._\b._\b.]
11
12 D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
13      b\bbm\bma\bak\bke\be is a program designed to simplify the maintenance of other pro-
14      grams.  Its input is a list of specifications as to the files upon which
15      programs and other files depend.  If no -\b-f\bf _\bm_\ba_\bk_\be_\bf_\bi_\bl_\be makefile option is
16      given, b\bbm\bma\bak\bke\be will try to open `_\bm_\ba_\bk_\be_\bf_\bi_\bl_\be' then `_\bM_\ba_\bk_\be_\bf_\bi_\bl_\be' in order to find
17      the specifications.  If the file `_\b._\bd_\be_\bp_\be_\bn_\bd' exists, it is read (see
18      mkdep(1)).
19
20      This manual page is intended as a reference document only.  For a more
21      thorough description of b\bbm\bma\bak\bke\be and makefiles, please refer to _\bM_\ba_\bk_\be _\b- _\bA
22      _\bT_\bu_\bt_\bo_\br_\bi_\ba_\bl.
23
24      b\bbm\bma\bak\bke\be will prepend the contents of the _\bM_\bA_\bK_\bE_\bF_\bL_\bA_\bG_\bS environment variable to
25      the command line arguments before parsing them.
26
27      The options are as follows:
28
29      -\b-B\bB      Try to be backwards compatible by executing a single shell per
30              command and by executing the commands to make the sources of a
31              dependency line in sequence.
32
33      -\b-C\bC _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by
34              Change to _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by before reading the makefiles or doing any-
35              thing else.  If multiple -\b-C\bC options are specified, each is inter-
36              preted relative to the previous one: -\b-C\bC _\b/ -\b-C\bC _\be_\bt_\bc is equivalent to
37              -\b-C\bC _\b/_\be_\bt_\bc.
38
39      -\b-D\bD _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be
40              Define _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be to be 1, in the global context.
41
42      -\b-d\bd _\b[_\b-_\b]_\bf_\bl_\ba_\bg_\bs
43              Turn on debugging, and specify which portions of b\bbm\bma\bak\bke\be are to
44              print debugging information.  Unless the flags are preceded by
45              `-' they are added to the _\bM_\bA_\bK_\bE_\bF_\bL_\bA_\bG_\bS environment variable and will
46              be processed by any child make processes.  By default, debugging
47              information is printed to standard error, but this can be changed
48              using the _\bF debugging flag.  The debugging output is always
49              unbuffered; in addition, if debugging is enabled but debugging
50              output is not directed to standard output, then the standard out-
51              put is line buffered.  _\bF_\bl_\ba_\bg_\bs is one or more of the following:
52
53              _\bA       Print all possible debugging information; equivalent to
54                      specifying all of the debugging flags.
55
56              _\ba       Print debugging information about archive searching and
57                      caching.
58
59              _\bC       Print debugging information about current working direc-
60                      tory.
61
62              _\bc       Print debugging information about conditional evaluation.
63
64              _\bd       Print debugging information about directory searching and
65                      caching.
66
67              _\be       Print debugging information about failed commands and
68                      targets.
69
70              _\bF[+\b+]_\bf_\bi_\bl_\be_\bn_\ba_\bm_\be
71                      Specify where debugging output is written.  This must be
72                      the last flag, because it consumes the remainder of the
73                      argument.  If the character immediately after the `F'
74                      flag is `+', then the file will be opened in append mode;
75                      otherwise the file will be overwritten.  If the file name
76                      is `stdout' or `stderr' then debugging output will be
77                      written to the standard output or standard error output
78                      file descriptors respectively (and the `+' option has no
79                      effect).  Otherwise, the output will be written to the
80                      named file.  If the file name ends `.%d' then the `%d' is
81                      replaced by the pid.
82
83              _\bf       Print debugging information about loop evaluation.
84
85              _\bg_\b1      Print the input graph before making anything.
86
87              _\bg_\b2      Print the input graph after making everything, or before
88                      exiting on error.
89
90              _\bg_\b3      Print the input graph before exiting on error.
91
92              _\bj       Print debugging information about running multiple
93                      shells.
94
95              _\bl       Print commands in Makefiles regardless of whether or not
96                      they are prefixed by `@' or other "quiet" flags.  Also
97                      known as "loud" behavior.
98
99              _\bm       Print debugging information about making targets, includ-
100                      ing modification dates.
101
102              _\bn       Don't delete the temporary command scripts created when
103                      running commands.  These temporary scripts are created in
104                      the directory referred to by the TMPDIR environment vari-
105                      able, or in _\b/_\bt_\bm_\bp if TMPDIR is unset or set to the empty
106                      string.  The temporary scripts are created by mkstemp(3),
107                      and have names of the form _\bm_\ba_\bk_\be_\bX_\bX_\bX_\bX_\bX_\bX.  _\bN_\bO_\bT_\bE: This can
108                      create many files in TMPDIR or _\b/_\bt_\bm_\bp, so use with care.
109
110              _\bp       Print debugging information about makefile parsing.
111
112              _\bs       Print debugging information about suffix-transformation
113                      rules.
114
115              _\bt       Print debugging information about target list mainte-
116                      nance.
117
118              _\bv       Print debugging information about variable assignment.
119
120              _\bx       Run shell commands with -\b-x\bx so the actual commands are
121                      printed as they are executed.
122
123      -\b-e\be      Specify that environment variables override macro assignments
124              within makefiles.
125
126      -\b-f\bf _\bm_\ba_\bk_\be_\bf_\bi_\bl_\be
127              Specify a makefile to read instead of the default `_\bm_\ba_\bk_\be_\bf_\bi_\bl_\be'.  If
128              _\bm_\ba_\bk_\be_\bf_\bi_\bl_\be is `-\b-', standard input is read.  Multiple makefiles may
129              be specified, and are read in the order specified.
130
131      -\b-I\bI _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by
132              Specify a directory in which to search for makefiles and included
133              makefiles.  The system makefile directory (or directories, see
134              the -\b-m\bm option) is automatically included as part of this list.
135
136      -\b-i\bi      Ignore non-zero exit of shell commands in the makefile.  Equiva-
137              lent to specifying `-\b-' before each command line in the makefile.
138
139      -\b-J\bJ _\bp_\br_\bi_\bv_\ba_\bt_\be
140              This option should _\bn_\bo_\bt be specified by the user.
141
142              When the _\bj option is in use in a recursive build, this option is
143              passed by a make to child makes to allow all the make processes
144              in the build to cooperate to avoid overloading the system.
145
146      -\b-j\bj _\bm_\ba_\bx_\b__\bj_\bo_\bb_\bs
147              Specify the maximum number of jobs that b\bbm\bma\bak\bke\be may have running at
148              any one time.  Turns compatibility mode off, unless the _\bB flag is
149              also specified.  When compatibility mode is off, all commands
150              associated with a target are executed in a single shell invoca-
151              tion as opposed to the traditional one shell invocation per line.
152              This can break traditional scripts which change directories on
153              each command invocation and then expect to start with a fresh
154              environment on the next line.  It is more efficient to correct
155              the scripts rather than turn backwards compatibility on.
156
157      -\b-k\bk      Continue processing after errors are encountered, but only on
158              those targets that do not depend on the target whose creation
159              caused the error.
160
161      -\b-m\bm _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by
162              Specify a directory in which to search for sys.mk and makefiles
163              included via the <_\bf_\bi_\bl_\be>-style include statement.  The -\b-m\bm option
164              can be used multiple times to form a search path.  This path will
165              override the default system include path: /usr/share/mk.  Fur-
166              thermore the system include path will be appended to the search
167              path used for "_\bf_\bi_\bl_\be"-style include statements (see the -\b-I\bI
168              option).
169
170              If a file or directory name in the -\b-m\bm argument (or the
171              MAKESYSPATH environment variable) starts with the string ".../"
172              then b\bbm\bma\bak\bke\be will search for the specified file or directory named
173              in the remaining part of the argument string.  The search starts
174              with the current directory of the Makefile and then works upward
175              towards the root of the filesystem.  If the search is successful,
176              then the resulting directory replaces the ".../" specification in
177              the -\b-m\bm argument.  If used, this feature allows b\bbm\bma\bak\bke\be to easily
178              search in the current source tree for customized sys.mk files
179              (e.g., by using ".../mk/sys.mk" as an argument).
180
181      -\b-n\bn      Display the commands that would have been executed, but do not
182              actually execute them unless the target depends on the .MAKE spe-
183              cial source (see below).
184
185      -\b-N\bN      Display the commands which would have been executed, but do not
186              actually execute any of them; useful for debugging top-level
187              makefiles without descending into subdirectories.
188
189      -\b-q\bq      Do not execute any commands, but exit 0 if the specified targets
190              are up-to-date and 1, otherwise.
191
192      -\b-r\br      Do not use the built-in rules specified in the system makefile.
193
194      -\b-s\bs      Do not echo any commands as they are executed.  Equivalent to
195              specifying `@\b@' before each command line in the makefile.
196
197      -\b-T\bT _\bt_\br_\ba_\bc_\be_\bf_\bi_\bl_\be
198              When used with the -\b-j\bj flag, append a trace record to _\bt_\br_\ba_\bc_\be_\bf_\bi_\bl_\be
199              for each job started and completed.
200
201      -\b-t\bt      Rather than re-building a target as specified in the makefile,
202              create it or update its modification time to make it appear up-
203              to-date.
204
205      -\b-V\bV _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be
206              Print b\bbm\bma\bak\bke\be's idea of the value of _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be, in the global con-
207              text.  Do not build any targets.  Multiple instances of this
208              option may be specified; the variables will be printed one per
209              line, with a blank line for each null or undefined variable.  If
210              _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be contains a `$' then the value will be expanded before
211              printing.
212
213      -\b-W\bW      Treat any warnings during makefile parsing as errors.
214
215      -\b-X\bX      Don't export variables passed on the command line to the environ-
216              ment individually.  Variables passed on the command line are
217              still exported via the _\bM_\bA_\bK_\bE_\bF_\bL_\bA_\bG_\bS environment variable.  This
218              option may be useful on systems which have a small limit on the
219              size of command arguments.
220
221      _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be_\b=_\bv_\ba_\bl_\bu_\be
222              Set the value of the variable _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be to _\bv_\ba_\bl_\bu_\be.  Normally, all
223              values passed on the command line are also exported to sub-makes
224              in the environment.  The -\b-X\bX flag disables this behavior.  Vari-
225              able assignments should follow options for POSIX compatibility
226              but no ordering is enforced.
227
228      There are seven different types of lines in a makefile: file dependency
229      specifications, shell commands, variable assignments, include statements,
230      conditional directives, for loops, and comments.
231
232      In general, lines may be continued from one line to the next by ending
233      them with a backslash (`\').  The trailing newline character and initial
234      whitespace on the following line are compressed into a single space.
235
236 F\bFI\bIL\bLE\bE D\bDE\bEP\bPE\bEN\bND\bDE\bEN\bNC\bCY\bY S\bSP\bPE\bEC\bCI\bIF\bFI\bIC\bCA\bAT\bTI\bIO\bON\bNS\bS
237      Dependency lines consist of one or more targets, an operator, and zero or
238      more sources.  This creates a relationship where the targets ``depend''
239      on the sources and are usually created from them.  The exact relationship
240      between the target and the source is determined by the operator that sep-
241      arates them.  The three operators are as follows:
242
243      :\b:     A target is considered out-of-date if its modification time is less
244            than those of any of its sources.  Sources for a target accumulate
245            over dependency lines when this operator is used.  The target is
246            removed if b\bbm\bma\bak\bke\be is interrupted.
247
248      !\b!     Targets are always re-created, but not until all sources have been
249            examined and re-created as necessary.  Sources for a target accumu-
250            late over dependency lines when this operator is used.  The target
251            is removed if b\bbm\bma\bak\bke\be is interrupted.
252
253      :\b::\b:    If no sources are specified, the target is always re-created.  Oth-
254            erwise, a target is considered out-of-date if any of its sources
255            has been modified more recently than the target.  Sources for a
256            target do not accumulate over dependency lines when this operator
257            is used.  The target will not be removed if b\bbm\bma\bak\bke\be is interrupted.
258
259      Targets and sources may contain the shell wildcard values `?', `*', `[]',
260      and `{}'.  The values `?', `*', and `[]' may only be used as part of the
261      final component of the target or source, and must be used to describe
262      existing files.  The value `{}' need not necessarily be used to describe
263      existing files.  Expansion is in directory order, not alphabetically as
264      done in the shell.
265
266 S\bSH\bHE\bEL\bLL\bL C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS
267      Each target may have associated with it a series of shell commands, nor-
268      mally used to create the target.  Each of the commands in this script
269      _\bm_\bu_\bs_\bt be preceded by a tab.  While any target may appear on a dependency
270      line, only one of these dependencies may be followed by a creation
271      script, unless the `:\b::\b:' operator is used.
272
273      If the first characters of the command line are any combination of `@\b@',
274      `+\b+', or `-\b-', the command is treated specially.  A `@\b@' causes the command
275      not to be echoed before it is executed.  A `+\b+' causes the command to be
276      executed even when -\b-n\bn is given.  This is similar to the effect of the
277      .MAKE special source, except that the effect can be limited to a single
278      line of a script.  A `-\b-' causes any non-zero exit status of the command
279      line to be ignored.
280
281 V\bVA\bAR\bRI\bIA\bAB\bBL\bLE\bE A\bAS\bSS\bSI\bIG\bGN\bNM\bME\bEN\bNT\bTS\bS
282      Variables in make are much like variables in the shell, and, by tradi-
283      tion, consist of all upper-case letters.
284
285    V\bVa\bar\bri\bia\bab\bbl\ble\be a\bas\bss\bsi\big\bgn\bnm\bme\ben\bnt\bt m\bmo\bod\bdi\bif\bfi\bie\ber\brs\bs
286      The five operators that can be used to assign values to variables are as
287      follows:
288
289      =\b=       Assign the value to the variable.  Any previous value is overrid-
290              den.
291
292      +\b+=\b=      Append the value to the current value of the variable.
293
294      ?\b?=\b=      Assign the value to the variable if it is not already defined.
295
296      :\b:=\b=      Assign with expansion, i.e. expand the value before assigning it
297              to the variable.  Normally, expansion is not done until the vari-
298              able is referenced.  _\bN_\bO_\bT_\bE: References to undefined variables are
299              _\bn_\bo_\bt expanded.  This can cause problems when variable modifiers
300              are used.
301
302      !\b!=\b=      Expand the value and pass it to the shell for execution and
303              assign the result to the variable.  Any newlines in the result
304              are replaced with spaces.
305
306      Any white-space before the assigned _\bv_\ba_\bl_\bu_\be is removed; if the value is
307      being appended, a single space is inserted between the previous contents
308      of the variable and the appended value.
309
310      Variables are expanded by surrounding the variable name with either curly
311      braces (`{}') or parentheses (`()') and preceding it with a dollar sign
312      (`$').  If the variable name contains only a single letter, the surround-
313      ing braces or parentheses are not required.  This shorter form is not
314      recommended.
315
316      If the variable name contains a dollar, then the name itself is expanded
317      first.  This allows almost arbitrary variable names, however names con-
318      taining dollar, braces, parenthesis, or whitespace are really best
319      avoided!
320
321      If the result of expanding a variable contains a dollar sign (`$') the
322      string is expanded again.
323
324      Variable substitution occurs at three distinct times, depending on where
325      the variable is being used.
326
327      1.   Variables in dependency lines are expanded as the line is read.
328
329      2.   Variables in shell commands are expanded when the shell command is
330           executed.
331
332      3.   ``.for'' loop index variables are expanded on each loop iteration.
333           Note that other variables are not expanded inside loops so the fol-
334           lowing example code:
335
336
337                 .for i in 1 2 3
338                 a+=     ${i}
339                 j=      ${i}
340                 b+=     ${j}
341                 .endfor
342
343                 all:
344                         @echo ${a}
345                         @echo ${b}
346
347           will print:
348
349                 1 2 3
350                 3 3 3
351
352           Because while ${a} contains ``1 2 3'' after the loop is executed,
353           ${b} contains ``${j} ${j} ${j}'' which expands to ``3 3 3'' since
354           after the loop completes ${j} contains ``3''.
355
356    V\bVa\bar\bri\bia\bab\bbl\ble\be c\bcl\bla\bas\bss\bse\bes\bs
357      The four different classes of variables (in order of increasing prece-
358      dence) are:
359
360      Environment variables
361              Variables defined as part of b\bbm\bma\bak\bke\be's environment.
362
363      Global variables
364              Variables defined in the makefile or in included makefiles.
365
366      Command line variables
367              Variables defined as part of the command line.
368
369      Local variables
370              Variables that are defined specific to a certain target.  The
371              seven local variables are as follows:
372
373              _\b._\bA_\bL_\bL_\bS_\bR_\bC   The list of all sources for this target; also known as
374                        `_\b>'.
375
376              _\b._\bA_\bR_\bC_\bH_\bI_\bV_\bE  The name of the archive file.
377
378              _\b._\bI_\bM_\bP_\bS_\bR_\bC   In suffix-transformation rules, the name/path of the
379                        source from which the target is to be transformed (the
380                        ``implied'' source); also known as `_\b<'.  It is not
381                        defined in explicit rules.
382
383              _\b._\bM_\bE_\bM_\bB_\bE_\bR   The name of the archive member.
384
385              _\b._\bO_\bO_\bD_\bA_\bT_\bE   The list of sources for this target that were deemed
386                        out-of-date; also known as `_\b?'.
387
388              _\b._\bP_\bR_\bE_\bF_\bI_\bX   The file prefix of the target, containing only the file
389                        portion, no suffix or preceding directory components;
390                        also known as `_\b*'.
391
392              _\b._\bT_\bA_\bR_\bG_\bE_\bT   The name of the target; also known as `_\b@'.
393
394              The shorter forms `_\b@', `_\b?', `_\b<', `_\b>', and `_\b*' are permitted for
395              backward compatibility with historical makefiles and are not rec-
396              ommended.  The six variables `_\b@_\bF', `_\b@_\bD', `_\b<_\bF', `_\b<_\bD', `_\b*_\bF', and
397              `_\b*_\bD' are permitted for compatibility with AT&T System V UNIX
398              makefiles and are not recommended.
399
400              Four of the local variables may be used in sources on dependency
401              lines because they expand to the proper value for each target on
402              the line.  These variables are `_\b._\bT_\bA_\bR_\bG_\bE_\bT', `_\b._\bP_\bR_\bE_\bF_\bI_\bX', `_\b._\bA_\bR_\bC_\bH_\bI_\bV_\bE',
403              and `_\b._\bM_\bE_\bM_\bB_\bE_\bR'.
404
405    A\bAd\bdd\bdi\bit\bti\bio\bon\bna\bal\bl b\bbu\bui\bil\blt\bt-\b-i\bin\bn v\bva\bar\bri\bia\bab\bbl\ble\bes\bs
406      In addition, b\bbm\bma\bak\bke\be sets or knows about the following variables:
407
408      _\b$               A single dollar sign `$', i.e.  `$$' expands to a single
409                      dollar sign.
410
411      _\b._\bA_\bL_\bL_\bT_\bA_\bR_\bG_\bE_\bT_\bS     The list of all targets encountered in the Makefile.  If
412                      evaluated during Makefile parsing, lists only those tar-
413                      gets encountered thus far.
414
415      _\b._\bC_\bU_\bR_\bD_\bI_\bR         A path to the directory where b\bbm\bma\bak\bke\be was executed.  Refer
416                      to the description of `PWD' for more details.
417
418      MAKE            The name that b\bbm\bma\bak\bke\be was executed with (_\ba_\br_\bg_\bv_\b[_\b0_\b]).  For
419                      compatibility b\bbm\bma\bak\bke\be also sets _\b._\bM_\bA_\bK_\bE with the same value.
420                      The preferred variable to use is the environment variable
421                      MAKE because it is more compatible with other versions of
422                      b\bbm\bma\bak\bke\be and cannot be confused with the special target with
423                      the same name.
424
425      _\b._\bM_\bA_\bK_\bE_\b._\bD_\bE_\bP_\bE_\bN_\bD_\bF_\bI_\bL_\bE
426                      Names the makefile (default `_\b._\bd_\be_\bp_\be_\bn_\bd') from which gener-
427                      ated dependencies are read.
428
429      _\b._\bM_\bA_\bK_\bE_\b._\bE_\bX_\bP_\bO_\bR_\bT_\bE_\bD  The list of variables exported by b\bbm\bma\bak\bke\be.
430
431      _\b._\bM_\bA_\bK_\bE_\b._\bJ_\bO_\bB_\bS      The argument to the -\b-j\bj option.
432
433      _\b._\bM_\bA_\bK_\bE_\b._\bJ_\bO_\bB_\b._\bP_\bR_\bE_\bF_\bI_\bX
434                      If b\bbm\bma\bak\bke\be is run with _\bj then output for each target is
435                      prefixed with a token `--- target ---' the first part of
436                      which can be controlled via _\b._\bM_\bA_\bK_\bE_\b._\bJ_\bO_\bB_\b._\bP_\bR_\bE_\bF_\bI_\bX.
437                      For example:
438                      .MAKE.JOB.PREFIX=${.newline}---${.MAKE:T}[${.MAKE.PID}]
439                      would produce tokens like `---make[1234] target ---' mak-
440                      ing it easier to track the degree of parallelism being
441                      achieved.
442
443      MAKEFLAGS       The environment variable `MAKEFLAGS' may contain anything
444                      that may be specified on b\bbm\bma\bak\bke\be's command line.  Anything
445                      specified on b\bbm\bma\bak\bke\be's command line is appended to the
446                      `MAKEFLAGS' variable which is then entered into the envi-
447                      ronment for all programs which b\bbm\bma\bak\bke\be executes.
448
449      _\b._\bM_\bA_\bK_\bE_\b._\bL_\bE_\bV_\bE_\bL     The recursion depth of b\bbm\bma\bak\bke\be.  The initial instance of
450                      b\bbm\bma\bak\bke\be will be 0, and an incremented value is put into the
451                      environment to be seen by the next generation.  This
452                      allows tests like: .if ${.MAKE.LEVEL} == 0 to protect
453                      things which should only be evaluated in the initial
454                      instance of b\bbm\bma\bak\bke\be.
455
456      _\b._\bM_\bA_\bK_\bE_\b._\bM_\bA_\bK_\bE_\bF_\bI_\bL_\bE_\b__\bP_\bR_\bE_\bF_\bE_\bR_\bE_\bN_\bC_\bE
457                      The ordered list of makefile names (default `_\bm_\ba_\bk_\be_\bf_\bi_\bl_\be',
458                      `_\bM_\ba_\bk_\be_\bf_\bi_\bl_\be') that b\bbm\bma\bak\bke\be will look for.
459
460      _\b._\bM_\bA_\bK_\bE_\b._\bM_\bA_\bK_\bE_\bF_\bI_\bL_\bE_\bS
461                      The list of makefiles read by b\bbm\bma\bak\bke\be, which is useful for
462                      tracking dependencies.  Each makefile is recorded only
463                      once, regardless of the number of times read.
464
465      _\b._\bM_\bA_\bK_\bE_\b._\bM_\bO_\bD_\bE      Processed after reading all makefiles.  Can affect the
466                      mode that b\bbm\bma\bak\bke\be runs in.  Currently just `_\bc_\bo_\bm_\bp_\ba_\bt' mode.
467
468      _\b._\bM_\bA_\bK_\bE_\bO_\bV_\bE_\bR_\bR_\bI_\bD_\bE_\bS  This variable is used to record the names of variables
469                      assigned to on the command line, so that they may be
470                      exported as part of `MAKEFLAGS'.  This behaviour can be
471                      disabled by assigning an empty value to `_\b._\bM_\bA_\bK_\bE_\bO_\bV_\bE_\bR_\bR_\bI_\bD_\bE_\bS'
472                      within a makefile.  Extra variables can be exported from
473                      a makefile by appending their names to `_\b._\bM_\bA_\bK_\bE_\bO_\bV_\bE_\bR_\bR_\bI_\bD_\bE_\bS'.
474                      `MAKEFLAGS' is re-exported whenever `_\b._\bM_\bA_\bK_\bE_\bO_\bV_\bE_\bR_\bR_\bI_\bD_\bE_\bS' is
475                      modified.
476
477      _\b._\bM_\bA_\bK_\bE_\b._\bP_\bI_\bD       The process-id of b\bbm\bma\bak\bke\be.
478
479      _\b._\bM_\bA_\bK_\bE_\b._\bP_\bP_\bI_\bD      The parent process-id of b\bbm\bma\bak\bke\be.
480
481      _\bM_\bA_\bK_\bE_\b__\bP_\bR_\bI_\bN_\bT_\b__\bV_\bA_\bR_\b__\bO_\bN_\b__\bE_\bR_\bR_\bO_\bR
482                      When b\bbm\bma\bak\bke\be stops due to an error, it prints its name and
483                      the value of `_\b._\bC_\bU_\bR_\bD_\bI_\bR' as well as the value of any vari-
484                      ables named in `_\bM_\bA_\bK_\bE_\b__\bP_\bR_\bI_\bN_\bT_\b__\bV_\bA_\bR_\b__\bO_\bN_\b__\bE_\bR_\bR_\bO_\bR'.
485
486      _\b._\bn_\be_\bw_\bl_\bi_\bn_\be        This variable is simply assigned a newline character as
487                      its value.  This allows expansions using the :\b:@\b@ modifier
488                      to put a newline between iterations of the loop rather
489                      than a space.  For example, the printing of
490                      `_\bM_\bA_\bK_\bE_\b__\bP_\bR_\bI_\bN_\bT_\b__\bV_\bA_\bR_\b__\bO_\bN_\b__\bE_\bR_\bR_\bO_\bR' could be done as
491                      ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@}.
492
493      _\b._\bO_\bB_\bJ_\bD_\bI_\bR         A path to the directory where the targets are built.  Its
494                      value is determined by trying to chdir(2) to the follow-
495                      ing directories in order and using the first match:
496
497                      1.   ${MAKEOBJDIRPREFIX}${.CURDIR}
498
499                           (Only if `MAKEOBJDIRPREFIX' is set in the environ-
500                           ment or on the command line.)
501
502                      2.   ${MAKEOBJDIR}
503
504                           (Only if `MAKEOBJDIR' is set in the environment or
505                           on the command line.)
506
507                      3.   ${.CURDIR}_\b/_\bo_\bb_\bj_\b.${MACHINE}
508
509                      4.   ${.CURDIR}_\b/_\bo_\bb_\bj
510
511                      5.   _\b/_\bu_\bs_\br_\b/_\bo_\bb_\bj_\b/${.CURDIR}
512
513                      6.   ${.CURDIR}
514
515                      Variable expansion is performed on the value before it's
516                      used, so expressions such as
517                            ${.CURDIR:S,^/usr/src,/var/obj,}
518                      may be used.  This is especially useful with
519                      `MAKEOBJDIR'.
520
521                      `_\b._\bO_\bB_\bJ_\bD_\bI_\bR' may be modified in the makefile as a global
522                      variable.  In all cases, b\bbm\bma\bak\bke\be will chdir(2) to `_\b._\bO_\bB_\bJ_\bD_\bI_\bR'
523                      and set `PWD' to that directory before executing any tar-
524                      gets.
525
526      _\b._\bP_\bA_\bR_\bS_\bE_\bD_\bI_\bR       A path to the directory of the current `_\bM_\ba_\bk_\be_\bf_\bi_\bl_\be' being
527                      parsed.
528
529      _\b._\bP_\bA_\bR_\bS_\bE_\bF_\bI_\bL_\bE      The basename of the current `_\bM_\ba_\bk_\be_\bf_\bi_\bl_\be' being parsed.
530                      This variable and `_\b._\bP_\bA_\bR_\bS_\bE_\bD_\bI_\bR' are both set only while the
531                      `_\bM_\ba_\bk_\be_\bf_\bi_\bl_\be_\bs' are being parsed.
532
533      _\b._\bP_\bA_\bT_\bH           A variable that represents the list of directories that
534                      b\bbm\bma\bak\bke\be will search for files.  The search list should be
535                      updated using the target `_\b._\bP_\bA_\bT_\bH' rather than the vari-
536                      able.
537
538      PWD             Alternate path to the current directory.  b\bbm\bma\bak\bke\be normally
539                      sets `_\b._\bC_\bU_\bR_\bD_\bI_\bR' to the canonical path given by getcwd(3).
540                      However, if the environment variable `PWD' is set and
541                      gives a path to the current directory, then b\bbm\bma\bak\bke\be sets
542                      `_\b._\bC_\bU_\bR_\bD_\bI_\bR' to the value of `PWD' instead.  This behaviour
543                      is disabled if `MAKEOBJDIRPREFIX' is set or `MAKEOBJDIR'
544                      contains a variable transform.  `PWD' is set to the value
545                      of `_\b._\bO_\bB_\bJ_\bD_\bI_\bR' for all programs which b\bbm\bma\bak\bke\be executes.
546
547      .TARGETS        The list of targets explicitly specified on the command
548                      line, if any.
549
550      VPATH           Colon-separated (``:'') lists of directories that b\bbm\bma\bak\bke\be
551                      will search for files.  The variable is supported for
552                      compatibility with old make programs only, use `_\b._\bP_\bA_\bT_\bH'
553                      instead.
554
555    V\bVa\bar\bri\bia\bab\bbl\ble\be m\bmo\bod\bdi\bif\bfi\bie\ber\brs\bs
556      Variable expansion may be modified to select or modify each word of the
557      variable (where a ``word'' is white-space delimited sequence of charac-
558      ters).  The general format of a variable expansion is as follows:
559
560            ${variable[:modifier[:...]]}
561
562      Each modifier begins with a colon, which may be escaped with a backslash
563      (`\').
564
565      A set of modifiers can be specified via a variable, as follows:
566
567            modifier_variable=modifier[:...]
568            ${variable:${modifier_variable}[:...]}
569
570      In this case the first modifier in the modifier_variable does not start
571      with a colon, since that must appear in the referencing variable.  If any
572      of the modifiers in the modifier_variable contain a dollar sign (`$'),
573      these must be doubled to avoid early expansion.
574
575      The supported modifiers are:
576
577      :\b:E\bE   Replaces each word in the variable with its suffix.
578
579      :\b:H\bH   Replaces each word in the variable with everything but the last com-
580           ponent.
581
582      :\b:M\bM_\bp_\ba_\bt_\bt_\be_\br_\bn
583           Select only those words that match _\bp_\ba_\bt_\bt_\be_\br_\bn.  The standard shell
584           wildcard characters (`*', `?', and `[]') may be used.  The wildcard
585           characters may be escaped with a backslash (`\').
586
587      :\b:N\bN_\bp_\ba_\bt_\bt_\be_\br_\bn
588           This is identical to `:\b:M\bM', but selects all words which do not match
589           _\bp_\ba_\bt_\bt_\be_\br_\bn.
590
591      :\b:O\bO   Order every word in variable alphabetically.  To sort words in
592           reverse order use the `:\b:O\bO:\b:[\b[-\b-1\b1.\b..\b.1\b1]\b]' combination of modifiers.
593
594      :\b:O\bOx\bx  Randomize words in variable.  The results will be different each
595           time you are referring to the modified variable; use the assignment
596           with expansion (`:\b:=\b=') to prevent such behaviour.  For example,
597
598                 LIST=                   uno due tre quattro
599                 RANDOM_LIST=            ${LIST:Ox}
600                 STATIC_RANDOM_LIST:=    ${LIST:Ox}
601
602                 all:
603                         @echo "${RANDOM_LIST}"
604                         @echo "${RANDOM_LIST}"
605                         @echo "${STATIC_RANDOM_LIST}"
606                         @echo "${STATIC_RANDOM_LIST}"
607           may produce output similar to:
608
609                 quattro due tre uno
610                 tre due quattro uno
611                 due uno quattro tre
612                 due uno quattro tre
613
614      :\b:Q\bQ   Quotes every shell meta-character in the variable, so that it can be
615           passed safely through recursive invocations of b\bbm\bma\bak\bke\be.
616
617      :\b:R\bR   Replaces each word in the variable with everything but its suffix.
618
619      :\b:t\btA\bA  Attempt to convert variable to an absolute path using realpath(3),
620           if that fails, the value is unchanged.
621
622      :\b:t\btl\bl  Converts variable to lower-case letters.
623
624      :\b:t\bts\bs_\bc
625           Words in the variable are normally separated by a space on expan-
626           sion.  This modifier sets the separator to the character _\bc.  If _\bc is
627           omitted, then no separator is used.  The common escapes (including
628           octal numeric codes), work as expected.
629
630      :\b:t\btu\bu  Converts variable to upper-case letters.
631
632      :\b:t\btW\bW  Causes the value to be treated as a single word (possibly containing
633           embedded white space).  See also `:\b:[\b[*\b*]\b]'.
634
635      :\b:t\btw\bw  Causes the value to be treated as a sequence of words delimited by
636           white space.  See also `:\b:[\b[@\b@]\b]'.
637
638      :\b:S\bS/_\bo_\bl_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg/_\bn_\be_\bw_\b__\bs_\bt_\br_\bi_\bn_\bg/[1\b1g\bgW\bW]
639           Modify the first occurrence of _\bo_\bl_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg in the variable's value,
640           replacing it with _\bn_\be_\bw_\b__\bs_\bt_\br_\bi_\bn_\bg.  If a `g' is appended to the last
641           slash of the pattern, all occurrences in each word are replaced.  If
642           a `1' is appended to the last slash of the pattern, only the first
643           word is affected.  If a `W' is appended to the last slash of the
644           pattern, then the value is treated as a single word (possibly con-
645           taining embedded white space).  If _\bo_\bl_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg begins with a caret
646           (`^'), _\bo_\bl_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg is anchored at the beginning of each word.  If
647           _\bo_\bl_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg ends with a dollar sign (`$'), it is anchored at the end
648           of each word.  Inside _\bn_\be_\bw_\b__\bs_\bt_\br_\bi_\bn_\bg, an ampersand (`&') is replaced by
649           _\bo_\bl_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg (without any `^' or `$').  Any character may be used as a
650           delimiter for the parts of the modifier string.  The anchoring,
651           ampersand and delimiter characters may be escaped with a backslash
652           (`\').
653
654           Variable expansion occurs in the normal fashion inside both
655           _\bo_\bl_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg and _\bn_\be_\bw_\b__\bs_\bt_\br_\bi_\bn_\bg with the single exception that a backslash
656           is used to prevent the expansion of a dollar sign (`$'), not a pre-
657           ceding dollar sign as is usual.
658
659      :\b:C\bC/_\bp_\ba_\bt_\bt_\be_\br_\bn/_\br_\be_\bp_\bl_\ba_\bc_\be_\bm_\be_\bn_\bt/[1\b1g\bgW\bW]
660           The :\b:C\bC modifier is just like the :\b:S\bS modifier except that the old and
661           new strings, instead of being simple strings, are a regular expres-
662           sion (see regex(3)) string _\bp_\ba_\bt_\bt_\be_\br_\bn and an ed(1)-style string
663           _\br_\be_\bp_\bl_\ba_\bc_\be_\bm_\be_\bn_\bt.  Normally, the first occurrence of the pattern _\bp_\ba_\bt_\bt_\be_\br_\bn
664           in each word of the value is substituted with _\br_\be_\bp_\bl_\ba_\bc_\be_\bm_\be_\bn_\bt.  The `1'
665           modifier causes the substitution to apply to at most one word; the
666           `g' modifier causes the substitution to apply to as many instances
667           of the search pattern _\bp_\ba_\bt_\bt_\be_\br_\bn as occur in the word or words it is
668           found in; the `W' modifier causes the value to be treated as a sin-
669           gle word (possibly containing embedded white space).  Note that `1'
670           and `g' are orthogonal; the former specifies whether multiple words
671           are potentially affected, the latter whether multiple substitutions
672           can potentially occur within each affected word.
673
674      :\b:T\bT   Replaces each word in the variable with its last component.
675
676      :\b:u\bu   Remove adjacent duplicate words (like uniq(1)).
677
678      :\b:?\b?_\bt_\br_\bu_\be_\b__\bs_\bt_\br_\bi_\bn_\bg:\b:_\bf_\ba_\bl_\bs_\be_\b__\bs_\bt_\br_\bi_\bn_\bg
679           If the variable name (not its value), when parsed as a .if condi-
680           tional expression, evaluates to true, return as its value the
681           _\bt_\br_\bu_\be_\b__\bs_\bt_\br_\bi_\bn_\bg, otherwise return the _\bf_\ba_\bl_\bs_\be_\b__\bs_\bt_\br_\bi_\bn_\bg.  Since the variable
682           name is used as the expression, :? must be the first modifier after
683           the variable name itself - which will, of course, usually contain
684           variable expansions.  A common error is trying to use expressions
685           like
686                 ${NUMBERS:M42:?match:no}
687           which actually tests defined(NUMBERS), to determine is any words
688           match "42" you need to use something like:
689                 ${${NUMBERS:M42} !=  :?match:no}.
690
691      _\b:_\bo_\bl_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg_\b=_\bn_\be_\bw_\b__\bs_\bt_\br_\bi_\bn_\bg
692           This is the AT&T System V UNIX style variable substitution.  It must
693           be the last modifier specified.  If _\bo_\bl_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg or _\bn_\be_\bw_\b__\bs_\bt_\br_\bi_\bn_\bg do not
694           contain the pattern matching character _\b% then it is assumed that
695           they are anchored at the end of each word, so only suffixes or
696           entire words may be replaced.  Otherwise _\b% is the substring of
697           _\bo_\bl_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg to be replaced in _\bn_\be_\bw_\b__\bs_\bt_\br_\bi_\bn_\bg.
698
699           Variable expansion occurs in the normal fashion inside both
700           _\bo_\bl_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg and _\bn_\be_\bw_\b__\bs_\bt_\br_\bi_\bn_\bg with the single exception that a backslash
701           is used to prevent the expansion of a dollar sign (`$'), not a pre-
702           ceding dollar sign as is usual.
703
704      :\b:@\b@_\bt_\be_\bm_\bp@\b@_\bs_\bt_\br_\bi_\bn_\bg@\b@
705           This is the loop expansion mechanism from the OSF Development Envi-
706           ronment (ODE) make.  Unlike .\b.f\bfo\bor\br loops expansion occurs at the time
707           of reference.  Assign _\bt_\be_\bm_\bp to each word in the variable and evaluate
708           _\bs_\bt_\br_\bi_\bn_\bg.  The ODE convention is that _\bt_\be_\bm_\bp should start and end with a
709           period.  For example.
710                 ${LINKS:@.LINK.@${LN} ${TARGET} ${.LINK.}@}
711
712      :\b:U\bU_\bn_\be_\bw_\bv_\ba_\bl
713           If the variable is undefined _\bn_\be_\bw_\bv_\ba_\bl is the value.  If the variable
714           is defined, the existing value is returned.  This is another ODE
715           make feature.  It is handy for setting per-target CFLAGS for
716           instance:
717                 ${_${.TARGET:T}_CFLAGS:U${DEF_CFLAGS}}
718           If a value is only required if the variable is undefined, use:
719                 ${VAR:D:Unewval}
720
721      :\b:D\bD_\bn_\be_\bw_\bv_\ba_\bl
722           If the variable is defined _\bn_\be_\bw_\bv_\ba_\bl is the value.
723
724      :\b:L\bL   The name of the variable is the value.
725
726      :\b:P\bP   The path of the node which has the same name as the variable is the
727           value.  If no such node exists or its path is null, then the name of
728           the variable is used.
729
730      :\b:!\b!_\bc_\bm_\bd!\b!
731           The output of running _\bc_\bm_\bd is the value.
732
733      :\b:s\bsh\bh  If the variable is non-empty it is run as a command and the output
734           becomes the new value.
735
736      :\b::\b:=\b=_\bs_\bt_\br
737           The variable is assigned the value _\bs_\bt_\br after substitution.  This
738           modifier and its variations are useful in obscure situations such as
739           wanting to set a variable when shell commands are being parsed.
740           These assignment modifiers always expand to nothing, so if appearing
741           in a rule line by themselves should be preceded with something to
742           keep b\bbm\bma\bak\bke\be happy.
743
744           The `:\b::\b:' helps avoid false matches with the AT&T System V UNIX style
745           :\b:=\b= modifier and since substitution always occurs the :\b::\b:=\b= form is
746           vaguely appropriate.
747
748      :\b::\b:?\b?=\b=_\bs_\bt_\br
749           As for :\b::\b:=\b= but only if the variable does not already have a value.
750
751      :\b::\b:+\b+=\b=_\bs_\bt_\br
752           Append _\bs_\bt_\br to the variable.
753
754      :\b::\b:!\b!=\b=_\bc_\bm_\bd
755           Assign the output of _\bc_\bm_\bd to the variable.
756
757      :\b:[\b[_\br_\ba_\bn_\bg_\be]\b]
758           Selects one or more words from the value, or performs other opera-
759           tions related to the way in which the value is divided into words.
760
761           Ordinarily, a value is treated as a sequence of words delimited by
762           white space.  Some modifiers suppress this behaviour, causing a
763           value to be treated as a single word (possibly containing embedded
764           white space).  An empty value, or a value that consists entirely of
765           white-space, is treated as a single word.  For the purposes of the
766           `:\b:[\b[]\b]' modifier, the words are indexed both forwards using positive
767           integers (where index 1 represents the first word), and backwards
768           using negative integers (where index -1 represents the last word).
769
770           The _\br_\ba_\bn_\bg_\be is subjected to variable expansion, and the expanded
771           result is then interpreted as follows:
772
773           _\bi_\bn_\bd_\be_\bx  Selects a single word from the value.
774
775           _\bs_\bt_\ba_\br_\bt.\b..\b._\be_\bn_\bd
776                  Selects all words from _\bs_\bt_\ba_\br_\bt to _\be_\bn_\bd, inclusive.  For example,
777                  `:\b:[\b[2\b2.\b..\b.-\b-1\b1]\b]' selects all words from the second word to the last
778                  word.  If _\bs_\bt_\ba_\br_\bt is greater than _\be_\bn_\bd, then the words are out-
779                  put in reverse order.  For example, `:\b:[\b[-\b-1\b1.\b..\b.1\b1]\b]' selects all
780                  the words from last to first.
781
782           *\b*      Causes subsequent modifiers to treat the value as a single
783                  word (possibly containing embedded white space).  Analogous
784                  to the effect of "$*" in Bourne shell.
785
786           0      Means the same as `:\b:[\b[*\b*]\b]'.
787
788           @\b@      Causes subsequent modifiers to treat the value as a sequence
789                  of words delimited by white space.  Analogous to the effect
790                  of "$@" in Bourne shell.
791
792           #\b#      Returns the number of words in the value.
793
794 I\bIN\bNC\bCL\bLU\bUD\bDE\bE S\bST\bTA\bAT\bTE\bEM\bME\bEN\bNT\bTS\bS,\b, C\bCO\bON\bND\bDI\bIT\bTI\bIO\bON\bNA\bAL\bLS\bS A\bAN\bND\bD F\bFO\bOR\bR L\bLO\bOO\bOP\bPS\bS
795      Makefile inclusion, conditional structures and for loops  reminiscent of
796      the C programming language are provided in b\bbm\bma\bak\bke\be.  All such structures
797      are identified by a line beginning with a single dot (`.') character.
798      Files are included with either .\b.i\bin\bnc\bcl\blu\bud\bde\be <_\bf_\bi_\bl_\be> or .\b.i\bin\bnc\bcl\blu\bud\bde\be "_\bf_\bi_\bl_\be".  Vari-
799      ables between the angle brackets or double quotes are expanded to form
800      the file name.  If angle brackets are used, the included makefile is
801      expected to be in the system makefile directory.  If double quotes are
802      used, the including makefile's directory and any directories specified
803      using the -\b-I\bI option are searched before the system makefile directory.
804      For compatibility with other versions of b\bbm\bma\bak\bke\be `include file ...' is also
805      accepted.  If the include statement is written as .\b.-\b-i\bin\bnc\bcl\blu\bud\bde\be or as
806      .\b.s\bsi\bin\bnc\bcl\blu\bud\bde\be then errors locating and/or opening include files are ignored.
807
808      Conditional expressions are also preceded by a single dot as the first
809      character of a line.  The possible conditionals are as follows:
810
811      .\b.e\ber\brr\bro\bor\br _\bm_\be_\bs_\bs_\ba_\bg_\be
812              The message is printed along with the name of the makefile and
813              line number, then b\bbm\bma\bak\bke\be will exit.
814
815      .\b.e\bex\bxp\bpo\bor\brt\bt _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be _\b._\b._\b.
816              Export the specified global variable.  If no variable list is
817              provided, all globals are exported except for internal variables
818              (those that start with `.').  This is not affected by the -\b-X\bX
819              flag, so should be used with caution.
820
821              Appending a variable name to _\b._\bM_\bA_\bK_\bE_\b._\bE_\bX_\bP_\bO_\bR_\bT_\bE_\bD is equivalent to
822              exporting a variable.
823
824      .\b.e\bex\bxp\bpo\bor\brt\bt-\b-e\ben\bnv\bv _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be _\b._\b._\b.
825              The same as `.export', except that the variable is not appended
826              to _\b._\bM_\bA_\bK_\bE_\b._\bE_\bX_\bP_\bO_\bR_\bT_\bE_\bD.  This allows exporting a value to the environ-
827              ment which is different from that used by b\bbm\bma\bak\bke\be internally.
828
829      .\b.i\bin\bnf\bfo\bo _\bm_\be_\bs_\bs_\ba_\bg_\be
830              The message is printed along with the name of the makefile and
831              line number.
832
833      .\b.u\bun\bnd\bde\bef\bf _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be
834              Un-define the specified global variable.  Only global variables
835              may be un-defined.
836
837      .\b.u\bun\bne\bex\bxp\bpo\bor\brt\bt _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be _\b._\b._\b.
838              The opposite of `.export'.  The specified global _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be will be
839              removed from _\b._\bM_\bA_\bK_\bE_\b._\bE_\bX_\bP_\bO_\bR_\bT_\bE_\bD.  If no variable list is provided,
840              all globals are unexported, and _\b._\bM_\bA_\bK_\bE_\b._\bE_\bX_\bP_\bO_\bR_\bT_\bE_\bD deleted.
841
842      .\b.u\bun\bne\bex\bxp\bpo\bor\brt\bt-\b-e\ben\bnv\bv
843              Unexport all globals previously exported and clear the environ-
844              ment inherited from the parent.  This operation will cause a mem-
845              ory leak of the original environment, so should be used spar-
846              ingly.  Testing for _\b._\bM_\bA_\bK_\bE_\b._\bL_\bE_\bV_\bE_\bL being 0, would make sense.  Also
847              note that any variables which originated in the parent environ-
848              ment should be explicitly preserved if desired.  For example:
849
850                    .if ${.MAKE.LEVEL} == 0
851                    PATH := ${PATH}
852                    .unexport-env
853                    .export PATH
854                    .endif
855
856              Would result in an environment containing only `PATH', which is
857              the minimal useful environment.  Actually `.MAKE.LEVEL' will also
858              be pushed into the new environment.
859
860      .\b.w\bwa\bar\brn\bni\bin\bng\bg _\bm_\be_\bs_\bs_\ba_\bg_\be
861              The message prefixed by `_\bw_\ba_\br_\bn_\bi_\bn_\bg_\b:' is printed along with the name
862              of the makefile and line number.
863
864      .\b.i\bif\bf [!]_\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn [_\bo_\bp_\be_\br_\ba_\bt_\bo_\br _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn _\b._\b._\b.]
865              Test the value of an expression.
866
867      .\b.i\bif\bfd\bde\bef\bf [!]_\bv_\ba_\br_\bi_\ba_\bb_\bl_\be [_\bo_\bp_\be_\br_\ba_\bt_\bo_\br _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be _\b._\b._\b.]
868              Test the value of a variable.
869
870      .\b.i\bif\bfn\bnd\bde\bef\bf [!]_\bv_\ba_\br_\bi_\ba_\bb_\bl_\be [_\bo_\bp_\be_\br_\ba_\bt_\bo_\br _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be _\b._\b._\b.]
871              Test the value of a variable.
872
873      .\b.i\bif\bfm\bma\bak\bke\be [!]_\bt_\ba_\br_\bg_\be_\bt [_\bo_\bp_\be_\br_\ba_\bt_\bo_\br _\bt_\ba_\br_\bg_\be_\bt _\b._\b._\b.]
874              Test the target being built.
875
876      .\b.i\bif\bfn\bnm\bma\bak\bke\be [!] _\bt_\ba_\br_\bg_\be_\bt [_\bo_\bp_\be_\br_\ba_\bt_\bo_\br _\bt_\ba_\br_\bg_\be_\bt _\b._\b._\b.]
877              Test the target being built.
878
879      .\b.e\bel\bls\bse\be   Reverse the sense of the last conditional.
880
881      .\b.e\bel\bli\bif\bf [!] _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn [_\bo_\bp_\be_\br_\ba_\bt_\bo_\br _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn _\b._\b._\b.]
882              A combination of `.\b.e\bel\bls\bse\be' followed by `.\b.i\bif\bf'.
883
884      .\b.e\bel\bli\bif\bfd\bde\bef\bf [!]_\bv_\ba_\br_\bi_\ba_\bb_\bl_\be [_\bo_\bp_\be_\br_\ba_\bt_\bo_\br _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be _\b._\b._\b.]
885              A combination of `.\b.e\bel\bls\bse\be' followed by `.\b.i\bif\bfd\bde\bef\bf'.
886
887      .\b.e\bel\bli\bif\bfn\bnd\bde\bef\bf [!]_\bv_\ba_\br_\bi_\ba_\bb_\bl_\be [_\bo_\bp_\be_\br_\ba_\bt_\bo_\br _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be _\b._\b._\b.]
888              A combination of `.\b.e\bel\bls\bse\be' followed by `.\b.i\bif\bfn\bnd\bde\bef\bf'.
889
890      .\b.e\bel\bli\bif\bfm\bma\bak\bke\be [!]_\bt_\ba_\br_\bg_\be_\bt [_\bo_\bp_\be_\br_\ba_\bt_\bo_\br _\bt_\ba_\br_\bg_\be_\bt _\b._\b._\b.]
891              A combination of `.\b.e\bel\bls\bse\be' followed by `.\b.i\bif\bfm\bma\bak\bke\be'.
892
893      .\b.e\bel\bli\bif\bfn\bnm\bma\bak\bke\be [!]_\bt_\ba_\br_\bg_\be_\bt [_\bo_\bp_\be_\br_\ba_\bt_\bo_\br _\bt_\ba_\br_\bg_\be_\bt _\b._\b._\b.]
894              A combination of `.\b.e\bel\bls\bse\be' followed by `.\b.i\bif\bfn\bnm\bma\bak\bke\be'.
895
896      .\b.e\ben\bnd\bdi\bif\bf  End the body of the conditional.
897
898      The _\bo_\bp_\be_\br_\ba_\bt_\bo_\br may be any one of the following:
899
900      |\b||\b|     Logical OR.
901
902      &\b&&\b&     Logical AND; of higher precedence than ``||''.
903
904      As in C, b\bbm\bma\bak\bke\be will only evaluate a conditional as far as is necessary to
905      determine its value.  Parentheses may be used to change the order of
906      evaluation.  The boolean operator `!\b!' may be used to logically negate an
907      entire conditional.  It is of higher precedence than `&\b&&\b&'.
908
909      The value of _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn may be any of the following:
910
911      d\bde\bef\bfi\bin\bne\bed\bd  Takes a variable name as an argument and evaluates to true if
912               the variable has been defined.
913
914      m\bma\bak\bke\be     Takes a target name as an argument and evaluates to true if the
915               target was specified as part of b\bbm\bma\bak\bke\be's command line or was
916               declared the default target (either implicitly or explicitly,
917               see _\b._\bM_\bA_\bI_\bN) before the line containing the conditional.
918
919      e\bem\bmp\bpt\bty\by    Takes a variable, with possible modifiers, and evaluates to true
920               if the expansion of the variable would result in an empty
921               string.
922
923      e\bex\bxi\bis\bst\bts\bs   Takes a file name as an argument and evaluates to true if the
924               file exists.  The file is searched for on the system search path
925               (see _\b._\bP_\bA_\bT_\bH).
926
927      t\bta\bar\brg\bge\bet\bt   Takes a target name as an argument and evaluates to true if the
928               target has been defined.
929
930      c\bco\bom\bmm\bma\ban\bnd\bds\bs
931               Takes a target name as an argument and evaluates to true if the
932               target has been defined and has commands associated with it.
933
934      _\bE_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn may also be an arithmetic or string comparison.  Variable
935      expansion is performed on both sides of the comparison, after which the
936      integral values are compared.  A value is interpreted as hexadecimal if
937      it is preceded by 0x, otherwise it is decimal; octal numbers are not sup-
938      ported.  The standard C relational operators are all supported.  If after
939      variable expansion, either the left or right hand side of a `=\b==\b=' or `!\b!=\b='
940      operator is not an integral value, then string comparison is performed
941      between the expanded variables.  If no relational operator is given, it
942      is assumed that the expanded variable is being compared against 0 or an
943      empty string in the case of a string comparison.
944
945      When b\bbm\bma\bak\bke\be is evaluating one of these conditional expressions, and it
946      encounters a (white-space separated) word it doesn't recognize, either
947      the ``make'' or ``defined'' expression is applied to it, depending on the
948      form of the conditional.  If the form is `.\b.i\bif\bfd\bde\bef\bf', `.\b.i\bif\bfn\bnd\bde\bef\bf', or `.\b.i\bif\bf'
949      the ``defined'' expression is applied.  Similarly, if the form is
950      `.\b.i\bif\bfm\bma\bak\bke\be' or `.\b.i\bif\bfn\bnm\bma\bak\bke\be, t\bth\bhe\be' ``make'' expression is applied.
951
952      If the conditional evaluates to true the parsing of the makefile contin-
953      ues as before.  If it evaluates to false, the following lines are
954      skipped.  In both cases this continues until a `.\b.e\bel\bls\bse\be' or `.\b.e\ben\bnd\bdi\bif\bf' is
955      found.
956
957      For loops are typically used to apply a set of rules to a list of files.
958      The syntax of a for loop is:
959
960      .\b.f\bfo\bor\br _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be [_\bv_\ba_\br_\bi_\ba_\bb_\bl_\be _\b._\b._\b.] i\bin\bn _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn
961      <make-rules>
962      .\b.e\ben\bnd\bdf\bfo\bor\br
963
964      After the for e\bex\bxp\bpr\bre\bes\bss\bsi\bio\bon\bn is evaluated, it is split into words.  On each
965      iteration of the loop, one word is taken and assigned to each v\bva\bar\bri\bia\bab\bbl\ble\be,
966      in order, and these v\bva\bar\bri\bia\bab\bbl\ble\bes\bs are substituted into the m\bma\bak\bke\be-\b-r\bru\bul\ble\bes\bs inside
967      the body of the for loop.  The number of words must come out even; that
968      is, if there are three iteration variables, the number of words provided
969      must be a multiple of three.
970
971 C\bCO\bOM\bMM\bME\bEN\bNT\bTS\bS
972      Comments begin with a hash (`#') character, anywhere but in a shell com-
973      mand line, and continue to the end of an unescaped new line.
974
975 S\bSP\bPE\bEC\bCI\bIA\bAL\bL S\bSO\bOU\bUR\bRC\bCE\bES\bS (\b(A\bAT\bTT\bTR\bRI\bIB\bBU\bUT\bTE\bES\bS)\b)
976      .\b.E\bEX\bXE\bEC\bC     Target is never out of date, but always execute commands any-
977                way.
978
979      .\b.I\bIG\bGN\bNO\bOR\bRE\bE   Ignore any errors from the commands associated with this tar-
980                get, exactly as if they all were preceded by a dash (`-').
981
982      .\b.M\bMA\bAD\bDE\bE     Mark all sources of this target as being up-to-date.
983
984      .\b.M\bMA\bAK\bKE\bE     Execute the commands associated with this target even if the -\b-n\bn
985                or -\b-t\bt options were specified.  Normally used to mark recursive
986                b\bbm\bma\bak\bke\be's.
987
988      .\b.N\bNO\bOP\bPA\bAT\bTH\bH   Do not search for the target in the directories specified by
989                .\b.P\bPA\bAT\bTH\bH.
990
991      .\b.N\bNO\bOT\bTM\bMA\bAI\bIN\bN  Normally b\bbm\bma\bak\bke\be selects the first target it encounters as the
992                default target to be built if no target was specified.  This
993                source prevents this target from being selected.
994
995      .\b.O\bOP\bPT\bTI\bIO\bON\bNA\bAL\bL
996                If a target is marked with this attribute and b\bbm\bma\bak\bke\be can't fig-
997                ure out how to create it, it will ignore this fact and assume
998                the file isn't needed or already exists.
999
1000      .\b.P\bPH\bHO\bON\bNY\bY    The target does not correspond to an actual file; it is always
1001                considered to be out of date, and will not be created with the
1002                -\b-t\bt option.  Suffix-transformation rules are not applied to
1003                .\b.P\bPH\bHO\bON\bNY\bY targets.
1004
1005      .\b.P\bPR\bRE\bEC\bCI\bIO\bOU\bUS\bS
1006                When b\bbm\bma\bak\bke\be is interrupted, it normally removes any partially
1007                made targets.  This source prevents the target from being
1008                removed.
1009
1010      .\b.R\bRE\bEC\bCU\bUR\bRS\bSI\bIV\bVE\bE
1011                Synonym for .\b.M\bMA\bAK\bKE\bE.
1012
1013      .\b.S\bSI\bIL\bLE\bEN\bNT\bT   Do not echo any of the commands associated with this target,
1014                exactly as if they all were preceded by an at sign (`@').
1015
1016      .\b.U\bUS\bSE\bE      Turn the target into b\bbm\bma\bak\bke\be's version of a macro.  When the tar-
1017                get is used as a source for another target, the other target
1018                acquires the commands, sources, and attributes (except for
1019                .\b.U\bUS\bSE\bE) of the source.  If the target already has commands, the
1020                .\b.U\bUS\bSE\bE target's commands are appended to them.
1021
1022      .\b.U\bUS\bSE\bEB\bBE\bEF\bFO\bOR\bRE\bE
1023                Exactly like .\b.U\bUS\bSE\bE, but prepend the .\b.U\bUS\bSE\bEB\bBE\bEF\bFO\bOR\bRE\bE target commands
1024                to the target.
1025
1026      .\b.W\bWA\bAI\bIT\bT     If .\b.W\bWA\bAI\bIT\bT appears in a dependency line, the sources that precede
1027                it are made before the sources that succeed it in the line.
1028                Since the dependents of files are not made until the file
1029                itself could be made, this also stops the dependents being
1030                built unless they are needed for another branch of the depen-
1031                dency tree.  So given:
1032
1033                x: a .WAIT b
1034                        echo x
1035                a:
1036                        echo a
1037                b: b1
1038                        echo b
1039                b1:
1040                        echo b1
1041
1042                the output is always `a', `b1', `b', `x'.
1043                The ordering imposed by .\b.W\bWA\bAI\bIT\bT is only relevant for parallel
1044                makes.
1045
1046 S\bSP\bPE\bEC\bCI\bIA\bAL\bL T\bTA\bAR\bRG\bGE\bET\bTS\bS
1047      Special targets may not be included with other targets, i.e. they must be
1048      the only target specified.
1049
1050      .\b.B\bBE\bEG\bGI\bIN\bN   Any command lines attached to this target are executed before
1051               anything else is done.
1052
1053      .\b.D\bDE\bEF\bFA\bAU\bUL\bLT\bT
1054               This is sort of a .\b.U\bUS\bSE\bE rule for any target (that was used only
1055               as a source) that b\bbm\bma\bak\bke\be can't figure out any other way to cre-
1056               ate.  Only the shell script is used.  The .\b.I\bIM\bMP\bPS\bSR\bRC\bC variable of a
1057               target that inherits .\b.D\bDE\bEF\bFA\bAU\bUL\bLT\bT's commands is set to the target's
1058               own name.
1059
1060      .\b.E\bEN\bND\bD     Any command lines attached to this target are executed after
1061               everything else is done.
1062
1063      .\b.E\bER\bRR\bRO\bOR\bR   Any command lines attached to this target are executed when
1064               another target fails.  The .\b.E\bER\bRR\bRO\bOR\bR_\b_T\bTA\bAR\bRG\bGE\bET\bT variable is set to the
1065               target that failed.  See also M\bMA\bAK\bKE\bE_\b_P\bPR\bRI\bIN\bNT\bT_\b_V\bVA\bAR\bR_\b_O\bON\bN_\b_E\bER\bRR\bRO\bOR\bR.
1066
1067      .\b.I\bIG\bGN\bNO\bOR\bRE\bE  Mark each of the sources with the .\b.I\bIG\bGN\bNO\bOR\bRE\bE attribute.  If no
1068               sources are specified, this is the equivalent of specifying the
1069               -\b-i\bi option.
1070
1071      .\b.I\bIN\bNT\bTE\bER\bRR\bRU\bUP\bPT\bT
1072               If b\bbm\bma\bak\bke\be is interrupted, the commands for this target will be
1073               executed.
1074
1075      .\b.M\bMA\bAI\bIN\bN    If no target is specified when b\bbm\bma\bak\bke\be is invoked, this target
1076               will be built.
1077
1078      .\b.M\bMA\bAK\bKE\bEF\bFL\bLA\bAG\bGS\bS
1079               This target provides a way to specify flags for b\bbm\bma\bak\bke\be when the
1080               makefile is used.  The flags are as if typed to the shell,
1081               though the -\b-f\bf option will have no effect.
1082
1083      .\b.N\bNO\bOP\bPA\bAT\bTH\bH  Apply the .\b.N\bNO\bOP\bPA\bAT\bTH\bH attribute to any specified sources.
1084
1085      .\b.N\bNO\bOT\bTP\bPA\bAR\bRA\bAL\bLL\bLE\bEL\bL
1086               Disable parallel mode.
1087
1088      .\b.N\bNO\bO_\b_P\bPA\bAR\bRA\bAL\bLL\bLE\bEL\bL
1089               Synonym for .\b.N\bNO\bOT\bTP\bPA\bAR\bRA\bAL\bLL\bLE\bEL\bL, for compatibility with other pmake
1090               variants.
1091
1092      .\b.O\bOR\bRD\bDE\bER\bR   The named targets are made in sequence.  This ordering does not
1093               add targets to the list of targets to be made.  Since the depen-
1094               dents of a target do not get built until the target itself could
1095               be built, unless `a' is built by another part of the dependency
1096               graph, the following is a dependency loop:
1097
1098               .ORDER: a b
1099               b: a
1100
1101               The ordering imposed by .\b.O\bOR\bRD\bDE\bER\bR is only relevant for parallel
1102               makes.
1103
1104      .\b.P\bPA\bAT\bTH\bH    The sources are directories which are to be searched for files
1105               not found in the current directory.  If no sources are speci-
1106               fied, any previously specified directories are deleted.  If the
1107               source is the special .\b.D\bDO\bOT\bTL\bLA\bAS\bST\bT target, then the current working
1108               directory is searched last.
1109
1110      .\b.P\bPH\bHO\bON\bNY\bY   Apply the .\b.P\bPH\bHO\bON\bNY\bY attribute to any specified sources.
1111
1112      .\b.P\bPR\bRE\bEC\bCI\bIO\bOU\bUS\bS
1113               Apply the .\b.P\bPR\bRE\bEC\bCI\bIO\bOU\bUS\bS attribute to any specified sources.  If no
1114               sources are specified, the .\b.P\bPR\bRE\bEC\bCI\bIO\bOU\bUS\bS attribute is applied to
1115               every target in the file.
1116
1117      .\b.S\bSH\bHE\bEL\bLL\bL   Sets the shell that b\bbm\bma\bak\bke\be will use to execute commands.  The
1118               sources are a set of _\bf_\bi_\be_\bl_\bd_\b=_\bv_\ba_\bl_\bu_\be pairs.
1119
1120               _\bn_\ba_\bm_\be        This is the minimal specification, used to select
1121                           one of the builtin shell specs; _\bs_\bh, _\bk_\bs_\bh, and _\bc_\bs_\bh.
1122
1123               _\bp_\ba_\bt_\bh        Specifies the path to the shell.
1124
1125               _\bh_\ba_\bs_\bE_\br_\br_\bC_\bt_\bl   Indicates whether the shell supports exit on error.
1126
1127               _\bc_\bh_\be_\bc_\bk       The command to turn on error checking.
1128
1129               _\bi_\bg_\bn_\bo_\br_\be      The command to disable error checking.
1130
1131               _\be_\bc_\bh_\bo        The command to turn on echoing of commands executed.
1132
1133               _\bq_\bu_\bi_\be_\bt       The command to turn off echoing of commands exe-
1134                           cuted.
1135
1136               _\bf_\bi_\bl_\bt_\be_\br      The output to filter after issuing the _\bq_\bu_\bi_\be_\bt com-
1137                           mand.  It is typically identical to _\bq_\bu_\bi_\be_\bt.
1138
1139               _\be_\br_\br_\bF_\bl_\ba_\bg     The flag to pass the shell to enable error checking.
1140
1141               _\be_\bc_\bh_\bo_\bF_\bl_\ba_\bg    The flag to pass the shell to enable command echo-
1142                           ing.
1143
1144               _\bn_\be_\bw_\bl_\bi_\bn_\be     The string literal to pass the shell that results in
1145                           a single newline character when used outside of any
1146                           quoting characters.
1147               Example:
1148
1149               .SHELL: name=ksh path=/bin/ksh hasErrCtl=true \
1150                       check="set -e" ignore="set +e" \
1151                       echo="set -v" quiet="set +v" filter="set +v" \
1152                       echoFlag=v errFlag=e newline="'\n'"
1153
1154      .\b.S\bSI\bIL\bLE\bEN\bNT\bT  Apply the .\b.S\bSI\bIL\bLE\bEN\bNT\bT attribute to any specified sources.  If no
1155               sources are specified, the .\b.S\bSI\bIL\bLE\bEN\bNT\bT attribute is applied to every
1156               command in the file.
1157
1158      .\b.S\bSU\bUF\bFF\bFI\bIX\bXE\bES\bS
1159               Each source specifies a suffix to b\bbm\bma\bak\bke\be.  If no sources are
1160               specified, any previously specified suffixes are deleted.  It
1161               allows the creation of suffix-transformation rules.
1162
1163               Example:
1164
1165               .SUFFIXES: .o
1166               .c.o:
1167                       cc -o ${.TARGET} -c ${.IMPSRC}
1168
1169 E\bEN\bNV\bVI\bIR\bRO\bON\bNM\bME\bEN\bNT\bT
1170      b\bbm\bma\bak\bke\be uses the following environment variables, if they exist: MACHINE,
1171      MACHINE_ARCH, MAKE, MAKEFLAGS, MAKEOBJDIR, MAKEOBJDIRPREFIX, MAKESYSPATH,
1172      PWD, and TMPDIR.
1173
1174      MAKEOBJDIRPREFIX and MAKEOBJDIR may only be set in the environment or on
1175      the command line to b\bbm\bma\bak\bke\be and not as makefile variables; see the descrip-
1176      tion of `_\b._\bO_\bB_\bJ_\bD_\bI_\bR' for more details.
1177
1178 F\bFI\bIL\bLE\bES\bS
1179      .depend        list of dependencies
1180      Makefile       list of dependencies
1181      makefile       list of dependencies
1182      sys.mk         system makefile
1183      /usr/share/mk  system makefile directory
1184
1185 C\bCO\bOM\bMP\bPA\bAT\bTI\bIB\bBI\bIL\bLI\bIT\bTY\bY
1186      The basic make syntax is compatible between different versions of make,
1187      however the special variables, variable modifiers and conditionals are
1188      not.
1189
1190      The way that parallel makes are scheduled changed in NetBSD 4.0 so that
1191      .ORDER and .WAIT apply recursively to the dependant nodes.  The algo-
1192      rithms used may change again in the future.
1193
1194      The way that .for loop variables are substituted changed after NetBSD 5.0
1195      so that they still appear to be variable expansions.  In particular this
1196      stops them being treated as syntax, and removes some obscure problems
1197      using them in .if statements.
1198
1199 S\bSE\bEE\bE A\bAL\bLS\bSO\bO
1200      mkdep(1)
1201
1202 H\bHI\bIS\bST\bTO\bOR\bRY\bY
1203      b\bbm\bma\bak\bke\be is derived from NetBSD's make(1).  It uses autoconf to facilitate
1204      portability to other platforms.
1205
1206 NetBSD 5.0_STABLE                June 30, 2010               NetBSD 5.0_STABLE