Annotation of src/usr.bin/make/make.1, Revision 1.84
1.84 ! agc 1: .\" $NetBSD: make.1,v 1.83 2003/08/01 00:39:54 sjg Exp $
1.15 thorpej 2: .\"
1.16 christos 3: .\" Copyright (c) 1990, 1993
4: .\" The Regents of the University of California. All rights reserved.
1.1 cgd 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.
1.84 ! agc 14: .\" 3. Neither the name of the University nor the names of its contributors
1.1 cgd 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: .\"
1.16 christos 30: .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94
1.1 cgd 31: .\"
1.83 sjg 32: .Dd July 31, 2003
1.1 cgd 33: .Dt MAKE 1
34: .Os
35: .Sh NAME
36: .Nm make
37: .Nd maintain program dependencies
38: .Sh SYNOPSIS
1.74 wiz 39: .Nm
1.75 thorpej 40: .Op Fl BeikNnqrstWX
1.30 mycroft 41: .Bk -words
1.1 cgd 42: .Op Fl D Ar variable
1.30 mycroft 43: .Ek
44: .Bk -words
1.1 cgd 45: .Op Fl d Ar flags
1.30 mycroft 46: .Ek
47: .Bk -words
1.1 cgd 48: .Op Fl f Ar makefile
1.30 mycroft 49: .Ek
50: .Bk -words
1.1 cgd 51: .Op Fl I Ar directory
1.30 mycroft 52: .Ek
1.1 cgd 53: .Bk -words
54: .Op Fl j Ar max_jobs
1.30 mycroft 55: .Ek
56: .Bk -words
1.44 sommerfe 57: .Op Fl J Ar private
58: .Ek
59: .Bk -words
1.13 christos 60: .Op Fl m Ar directory
1.1 cgd 61: .Ek
1.30 mycroft 62: .Bk -words
1.44 sommerfe 63: .Op Fl T Ar file
64: .Ek
65: .Bk -words
1.16 christos 66: .Op Fl V Ar variable
1.30 mycroft 67: .Ek
1.1 cgd 68: .Op Ar variable=value
1.30 mycroft 69: .Bk -words
1.1 cgd 70: .Op Ar target ...
1.30 mycroft 71: .Ek
1.1 cgd 72: .Sh DESCRIPTION
1.25 lukem 73: .Nm
1.1 cgd 74: is a program designed to simplify the maintenance of other programs.
75: Its input is a list of specifications as to the files upon which programs
76: and other files depend.
77: If the file
78: .Ql Pa makefile
79: exists, it is read for this list of specifications.
80: If it does not exist, the file
81: .Ql Pa Makefile
82: is read.
83: If the file
84: .Ql Pa .depend
85: exists, it is read (see
1.66 wiz 86: .Xr mkdep 1 ) .
1.1 cgd 87: .Pp
88: This manual page is intended as a reference document only.
89: For a more thorough description of
1.25 lukem 90: .Nm
1.1 cgd 91: and makefiles, please refer to
92: .%T "Make \- A Tutorial" .
93: .Pp
94: The options are as follows:
95: .Bl -tag -width Ds
1.16 christos 96: .It Fl B
1.10 christos 97: Try to be backwards compatible by executing a single shell per command and
98: by executing the commands to make the sources of a dependency line in sequence.
1.1 cgd 99: .It Fl D Ar variable
1.8 christos 100: Define
101: .Ar variable
1.1 cgd 102: to be 1, in the global context.
103: .It Fl d Ar flags
104: Turn on debugging, and specify which portions of
1.25 lukem 105: .Nm
1.1 cgd 106: are to print debugging information.
107: .Ar Flags
108: is one or more of the following:
109: .Bl -tag -width Ds
110: .It Ar A
111: Print all possible debugging information;
112: equivalent to specifying all of the debugging flags.
113: .It Ar a
114: Print debugging information about archive searching and caching.
115: .It Ar c
116: Print debugging information about conditional evaluation.
117: .It Ar d
118: Print debugging information about directory searching and caching.
119: .It Ar "g1"
120: Print the input graph before making anything.
121: .It Ar "g2"
122: Print the input graph after making everything, or before exiting
123: on error.
124: .It Ar j
125: Print debugging information about running multiple shells.
126: .It Ar m
127: Print debugging information about making targets, including modification
128: dates.
129: .It Ar s
130: Print debugging information about suffix-transformation rules.
131: .It Ar t
132: Print debugging information about target list maintenance.
133: .It Ar v
134: Print debugging information about variable assignment.
1.49 sjg 135: .It Ar x
1.57 wiz 136: Run shell commands with
137: .Fl x
138: so the actual commands are printed as they are executed.
1.1 cgd 139: .El
140: .It Fl e
1.68 perry 141: Specify that environment variables override macro assignments within
1.1 cgd 142: makefiles.
143: .It Fl f Ar makefile
144: Specify a makefile to read instead of the default
145: .Ql Pa makefile
146: and
147: If
148: .Ar makefile
149: is
150: .Ql Fl ,
151: standard input is read.
152: Multiple makefile's may be specified, and are read in the order specified.
153: .It Fl I Ar directory
154: Specify a directory in which to search for makefiles and included makefiles.
1.13 christos 155: The system makefile directory (or directories, see the
156: .Fl m
157: option) is automatically included as part of this list.
1.1 cgd 158: .It Fl i
159: Ignore non-zero exit of shell commands in the makefile.
160: Equivalent to specifying
161: .Ql Fl
162: before each command line in the makefile.
1.44 sommerfe 163: .It Fl J Ar private
164: This option should
165: .Em not
166: be specified by the user.
167: .Pp
168: When the
169: .Ar j
170: option is in use in a recursive build, this option is passed by a make
171: to child makes to allow all the make processes in the build to
172: cooperate to avoid overloading the system.
1.1 cgd 173: .It Fl j Ar max_jobs
174: Specify the maximum number of jobs that
1.25 lukem 175: .Nm
1.67 grant 176: may have running at any one time.
177: Turns compatibility mode off, unless the
1.11 christos 178: .Ar B
179: flag is also specified.
1.1 cgd 180: .It Fl k
181: Continue processing after errors are encountered, but only on those targets
182: that do not depend on the target whose creation caused the error.
1.13 christos 183: .It Fl m Ar directory
184: Specify a directory in which to search for sys.mk and makefiles included
1.67 grant 185: via the \*[Lt]...\*[Gt] style.
186: Multiple directories can be added to form a search path.
1.13 christos 187: This path will override the default system include path: /usr/share/mk.
188: Furthermore the system include path will be appended to the search path used
189: for "..."-style inclusions (see the
190: .Fl I
191: option).
1.1 cgd 192: .It Fl n
1.45 sommerfe 193: Display the commands that would have been executed, but do not
194: actually execute them unless the target depends on the .MAKE special
1.64 wiz 195: source (see below).
1.45 sommerfe 196: .It Fl N
197: Display the commands which would have been executed, but do not
198: actually execute any of them; useful for debugging top-level makefiles
199: without descending into subdirectories.
1.1 cgd 200: .It Fl q
201: Do not execute any commands, but exit 0 if the specified targets are
202: up-to-date and 1, otherwise.
203: .It Fl r
204: Do not use the built-in rules specified in the system makefile.
205: .It Fl s
206: Do not echo any commands as they are executed.
207: Equivalent to specifying
208: .Ql Ic @
209: before each command line in the makefile.
1.44 sommerfe 210: .It Fl T Ar tracefile
211: When used with the
1.48 wiz 212: .Fl j
1.44 sommerfe 213: flag,
214: append a trace record to
215: .Ar tracefile
216: for each job started and completed.
1.1 cgd 217: .It Fl t
218: Rather than re-building a target as specified in the makefile, create it
219: or update its modification time to make it appear up-to-date.
1.16 christos 220: .It Fl V Ar variable
221: Print
1.74 wiz 222: .Nm Ns 's
1.16 christos 223: idea of the value of
224: .Ar variable ,
225: in the global context.
226: Do not build any targets.
227: Multiple instances of this option may be specified;
228: the variables will be printed one per line,
229: with a blank line for each null or undefined variable.
1.46 christos 230: .It Fl W
231: Treat any warnings during makefile parsing as errors.
1.75 thorpej 232: .It Fl X
233: Don't export variables passed on the command line to the environment
234: individually.
235: Variables passed on the command line are still exported
236: via the
237: .Va MAKEFLAGS
238: environment variable.
239: This option may be useful on systems which have a small limit on the
240: size of command arguments.
1.1 cgd 241: .It Ar variable=value
242: Set the value of the variable
243: .Ar variable
244: to
245: .Ar value .
1.75 thorpej 246: Normally, all values passed on the command line are also exported to
247: sub-makes in the environment.
248: The
249: .Fl X
250: flag disables this behavior.
1.1 cgd 251: .El
252: .Pp
1.6 cgd 253: There are seven different types of lines in a makefile: file dependency
1.1 cgd 254: specifications, shell commands, variable assignments, include statements,
1.6 cgd 255: conditional directives, for loops, and comments.
1.1 cgd 256: .Pp
257: In general, lines may be continued from one line to the next by ending
258: them with a backslash
259: .Pq Ql \e .
260: The trailing newline character and initial whitespace on the following
261: line are compressed into a single space.
262: .Sh FILE DEPENDENCY SPECIFICATIONS
263: Dependency lines consist of one or more targets, an operator, and zero
264: or more sources.
265: This creates a relationship where the targets ``depend'' on the sources
266: and are usually created from them.
267: The exact relationship between the target and the source is determined
268: by the operator that separates them.
269: The three operators are as follows:
270: .Bl -tag -width flag
271: .It Ic \&:
272: A target is considered out-of-date if its modification time is less than
273: those of any of its sources.
274: Sources for a target accumulate over dependency lines when this operator
275: is used.
276: The target is removed if
1.25 lukem 277: .Nm
1.1 cgd 278: is interrupted.
279: .It Ic \&!
280: Targets are always re-created, but not until all sources have been
281: examined and re-created as necessary.
282: Sources for a target accumulate over dependency lines when this operator
283: is used.
284: The target is removed if
1.25 lukem 285: .Nm
1.1 cgd 286: is interrupted.
287: .It Ic \&::
288: If no sources are specified, the target is always re-created.
289: Otherwise, a target is considered out-of-date if any of its sources has
290: been modified more recently than the target.
291: Sources for a target do not accumulate over dependency lines when this
292: operator is used.
293: The target will not be removed if
1.25 lukem 294: .Nm
1.1 cgd 295: is interrupted.
296: .El
297: .Pp
298: Targets and sources may contain the shell wildcard values
1.80 wiz 299: .Ql \&? ,
1.1 cgd 300: .Ql * ,
301: .Ql []
302: and
303: .Ql {} .
304: The values
1.80 wiz 305: .Ql \&? ,
1.1 cgd 306: .Ql *
307: and
308: .Ql []
309: may only be used as part of the final
310: component of the target or source, and must be used to describe existing
311: files.
312: The value
313: .Ql {}
314: need not necessarily be used to describe existing files.
315: Expansion is in directory order, not alphabetically as done in the shell.
316: .Sh SHELL COMMANDS
317: Each target may have associated with it a series of shell commands, normally
318: used to create the target.
319: Each of the commands in this script
320: .Em must
321: be preceded by a tab.
322: While any target may appear on a dependency line, only one of these
323: dependencies may be followed by a creation script, unless the
324: .Ql Ic ::
325: operator is used.
326: .Pp
327: If the first or first two characters of the command line are
328: .Ql Ic @
329: and/or
330: .Ql Ic \- ,
331: the command is treated specially.
332: A
333: .Ql Ic @
334: causes the command not to be echoed before it is executed.
335: A
336: .Ql Ic \-
337: causes any non-zero exit status of the command line to be ignored.
338: .Sh VARIABLE ASSIGNMENTS
339: Variables in make are much like variables in the shell, and, by tradition,
340: consist of all upper-case letters.
341: The five operators that can be used to assign values to variables are as
342: follows:
343: .Bl -tag -width Ds
344: .It Ic \&=
345: Assign the value to the variable.
346: Any previous value is overridden.
347: .It Ic \&+=
348: Append the value to the current value of the variable.
349: .It Ic \&?=
350: Assign the value to the variable if it is not already defined.
351: .It Ic \&:=
352: Assign with expansion, i.e. expand the value before assigning it
353: to the variable.
354: Normally, expansion is not done until the variable is referenced.
355: .It Ic \&!=
356: Expand the value and pass it to the shell for execution and assign
357: the result to the variable.
358: Any newlines in the result are replaced with spaces.
359: .El
360: .Pp
361: Any white-space before the assigned
362: .Ar value
363: is removed; if the value is being appended, a single space is inserted
364: between the previous contents of the variable and the appended value.
365: .Pp
366: Variables are expanded by surrounding the variable name with either
367: curly braces
368: .Pq Ql {}
1.7 mycroft 369: or parentheses
1.1 cgd 370: .Pq Ql ()
371: and preceding it with
372: a dollar sign
373: .Pq Ql \&$ .
374: If the variable name contains only a single letter, the surrounding
1.7 mycroft 375: braces or parentheses are not required.
1.1 cgd 376: This shorter form is not recommended.
377: .Pp
378: Variable substitution occurs at two distinct times, depending on where
379: the variable is being used.
380: Variables in dependency lines are expanded as the line is read.
381: Variables in shell commands are expanded when the shell command is
382: executed.
383: .Pp
384: The four different classes of variables (in order of increasing precedence)
385: are:
386: .Bl -tag -width Ds
387: .It Environment variables
388: Variables defined as part of
1.74 wiz 389: .Nm Ns 's
1.1 cgd 390: environment.
391: .It Global variables
392: Variables defined in the makefile or in included makefiles.
393: .It Command line variables
394: Variables defined as part of the command line.
395: .It Local variables
396: Variables that are defined specific to a certain target.
397: The seven local variables are as follows:
398: .Bl -tag -width ".ARCHIVE"
399: .It Va .ALLSRC
400: The list of all sources for this target; also known as
1.62 ross 401: .Ql Va \&\*[Gt] .
1.1 cgd 402: .It Va .ARCHIVE
403: The name of the archive file.
404: .It Va .IMPSRC
405: The name/path of the source from which the target is to be transformed
406: (the ``implied'' source); also known as
1.62 ross 407: .Ql Va \&\*[Lt] .
1.1 cgd 408: .It Va .MEMBER
409: The name of the archive member.
410: .It Va .OODATE
411: The list of sources for this target that were deemed out-of-date; also
412: known as
413: .Ql Va \&? .
414: .It Va .PREFIX
415: The file prefix of the file, containing only the file portion, no suffix
416: or preceding directory components; also known as
417: .Ql Va * .
418: .It Va .TARGET
419: The name of the target; also known as
420: .Ql Va @ .
421: .El
422: .Pp
423: The shorter forms
424: .Ql Va @ ,
1.80 wiz 425: .Ql Va \&? ,
1.65 christos 426: .Ql Va \&\*[Lt] ,
427: .Ql Va \&\*[Gt] ,
1.1 cgd 428: and
429: .Ql Va *
430: are permitted for backward
431: compatibility with historical makefiles and are not recommended.
432: The six variables
433: .Ql Va "@F" ,
434: .Ql Va "@D" ,
1.62 ross 435: .Ql Va "\*[Lt]F" ,
436: .Ql Va "\*[Lt]D" ,
1.66 wiz 437: .Ql Va "*F" ,
1.1 cgd 438: and
439: .Ql Va "*D"
1.66 wiz 440: are permitted for compatibility with
1.1 cgd 441: .At V
442: makefiles and are not recommended.
443: .Pp
444: Four of the local variables may be used in sources on dependency lines
445: because they expand to the proper value for each target on the line.
446: These variables are
447: .Ql Va .TARGET ,
448: .Ql Va .PREFIX ,
449: .Ql Va .ARCHIVE ,
450: and
451: .Ql Va .MEMBER .
1.59 bgrayson 452: .El
1.1 cgd 453: .Pp
454: In addition,
1.25 lukem 455: .Nm
1.1 cgd 456: sets or knows about the following variables:
1.50 sjg 457: .Bl -tag -width .MAKEOVERRIDES
1.1 cgd 458: .It Va \&$
459: A single dollar sign
460: .Ql \&$ ,
461: i.e.
462: .Ql \&$$
463: expands to a single dollar
464: sign.
1.22 pk 465: .Pq Va argv[0]
1.56 tv 466: .It Va .ALLTARGETS
1.67 grant 467: The list of all targets encountered in the Makefile.
468: If evaluated during
1.56 tv 469: Makefile parsing, lists only those targets encountered thus far.
1.1 cgd 470: .It Va .CURDIR
471: A path to the directory where
1.25 lukem 472: .Nm
1.1 cgd 473: was executed.
1.78 christos 474: .It Ev MAKE
1.55 tv 475: The name that
476: .Nm
1.79 wiz 477: was executed with.
478: For compatibily
1.78 christos 479: .Nm
480: also sets
481: .Va .MAKE
482: with the same value.
483: The preferred variable to use is
484: .Ev MAKE
485: because it is more compatible with other versions of
486: .Nm
487: and cannot be confused with the special target with the same name.
1.1 cgd 488: .It Ev MAKEFLAGS
489: The environment variable
490: .Ql Ev MAKEFLAGS
491: may contain anything that
492: may be specified on
1.74 wiz 493: .Nm Ns 's
1.1 cgd 494: command line.
495: Anything specified on
1.74 wiz 496: .Nm Ns 's
1.1 cgd 497: command line is appended to the
498: .Ql Ev MAKEFLAGS
499: variable which is then
500: entered into the environment for all programs which
1.25 lukem 501: .Nm
1.1 cgd 502: executes.
1.50 sjg 503: .It Va .MAKEOVERRIDES
1.57 wiz 504: This variable is used to record the names of variables assigned to
505: on the command line, so that they may be exported as part of
1.50 sjg 506: .Ql Ev MAKEFLAGS .
1.57 wiz 507: This behaviour can be disabled by assigning an empty value to
1.50 sjg 508: .Ql Va .MAKEOVERRIDES
1.67 grant 509: within a makefile.
510: Extra variables can be exported from a makefile
1.57 wiz 511: by appending their names to
1.51 sjg 512: .Ql Va .MAKEOVERRIDES .
513: .Ql Ev MAKEFLAGS
1.57 wiz 514: is re-exported whenever
1.51 sjg 515: .Ql Va .MAKEOVERRIDES
516: is modified.
1.55 tv 517: .It Va MAKE_PRINT_VAR_ON_ERROR
1.57 wiz 518: When
1.55 tv 519: .Nm
520: stops due to an error, it prints its name and the value of
521: .Ql Va .CURDIR
1.57 wiz 522: as well as the value of any variables named in
1.55 tv 523: .Ql Va MAKE_PRINT_VAR_ON_ERROR .
524: .It Va .newline
525: This variable is simply assigned a newline character as its value.
526: This allows expansions using the :@ modifier to put a newline between
1.67 grant 527: iterations of the loop rather than a space.
528: For example, the printing of
1.55 tv 529: .Ql Va MAKE_PRINT_VAR_ON_ERROR
530: could be done as ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@}.
531: .It Va .OBJDIR
532: A path to the directory where the targets are built.
533: .It Va .PARSEDIR
534: A path to the directory of the current
535: .Ql Pa Makefile
536: being parsed.
537: .It Va .PARSEFILE
538: The basename of the current
539: .Ql Pa Makefile
540: being parsed.
541: This variable and
542: .Ql Va .PARSEDIR
543: are both set only while the
544: .Ql Pa Makefiles
545: are being parsed.
1.69 sjg 546: .It Va .PATH
1.82 wiz 547: A variable that represents the list of directories that
1.69 sjg 548: .Nm
1.70 wiz 549: will search for files.
550: The search list should be updated using the target
1.69 sjg 551: .Ql Va .PATH
552: rather than the variable.
1.16 christos 553: .It Ev PWD
554: Alternate path to the current directory.
1.25 lukem 555: .Nm
1.16 christos 556: normally sets
557: .Ql Va .CURDIR
558: to the canonical path given by
1.48 wiz 559: .Xr getcwd 3 .
1.16 christos 560: However, if the environment variable
561: .Ql Ev PWD
562: is set and gives a path to the current directory, then
1.25 lukem 563: .Nm
1.16 christos 564: sets
565: .Ql Va .CURDIR
566: to the value of
567: .Ql Ev PWD
1.67 grant 568: instead.
569: This behaviour is disabled if
1.40 sjg 570: .Ql Ev MAKEOBJDIRPREFIX
571: is set.
1.16 christos 572: .Ql Ev PWD
573: is set to the value of
574: .Ql Va .OBJDIR
575: for all programs which
1.25 lukem 576: .Nm
1.16 christos 577: executes.
1.1 cgd 578: .El
579: .Pp
580: Variable expansion may be modified to select or modify each word of the
581: variable (where a ``word'' is white-space delimited sequence of characters).
582: The general format of a variable expansion is as follows:
583: .Pp
584: .Dl {variable[:modifier[:...]]}
585: .Pp
586: Each modifier begins with a colon and one of the following
587: special characters.
588: The colon may be escaped with a backslash
589: .Pq Ql \e .
1.61 ross 590: .Bl -tag -width EEE
1.1 cgd 591: .It Cm E
592: Replaces each word in the variable with its suffix.
593: .It Cm H
594: Replaces each word in the variable with everything but the last component.
595: .It Cm M Ns Ar pattern
1.72 uebayasi 596: Select only those words that match
597: .Ar pattern .
1.1 cgd 598: The standard shell wildcard characters
599: .Pf ( Ql * ,
1.80 wiz 600: .Ql \&? ,
1.1 cgd 601: and
602: .Ql Op )
603: may
604: be used.
605: The wildcard characters may be escaped with a backslash
606: .Pq Ql \e .
607: .It Cm N Ns Ar pattern
608: This is identical to
609: .Ql Cm M ,
610: but selects all words which do not match
1.72 uebayasi 611: .Ar pattern .
1.36 christos 612: .It Cm O
613: Order every word in variable alphabetically.
1.17 christos 614: .It Cm Q
615: Quotes every shell meta-character in the variable, so that it can be passed
616: safely through recursive invocations of
1.74 wiz 617: .Nm .
1.1 cgd 618: .It Cm R
619: Replaces each word in the variable with everything but its suffix.
1.60 pk 620: .It Cm tl
621: Converts variable to lower-case letters.
1.81 sjg 622: .It Cm ts Ar c
623: Words in the variable are normally separated by a space on expansion.
624: This modifier sets the separator to the character
625: .Ar c .
626: If
627: .Ar c
628: is omitted, then no separator is used.
1.82 wiz 629: .It Cm tu
630: Converts variable to upper-case letters.
1.1 cgd 631: .Sm off
1.17 christos 632: .It Cm S No \&/ Ar old_string Xo
633: .No \&/ Ar new_string
634: .No \&/ Op Cm 1g
1.1 cgd 635: .Xc
636: .Sm on
637: Modify the first occurrence of
1.17 christos 638: .Ar old_string
639: in the variable's value, replacing it with
640: .Ar new_string .
1.1 cgd 641: If a
642: .Ql g
643: is appended to the last slash of the pattern, all occurrences
644: in each word are replaced.
1.17 christos 645: If a
646: .Ql 1
647: is appended to the last slash of the pattern, only the first word
648: is affected.
1.1 cgd 649: If
1.17 christos 650: .Ar old_string
651: begins with a caret
1.1 cgd 652: .Pq Ql ^ ,
1.17 christos 653: .Ar old_string
1.1 cgd 654: is anchored at the beginning of each word.
655: If
1.17 christos 656: .Ar old_string
1.1 cgd 657: ends with a dollar sign
658: .Pq Ql \&$ ,
659: it is anchored at the end of each word.
660: Inside
661: .Ar new_string ,
662: an ampersand
1.62 ross 663: .Pq Ql \*[Am]
1.1 cgd 664: is replaced by
1.17 christos 665: .Ar old_string
666: (without any
667: .Ql ^
668: or
669: .Ql \&$ ) .
1.1 cgd 670: Any character may be used as a delimiter for the parts of the modifier
671: string.
672: The anchoring, ampersand and delimiter characters may be escaped with a
673: backslash
674: .Pq Ql \e .
675: .Pp
676: Variable expansion occurs in the normal fashion inside both
677: .Ar old_string
678: and
679: .Ar new_string
680: with the single exception that a backslash is used to prevent the expansion
681: of a dollar sign
1.17 christos 682: .Pq Ql \&$ ,
1.1 cgd 683: not a preceding dollar sign as is usual.
1.17 christos 684: .Sm off
685: .It Cm C No \&/ Ar pattern Xo
686: .No \&/ Ar replacement
687: .No \&/ Op Cm 1g
688: .Xc
689: .Sm on
690: The
691: .Cm C
692: modifier is just like the
693: .Cm S
1.37 msaitoh 694: modifier except that the old and new strings, instead of being
1.17 christos 695: simple strings, are a regular expression (see
696: .Xr regex 3 )
1.72 uebayasi 697: string
698: .Ar pattern
1.17 christos 699: and an
700: .Xr ed 1 Ns \-style
1.72 uebayasi 701: string
702: .Ar replacement .
703: Normally, the first occurrence of the pattern
704: .Ar pattern
705: in each word of the value is substituted with
706: .Ar replacement .
1.67 grant 707: The
1.17 christos 708: .Ql 1
709: modifier causes the substitution to apply to at most one word; the
710: .Ql g
711: modifier causes the substitution to apply to as many instances of the
1.72 uebayasi 712: search pattern
713: .Ar pattern
714: as occur in the word or words it is found in.
1.67 grant 715: Note that
1.17 christos 716: .Ql 1
717: and
718: .Ql g
719: are orthogonal; the former specifies whether multiple words are
720: potentially affected, the latter whether multiple substitutions can
721: potentially occur within each affected word.
1.1 cgd 722: .It Cm T
723: Replaces each word in the variable with its last component.
1.43 christos 724: .It Cm u
725: Remove adjacent duplicate words (like
1.57 wiz 726: .Xr uniq 1 ) .
1.80 wiz 727: .It Cm \&? Ar true_string Cm : Ar false_string
1.27 christos 728: If the variable evaluates to true, return as its value the
1.57 wiz 729: .Ar true_string ,
1.27 christos 730: otherwise return the
1.57 wiz 731: .Ar false_string .
1.1 cgd 732: .It Ar old_string=new_string
733: This is the
734: .At V
735: style variable substitution.
736: It must be the last modifier specified.
1.16 christos 737: If
1.6 cgd 738: .Ar old_string
739: or
740: .Ar new_string
741: do not contain the pattern matching character
742: .Ar %
1.16 christos 743: then it is assumed that they are
1.6 cgd 744: anchored at the end of each word, so only suffixes or entire
1.67 grant 745: words may be replaced.
746: Otherwise
1.6 cgd 747: .Ar %
1.16 christos 748: is the substring of
749: .Ar old_string
1.6 cgd 750: to be replaced in
1.64 wiz 751: .Ar new_string .
1.40 sjg 752: .It Cm @ Ar temp Cm @ Xo
1.80 wiz 753: .Ar string Cm @
1.40 sjg 754: .Xc
755: This is the loop expansion mechanism from the OSF Development
1.67 grant 756: Environment (ODE) make.
757: Unlike
1.48 wiz 758: .Cm \&.for
1.40 sjg 759: loops expansion occurs at the time of
1.67 grant 760: reference.
761: Assign
1.40 sjg 762: .Ar temp
763: to each word in the variable and evaluate
764: .Ar string .
1.48 wiz 765: The ODE convention is that
1.40 sjg 766: .Ar temp
1.67 grant 767: should start and end with a period.
768: For example.
1.40 sjg 769: .Dl ${LINKS:@.LINK.@${LN} ${TARGET} ${.LINK.}@}
770: .It Cm U Ar newval
771: If the variable is undefined
772: .Ar newval
1.63 lukem 773: is the value.
774: If the variable is defined, the existing value is returned.
1.67 grant 775: This is another ODE make feature.
776: It is handy for setting per-target CFLAGS for instance:
1.40 sjg 777: .Dl ${_${.TARGET:T}_CFLAGS:U${DEF_CFLAGS}}
1.63 lukem 778: If a value is only required if the variable is undefined, use:
779: .Dl ${VAR:D:Unewval}
1.40 sjg 780: .It Cm D Ar newval
781: If the variable is defined
782: .Ar newval
783: is the value.
784: .It Cm L
785: The name of the variable is the value.
786: .It Cm P
787: The path of the node which has the same name as the variable
1.67 grant 788: is the value.
789: If no such node exists or its path is null, then the
1.40 sjg 790: name of the variable is used.
1.80 wiz 791: .It Cm \&! Ar cmd Cm \&!
1.40 sjg 792: The output of running
793: .Ar cmd
794: is the value.
795: .It Cm sh
796: If the variable is non-empty it is run as a command and the output
797: becomes the new value.
1.42 sjg 798: .It Cm \&:= Ar str
1.48 wiz 799: The variable is assigned the value
1.41 sjg 800: .Ar str
1.67 grant 801: after substitution.
802: This modifier and its variations are useful in
1.48 wiz 803: obscure situations such as wanting to apply modifiers to
1.41 sjg 804: .Cm \&.for
1.48 wiz 805: loop iteration variables which won't work due to the way
1.41 sjg 806: .Cm \&.for
1.67 grant 807: loops are implemented.
808: These assignment modifiers always expand to
1.41 sjg 809: nothing, so if appearing in a rule line by themselves should be
1.48 wiz 810: preceded with something to keep
1.41 sjg 811: .Nm
1.67 grant 812: happy.
813: As in:
1.41 sjg 814: .Bd -literal
815: use_foo: \&.USE
816: \&.for i in ${\&.TARGET} ${\&.TARGET:R}\&.gz
1.42 sjg 817: @: ${t::=$i}
1.41 sjg 818: @echo t:R:T=${t:R:T}
819: \&.endfor
820:
821: .Ed
1.42 sjg 822: The double
823: .Cm \&:
824: helps avoid false matches with the
825: .At V
1.48 wiz 826: style
1.42 sjg 827: .Cm \&=
1.48 wiz 828: modifier and since substitution always occurs the
1.42 sjg 829: .Cm \&:=
830: form is vaguely appropriate.
831: .It Cm \&:?= Ar str
1.41 sjg 832: As for
1.42 sjg 833: .Cm \&:=
1.41 sjg 834: but only if the variable does not already have a value.
1.42 sjg 835: .It Cm \&:+= Ar str
1.48 wiz 836: Append
1.41 sjg 837: .Ar str
838: to the variable.
1.42 sjg 839: .It Cm \&:!= Ar cmd
1.48 wiz 840: Assign the output of
1.41 sjg 841: .Ar cmd
842: to the variable.
1.6 cgd 843: .El
844: .Sh INCLUDE STATEMENTS, CONDITIONALS AND FOR LOOPS
1.16 christos 845: Makefile inclusion, conditional structures and for loops reminiscent
1.6 cgd 846: of the C programming language are provided in
1.74 wiz 847: .Nm .
1.1 cgd 848: All such structures are identified by a line beginning with a single
849: dot
850: .Pq Ql \&.
851: character.
852: Files are included with either
1.29 ross 853: .Cm \&.include Aq Ar file
1.1 cgd 854: or
1.29 ross 855: .Cm \&.include Pf \*q Ar file Ns \*q .
1.1 cgd 856: Variables between the angle brackets or double quotes are expanded
857: to form the file name.
858: If angle brackets are used, the included makefile is expected to be in
859: the system makefile directory.
860: If double quotes are used, the including makefile's directory and any
861: directories specified using the
862: .Fl I
863: option are searched before the system
864: makefile directory.
1.28 christos 865: For compatibility with other versions of
866: .Nm
867: .Ql include file ...
1.67 grant 868: is also accepted.
869: If the include statement is written as
1.29 ross 870: .Cm .-include
871: or as
872: .Cm .sinclude
1.28 christos 873: then errors locating and/or opening include files are ignored.
1.1 cgd 874: .Pp
875: Conditional expressions are also preceded by a single dot as the first
1.5 jtc 876: character of a line.
1.1 cgd 877: The possible conditionals are as follows:
878: .Bl -tag -width Ds
879: .It Ic .undef Ar variable
880: Un-define the specified global variable.
881: Only global variables may be un-defined.
882: .It Xo
883: .Ic \&.if
884: .Oo \&! Oc Ns Ar expression
885: .Op Ar operator expression ...
886: .Xc
887: Test the value of an expression.
888: .It Xo
889: .Ic .ifdef
890: .Oo \&! Oc Ns Ar variable
891: .Op Ar operator variable ...
892: .Xc
1.7 mycroft 893: Test the value of a variable.
1.1 cgd 894: .It Xo
895: .Ic .ifndef
896: .Oo \&! Oc Ns Ar variable
897: .Op Ar operator variable ...
898: .Xc
1.7 mycroft 899: Test the value of a variable.
1.1 cgd 900: .It Xo
901: .Ic .ifmake
902: .Oo \&! Oc Ns Ar target
903: .Op Ar operator target ...
904: .Xc
1.7 mycroft 905: Test the target being built.
1.1 cgd 906: .It Xo
907: .Ic .ifnmake
1.80 wiz 908: .Oo \&! Ns Oc Ar target
1.1 cgd 909: .Op Ar operator target ...
910: .Xc
911: Test the target being built.
912: .It Ic .else
913: Reverse the sense of the last conditional.
914: .It Xo
915: .Ic .elif
1.80 wiz 916: .Oo \&! Ns Oc Ar expression
1.1 cgd 917: .Op Ar operator expression ...
918: .Xc
919: A combination of
920: .Ql Ic .else
921: followed by
922: .Ql Ic .if .
923: .It Xo
924: .Ic .elifdef
925: .Oo \&! Oc Ns Ar variable
926: .Op Ar operator variable ...
927: .Xc
928: A combination of
929: .Ql Ic .else
930: followed by
931: .Ql Ic .ifdef .
932: .It Xo
933: .Ic .elifndef
934: .Oo \&! Oc Ns Ar variable
935: .Op Ar operator variable ...
936: .Xc
937: A combination of
938: .Ql Ic .else
939: followed by
940: .Ql Ic .ifndef .
941: .It Xo
942: .Ic .elifmake
943: .Oo \&! Oc Ns Ar target
944: .Op Ar operator target ...
945: .Xc
946: A combination of
947: .Ql Ic .else
948: followed by
949: .Ql Ic .ifmake .
950: .It Xo
951: .Ic .elifnmake
952: .Oo \&! Oc Ns Ar target
953: .Op Ar operator target ...
954: .Xc
955: A combination of
956: .Ql Ic .else
957: followed by
958: .Ql Ic .ifnmake .
959: .It Ic .endif
960: End the body of the conditional.
961: .El
962: .Pp
963: The
964: .Ar operator
965: may be any one of the following:
966: .Bl -tag -width "Cm XX"
967: .It Cm \&|\&|
1.64 wiz 968: Logical OR.
1.62 ross 969: .It Cm \&\*[Am]\*[Am]
1.1 cgd 970: Logical
971: .Tn AND ;
972: of higher precedence than
1.26 hubertf 973: .Dq \&|\&| .
1.1 cgd 974: .El
975: .Pp
976: As in C,
1.25 lukem 977: .Nm
1.1 cgd 978: will only evaluate a conditional as far as is necessary to determine
979: its value.
1.16 christos 980: Parentheses may be used to change the order of evaluation.
1.1 cgd 981: The boolean operator
982: .Ql Ic \&!
983: may be used to logically negate an entire
984: conditional.
1.5 jtc 985: It is of higher precedence than
1.62 ross 986: .Ql Ic \&\*[Am]\*[Am] .
1.1 cgd 987: .Pp
988: The value of
989: .Ar expression
990: may be any of the following:
1.61 ross 991: .Bl -tag -width defined
1.1 cgd 992: .It Ic defined
993: Takes a variable name as an argument and evaluates to true if the variable
994: has been defined.
995: .It Ic make
996: Takes a target name as an argument and evaluates to true if the target
997: was specified as part of
1.74 wiz 998: .Nm Ns 's
1.1 cgd 999: command line or was declared the default target (either implicitly or
1000: explicitly, see
1001: .Va .MAIN )
1002: before the line containing the conditional.
1003: .It Ic empty
1.5 jtc 1004: Takes a variable, with possible modifiers, and evaluates to true if
1.1 cgd 1005: the expansion of the variable would result in an empty string.
1006: .It Ic exists
1007: Takes a file name as an argument and evaluates to true if the file exists.
1008: The file is searched for on the system search path (see
1009: .Va .PATH ) .
1010: .It Ic target
1011: Takes a target name as an argument and evaluates to true if the target
1012: has been defined.
1.47 christos 1013: .It Ic commands
1014: Takes a target name as an argument and evaluates to true if the target
1015: has been defined and has commands associated with it.
1.1 cgd 1016: .El
1017: .Pp
1018: .Ar Expression
1.67 grant 1019: may also be an arithmetic or string comparison.
1020: Variable expansion is
1.6 cgd 1021: performed on both sides of the comparison, after which the integral
1.67 grant 1022: values are compared.
1023: A value is interpreted as hexadecimal if it is
1.6 cgd 1024: preceded by 0x, otherwise it is decimal; octal numbers are not supported.
1.67 grant 1025: The standard C relational operators are all supported.
1026: If after
1.6 cgd 1027: variable expansion, either the left or right hand side of a
1.1 cgd 1028: .Ql Ic ==
1029: or
1030: .Ql Ic "!="
1.6 cgd 1031: operator is not an integral value, then
1032: string comparison is performed between the expanded
1033: variables.
1.1 cgd 1034: If no relational operator is given, it is assumed that the expanded
1035: variable is being compared against 0.
1036: .Pp
1037: When
1.25 lukem 1038: .Nm
1.1 cgd 1039: is evaluating one of these conditional expression, and it encounters
1040: a word it doesn't recognize, either the ``make'' or ``defined''
1041: expression is applied to it, depending on the form of the conditional.
1042: If the form is
1043: .Ql Ic .ifdef
1044: or
1045: .Ql Ic .ifndef ,
1046: the ``defined'' expression
1047: is applied.
1048: Similarly, if the form is
1049: .Ql Ic .ifmake
1050: or
1051: .Ql Ic .ifnmake , the ``make''
1052: expression is applied.
1053: .Pp
1054: If the conditional evaluates to true the parsing of the makefile continues
1055: as before.
1056: If it evaluates to false, the following lines are skipped.
1057: In both cases this continues until a
1058: .Ql Ic .else
1059: or
1060: .Ql Ic .endif
1061: is found.
1.16 christos 1062: .Pp
1.6 cgd 1063: For loops are typically used to apply a set of rules to a list of files.
1064: The syntax of a for loop is:
1.59 bgrayson 1065: .Pp
1066: .Bl -tag -compact -width Ds
1.6 cgd 1067: .It Xo
1068: .Ic \&.for
1.48 wiz 1069: .Ar variable
1.39 christos 1070: .Op Ar variable ...
1.16 christos 1071: .Ic in
1.6 cgd 1072: .Ar expression
1073: .Xc
1.80 wiz 1074: .It Aq make-rules
1075: .It Ic \&.endfor
1.6 cgd 1076: .El
1.59 bgrayson 1077: .Pp
1.6 cgd 1078: After the for
1.16 christos 1079: .Ic expression
1.67 grant 1080: is evaluated, it is split into words.
1081: On each iteration of the loop, one word is taken and assigned to each
1.39 christos 1082: .Ic variable ,
1083: in order, and these
1084: .Ic variables
1085: are substituted into the
1.16 christos 1086: .Ic make-rules
1.6 cgd 1087: inside the body of the for loop.
1.39 christos 1088: The number of words must come out even; that is, if there are three
1089: iteration variables, the number of words provided must be a multiple
1090: of three.
1.1 cgd 1091: .Sh COMMENTS
1092: Comments begin with a hash
1093: .Pq Ql \&#
1094: character, anywhere but in a shell
1095: command line, and continue to the end of the line.
1096: .Sh SPECIAL SOURCES
1.61 ross 1097: .Bl -tag -width .IGNOREx
1.1 cgd 1098: .It Ic .IGNORE
1099: Ignore any errors from the commands associated with this target, exactly
1100: as if they all were preceded by a dash
1101: .Pq Ql \- .
1.18 christos 1102: .It Ic .MADE
1.48 wiz 1103: Mark all sources of this target as being up-to-date.
1.1 cgd 1104: .It Ic .MAKE
1105: Execute the commands associated with this target even if the
1106: .Fl n
1107: or
1108: .Fl t
1109: options were specified.
1110: Normally used to mark recursive
1.74 wiz 1111: .Nm Ns 's .
1.1 cgd 1112: .It Ic .NOTMAIN
1113: Normally
1.25 lukem 1114: .Nm
1.1 cgd 1115: selects the first target it encounters as the default target to be built
1116: if no target was specified.
1117: This source prevents this target from being selected.
1118: .It Ic .OPTIONAL
1119: If a target is marked with this attribute and
1.25 lukem 1120: .Nm
1.1 cgd 1121: can't figure out how to create it, it will ignore this fact and assume
1122: the file isn't needed or already exists.
1123: .It Ic .PRECIOUS
1124: When
1.25 lukem 1125: .Nm
1.1 cgd 1126: is interrupted, it removes any partially made targets.
1127: This source prevents the target from being removed.
1128: .It Ic .SILENT
1129: Do not echo any of the commands associated with this target, exactly
1130: as if they all were preceded by an at sign
1131: .Pq Ql @ .
1132: .It Ic .USE
1133: Turn the target into
1.74 wiz 1134: .Nm Ns 's
1.1 cgd 1135: version of a macro.
1136: When the target is used as a source for another target, the other target
1137: acquires the commands, sources, and attributes (except for
1138: .Ic .USE )
1139: of the
1140: source.
1141: If the target already has commands, the
1142: .Ic .USE
1143: target's commands are appended
1144: to them.
1.52 christos 1145: .It Ic .USEBEFORE
1146: Exactly like
1147: .Ic .USE ,
1.57 wiz 1148: but prepend the
1.52 christos 1149: .Ic .USEBEFORE
1150: target commands to the target.
1.12 christos 1151: .It Ic .WAIT
1.71 mjl 1152: If
1.12 christos 1153: .Ic .WAIT
1.71 mjl 1154: appears in a dependency line, the sources that precede it are
1.67 grant 1155: made before the sources that succeed it in the line.
1.71 mjl 1156: Loops are not
1.12 christos 1157: detected and targets that form loops will be silently ignored.
1.1 cgd 1158: .El
1.57 wiz 1159: .Sh SPECIAL TARGETS
1.1 cgd 1160: Special targets may not be included with other targets, i.e. they must be
1161: the only target specified.
1.61 ross 1162: .Bl -tag -width .BEGINx
1.1 cgd 1163: .It Ic .BEGIN
1164: Any command lines attached to this target are executed before anything
1165: else is done.
1166: .It Ic .DEFAULT
1167: This is sort of a
1168: .Ic .USE
1169: rule for any target (that was used only as a
1170: source) that
1.25 lukem 1171: .Nm
1.1 cgd 1172: can't figure out any other way to create.
1173: Only the shell script is used.
1174: The
1175: .Ic .IMPSRC
1176: variable of a target that inherits
1177: .Ic .DEFAULT Ns 's
1178: commands is set
1179: to the target's own name.
1180: .It Ic .END
1181: Any command lines attached to this target are executed after everything
1182: else is done.
1183: .It Ic .IGNORE
1184: Mark each of the sources with the
1185: .Ic .IGNORE
1186: attribute.
1187: If no sources are specified, this is the equivalent of specifying the
1188: .Fl i
1189: option.
1190: .It Ic .INTERRUPT
1191: If
1.25 lukem 1192: .Nm
1.1 cgd 1193: is interrupted, the commands for this target will be executed.
1194: .It Ic .MAIN
1195: If no target is specified when
1.25 lukem 1196: .Nm
1.1 cgd 1197: is invoked, this target will be built.
1198: .It Ic .MAKEFLAGS
1199: This target provides a way to specify flags for
1.25 lukem 1200: .Nm
1.1 cgd 1201: when the makefile is used.
1202: The flags are as if typed to the shell, though the
1203: .Fl f
1204: option will have
1205: no effect.
1.12 christos 1206: .\" XXX: NOT YET!!!!
1207: .\" .It Ic .NOTPARALLEL
1.70 wiz 1208: .\" The named targets are executed in non parallel mode.
1209: .\" If no targets are
1.12 christos 1210: .\" specified, then all targets are executed in non parallel mode.
1.20 gwr 1211: .It Ic .NOPATH
1212: Apply the
1213: .Ic .NOPATH
1.67 grant 1214: attribute to any specified sources.
1215: Targets with this attribute are not
1.21 mycroft 1216: searched for in the directories specified by
1217: .Ic .PATH .
1.12 christos 1218: .It Ic .NOTPARALLEL
1219: Disable parallel mode.
1220: .It Ic .NO_PARALLEL
1221: Same as above, for compatibility with other pmake variants.
1222: .It Ic .ORDER
1223: The named targets are made in sequence.
1224: .\" XXX: NOT YET!!!!
1225: .\" .It Ic .PARALLEL
1.70 wiz 1226: .\" The named targets are executed in parallel mode.
1227: .\" If no targets are
1.12 christos 1228: .\" specified, then all targets are executed in parallel mode.
1.1 cgd 1229: .It Ic .PATH
1230: The sources are directories which are to be searched for files not
1231: found in the current directory.
1232: If no sources are specified, any previously specified directories are
1233: deleted.
1.34 thorpej 1234: If the source is the special
1235: .Ic .DOTLAST
1236: target, then the current working
1.33 thorpej 1237: directory is searched last.
1.14 christos 1238: .It Ic .PHONY
1239: Apply the
1240: .Ic .PHONY
1.67 grant 1241: attribute to any specified sources.
1242: Targets with this attribute do not
1.19 mycroft 1243: correspond to actual files; they are always considered to be out of date,
1244: and will not be created with the
1245: .Fl t
1246: option.
1.1 cgd 1247: .It Ic .PRECIOUS
1248: Apply the
1249: .Ic .PRECIOUS
1250: attribute to any specified sources.
1251: If no sources are specified, the
1252: .Ic .PRECIOUS
1253: attribute is applied to every
1254: target in the file.
1.83 sjg 1255: .It Ic .SHELL
1256: Sets the shell that
1257: .Nm
1258: will use to execute commands.
1259: The sources are a set of
1260: .Ar field=value
1261: pairs.
1262: .Bl -tag -width hasErrCtls
1263: .It Ar name
1264: This is the minimal specification, used to select one of the builtin
1265: shell specs;
1266: .Ar sh ,
1267: .Ar ksh ,
1268: and
1269: .Ar csh .
1270: .It Ar path
1271: Specifies the path to the shell.
1272: .It Ar hasErrCtl
1273: Indicates whether the shell supports exit on error.
1274: .It Ar check
1275: The command to turn on error checking.
1276: .It Ar ignore
1277: The command to disable error checking.
1278: .It Ar echo
1279: The command to turn on echoing of commands executed.
1280: .It Ar quiet
1281: The command to turn off echoing of commands executed.
1282: .It Ar filter
1283: The output to filter after issuing the
1284: .Ar quiet
1285: command. It is typically identical to
1286: .Ar quiet .
1287: .It Ar errFlag
1288: The flag to pass the shell to enable error checking.
1289: .It Ar echoFlag
1290: The flag to pass the shell to enable command echoing.
1291: .El
1292: Example:
1293: .Bd -literal
1294: \&.SHELL: name=ksh path=/bin/ksh hasErrCtl=true \\
1295: check="set -e" ignore="set +e" \\
1296: echo="set -v" quiet="set +v" filter="set +v" \\
1297: echoFlag=v errFlag=e
1298: .Ed
1.1 cgd 1299: .It Ic .SILENT
1300: Apply the
1301: .Ic .SILENT
1302: attribute to any specified sources.
1303: If no sources are specified, the
1304: .Ic .SILENT
1305: attribute is applied to every
1306: command in the file.
1307: .It Ic .SUFFIXES
1308: Each source specifies a suffix to
1.74 wiz 1309: .Nm .
1.71 mjl 1310: If no sources are specified, any previously specified suffixes are deleted.
1.31 ross 1311: .El
1.1 cgd 1312: .Sh ENVIRONMENT
1.25 lukem 1313: .Nm
1.73 perry 1314: uses the following environment variables, if they exist:
1.16 christos 1315: .Ev MACHINE ,
1.26 hubertf 1316: .Ev MACHINE_ARCH ,
1.1 cgd 1317: .Ev MAKE ,
1.16 christos 1318: .Ev MAKEFLAGS ,
1319: .Ev MAKEOBJDIR ,
1.38 sjg 1320: .Ev MAKEOBJDIRPREFIX ,
1.76 jrf 1321: .Ev MAKESYSPATH ,
1.1 cgd 1322: and
1.16 christos 1323: .Ev PWD .
1.57 wiz 1324: .Pp
1.38 sjg 1325: If
1326: .Ev MAKEOBJDIRPREFIX
1327: is set, then
1328: .Nm
1.48 wiz 1329: will
1.38 sjg 1330: .Xr chdir 2
1331: to ${MAKEOBJDIRPREFIX}${.CURDIR} if it exists.
1332: Otherwise if
1333: .Ev MAKEOBJDIR
1334: and the named directory exists
1335: .Nm
1.48 wiz 1336: will
1.38 sjg 1337: .Xr chdir 2
1338: to it.
1.48 wiz 1339: These actions are taken before any makefiles are read which is why they
1.38 sjg 1340: need to be set in the environment.
1.1 cgd 1341: .Sh FILES
1342: .Bl -tag -width /usr/share/mk -compact
1343: .It .depend
1344: list of dependencies
1345: .It Makefile
1346: list of dependencies
1347: .It makefile
1348: list of dependencies
1349: .It sys.mk
1350: system makefile
1351: .It /usr/share/mk
1352: system makefile directory
1353: .El
1354: .Sh SEE ALSO
1355: .Xr mkdep 1
1356: .Sh HISTORY
1357: A
1.25 lukem 1358: .Nm
1.1 cgd 1359: command appeared in
1360: .At v7 .
CVSweb <webmaster@jp.NetBSD.org>