Annotation of src/usr.bin/make/make.1, Revision 1.5
1.1 cgd 1: .\" Copyright (c) 1990 The Regents of the University of California.
2: .\" All rights reserved.
3: .\"
4: .\" Redistribution and use in source and binary forms, with or without
5: .\" modification, are permitted provided that the following conditions
6: .\" are met:
7: .\" 1. Redistributions of source code must retain the above copyright
8: .\" notice, this list of conditions and the following disclaimer.
9: .\" 2. Redistributions in binary form must reproduce the above copyright
10: .\" notice, this list of conditions and the following disclaimer in the
11: .\" documentation and/or other materials provided with the distribution.
12: .\" 3. All advertising materials mentioning features or use of this software
13: .\" must display the following acknowledgement:
14: .\" This product includes software developed by the University of
15: .\" California, Berkeley and its contributors.
16: .\" 4. Neither the name of the University nor the names of its contributors
17: .\" may be used to endorse or promote products derived from this software
18: .\" without specific prior written permission.
19: .\"
20: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30: .\" SUCH DAMAGE.
31: .\"
1.3 mycroft 32: .\" from: @(#)make.1 5.7 (Berkeley) 7/24/91
1.5 ! jtc 33: .\" $Id: make.1,v 1.4 1993/12/22 00:25:59 pk Exp $
1.1 cgd 34: .\"
35: .Dd July 24, 1991
36: .Dt MAKE 1
37: .Os
38: .Sh NAME
39: .Nm make
40: .Nd maintain program dependencies
41: .Sh SYNOPSIS
42: .Nm make
43: .Op Fl eiknqrstv
44: .Op Fl D Ar variable
45: .Op Fl d Ar flags
46: .Op Fl f Ar makefile
47: .Op Fl I Ar directory
48: .Bk -words
49: .Op Fl j Ar max_jobs
50: .Ek
51: .Op Ar variable=value
52: .Op Ar target ...
53: .Sh DESCRIPTION
54: .Nm Make
55: is a program designed to simplify the maintenance of other programs.
56: Its input is a list of specifications as to the files upon which programs
57: and other files depend.
58: If the file
59: .Ql Pa makefile
60: exists, it is read for this list of specifications.
61: If it does not exist, the file
62: .Ql Pa Makefile
63: is read.
64: If the file
65: .Ql Pa .depend
66: exists, it is read (see
67: .Xr mkdep 1) .
68: .Pp
69: This manual page is intended as a reference document only.
70: For a more thorough description of
71: .Nm make
72: and makefiles, please refer to
73: .%T "Make \- A Tutorial" .
74: .Pp
75: The options are as follows:
76: .Bl -tag -width Ds
77: .It Fl D Ar variable
1.2 mycroft 78: Define
79: .Ar variable
1.1 cgd 80: to be 1, in the global context.
81: .It Fl d Ar flags
82: Turn on debugging, and specify which portions of
83: .Nm make
84: are to print debugging information.
85: .Ar Flags
86: is one or more of the following:
87: .Bl -tag -width Ds
88: .It Ar A
89: Print all possible debugging information;
90: equivalent to specifying all of the debugging flags.
91: .It Ar a
92: Print debugging information about archive searching and caching.
93: .It Ar c
94: Print debugging information about conditional evaluation.
95: .It Ar d
96: Print debugging information about directory searching and caching.
97: .It Ar "g1"
98: Print the input graph before making anything.
99: .It Ar "g2"
100: Print the input graph after making everything, or before exiting
101: on error.
102: .It Ar j
103: Print debugging information about running multiple shells.
104: .It Ar m
105: Print debugging information about making targets, including modification
106: dates.
107: .It Ar s
108: Print debugging information about suffix-transformation rules.
109: .It Ar t
110: Print debugging information about target list maintenance.
111: .It Ar v
112: Print debugging information about variable assignment.
113: .El
114: .It Fl e
115: Specify that environmental variables override macro assignments within
116: makefiles.
117: .It Fl f Ar makefile
118: Specify a makefile to read instead of the default
119: .Ql Pa makefile
120: and
121: .Ql Pa Makefile .
122: If
123: .Ar makefile
124: is
125: .Ql Fl ,
126: standard input is read.
127: Multiple makefile's may be specified, and are read in the order specified.
128: .It Fl I Ar directory
129: Specify a directory in which to search for makefiles and included makefiles.
130: The system makefile directory is automatically included as part of this
131: list.
132: .It Fl i
133: Ignore non-zero exit of shell commands in the makefile.
134: Equivalent to specifying
135: .Ql Fl
136: before each command line in the makefile.
137: .It Fl j Ar max_jobs
138: Specify the maximum number of jobs that
139: .Nm make
140: may have running at any one time.
141: .It Fl k
142: Continue processing after errors are encountered, but only on those targets
143: that do not depend on the target whose creation caused the error.
144: .It Fl n
145: Display the commands that would have been executed, but do not actually
146: execute them.
147: .It Fl q
148: Do not execute any commands, but exit 0 if the specified targets are
149: up-to-date and 1, otherwise.
150: .It Fl r
151: Do not use the built-in rules specified in the system makefile.
152: .It Fl s
153: Do not echo any commands as they are executed.
154: Equivalent to specifying
155: .Ql Ic @
156: before each command line in the makefile.
157: .It Fl t
158: Rather than re-building a target as specified in the makefile, create it
159: or update its modification time to make it appear up-to-date.
160: .It Ar variable=value
161: Set the value of the variable
162: .Ar variable
163: to
164: .Ar value .
165: .El
166: .Pp
167: There are six different types of lines in a makefile: file dependency
168: specifications, shell commands, variable assignments, include statements,
169: conditional directives, and comments.
170: .Pp
171: In general, lines may be continued from one line to the next by ending
172: them with a backslash
173: .Pq Ql \e .
174: The trailing newline character and initial whitespace on the following
175: line are compressed into a single space.
176: .Sh FILE DEPENDENCY SPECIFICATIONS
177: Dependency lines consist of one or more targets, an operator, and zero
178: or more sources.
179: This creates a relationship where the targets ``depend'' on the sources
180: and are usually created from them.
181: The exact relationship between the target and the source is determined
182: by the operator that separates them.
183: The three operators are as follows:
184: .Bl -tag -width flag
185: .It Ic \&:
186: A target is considered out-of-date if its modification time is less than
187: those of any of its sources.
188: Sources for a target accumulate over dependency lines when this operator
189: is used.
190: The target is removed if
191: .Nm make
192: is interrupted.
193: .It Ic \&!
194: Targets are always re-created, but not until all sources have been
195: examined and re-created as necessary.
196: Sources for a target accumulate over dependency lines when this operator
197: is used.
198: The target is removed if
199: .Nm make
200: is interrupted.
201: .It Ic \&::
202: If no sources are specified, the target is always re-created.
203: Otherwise, a target is considered out-of-date if any of its sources has
204: been modified more recently than the target.
205: Sources for a target do not accumulate over dependency lines when this
206: operator is used.
207: The target will not be removed if
208: .Nm make
209: is interrupted.
210: .El
211: .Pp
212: Targets and sources may contain the shell wildcard values
213: .Ql ? ,
214: .Ql * ,
215: .Ql []
216: and
217: .Ql {} .
218: The values
219: .Ql ? ,
220: .Ql *
221: and
222: .Ql []
223: may only be used as part of the final
224: component of the target or source, and must be used to describe existing
225: files.
226: The value
227: .Ql {}
228: need not necessarily be used to describe existing files.
229: Expansion is in directory order, not alphabetically as done in the shell.
230: .Sh SHELL COMMANDS
231: Each target may have associated with it a series of shell commands, normally
232: used to create the target.
233: Each of the commands in this script
234: .Em must
235: be preceded by a tab.
236: While any target may appear on a dependency line, only one of these
237: dependencies may be followed by a creation script, unless the
238: .Ql Ic ::
239: operator is used.
240: .Pp
241: If the first or first two characters of the command line are
242: .Ql Ic @
243: and/or
244: .Ql Ic \- ,
245: the command is treated specially.
246: A
247: .Ql Ic @
248: causes the command not to be echoed before it is executed.
249: A
250: .Ql Ic \-
251: causes any non-zero exit status of the command line to be ignored.
252: .Sh VARIABLE ASSIGNMENTS
253: Variables in make are much like variables in the shell, and, by tradition,
254: consist of all upper-case letters.
255: The five operators that can be used to assign values to variables are as
256: follows:
257: .Bl -tag -width Ds
258: .It Ic \&=
259: Assign the value to the variable.
260: Any previous value is overridden.
261: .It Ic \&+=
262: Append the value to the current value of the variable.
263: .It Ic \&?=
264: Assign the value to the variable if it is not already defined.
265: .It Ic \&:=
266: Assign with expansion, i.e. expand the value before assigning it
267: to the variable.
268: Normally, expansion is not done until the variable is referenced.
269: .It Ic \&!=
270: Expand the value and pass it to the shell for execution and assign
271: the result to the variable.
272: Any newlines in the result are replaced with spaces.
273: .El
274: .Pp
275: Any white-space before the assigned
276: .Ar value
277: is removed; if the value is being appended, a single space is inserted
278: between the previous contents of the variable and the appended value.
279: .Pp
280: Variables are expanded by surrounding the variable name with either
281: curly braces
282: .Pq Ql {}
283: or parenthesis
284: .Pq Ql ()
285: and preceding it with
286: a dollar sign
287: .Pq Ql \&$ .
288: If the variable name contains only a single letter, the surrounding
289: braces or parenthesis are not required.
290: This shorter form is not recommended.
291: .Pp
292: Variable substitution occurs at two distinct times, depending on where
293: the variable is being used.
294: Variables in dependency lines are expanded as the line is read.
295: Variables in shell commands are expanded when the shell command is
296: executed.
297: .Pp
298: The four different classes of variables (in order of increasing precedence)
299: are:
300: .Bl -tag -width Ds
301: .It Environment variables
302: Variables defined as part of
303: .Nm make Ns 's
304: environment.
305: .It Global variables
306: Variables defined in the makefile or in included makefiles.
307: .It Command line variables
308: Variables defined as part of the command line.
309: .It Local variables
310: Variables that are defined specific to a certain target.
311: The seven local variables are as follows:
312: .Bl -tag -width ".ARCHIVE"
313: .It Va .ALLSRC
314: The list of all sources for this target; also known as
315: .Ql Va \&> .
316: .It Va .ARCHIVE
317: The name of the archive file.
318: .It Va .IMPSRC
319: The name/path of the source from which the target is to be transformed
320: (the ``implied'' source); also known as
321: .Ql Va \&< .
322: .It Va .MEMBER
323: The name of the archive member.
324: .It Va .OODATE
325: The list of sources for this target that were deemed out-of-date; also
326: known as
327: .Ql Va \&? .
328: .It Va .PREFIX
329: The file prefix of the file, containing only the file portion, no suffix
330: or preceding directory components; also known as
331: .Ql Va * .
332: .It Va .TARGET
333: The name of the target; also known as
334: .Ql Va @ .
335: .El
336: .Pp
337: The shorter forms
338: .Ql Va @ ,
339: .Ql Va ? ,
340: .Ql Va \&>
341: and
342: .Ql Va *
343: are permitted for backward
344: compatibility with historical makefiles and are not recommended.
345: The six variables
346: .Ql Va "@F" ,
347: .Ql Va "@D" ,
348: .Ql Va "<F" ,
349: .Ql Va "<D" ,
350: .Ql Va "*F"
351: and
352: .Ql Va "*D"
353: are
354: permitted for compatibility with
355: .At V
356: makefiles and are not recommended.
357: .Pp
358: Four of the local variables may be used in sources on dependency lines
359: because they expand to the proper value for each target on the line.
360: These variables are
361: .Ql Va .TARGET ,
362: .Ql Va .PREFIX ,
363: .Ql Va .ARCHIVE ,
364: and
365: .Ql Va .MEMBER .
366: .Pp
367: In addition,
368: .Nm make
369: sets or knows about the following variables:
370: .Bl -tag -width MAKEFLAGS
371: .It Va \&$
372: A single dollar sign
373: .Ql \&$ ,
374: i.e.
375: .Ql \&$$
376: expands to a single dollar
377: sign.
378: .It Va .MAKE
379: The name that
380: .Nm make
381: was executed with
382: .Pq Va argv Op 0
383: .It Va .CURDIR
384: A path to the directory where
385: .Nm make
386: was executed.
1.4 pk 387: .It Va .OBJDIR
388: A path to the directory where the targets are built.
1.1 cgd 389: .It Ev MAKEFLAGS
390: The environment variable
391: .Ql Ev MAKEFLAGS
392: may contain anything that
393: may be specified on
394: .Nm make Ns 's
395: command line.
396: Anything specified on
397: .Nm make Ns 's
398: command line is appended to the
399: .Ql Ev MAKEFLAGS
400: variable which is then
401: entered into the environment for all programs which
402: .Nm make
403: executes.
404: .El
405: .Pp
406: Variable expansion may be modified to select or modify each word of the
407: variable (where a ``word'' is white-space delimited sequence of characters).
408: The general format of a variable expansion is as follows:
409: .Pp
410: .Dl {variable[:modifier[:...]]}
411: .Pp
412: Each modifier begins with a colon and one of the following
413: special characters.
414: The colon may be escaped with a backslash
415: .Pq Ql \e .
416: .Bl -tag -width Cm E\&
417: .It Cm E
418: Replaces each word in the variable with its suffix.
419: .It Cm H
420: Replaces each word in the variable with everything but the last component.
421: .It Cm M Ns Ar pattern
422: Select only those words that match the rest of the modifier.
423: The standard shell wildcard characters
424: .Pf ( Ql * ,
425: .Ql ? ,
426: and
427: .Ql Op )
428: may
429: be used.
430: The wildcard characters may be escaped with a backslash
431: .Pq Ql \e .
432: .It Cm N Ns Ar pattern
433: This is identical to
434: .Ql Cm M ,
435: but selects all words which do not match
436: the rest of the modifier.
437: .It Cm R
438: Replaces each word in the variable with everything but its suffix.
439: .Sm off
440: .It Cm S No \&/ Ar old_pattern Xo
441: .No \&/ Ar new_pattern
442: .No \&/ Op Cm g
443: .Xc
444: .Sm on
445: Modify the first occurrence of
446: .Ar old_pattern
447: in each word to be replaced with
448: .Ar new_pattern .
449: If a
450: .Ql g
451: is appended to the last slash of the pattern, all occurrences
452: in each word are replaced.
453: If
454: .Ar old_pattern
455: begins with a carat
456: .Pq Ql ^ ,
457: .Ar old_pattern
458: is anchored at the beginning of each word.
459: If
460: .Ar old_pattern
461: ends with a dollar sign
462: .Pq Ql \&$ ,
463: it is anchored at the end of each word.
464: Inside
465: .Ar new_string ,
466: an ampersand
467: .Pq Ql &
468: is replaced by
469: .Ar old_pattern .
470: Any character may be used as a delimiter for the parts of the modifier
471: string.
472: The anchoring, ampersand and delimiter characters may be escaped with a
473: backslash
474: .Pq Ql \e .
475: .Pp
476: Variable expansion occurs in the normal fashion inside both
477: .Ar old_string
478: and
479: .Ar new_string
480: with the single exception that a backslash is used to prevent the expansion
481: of a dollar sign
482: .Pq Ql \&$
483: not a preceding dollar sign as is usual.
484: .It Cm T
485: Replaces each word in the variable with its last component.
486: .It Ar old_string=new_string
487: This is the
488: .At V
489: style variable substitution.
490: It must be the last modifier specified.
491: .Ar Old_string
492: is anchored at the end of each word, so only suffixes or entire
493: words may be replaced.
494: .El
495: .Sh INCLUDE STATEMENTS AND CONDITIONALS
496: Makefile inclusion and conditional structures reminiscent of the C
497: programming language are provided in
498: .Nm make .
499: All such structures are identified by a line beginning with a single
500: dot
501: .Pq Ql \&.
502: character.
503: Files are included with either
504: .Ql .include <file>
505: or
506: .Ql .include \*qfile\*q .
507: Variables between the angle brackets or double quotes are expanded
508: to form the file name.
509: If angle brackets are used, the included makefile is expected to be in
510: the system makefile directory.
511: If double quotes are used, the including makefile's directory and any
512: directories specified using the
513: .Fl I
514: option are searched before the system
515: makefile directory.
516: .Pp
517: Conditional expressions are also preceded by a single dot as the first
1.5 ! jtc 518: character of a line.
1.1 cgd 519: The possible conditionals are as follows:
520: .Bl -tag -width Ds
521: .It Ic .undef Ar variable
522: Un-define the specified global variable.
523: Only global variables may be un-defined.
524: .It Xo
525: .Ic \&.if
526: .Oo \&! Oc Ns Ar expression
527: .Op Ar operator expression ...
528: .Xc
529: Test the value of an expression.
530: .It Xo
531: .Ic .ifdef
532: .Oo \&! Oc Ns Ar variable
533: .Op Ar operator variable ...
534: .Xc
535: Test the value of an variable.
536: .It Xo
537: .Ic .ifndef
538: .Oo \&! Oc Ns Ar variable
539: .Op Ar operator variable ...
540: .Xc
541: Test the value of an variable.
542: .It Xo
543: .Ic .ifmake
544: .Oo \&! Oc Ns Ar target
545: .Op Ar operator target ...
546: .Xc
547: Test the the target being built.
548: .It Xo
549: .Ic .ifnmake
550: .Oo \&! Oc Ar target
551: .Op Ar operator target ...
552: .Xc
553: Test the target being built.
554: .It Ic .else
555: Reverse the sense of the last conditional.
556: .It Xo
557: .Ic .elif
558: .Oo \&! Oc Ar expression
559: .Op Ar operator expression ...
560: .Xc
561: A combination of
562: .Ql Ic .else
563: followed by
564: .Ql Ic .if .
565: .It Xo
566: .Ic .elifdef
567: .Oo \&! Oc Ns Ar variable
568: .Op Ar operator variable ...
569: .Xc
570: A combination of
571: .Ql Ic .else
572: followed by
573: .Ql Ic .ifdef .
574: .It Xo
575: .Ic .elifndef
576: .Oo \&! Oc Ns Ar variable
577: .Op Ar operator variable ...
578: .Xc
579: A combination of
580: .Ql Ic .else
581: followed by
582: .Ql Ic .ifndef .
583: .It Xo
584: .Ic .elifmake
585: .Oo \&! Oc Ns Ar target
586: .Op Ar operator target ...
587: .Xc
588: A combination of
589: .Ql Ic .else
590: followed by
591: .Ql Ic .ifmake .
592: .It Xo
593: .Ic .elifnmake
594: .Oo \&! Oc Ns Ar target
595: .Op Ar operator target ...
596: .Xc
597: A combination of
598: .Ql Ic .else
599: followed by
600: .Ql Ic .ifnmake .
601: .It Ic .endif
602: End the body of the conditional.
603: .El
604: .Pp
605: The
606: .Ar operator
607: may be any one of the following:
608: .Bl -tag -width "Cm XX"
609: .It Cm \&|\&|
610: logical OR
611: .It Cm \&&&
612: Logical
613: .Tn AND ;
614: of higher precedence than
615: .Dq .
616: .El
617: .Pp
618: As in C,
619: .Nm make
620: will only evaluate a conditional as far as is necessary to determine
621: its value.
622: Parenthesis may be used to change the order of evaluation.
623: The boolean operator
624: .Ql Ic \&!
625: may be used to logically negate an entire
626: conditional.
1.5 ! jtc 627: It is of higher precedence than
1.1 cgd 628: .Ql Ic \&&& .
629: .Pp
630: The value of
631: .Ar expression
632: may be any of the following:
633: .Bl -tag -width Ic defined
634: .It Ic defined
635: Takes a variable name as an argument and evaluates to true if the variable
636: has been defined.
637: .It Ic make
638: Takes a target name as an argument and evaluates to true if the target
639: was specified as part of
640: .Nm make Ns 's
641: command line or was declared the default target (either implicitly or
642: explicitly, see
643: .Va .MAIN )
644: before the line containing the conditional.
645: .It Ic empty
1.5 ! jtc 646: Takes a variable, with possible modifiers, and evaluates to true if
1.1 cgd 647: the expansion of the variable would result in an empty string.
648: .It Ic exists
649: Takes a file name as an argument and evaluates to true if the file exists.
650: The file is searched for on the system search path (see
651: .Va .PATH ) .
652: .It Ic target
653: Takes a target name as an argument and evaluates to true if the target
654: has been defined.
655: .El
656: .Pp
657: .Ar Expression
658: may also be an arithmetic or string comparison, with the left-hand side
659: being a variable expansion.
660: The standard C relational operators are all supported, and the usual
661: number/base conversion is performed.
662: Note, octal numbers are not supported.
663: If the righthand value of a
664: .Ql Ic ==
665: or
666: .Ql Ic "!="
667: operator begins with a
668: quotation mark
669: .Pq Ql \*q
670: a string comparison is done between the expanded
671: variable and the text between the quotation marks.
672: If no relational operator is given, it is assumed that the expanded
673: variable is being compared against 0.
674: .Pp
675: When
676: .Nm make
677: is evaluating one of these conditional expression, and it encounters
678: a word it doesn't recognize, either the ``make'' or ``defined''
679: expression is applied to it, depending on the form of the conditional.
680: If the form is
681: .Ql Ic .ifdef
682: or
683: .Ql Ic .ifndef ,
684: the ``defined'' expression
685: is applied.
686: Similarly, if the form is
687: .Ql Ic .ifmake
688: or
689: .Ql Ic .ifnmake , the ``make''
690: expression is applied.
691: .Pp
692: If the conditional evaluates to true the parsing of the makefile continues
693: as before.
694: If it evaluates to false, the following lines are skipped.
695: In both cases this continues until a
696: .Ql Ic .else
697: or
698: .Ql Ic .endif
699: is found.
700: .Sh COMMENTS
701: Comments begin with a hash
702: .Pq Ql \&#
703: character, anywhere but in a shell
704: command line, and continue to the end of the line.
705: .Sh SPECIAL SOURCES
706: .Bl -tag -width Ic .IGNORE
707: .It Ic .IGNORE
708: Ignore any errors from the commands associated with this target, exactly
709: as if they all were preceded by a dash
710: .Pq Ql \- .
711: .It Ic .MAKE
712: Execute the commands associated with this target even if the
713: .Fl n
714: or
715: .Fl t
716: options were specified.
717: Normally used to mark recursive
718: .Nm make Ns 's .
719: .It Ic .NOTMAIN
720: Normally
721: .Nm make
722: selects the first target it encounters as the default target to be built
723: if no target was specified.
724: This source prevents this target from being selected.
725: .It Ic .OPTIONAL
726: If a target is marked with this attribute and
727: .Nm make
728: can't figure out how to create it, it will ignore this fact and assume
729: the file isn't needed or already exists.
730: .It Ic .PRECIOUS
731: When
732: .Nm make
733: is interrupted, it removes any partially made targets.
734: This source prevents the target from being removed.
735: .It Ic .SILENT
736: Do not echo any of the commands associated with this target, exactly
737: as if they all were preceded by an at sign
738: .Pq Ql @ .
739: .It Ic .USE
740: Turn the target into
741: .Nm make Ns 's .
742: version of a macro.
743: When the target is used as a source for another target, the other target
744: acquires the commands, sources, and attributes (except for
745: .Ic .USE )
746: of the
747: source.
748: If the target already has commands, the
749: .Ic .USE
750: target's commands are appended
751: to them.
752: .El
753: .Sh "SPECIAL TARGETS"
754: Special targets may not be included with other targets, i.e. they must be
755: the only target specified.
756: .Bl -tag -width Ic .BEGIN
757: .It Ic .BEGIN
758: Any command lines attached to this target are executed before anything
759: else is done.
760: .It Ic .DEFAULT
761: This is sort of a
762: .Ic .USE
763: rule for any target (that was used only as a
764: source) that
765: .Nm make
766: can't figure out any other way to create.
767: Only the shell script is used.
768: The
769: .Ic .IMPSRC
770: variable of a target that inherits
771: .Ic .DEFAULT Ns 's
772: commands is set
773: to the target's own name.
774: .It Ic .END
775: Any command lines attached to this target are executed after everything
776: else is done.
777: .It Ic .IGNORE
778: Mark each of the sources with the
779: .Ic .IGNORE
780: attribute.
781: If no sources are specified, this is the equivalent of specifying the
782: .Fl i
783: option.
784: .It Ic .INTERRUPT
785: If
786: .Nm make
787: is interrupted, the commands for this target will be executed.
788: .It Ic .MAIN
789: If no target is specified when
790: .Nm make
791: is invoked, this target will be built.
792: .It Ic .MAKEFLAGS
793: This target provides a way to specify flags for
794: .Nm make
795: when the makefile is used.
796: The flags are as if typed to the shell, though the
797: .Fl f
798: option will have
799: no effect.
800: .It Ic .PATH
801: The sources are directories which are to be searched for files not
802: found in the current directory.
803: If no sources are specified, any previously specified directories are
804: deleted.
805: .It Ic .PRECIOUS
806: Apply the
807: .Ic .PRECIOUS
808: attribute to any specified sources.
809: If no sources are specified, the
810: .Ic .PRECIOUS
811: attribute is applied to every
812: target in the file.
813: .It Ic .SILENT
814: Apply the
815: .Ic .SILENT
816: attribute to any specified sources.
817: If no sources are specified, the
818: .Ic .SILENT
819: attribute is applied to every
820: command in the file.
821: .It Ic .SUFFIXES
822: Each source specifies a suffix to
823: .Nm make .
1.4 pk 824: If no sources are specified, any previous specified suffices are deleted.
1.1 cgd 825: .Sh ENVIRONMENT
826: .Nm Make
827: utilizes the following environment variables, if they exist:
828: .Ev MAKE ,
829: .Ev MAKEFLAGS
830: and
831: .Ev MAKEOBJDIR .
832: .Sh FILES
833: .Bl -tag -width /usr/share/mk -compact
834: .It .depend
835: list of dependencies
836: .It Makefile
837: list of dependencies
838: .It makefile
839: list of dependencies
840: .It sys.mk
841: system makefile
842: .It /usr/share/mk
843: system makefile directory
844: .El
845: .Sh SEE ALSO
846: .Xr mkdep 1
847: .Sh HISTORY
848: A
849: .Nm Make
850: command appeared in
851: .At v7 .
CVSweb <webmaster@jp.NetBSD.org>