xref: /netbsd-src/usr.bin/make/make.1 (revision 8b0f9554ff8762542c4defc4f70e1eb76fb508fa)
1.\"	$NetBSD: make.1,v 1.134 2007/10/08 20:26:36 sjg Exp $
2.\"
3.\" Copyright (c) 1990, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"	from: @(#)make.1	8.4 (Berkeley) 3/19/94
31.\"
32.Dd November 19, 2006
33.Dt MAKE 1
34.Os
35.Sh NAME
36.Nm make
37.Nd maintain program dependencies
38.Sh SYNOPSIS
39.Nm
40.Op Fl BeikNnqrstWX
41.Bk -words
42.Op Fl D Ar variable
43.Ek
44.Bk -words
45.Op Fl d Ar flags
46.Ek
47.Bk -words
48.Op Fl f Ar makefile
49.Ek
50.Bk -words
51.Op Fl I Ar directory
52.Ek
53.Bk -words
54.Op Fl J Ar private
55.Ek
56.Bk -words
57.Op Fl j Ar max_jobs
58.Ek
59.Bk -words
60.Op Fl m Ar directory
61.Ek
62.Bk -words
63.Op Fl T Ar file
64.Ek
65.Bk -words
66.Op Fl V Ar variable
67.Ek
68.Op Ar variable=value
69.Bk -words
70.Op Ar target ...
71.Ek
72.Sh DESCRIPTION
73.Nm
74is a program designed to simplify the maintenance of other programs.
75Its input is a list of specifications as to the files upon which programs
76and other files depend.
77If no
78.Fl f Ar makefile
79makefile option is given,
80.Nm
81will try to open
82.Ql Pa makefile
83then
84.Ql Pa Makefile
85in order to find the specifications.
86If the file
87.Ql Pa .depend
88exists, it is read (see
89.Xr mkdep 1 ) .
90.Pp
91This manual page is intended as a reference document only.
92For a more thorough description of
93.Nm
94and makefiles, please refer to
95.%T "Make \- A Tutorial" .
96.Pp
97.Nm
98will prepend the contents of the
99.Va MAKEFLAGS
100environment variable to the command line arguments before parsing them.
101.Pp
102The options are as follows:
103.Bl -tag -width Ds
104.It Fl B
105Try to be backwards compatible by executing a single shell per command and
106by executing the commands to make the sources of a dependency line in sequence.
107.It Fl D Ar variable
108Define
109.Ar variable
110to be 1, in the global context.
111.It Fl d Ar [-]flags
112Turn on debugging, and specify which portions of
113.Nm
114are to print debugging information.
115Unless the flags are preceded by
116.Ql -
117they are added to the
118.Va MAKEFLAGS
119environment variable and will be processed by any child make processes.
120.Ar Flags
121is one or more of the following:
122.Bl -tag -width Ds
123.It Ar A
124Print all possible debugging information;
125equivalent to specifying all of the debugging flags.
126.It Ar a
127Print debugging information about archive searching and caching.
128.It Ar c
129Print debugging information about conditional evaluation.
130.It Ar d
131Print debugging information about directory searching and caching.
132.It Ar e
133Print debugging information about failed commands and targets.
134.It Ar F
135Use the rest of
136.Ql flags
137as the name of the file to which the debug output is written.
138If the filename ends
139.Ql .%d
140then the
141.Ql %d
142is replaced by the pid.
143.It Ar f
144Print debugging information about loop evaluation.
145.It Ar "g1"
146Print the input graph before making anything.
147.It Ar "g2"
148Print the input graph after making everything, or before exiting
149on error.
150.It Ar "g3"
151Print the input graph before exiting on error.
152.It Ar j
153Print debugging information about running multiple shells.
154.It Ar m
155Print debugging information about making targets, including modification
156dates.
157.It Ar n
158Don't delete the temporary command scripts created in
159.Pa /tmp
160when running commands.
161These are created via
162.Xr mkstemp 3
163and have names of the form
164.Pa /tmp/makeXXXXX .
165.Em NOTE :
166This can create many file in
167.Pa /tmp
168so use with care.
169.It Ar p
170Print debugging information about makefile parsing.
171.It Ar s
172Print debugging information about suffix-transformation rules.
173.It Ar t
174Print debugging information about target list maintenance.
175.It Ar v
176Print debugging information about variable assignment.
177.It Ar x
178Run shell commands with
179.Fl x
180so the actual commands are printed as they are executed.
181.El
182.It Fl e
183Specify that environment variables override macro assignments within
184makefiles.
185.It Fl f Ar makefile
186Specify a makefile to read instead of the default
187.Ql Pa makefile .
188If
189.Ar makefile
190is
191.Ql Fl ,
192standard input is read.
193Multiple makefiles may be specified, and are read in the order specified.
194.It Fl I Ar directory
195Specify a directory in which to search for makefiles and included makefiles.
196The system makefile directory (or directories, see the
197.Fl m
198option) is automatically included as part of this list.
199.It Fl i
200Ignore non-zero exit of shell commands in the makefile.
201Equivalent to specifying
202.Ql Fl
203before each command line in the makefile.
204.It Fl J Ar private
205This option should
206.Em not
207be specified by the user.
208.Pp
209When the
210.Ar j
211option is in use in a recursive build, this option is passed by a make
212to child makes to allow all the make processes in the build to
213cooperate to avoid overloading the system.
214.It Fl j Ar max_jobs
215Specify the maximum number of jobs that
216.Nm
217may have running at any one time.
218Turns compatibility mode off, unless the
219.Ar B
220flag is also specified.
221.It Fl k
222Continue processing after errors are encountered, but only on those targets
223that do not depend on the target whose creation caused the error.
224.It Fl m Ar directory
225Specify a directory in which to search for sys.mk and makefiles included
226via the
227.Ao Ar file Ac Ns -style
228include statement.
229The
230.Fl m
231option can be used multiple times to form a search path.
232This path will override the default system include path: /usr/share/mk.
233Furthermore the system include path will be appended to the search path used
234for
235.Qo Ar file Qc Ns -style
236include statements (see the
237.Fl I
238option).
239.Pp
240If a file or directory name in the
241.Fl m
242argument (or the
243.Ev MAKESYSPATH
244environment variable) starts with the string
245.Qq \&.../
246then
247.Nm
248will search for the specified file or directory named in the remaining part
249of the argument string.
250The search starts with the current directory of
251the Makefile and then works upward towards the root of the filesystem.
252If the search is successful, then the resulting directory replaces the
253.Qq \&.../
254specification in the
255.Fl m
256argument.
257If used, this feature allows
258.Nm
259to easily search in the current source tree for customized sys.mk files
260(e.g., by using
261.Qq \&.../mk/sys.mk
262as an argument).
263.It Fl n
264Display the commands that would have been executed, but do not
265actually execute them unless the target depends on the .MAKE special
266source (see below).
267.It Fl N
268Display the commands which would have been executed, but do not
269actually execute any of them; useful for debugging top-level makefiles
270without descending into subdirectories.
271.It Fl q
272Do not execute any commands, but exit 0 if the specified targets are
273up-to-date and 1, otherwise.
274.It Fl r
275Do not use the built-in rules specified in the system makefile.
276.It Fl s
277Do not echo any commands as they are executed.
278Equivalent to specifying
279.Ql Ic @
280before each command line in the makefile.
281.It Fl T Ar tracefile
282When used with the
283.Fl j
284flag,
285append a trace record to
286.Ar tracefile
287for each job started and completed.
288.It Fl t
289Rather than re-building a target as specified in the makefile, create it
290or update its modification time to make it appear up-to-date.
291.It Fl V Ar variable
292Print
293.Nm Ns 's
294idea of the value of
295.Ar variable ,
296in the global context.
297Do not build any targets.
298Multiple instances of this option may be specified;
299the variables will be printed one per line,
300with a blank line for each null or undefined variable.
301If
302.Ar variable
303contains a
304.Ql \&$
305then the value will be expanded before printing.
306.It Fl W
307Treat any warnings during makefile parsing as errors.
308.It Fl X
309Don't export variables passed on the command line to the environment
310individually.
311Variables passed on the command line are still exported
312via the
313.Va MAKEFLAGS
314environment variable.
315This option may be useful on systems which have a small limit on the
316size of command arguments.
317.It Ar variable=value
318Set the value of the variable
319.Ar variable
320to
321.Ar value .
322Normally, all values passed on the command line are also exported to
323sub-makes in the environment.
324The
325.Fl X
326flag disables this behavior.
327Variable assignments should follow options for POSIX compatibility
328but no ordering is enforced.
329.El
330.Pp
331There are seven different types of lines in a makefile: file dependency
332specifications, shell commands, variable assignments, include statements,
333conditional directives, for loops, and comments.
334.Pp
335In general, lines may be continued from one line to the next by ending
336them with a backslash
337.Pq Ql \e .
338The trailing newline character and initial whitespace on the following
339line are compressed into a single space.
340.Sh FILE DEPENDENCY SPECIFICATIONS
341Dependency lines consist of one or more targets, an operator, and zero
342or more sources.
343This creates a relationship where the targets ``depend'' on the sources
344and are usually created from them.
345The exact relationship between the target and the source is determined
346by the operator that separates them.
347The three operators are as follows:
348.Bl -tag -width flag
349.It Ic \&:
350A target is considered out-of-date if its modification time is less than
351those of any of its sources.
352Sources for a target accumulate over dependency lines when this operator
353is used.
354The target is removed if
355.Nm
356is interrupted.
357.It Ic \&!
358Targets are always re-created, but not until all sources have been
359examined and re-created as necessary.
360Sources for a target accumulate over dependency lines when this operator
361is used.
362The target is removed if
363.Nm
364is interrupted.
365.It Ic \&::
366If no sources are specified, the target is always re-created.
367Otherwise, a target is considered out-of-date if any of its sources has
368been modified more recently than the target.
369Sources for a target do not accumulate over dependency lines when this
370operator is used.
371The target will not be removed if
372.Nm
373is interrupted.
374.El
375.Pp
376Targets and sources may contain the shell wildcard values
377.Ql \&? ,
378.Ql * ,
379.Ql [] ,
380and
381.Ql {} .
382The values
383.Ql \&? ,
384.Ql * ,
385and
386.Ql []
387may only be used as part of the final
388component of the target or source, and must be used to describe existing
389files.
390The value
391.Ql {}
392need not necessarily be used to describe existing files.
393Expansion is in directory order, not alphabetically as done in the shell.
394.Sh SHELL COMMANDS
395Each target may have associated with it a series of shell commands, normally
396used to create the target.
397Each of the commands in this script
398.Em must
399be preceded by a tab.
400While any target may appear on a dependency line, only one of these
401dependencies may be followed by a creation script, unless the
402.Ql Ic \&::
403operator is used.
404.Pp
405If the first characters of the command line are any combination of
406.Ql Ic @ ,
407.Ql Ic + ,
408or
409.Ql Ic \- ,
410the command is treated specially.
411A
412.Ql Ic @
413causes the command not to be echoed before it is executed.
414A
415.Ql Ic +
416causes the command to be executed even when
417.Fl n
418is given.
419This is similar to the effect of the .MAKE special source,
420except that the effect can be limited to a single line of a script.
421A
422.Ql Ic \-
423causes any non-zero exit status of the command line to be ignored.
424.Sh VARIABLE ASSIGNMENTS
425Variables in make are much like variables in the shell, and, by tradition,
426consist of all upper-case letters.
427.Ss Variable assignment modifiers
428The five operators that can be used to assign values to variables are as
429follows:
430.Bl -tag -width Ds
431.It Ic \&=
432Assign the value to the variable.
433Any previous value is overridden.
434.It Ic \&+=
435Append the value to the current value of the variable.
436.It Ic \&?=
437Assign the value to the variable if it is not already defined.
438.It Ic \&:=
439Assign with expansion, i.e. expand the value before assigning it
440to the variable.
441Normally, expansion is not done until the variable is referenced.
442.Em NOTE :
443References to undefined variables are
444.Em not
445expanded.
446This can cause problems when variable modifiers are used.
447.It Ic \&!=
448Expand the value and pass it to the shell for execution and assign
449the result to the variable.
450Any newlines in the result are replaced with spaces.
451.El
452.Pp
453Any white-space before the assigned
454.Ar value
455is removed; if the value is being appended, a single space is inserted
456between the previous contents of the variable and the appended value.
457.Pp
458Variables are expanded by surrounding the variable name with either
459curly braces
460.Pq Ql {}
461or parentheses
462.Pq Ql ()
463and preceding it with
464a dollar sign
465.Pq Ql \&$ .
466If the variable name contains only a single letter, the surrounding
467braces or parentheses are not required.
468This shorter form is not recommended.
469.Pp
470Variable substitution occurs at two distinct times, depending on where
471the variable is being used.
472Variables in dependency lines are expanded as the line is read.
473Variables in shell commands are expanded when the shell command is
474executed.
475.Ss Variable classes
476The four different classes of variables (in order of increasing precedence)
477are:
478.Bl -tag -width Ds
479.It Environment variables
480Variables defined as part of
481.Nm Ns 's
482environment.
483.It Global variables
484Variables defined in the makefile or in included makefiles.
485.It Command line variables
486Variables defined as part of the command line.
487.It Local variables
488Variables that are defined specific to a certain target.
489The seven local variables are as follows:
490.Bl -tag -width ".ARCHIVE"
491.It Va .ALLSRC
492The list of all sources for this target; also known as
493.Ql Va \&\*[Gt] .
494.It Va .ARCHIVE
495The name of the archive file.
496.It Va .IMPSRC
497The name/path of the source from which the target is to be transformed
498(the ``implied'' source); also known as
499.Ql Va \&\*[Lt] .
500.It Va .MEMBER
501The name of the archive member.
502.It Va .OODATE
503The list of sources for this target that were deemed out-of-date; also
504known as
505.Ql Va \&? .
506.It Va .PREFIX
507The file prefix of the file, containing only the file portion, no suffix
508or preceding directory components; also known as
509.Ql Va * .
510.It Va .TARGET
511The name of the target; also known as
512.Ql Va @ .
513.El
514.Pp
515The shorter forms
516.Ql Va @ ,
517.Ql Va \&? ,
518.Ql Va \&\*[Lt] ,
519.Ql Va \&\*[Gt] ,
520and
521.Ql Va *
522are permitted for backward
523compatibility with historical makefiles and are not recommended.
524The six variables
525.Ql Va "@F" ,
526.Ql Va "@D" ,
527.Ql Va "\*[Lt]F" ,
528.Ql Va "\*[Lt]D" ,
529.Ql Va "*F" ,
530and
531.Ql Va "*D"
532are permitted for compatibility with
533.At V
534makefiles and are not recommended.
535.Pp
536Four of the local variables may be used in sources on dependency lines
537because they expand to the proper value for each target on the line.
538These variables are
539.Ql Va .TARGET ,
540.Ql Va .PREFIX ,
541.Ql Va .ARCHIVE ,
542and
543.Ql Va .MEMBER .
544.El
545.Ss Additional inbuilt variables
546In addition,
547.Nm
548sets or knows about the following variables:
549.Bl -tag -width .MAKEOVERRIDES
550.It Va \&$
551A single dollar sign
552.Ql \&$ ,
553i.e.
554.Ql \&$$
555expands to a single dollar
556sign.
557.It Va .ALLTARGETS
558The list of all targets encountered in the Makefile.
559If evaluated during
560Makefile parsing, lists only those targets encountered thus far.
561.It Va .CURDIR
562A path to the directory where
563.Nm
564was executed.
565Refer to the description of
566.Ql Ev PWD
567for more details.
568.It Ev MAKE
569The name that
570.Nm
571was executed with
572.Pq Va argv[0] .
573For compatibility
574.Nm
575also sets
576.Va .MAKE
577with the same value.
578The preferred variable to use is the environment variable
579.Ev MAKE
580because it is more compatible with other versions of
581.Nm
582and cannot be confused with the special target with the same name.
583.It Va .MAKE.EXPORTED
584The list of variables exported by
585.Nm .
586.It Va .MAKE.MAKEFILES
587The list of makefiles read by
588.Nm ,
589which is useful for tracking dependencies.
590Each makefile is recorded only once, regardless of the number of times read.
591.It Va .MAKE.PID
592The process-id of
593.Nm .
594.It Va .MAKE.PPID
595The parent process-id of
596.Nm .
597.It Va .MAKE.JOB.PREFIX
598If
599.Nm
600is run with
601.Ar j
602then output for each target is prefixed with a token
603.Ql --- target ---
604the first part of which can be controlled via
605.Va .MAKE.JOB.PREFIX .
606.br
607For example:
608.Li .MAKE.JOB.PREFIX=${.newline}---${.MAKE:T}[${.MAKE.PID}]
609would produce tokens like
610.Ql ---make[1234] target ---
611making it easier to track the degree of parallelism being achieved.
612.It Ev MAKEFLAGS
613The environment variable
614.Ql Ev MAKEFLAGS
615may contain anything that
616may be specified on
617.Nm Ns 's
618command line.
619Anything specified on
620.Nm Ns 's
621command line is appended to the
622.Ql Ev MAKEFLAGS
623variable which is then
624entered into the environment for all programs which
625.Nm
626executes.
627.It Va .MAKEOVERRIDES
628This variable is used to record the names of variables assigned to
629on the command line, so that they may be exported as part of
630.Ql Ev MAKEFLAGS .
631This behaviour can be disabled by assigning an empty value to
632.Ql Va .MAKEOVERRIDES
633within a makefile.
634Extra variables can be exported from a makefile
635by appending their names to
636.Ql Va .MAKEOVERRIDES .
637.Ql Ev MAKEFLAGS
638is re-exported whenever
639.Ql Va .MAKEOVERRIDES
640is modified.
641.It Va MAKE_PRINT_VAR_ON_ERROR
642When
643.Nm
644stops due to an error, it prints its name and the value of
645.Ql Va .CURDIR
646as well as the value of any variables named in
647.Ql Va MAKE_PRINT_VAR_ON_ERROR .
648.It Va .newline
649This variable is simply assigned a newline character as its value.
650This allows expansions using the
651.Cm \&:@
652modifier to put a newline between
653iterations of the loop rather than a space.
654For example, the printing of
655.Ql Va MAKE_PRINT_VAR_ON_ERROR
656could be done as ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@}.
657.It Va .OBJDIR
658A path to the directory where the targets are built.
659Its value is determined by trying to
660.Xr chdir 2
661to the following directories in order and using the first match:
662.Bl -enum
663.It
664.Ev ${MAKEOBJDIRPREFIX}${.CURDIR}
665.Pp
666(Only if
667.Ql Ev MAKEOBJDIRPREFIX
668is set in the environment or on the command line.)
669.It
670.Ev ${MAKEOBJDIR}
671.Pp
672(Only if
673.Ql Ev MAKEOBJDIR
674is set in the environment or on the command line.)
675.It
676.Ev ${.CURDIR} Ns Pa /obj. Ns Ev ${MACHINE}
677.It
678.Ev ${.CURDIR} Ns Pa /obj
679.It
680.Pa /usr/obj/ Ns Ev ${.CURDIR}
681.It
682.Ev ${.CURDIR}
683.El
684.Pp
685Variable expansion is performed on the value before it's used,
686so expressions such as
687.Dl ${.CURDIR:C,^/usr/src,/var/obj,}
688may be used.
689.Pp
690.Ql Va .OBJDIR
691may be modified in the makefile as a global variable.
692In all cases,
693.Nm
694will
695.Xr chdir 2
696to
697.Ql Va .OBJDIR
698and set
699.Ql Ev PWD
700to that directory before executing any targets.
701.
702.It Va .PARSEDIR
703A path to the directory of the current
704.Ql Pa Makefile
705being parsed.
706.It Va .PARSEFILE
707The basename of the current
708.Ql Pa Makefile
709being parsed.
710This variable and
711.Ql Va .PARSEDIR
712are both set only while the
713.Ql Pa Makefiles
714are being parsed.
715.It Va .PATH
716A variable that represents the list of directories that
717.Nm
718will search for files.
719The search list should be updated using the target
720.Ql Va .PATH
721rather than the variable.
722.It Ev PWD
723Alternate path to the current directory.
724.Nm
725normally sets
726.Ql Va .CURDIR
727to the canonical path given by
728.Xr getcwd 3 .
729However, if the environment variable
730.Ql Ev PWD
731is set and gives a path to the current directory, then
732.Nm
733sets
734.Ql Va .CURDIR
735to the value of
736.Ql Ev PWD
737instead.
738This behaviour is disabled if
739.Ql Ev MAKEOBJDIRPREFIX
740is set or
741.Ql Ev MAKEOBJDIR
742contains a variable transform.
743.Ql Ev PWD
744is set to the value of
745.Ql Va .OBJDIR
746for all programs which
747.Nm
748executes.
749.El
750.Ss Variable modifiers
751Variable expansion may be modified to select or modify each word of the
752variable (where a ``word'' is white-space delimited sequence of characters).
753The general format of a variable expansion is as follows:
754.Pp
755.Dl ${variable[:modifier[:...]]}
756.Pp
757Each modifier begins with a colon,
758which may be escaped with a backslash
759.Pq Ql \e .
760.Pp
761A set of modifiers can be specified via a variable, as follows:
762.Pp
763.Dl modifier_variable=modifier[:...]
764.Dl ${variable:${modifier_variable}[:...]}
765.Pp
766In this case the first modifier in the modifier_variable does not
767start with a colon, since that must appear in the referencing
768variable.
769If any of the modifiers in the modifier_variable contain a dollar sign
770.Pq Ql $ ,
771these must be doubled to avoid early expansion.
772.Pp
773The supported modifiers are:
774.Bl -tag -width EEE
775.It Cm \&:E
776Replaces each word in the variable with its suffix.
777.It Cm \&:H
778Replaces each word in the variable with everything but the last component.
779.It Cm \&:M Ns Ar pattern
780Select only those words that match
781.Ar pattern .
782The standard shell wildcard characters
783.Pf ( Ql * ,
784.Ql \&? ,
785and
786.Ql Op )
787may
788be used.
789The wildcard characters may be escaped with a backslash
790.Pq Ql \e .
791.It Cm \&:N Ns Ar pattern
792This is identical to
793.Ql Cm \&:M ,
794but selects all words which do not match
795.Ar pattern .
796.It Cm \&:O
797Order every word in variable alphabetically.
798To sort words in
799reverse order use the
800.Ql Cm \&:O:[-1..1]
801combination of modifiers.
802.It Cm \&:Ox
803Randomize words in variable.
804The results will be different each time you are referring to the
805modified variable; use the assignment with expansion
806.Pq Ql Cm \&:=
807to prevent such behaviour.
808For example,
809.Bd -literal -offset indent
810LIST=			uno due tre quattro
811RANDOM_LIST=		${LIST:Ox}
812STATIC_RANDOM_LIST:=	${LIST:Ox}
813
814all:
815	@echo "${RANDOM_LIST}"
816	@echo "${RANDOM_LIST}"
817	@echo "${STATIC_RANDOM_LIST}"
818	@echo "${STATIC_RANDOM_LIST}"
819.Ed
820may produce output similar to:
821.Bd -literal -offset indent
822quattro due tre uno
823tre due quattro uno
824due uno quattro tre
825due uno quattro tre
826.Ed
827.It Cm \&:Q
828Quotes every shell meta-character in the variable, so that it can be passed
829safely through recursive invocations of
830.Nm .
831.It Cm \&:R
832Replaces each word in the variable with everything but its suffix.
833.It Cm \&:tl
834Converts variable to lower-case letters.
835.It Cm \&:ts Ns Ar c
836Words in the variable are normally separated by a space on expansion.
837This modifier sets the separator to the character
838.Ar c .
839If
840.Ar c
841is omitted, then no separator is used.
842.It Cm \&:tu
843Converts variable to upper-case letters.
844.It Cm \&:tW
845Causes the value to be treated as a single word
846(possibly containing embedded white space).
847See also
848.Ql Cm \&:[*] .
849.It Cm \&:tw
850Causes the value to be treated as a sequence of
851words delimited by white space.
852See also
853.Ql Cm \&:[@] .
854.Sm off
855.It Cm \&:S No \&/ Ar old_string Xo
856.No \&/ Ar new_string
857.No \&/ Op Cm 1gW
858.Xc
859.Sm on
860Modify the first occurrence of
861.Ar old_string
862in the variable's value, replacing it with
863.Ar new_string .
864If a
865.Ql g
866is appended to the last slash of the pattern, all occurrences
867in each word are replaced.
868If a
869.Ql 1
870is appended to the last slash of the pattern, only the first word
871is affected.
872If a
873.Ql W
874is appended to the last slash of the pattern,
875then the value is treated as a single word
876(possibly containing embedded white space).
877If
878.Ar old_string
879begins with a caret
880.Pq Ql ^ ,
881.Ar old_string
882is anchored at the beginning of each word.
883If
884.Ar old_string
885ends with a dollar sign
886.Pq Ql \&$ ,
887it is anchored at the end of each word.
888Inside
889.Ar new_string ,
890an ampersand
891.Pq Ql \*[Am]
892is replaced by
893.Ar old_string
894(without any
895.Ql ^
896or
897.Ql \&$ ) .
898Any character may be used as a delimiter for the parts of the modifier
899string.
900The anchoring, ampersand and delimiter characters may be escaped with a
901backslash
902.Pq Ql \e .
903.Pp
904Variable expansion occurs in the normal fashion inside both
905.Ar old_string
906and
907.Ar new_string
908with the single exception that a backslash is used to prevent the expansion
909of a dollar sign
910.Pq Ql \&$ ,
911not a preceding dollar sign as is usual.
912.Sm off
913.It Cm \&:C No \&/ Ar pattern Xo
914.No \&/ Ar replacement
915.No \&/ Op Cm 1gW
916.Xc
917.Sm on
918The
919.Cm \&:C
920modifier is just like the
921.Cm \&:S
922modifier except that the old and new strings, instead of being
923simple strings, are a regular expression (see
924.Xr regex 3 )
925string
926.Ar pattern
927and an
928.Xr ed 1 Ns \-style
929string
930.Ar replacement .
931Normally, the first occurrence of the pattern
932.Ar pattern
933in each word of the value is substituted with
934.Ar replacement .
935The
936.Ql 1
937modifier causes the substitution to apply to at most one word; the
938.Ql g
939modifier causes the substitution to apply to as many instances of the
940search pattern
941.Ar pattern
942as occur in the word or words it is found in; the
943.Ql W
944modifier causes the value to be treated as a single word
945(possibly containing embedded white space).
946Note that
947.Ql 1
948and
949.Ql g
950are orthogonal; the former specifies whether multiple words are
951potentially affected, the latter whether multiple substitutions can
952potentially occur within each affected word.
953.It Cm \&:T
954Replaces each word in the variable with its last component.
955.It Cm \&:u
956Remove adjacent duplicate words (like
957.Xr uniq 1 ) .
958.Sm off
959.It Cm \&:\&? Ar true_string Cm \&: Ar false_string
960.Sm on
961If the variable (actually an expression; see below)
962evaluates to true, return as its value the
963.Ar true_string ,
964otherwise return the
965.Ar false_string .
966.It Ar :old_string=new_string
967This is the
968.At V
969style variable substitution.
970It must be the last modifier specified.
971If
972.Ar old_string
973or
974.Ar new_string
975do not contain the pattern matching character
976.Ar %
977then it is assumed that they are
978anchored at the end of each word, so only suffixes or entire
979words may be replaced.
980Otherwise
981.Ar %
982is the substring of
983.Ar old_string
984to be replaced in
985.Ar new_string .
986.Pp
987Variable expansion occurs in the normal fashion inside both
988.Ar old_string
989and
990.Ar new_string
991with the single exception that a backslash is used to prevent the
992expansion of a dollar sign
993.Pq Ql \&$ ,
994not a preceding dollar sign as is usual.
995.Sm off
996.It Cm \&:@ Ar temp Cm @ Xo
997.Ar string Cm @
998.Sm on
999.Xc
1000This is the loop expansion mechanism from the OSF Development
1001Environment (ODE) make.
1002Unlike
1003.Cm \&.for
1004loops expansion occurs at the time of
1005reference.
1006Assign
1007.Ar temp
1008to each word in the variable and evaluate
1009.Ar string .
1010The ODE convention is that
1011.Ar temp
1012should start and end with a period.
1013For example.
1014.Dl ${LINKS:@.LINK.@${LN} ${TARGET} ${.LINK.}@}
1015.It Cm \&:U Ns Ar newval
1016If the variable is undefined
1017.Ar newval
1018is the value.
1019If the variable is defined, the existing value is returned.
1020This is another ODE make feature.
1021It is handy for setting per-target CFLAGS for instance:
1022.Dl ${_${.TARGET:T}_CFLAGS:U${DEF_CFLAGS}}
1023If a value is only required if the variable is undefined, use:
1024.Dl ${VAR:D:Unewval}
1025.It Cm \&:D Ns Ar newval
1026If the variable is defined
1027.Ar newval
1028is the value.
1029.It Cm \&:L
1030The name of the variable is the value.
1031.It Cm \&:P
1032The path of the node which has the same name as the variable
1033is the value.
1034If no such node exists or its path is null, then the
1035name of the variable is used.
1036.Sm off
1037.It Cm \&:\&! Ar cmd Cm \&!
1038.Sm on
1039The output of running
1040.Ar cmd
1041is the value.
1042.It Cm \&:sh
1043If the variable is non-empty it is run as a command and the output
1044becomes the new value.
1045.It Cm \&::= Ns Ar str
1046The variable is assigned the value
1047.Ar str
1048after substitution.
1049This modifier and its variations are useful in
1050obscure situations such as wanting to apply modifiers to
1051.Cm \&.for
1052loop iteration variables which won't work due to the way
1053.Cm \&.for
1054loops are implemented.
1055These assignment modifiers always expand to
1056nothing, so if appearing in a rule line by themselves should be
1057preceded with something to keep
1058.Nm
1059happy.
1060As in:
1061.Bd -literal
1062use_foo: \&.USE
1063\&.for i in ${\&.TARGET} ${\&.TARGET:R}\&.gz
1064	@: ${t::=$i}
1065	@echo t:R:T=${t:R:T}
1066\&.endfor
1067
1068.Ed
1069The
1070.Ql Cm \&::
1071helps avoid false matches with the
1072.At V
1073style
1074.Cm \&:=
1075modifier and since substitution always occurs the
1076.Cm \&::=
1077form is vaguely appropriate.
1078.It Cm \&::?= Ns Ar str
1079As for
1080.Cm \&::=
1081but only if the variable does not already have a value.
1082.It Cm \&::+= Ns Ar str
1083Append
1084.Ar str
1085to the variable.
1086.It Cm \&::!= Ns Ar cmd
1087Assign the output of
1088.Ar cmd
1089to the variable.
1090.It Cm \&:\&[ Ns Ar range Ns Cm \&]
1091Selects one or more words from the value,
1092or performs other operations related to the way in which the
1093value is divided into words.
1094.Pp
1095Ordinarily, a value is treated as a sequence of words
1096delimited by white space.
1097Some modifiers suppress this behaviour,
1098causing a value to be treated as a single word
1099(possibly containing embedded white space).
1100An empty value, or a value that consists entirely of white-space,
1101is treated as a single word.
1102For the purposes of the
1103.Ql Cm \&:[]
1104modifier, the words are indexed both forwards using positive integers
1105(where index 1 represents the first word),
1106and backwards using negative integers
1107(where index -1 represents the last word).
1108.Pp
1109The
1110.Ar range
1111is subjected to variable expansion, and the expanded result is
1112then interpreted as follows:
1113.Bl -tag -width index
1114.\" :[n]
1115.It Ar index
1116Selects a single word from the value.
1117.\" :[start..end]
1118.It Ar start Ns Cm \&.. Ns Ar end
1119Selects all words from
1120.Ar start
1121to
1122.Ar end ,
1123inclusive.
1124For example,
1125.Ql Cm \&:[2..-1]
1126selects all words from the second word to the last word.
1127If
1128.Ar start
1129is greater than
1130.Ar end ,
1131then the words are output in reverse order.
1132For example,
1133.Ql Cm \&:[-1..1]
1134selects all the words from last to first.
1135.\" :[*]
1136.It Cm \&*
1137Causes subsequent modifiers to treat the value as a single word
1138(possibly containing embedded white space).
1139Analogous to the effect of
1140\&"$*\&"
1141in Bourne shell.
1142.\" :[0]
1143.It 0
1144Means the same as
1145.Ql Cm \&:[*] .
1146.\" :[*]
1147.It Cm \&@
1148Causes subsequent modifiers to treat the value as a sequence of words
1149delimited by white space.
1150Analogous to the effect of
1151\&"$@\&"
1152in Bourne shell.
1153.\" :[#]
1154.It Cm \&#
1155Returns the number of words in the value.
1156.El \" :[range]
1157.El
1158.Sh INCLUDE STATEMENTS, CONDITIONALS AND FOR LOOPS
1159Makefile inclusion, conditional structures and for loops  reminiscent
1160of the C programming language are provided in
1161.Nm .
1162All such structures are identified by a line beginning with a single
1163dot
1164.Pq Ql \&.
1165character.
1166Files are included with either
1167.Cm \&.include Aq Ar file
1168or
1169.Cm \&.include Pf \*q Ar file Ns \*q .
1170Variables between the angle brackets or double quotes are expanded
1171to form the file name.
1172If angle brackets are used, the included makefile is expected to be in
1173the system makefile directory.
1174If double quotes are used, the including makefile's directory and any
1175directories specified using the
1176.Fl I
1177option are searched before the system
1178makefile directory.
1179For compatibility with other versions of
1180.Nm
1181.Ql include file ...
1182is also accepted.
1183If the include statement is written as
1184.Cm .-include
1185or as
1186.Cm .sinclude
1187then errors locating and/or opening include files are ignored.
1188.Pp
1189Conditional expressions are also preceded by a single dot as the first
1190character of a line.
1191The possible conditionals are as follows:
1192.Bl -tag -width Ds
1193.It Ic .export Ar variable
1194Export the specified global variable.
1195If no variable is provided, all globals are exported
1196except for internal variables (those that start with
1197.Ql \&.
1198).
1199This is not affected by the
1200.Fl X
1201flag, so should be used with caution.
1202Appending a variable name to
1203.Va .MAKE.EXPORTED
1204is equivalent to exporting a variable.
1205.It Ic .undef Ar variable
1206Un-define the specified global variable.
1207Only global variables may be un-defined.
1208.It Xo
1209.Ic \&.if
1210.Oo \&! Oc Ns Ar expression
1211.Op Ar operator expression ...
1212.Xc
1213Test the value of an expression.
1214.It Xo
1215.Ic .ifdef
1216.Oo \&! Oc Ns Ar variable
1217.Op Ar operator variable ...
1218.Xc
1219Test the value of a variable.
1220.It Xo
1221.Ic .ifndef
1222.Oo \&! Oc Ns Ar variable
1223.Op Ar operator variable ...
1224.Xc
1225Test the value of a variable.
1226.It Xo
1227.Ic .ifmake
1228.Oo \&! Oc Ns Ar target
1229.Op Ar operator target ...
1230.Xc
1231Test the target being built.
1232.It Xo
1233.Ic .ifnmake
1234.Oo \&! Ns Oc Ar target
1235.Op Ar operator target ...
1236.Xc
1237Test the target being built.
1238.It Ic .else
1239Reverse the sense of the last conditional.
1240.It Xo
1241.Ic .elif
1242.Oo \&! Ns Oc Ar expression
1243.Op Ar operator expression ...
1244.Xc
1245A combination of
1246.Ql Ic .else
1247followed by
1248.Ql Ic .if .
1249.It Xo
1250.Ic .elifdef
1251.Oo \&! Oc Ns Ar variable
1252.Op Ar operator variable ...
1253.Xc
1254A combination of
1255.Ql Ic .else
1256followed by
1257.Ql Ic .ifdef .
1258.It Xo
1259.Ic .elifndef
1260.Oo \&! Oc Ns Ar variable
1261.Op Ar operator variable ...
1262.Xc
1263A combination of
1264.Ql Ic .else
1265followed by
1266.Ql Ic .ifndef .
1267.It Xo
1268.Ic .elifmake
1269.Oo \&! Oc Ns Ar target
1270.Op Ar operator target ...
1271.Xc
1272A combination of
1273.Ql Ic .else
1274followed by
1275.Ql Ic .ifmake .
1276.It Xo
1277.Ic .elifnmake
1278.Oo \&! Oc Ns Ar target
1279.Op Ar operator target ...
1280.Xc
1281A combination of
1282.Ql Ic .else
1283followed by
1284.Ql Ic .ifnmake .
1285.It Ic .endif
1286End the body of the conditional.
1287.El
1288.Pp
1289The
1290.Ar operator
1291may be any one of the following:
1292.Bl -tag -width "Cm XX"
1293.It Cm \&|\&|
1294Logical OR.
1295.It Cm \&\*[Am]\*[Am]
1296Logical
1297.Tn AND ;
1298of higher precedence than
1299.Dq \&|\&| .
1300.El
1301.Pp
1302As in C,
1303.Nm
1304will only evaluate a conditional as far as is necessary to determine
1305its value.
1306Parentheses may be used to change the order of evaluation.
1307The boolean operator
1308.Ql Ic \&!
1309may be used to logically negate an entire
1310conditional.
1311It is of higher precedence than
1312.Ql Ic \&\*[Am]\*[Am] .
1313.Pp
1314The value of
1315.Ar expression
1316may be any of the following:
1317.Bl -tag -width defined
1318.It Ic defined
1319Takes a variable name as an argument and evaluates to true if the variable
1320has been defined.
1321.It Ic make
1322Takes a target name as an argument and evaluates to true if the target
1323was specified as part of
1324.Nm Ns 's
1325command line or was declared the default target (either implicitly or
1326explicitly, see
1327.Va .MAIN )
1328before the line containing the conditional.
1329.It Ic empty
1330Takes a variable, with possible modifiers, and evaluates to true if
1331the expansion of the variable would result in an empty string.
1332.It Ic exists
1333Takes a file name as an argument and evaluates to true if the file exists.
1334The file is searched for on the system search path (see
1335.Va .PATH ) .
1336.It Ic target
1337Takes a target name as an argument and evaluates to true if the target
1338has been defined.
1339.It Ic commands
1340Takes a target name as an argument and evaluates to true if the target
1341has been defined and has commands associated with it.
1342.El
1343.Pp
1344.Ar Expression
1345may also be an arithmetic or string comparison.
1346Variable expansion is
1347performed on both sides of the comparison, after which the integral
1348values are compared.
1349A value is interpreted as hexadecimal if it is
1350preceded by 0x, otherwise it is decimal; octal numbers are not supported.
1351The standard C relational operators are all supported.
1352If after
1353variable expansion, either the left or right hand side of a
1354.Ql Ic ==
1355or
1356.Ql Ic "!="
1357operator is not an integral value, then
1358string comparison is performed between the expanded
1359variables.
1360If no relational operator is given, it is assumed that the expanded
1361variable is being compared against 0 or an empty string in the case
1362of a string comparison.
1363.Pp
1364When
1365.Nm
1366is evaluating one of these conditional expression, and it encounters
1367a word it doesn't recognize, either the ``make'' or ``defined''
1368expression is applied to it, depending on the form of the conditional.
1369If the form is
1370.Ql Ic .ifdef
1371or
1372.Ql Ic .ifndef ,
1373the ``defined'' expression
1374is applied.
1375Similarly, if the form is
1376.Ql Ic .ifmake
1377or
1378.Ql Ic .ifnmake , the ``make''
1379expression is applied.
1380.Pp
1381If the conditional evaluates to true the parsing of the makefile continues
1382as before.
1383If it evaluates to false, the following lines are skipped.
1384In both cases this continues until a
1385.Ql Ic .else
1386or
1387.Ql Ic .endif
1388is found.
1389.Pp
1390For loops are typically used to apply a set of rules to a list of files.
1391The syntax of a for loop is:
1392.Pp
1393.Bl -tag -compact -width Ds
1394.It Xo
1395.Ic \&.for
1396.Ar variable
1397.Op Ar variable ...
1398.Ic in
1399.Ar expression
1400.Xc
1401.It Aq make-rules
1402.It Ic \&.endfor
1403.El
1404.Pp
1405After the for
1406.Ic expression
1407is evaluated, it is split into words.
1408On each iteration of the loop, one word is taken and assigned to each
1409.Ic variable ,
1410in order, and these
1411.Ic variables
1412are substituted into the
1413.Ic make-rules
1414inside the body of the for loop.
1415The number of words must come out even; that is, if there are three
1416iteration variables, the number of words provided must be a multiple
1417of three.
1418.Sh COMMENTS
1419Comments begin with a hash
1420.Pq Ql \&#
1421character, anywhere but in a shell
1422command line, and continue to the end of an unescaped new line.
1423.Sh SPECIAL SOURCES (ATTRIBUTES)
1424.Bl -tag -width .IGNOREx
1425.It Ic .EXEC
1426Target is never out of date, but always execute commands anyway.
1427.It Ic .IGNORE
1428Ignore any errors from the commands associated with this target, exactly
1429as if they all were preceded by a dash
1430.Pq Ql \- .
1431.\" .It Ic .INVISIBLE
1432.\" XXX
1433.\" .It Ic .JOIN
1434.\" XXX
1435.It Ic .MADE
1436Mark all sources of this target as being up-to-date.
1437.It Ic .MAKE
1438Execute the commands associated with this target even if the
1439.Fl n
1440or
1441.Fl t
1442options were specified.
1443Normally used to mark recursive
1444.Nm Ns 's .
1445.It Ic .NOPATH
1446Do not search for the target in the directories specified by
1447.Ic .PATH .
1448.It Ic .NOTMAIN
1449Normally
1450.Nm
1451selects the first target it encounters as the default target to be built
1452if no target was specified.
1453This source prevents this target from being selected.
1454.It Ic .OPTIONAL
1455If a target is marked with this attribute and
1456.Nm
1457can't figure out how to create it, it will ignore this fact and assume
1458the file isn't needed or already exists.
1459.It Ic .PHONY
1460The target does not
1461correspond to an actual file; it is always considered to be out of date,
1462and will not be created with the
1463.Fl t
1464option.
1465.It Ic .PRECIOUS
1466When
1467.Nm
1468is interrupted, it normally removes any partially made targets.
1469This source prevents the target from being removed.
1470.It Ic .RECURSIVE
1471Synonym for
1472.Ic .MAKE .
1473.It Ic .SILENT
1474Do not echo any of the commands associated with this target, exactly
1475as if they all were preceded by an at sign
1476.Pq Ql @ .
1477.It Ic .USE
1478Turn the target into
1479.Nm Ns 's
1480version of a macro.
1481When the target is used as a source for another target, the other target
1482acquires the commands, sources, and attributes (except for
1483.Ic .USE )
1484of the
1485source.
1486If the target already has commands, the
1487.Ic .USE
1488target's commands are appended
1489to them.
1490.It Ic .USEBEFORE
1491Exactly like
1492.Ic .USE ,
1493but prepend the
1494.Ic .USEBEFORE
1495target commands to the target.
1496.It Ic .WAIT
1497If
1498.Ic .WAIT
1499appears in a dependency line, the sources that precede it are
1500made before the sources that succeed it in the line.
1501Since the dependents of files are not made until the file itself
1502could be made, this also stops the dependents being built unless they
1503are needed for another branch of the dependency tree.
1504So given:
1505.Bd -literal
1506x: a .WAIT b
1507	echo x
1508a:
1509	echo a
1510b: b1
1511	echo b
1512b1:
1513	echo b1
1514
1515.Ed
1516the output is always
1517.Ql b1 ,
1518.Ql b ,
1519.Ql a ,
1520.Ql x .
1521.br
1522The ordering imposed by
1523.Ic .WAIT
1524is only relevant for parallel makes.
1525.El
1526.Sh SPECIAL TARGETS
1527Special targets may not be included with other targets, i.e. they must be
1528the only target specified.
1529.Bl -tag -width .BEGINx
1530.It Ic .BEGIN
1531Any command lines attached to this target are executed before anything
1532else is done.
1533.It Ic .DEFAULT
1534This is sort of a
1535.Ic .USE
1536rule for any target (that was used only as a
1537source) that
1538.Nm
1539can't figure out any other way to create.
1540Only the shell script is used.
1541The
1542.Ic .IMPSRC
1543variable of a target that inherits
1544.Ic .DEFAULT Ns 's
1545commands is set
1546to the target's own name.
1547.It Ic .END
1548Any command lines attached to this target are executed after everything
1549else is done.
1550.It Ic .IGNORE
1551Mark each of the sources with the
1552.Ic .IGNORE
1553attribute.
1554If no sources are specified, this is the equivalent of specifying the
1555.Fl i
1556option.
1557.It Ic .INTERRUPT
1558If
1559.Nm
1560is interrupted, the commands for this target will be executed.
1561.It Ic .MAIN
1562If no target is specified when
1563.Nm
1564is invoked, this target will be built.
1565.It Ic .MAKEFLAGS
1566This target provides a way to specify flags for
1567.Nm
1568when the makefile is used.
1569The flags are as if typed to the shell, though the
1570.Fl f
1571option will have
1572no effect.
1573.\" XXX: NOT YET!!!!
1574.\" .It Ic .NOTPARALLEL
1575.\" The named targets are executed in non parallel mode.
1576.\" If no targets are
1577.\" specified, then all targets are executed in non parallel mode.
1578.It Ic .NOPATH
1579Apply the
1580.Ic .NOPATH
1581attribute to any specified sources.
1582.It Ic .NOTPARALLEL
1583Disable parallel mode.
1584.It Ic .NO_PARALLEL
1585Synonym for
1586.Ic .NOTPARALLEL ,
1587for compatibility with other pmake variants.
1588.It Ic .ORDER
1589The named targets are made in sequence.
1590This ordering does not add targets to the list of targets to be made.
1591Since the dependents of a target do not get built until the target itself
1592could be built, unless
1593.Ql a
1594is built by another part of the dependency graph,
1595the following is a dependency loop:
1596.Bd -literal
1597\&.ORDER a b
1598b: a
1599.Ed
1600.Pp
1601The ordering imposed by
1602.Ic .ORDER
1603is only relevant for parallel makes.
1604.\" XXX: NOT YET!!!!
1605.\" .It Ic .PARALLEL
1606.\" The named targets are executed in parallel mode.
1607.\" If no targets are
1608.\" specified, then all targets are executed in parallel mode.
1609.It Ic .PATH
1610The sources are directories which are to be searched for files not
1611found in the current directory.
1612If no sources are specified, any previously specified directories are
1613deleted.
1614If the source is the special
1615.Ic .DOTLAST
1616target, then the current working
1617directory is searched last.
1618.It Ic .PHONY
1619Apply the
1620.Ic .PHONY
1621attribute to any specified sources.
1622.It Ic .PRECIOUS
1623Apply the
1624.Ic .PRECIOUS
1625attribute to any specified sources.
1626If no sources are specified, the
1627.Ic .PRECIOUS
1628attribute is applied to every
1629target in the file.
1630.It Ic .SHELL
1631Sets the shell that
1632.Nm
1633will use to execute commands.
1634The sources are a set of
1635.Ar field=value
1636pairs.
1637.Bl -tag -width hasErrCtls
1638.It Ar name
1639This is the minimal specification, used to select one of the builtin
1640shell specs;
1641.Ar sh ,
1642.Ar ksh ,
1643and
1644.Ar csh .
1645.It Ar path
1646Specifies the path to the shell.
1647.It Ar hasErrCtl
1648Indicates whether the shell supports exit on error.
1649.It Ar check
1650The command to turn on error checking.
1651.It Ar ignore
1652The command to disable error checking.
1653.It Ar echo
1654The command to turn on echoing of commands executed.
1655.It Ar quiet
1656The command to turn off echoing of commands executed.
1657.It Ar filter
1658The output to filter after issuing the
1659.Ar quiet
1660command.
1661It is typically identical to
1662.Ar quiet .
1663.It Ar errFlag
1664The flag to pass the shell to enable error checking.
1665.It Ar echoFlag
1666The flag to pass the shell to enable command echoing.
1667.It Ar newline
1668The string literal to pass the shell that results in a single newline
1669character when used outside of any quoting characters.
1670.El
1671Example:
1672.Bd -literal
1673\&.SHELL: name=ksh path=/bin/ksh hasErrCtl=true \\
1674	check="set -e" ignore="set +e" \\
1675	echo="set -v" quiet="set +v" filter="set +v" \\
1676	echoFlag=v errFlag=e newline="'\\n'"
1677.Ed
1678.It Ic .SILENT
1679Apply the
1680.Ic .SILENT
1681attribute to any specified sources.
1682If no sources are specified, the
1683.Ic .SILENT
1684attribute is applied to every
1685command in the file.
1686.It Ic .SUFFIXES
1687Each source specifies a suffix to
1688.Nm .
1689If no sources are specified, any previously specified suffixes are deleted.
1690.El
1691.Sh ENVIRONMENT
1692.Nm
1693uses the following environment variables, if they exist:
1694.Ev MACHINE ,
1695.Ev MACHINE_ARCH ,
1696.Ev MAKE ,
1697.Ev MAKEFLAGS ,
1698.Ev MAKEOBJDIR ,
1699.Ev MAKEOBJDIRPREFIX ,
1700.Ev MAKESYSPATH ,
1701and
1702.Ev PWD .
1703.Pp
1704.Ev MAKEOBJDIRPREFIX
1705and
1706.Ev MAKEOBJDIR
1707may only be set in the environment or on the command line to
1708.Nm
1709and not as makefile variables;
1710see the description of
1711.Ql Va .OBJDIR
1712for more details.
1713.Sh FILES
1714.Bl -tag -width /usr/share/mk -compact
1715.It .depend
1716list of dependencies
1717.It Makefile
1718list of dependencies
1719.It makefile
1720list of dependencies
1721.It sys.mk
1722system makefile
1723.It /usr/share/mk
1724system makefile directory
1725.El
1726.Sh COMPATIBILITY
1727The basic make syntax is compatible between different versions of make,
1728however the special variables, variable modifiers and conditionals are not.
1729.Pp
1730The way that parallel makes are scheduled changed in
1731.Nx 4.0
1732so that .ORDER and .WAIT apply recursively to the dependant nodes.
1733The algorithms used may change again in the future.
1734.Sh SEE ALSO
1735.Xr mkdep 1
1736.Sh HISTORY
1737A
1738.Nm
1739command appeared in
1740.At v7 .
1741