1 .\" Copyright (c) 1990, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94
33 .\" $FreeBSD: src/usr.bin/make/make.1,v 1.29.2.15 2002/12/17 19:01:18 seanc Exp $
34 .\" $DragonFly: src/usr.bin/make/make.1,v 1.28 2005/08/03 17:33:30 okumoto Exp $
41 .Nd maintain program dependencies
56 .Op Fl x Ar warning_options
57 .Op Ar variable Ns No = Ns Ar value
62 utility is a program designed to simplify the maintenance of other programs.
63 Its input is a list of specifications
64 describing dependency relationships between the generation of
71 that can be found in either the current directory or a special object directory
74 will be read for this list of specifications.
77 can be found, it is also read (see
80 This manual page is intended as a reference document only.
81 For a more thorough introduction to
83 and makefiles, please refer to
84 .%T "Make \- A Tutorial" .
86 The options are as follows:
89 Make archive errors non-fatal, causing
91 to just skip the remainder
92 or all of the archive and continue after printing a message.
94 Try to be backwards compatible by executing a single shell per command and
95 by executing the commands to make the sources of a dependency line in sequence.
96 This is turned on by default unless
102 before reading the makefiles or doing anything else.
105 options are specified, each is interpreted relative to the previous one:
106 .Fl C Pa / Fl C Pa etc
112 to be 1, in the global context.
114 Turn on debugging, and specify which portions of
116 are to print debugging information.
119 is one or more of the following:
122 Print all possible debugging information;
123 equivalent to specifying all of the debugging flags.
125 Print debugging information about archive searching and caching.
127 Print debugging information about conditional evaluation.
129 Print debugging information about directory searching and caching.
131 Print debugging information about the execution of for loops.
133 Print the input graph before making anything.
135 Print the input graph after making everything, or before exiting
138 Print debugging information about running multiple shells.
140 Print commands in Makefiles regardless of whether or not they are prefixed
141 by @ or other "quiet" flags.
142 Also known as "loud" behavior.
144 Print debugging information about making targets, including modification
147 Print debugging information about suffix-transformation rules.
149 Print debugging information about target list maintenance.
151 Print debugging information about variable assignment.
154 Specify a variable whose environment value (if any) will override
155 macro assignments within makefiles.
157 Specify that environment values override macro assignments within
158 makefiles for all variables.
160 Specify a makefile to read instead of the default
168 standard input is read.
169 Multiple makefiles may be specified, and are read in the order specified.
170 .It Fl I Ar directory
171 Specify a directory in which to search for makefiles and included makefiles.
172 The system makefile directory (or directories, see the
174 option) is automatically included as part of this list.
176 Ignore non-zero exit of shell commands in the makefile.
177 Equivalent to specifying
179 before each command line in the makefile.
181 Specify the maximum number of jobs that
183 may have running at any one time.
184 Turns compatibility mode off, unless the
186 flag is also specified.
188 Continue processing after errors are encountered, but only on those targets
189 that do not depend on the target whose creation caused the error.
190 .It Fl m Ar directory
191 Specify a directory in which to search for
193 and makefiles included via the <...> style.
194 Multiple directories can be added to form a search path.
195 This path will override the default system include path:
197 Furthermore, the system include path will be appended to the search path used
198 for "..."-style inclusions (see the
202 Display the commands that would have been executed, but do not actually
205 Collate the output of a given job and display it only when the job finishes,
206 instead of mixing the output of parallel jobs together.
207 This option has no effect unless
211 Do not execute any commands, but exit 0 if the specified targets are
212 up-to-date and 1, otherwise.
214 Do not use the built-in rules specified in the system makefile.
216 Stop processing when an error is encountered.
218 This is needed to negate the
220 option during recursive builds.
222 Do not echo any commands as they are executed.
223 Equivalent to specifying
225 before each command line in the makefile.
227 Rather than re-building a target as specified in the makefile, create it
228 or update its modification time to make it appear up-to-date.
234 in the global context.
235 Do not build any targets.
236 Multiple instances of this option may be specified;
237 the variables will be printed one per line,
238 with a blank line for each null or undefined variable.
241 For multi-job makes, this will cause file banners to be generated.
245 option to print the values of variables,
246 do not recursively expand the values.
247 .It Ar variable Ns No = Ns Ar value
248 Set the value of the variable
252 .It Fl x Ar warning_options
253 Specify extended warning options.
254 This option may be specified several times.
259 in which case the warning is switched off.
260 The currently available options are:
261 .Bl -tag -width indent
263 Warn if anything except blanks and comments follows an
275 There are seven different types of lines in a makefile: file dependency
276 specifications, shell commands, variable assignments, include statements,
277 conditional directives, for loops, and comments.
279 In general, lines may be continued from one line to the next by ending
280 them with a backslash
282 The trailing newline character and initial whitespace on the following
283 line are compressed into a single space.
284 .Sh FILE DEPENDENCY SPECIFICATIONS
285 Dependency lines consist of one or more targets, an operator, and zero
287 This creates a relationship where the targets
290 and are usually created from them.
291 The exact relationship between the target and the source is determined
292 by the operator that separates them.
293 The three operators are as follows:
296 A target is considered out-of-date if its modification time is less than
297 those of any of its sources.
298 Sources for a target accumulate over dependency lines when this operator
300 The target is removed if
304 Targets are always re-created, but not until all sources have been
305 examined and re-created as necessary.
306 Sources for a target accumulate over dependency lines when this operator
308 The target is removed if
312 If no sources are specified, the target is always re-created.
313 Otherwise, a target is considered out-of-date if any of its sources has
314 been modified more recently than the target.
315 Sources for a target do not accumulate over dependency lines when this
317 The target will not be removed if
322 Targets and sources may contain the shell wildcard expressions
333 may only be used as part of the final
334 component of the target or source, and must be used to describe existing
338 need not necessarily be used to describe existing files.
339 Expansion is in directory order, not alphabetically as done in the shell.
341 Each target may have associated with it a series of shell commands, normally
342 used to create the target.
343 Each of the commands in this script
345 be preceded by a tab.
346 While any target may appear on a dependency line, only one of these
347 dependencies may be followed by a creation script, unless the
351 If the first characters of the command line are
356 the command is treated specially.
359 causes the command not to be echoed before it is executed.
362 causes any non-zero exit status of the command line to be ignored.
365 causes the command to be executed even if
367 is specified on the command line.
368 .Sh VARIABLE ASSIGNMENTS
371 are much like variables in the shell, and, by tradition,
372 consist of all upper-case letters.
373 The five operators that can be used to assign values to variables are as
377 Assign the value to the variable.
378 Any previous value is overridden.
380 Append the value to the current value of the variable.
382 Assign the value to the variable if it is not already defined.
384 Assign with expansion, i.e., expand the value before assigning it
386 Normally, expansion is not done until the variable is referenced.
388 Expand the value and pass it to the shell for execution and assign
389 the result to the variable.
390 Any newlines in the result are replaced with spaces.
393 Any whitespace before the assigned
395 is removed; if the value is being appended, a single space is inserted
396 between the previous contents of the variable and the appended value.
398 Variables are expanded by surrounding the variable name with either
403 and preceding it with
406 If the variable name contains only a single letter, the surrounding
407 braces or parentheses are not required.
408 This shorter form is not recommended.
410 Variable substitution occurs at two distinct times, depending on where
411 the variable is being used.
412 Variables in dependency lines are expanded as the line is read.
413 Variables in shell commands are expanded when the shell command is
416 The four different classes of variables (in order of increasing precedence)
419 .It Environment variables
420 Variables defined as part of
424 Variables defined in the makefile or in included makefiles.
425 .It Command line variables
426 Variables defined as part of the command line and variables
429 environment variable or the
433 Variables that are defined specific to a certain target.
434 The seven local variables are as follows:
435 .Bl -tag -width ".ARCHIVE"
437 The list of all sources for this target; also known as
440 The name of the archive file; also known as
443 The name/path of the source from which the target is to be transformed
446 source); also known as
449 The name of the archive member; also known as
452 The list of sources for this target that were deemed out-of-date; also
456 The file prefix of the file, containing only the file portion, no suffix
457 or preceding directory components; also known as
460 The name of the target; also known as
473 are permitted for backward
474 compatibility and are not recommended.
484 permitted for compatibility with
486 makefiles and are not recommended.
488 Four of the local variables may be used in sources on dependency lines
489 because they expand to the proper value for each target on the line.
500 sets or knows about the following internal variables or environment
502 .Bl -tag -width ".Va .MAKEFILE_LIST"
508 expands to a single dollar
514 .Pq Va argv Ns Op 0 .
516 A path to the directory where
523 to the canonical path given by
526 A path to the directory where the targets are built.
529 searches for an alternate directory to place target files.
530 It will attempt to change into this special directory
531 and will search this directory for makefiles
532 not found in the current directory.
533 The following directories are tried in order:
537 ${MAKEOBJDIRPREFIX}/`pwd`
548 The first directory that
550 successfully changes into is used.
555 is set in the environment but
557 is unable to change into the corresponding directory,
558 then the current directory is used
559 without checking the remainder of the list.
560 If they are undefined and
562 is unable to change into any of the remaining three directories,
563 then the current directory is used.
568 must be environment variables and should not be set on
576 to the canonical path given by
578 .It Va .MAKEFILE_LIST
581 reads various makefiles, including the default files and any
582 obtained from the command line and
584 directives, their names will be automatically appended to the
587 They are added right before
589 begins to parse them, so that the name of the current makefile is the
590 last word in this variable.
592 The environment variable
594 may contain anything that
598 Its contents are stored in
602 All options and variable assignments specified on
604 command line are appended to the
606 variable which is then
607 entered into the environment as
609 for all programs which
612 By modifying the contents of the
614 variable, makefile can alter the contents of the
616 environment variable made available for all programs which
618 executes; compare with the
620 special target below.
622 When passing macro definitions and flag arguments in the
624 environment variable,
625 space and tab characters are quoted by preceding them with a backslash.
628 variable from the environment,
629 all sequences of a backslash and one of space or tab
630 are replaced just with their second character
631 without causing a word break.
632 Any other occurrences of a backslash are retained.
633 Groups of unquoted space, tab and newline characters cause word
636 This variable is provided for backward compatibility and
637 contains all the options from the
639 environment variable plus any options specified on
645 is currently building.
655 Name of the machine architecture
657 is running on, obtained from the
659 environment variable, or through
663 Name of the machine architecture
665 was compiled for, defined at compilation time.
667 Makefiles may assign a colon-delimited list of directories to
669 These directories will be searched for source files by
671 after it has finished parsing all input makefiles.
674 Variable expansion may be modified to select or modify each word of the
677 is whitespace-delimited sequence of characters).
678 The general format of a variable expansion is as follows:
680 .Dl {variable[:modifier[:...]]}
682 Each modifier begins with a colon and one of the following
684 The colon may be escaped with a backslash
688 .It Cm C No \&/ Ar pattern Xo
689 .No \&/ Ar replacement
693 Modify each word of the value,
694 substituting every match of the extended regular expression
702 Normally, the first occurrence of the pattern in
703 each word of the value is changed.
706 modifier causes the substitution to apply to at most one word; the
708 modifier causes the substitution to apply to as many instances of the
709 search pattern as occur in the word or words it is found in.
714 are orthogonal; the former specifies whether multiple words are
715 potentially affected, the latter whether multiple substitutions can
716 potentially occur within each affected word.
718 Replaces each word in the variable with its suffix.
720 Replaces each word in the variable with everything but the last component.
722 Converts variable to lower-case letters.
723 .It Cm M Ns Ar pattern
724 Select only those words that match the rest of the modifier.
725 The standard shell wildcard characters
732 The wildcard characters may be escaped with a backslash
734 .It Cm N Ns Ar pattern
737 but selects all words which do not match
738 the rest of the modifier.
740 Order every word in the variable alphabetically.
742 Quotes every shell meta-character in the variable, so that it can be passed
743 safely through recursive invocations of
746 Replaces each word in the variable with everything but its suffix.
748 .It Cm S No \&/ Ar old_string Xo
749 .No \&/ Ar new_string
753 Modify the first occurrence of
755 in each word of the variable's value, replacing it with
759 is appended to the last slash of the pattern, all occurrences
760 in each word are replaced.
766 is anchored at the beginning of each word.
769 ends with a dollar sign
771 it is anchored at the end of each word.
778 Any character may be used as a delimiter for the parts of the modifier
780 The anchoring, ampersand, and delimiter characters may be escaped with a
784 Variable expansion occurs in the normal fashion inside both
788 with the single exception that a backslash is used to prevent the expansion
791 not a preceding dollar sign as is usual.
792 .It Ar old_string=new_string
795 style variable substitution.
796 It must be the last modifier specified.
801 do not contain the pattern matching character
803 then it is assumed that they are
804 anchored at the end of each word, so only suffixes or entire
805 words may be replaced.
813 Replaces each word in the variable with its last component.
815 Converts variable to upper-case letters.
817 .Sh DIRECTIVES, CONDITIONALS, AND FOR LOOPS
818 Directives, conditionals, and for loops reminiscent
819 of the C programming language are provided in
821 All such structures are identified by a line beginning with a single
825 The following directives are supported:
827 .It Ic \&.include Ar <file>
828 .It Ic \&.include Ar \*qfile\*q
829 Include the specified makefile.
830 Variables between the angle brackets
831 or double quotes are expanded to form the file name.
833 are used, the included makefile is expected to be in the system
835 If double quotes are used, the including
836 makefile's directory and any directories specified using the
838 option are searched before the system
840 .It Ic .undef Ar variable
841 Un-define the specified global variable.
842 Only global variables may be un-defined.
843 .It Ic \&.makeenv Ar variable
844 Set the environment flag for a preexisting global variable. The current
845 and future contents of the variable will be exported to the environment.
846 .It Ic .error Ar message
847 Terminate processing of the makefile immediately.
849 makefile, the line on which the error was encountered and the specified
850 message are printed to the standard error output and
852 terminates with exit code 1.
853 Variables in the message are expanded.
854 .It Ic .warning Ar message
855 Emit a warning message.
856 The filename of the makefile,
857 the line on which the warning was encountered,
858 and the specified message are printed to the standard error output.
859 Variables in the message are expanded.
862 Conditionals are used to determine which parts of the Makefile
864 They are used similarly to the conditionals supported
865 by the C pre-processor.
866 The following conditionals are supported:
870 .Oo \&! Oc Ns Ar expression
871 .Op Ar operator expression ...
873 Test the value of an expression.
876 .Oo \&! Oc Ns Ar variable
877 .Op Ar operator variable ...
879 Test the value of a variable.
882 .Oo \&! Oc Ns Ar variable
883 .Op Ar operator variable ...
885 Test the value of a variable.
888 .Oo \&! Oc Ns Ar target
889 .Op Ar operator target ...
891 Test the target being built.
894 .Oo \&! Oc Ns Ar target
895 .Op Ar operator target ...
897 Test the target being built.
899 Reverse the sense of the last conditional.
902 .Oo \&! Oc Ns Ar expression
903 .Op Ar operator expression ...
911 .Oo \&! Oc Ns Ar variable
912 .Op Ar operator variable ...
920 .Oo \&! Oc Ns Ar variable
921 .Op Ar operator variable ...
929 .Oo \&! Oc Ns Ar target
930 .Op Ar operator target ...
938 .Oo \&! Oc Ns Ar target
939 .Op Ar operator target ...
946 End the body of the conditional.
951 may be any one of the following:
952 .Bl -tag -width "Cm XX"
959 of higher precedence than
965 will only evaluate a conditional as far as is necessary to determine
967 Parentheses may be used to change the order of evaluation.
970 may be used to logically negate an entire
972 It is of higher precedence than
977 may be any of the following:
980 Takes a variable name as an argument and evaluates to true if the variable
983 Takes a target name as an argument and evaluates to true if the target
984 was specified as part of
986 command line or was declared the default target (either implicitly or
989 before the line containing the conditional.
991 Takes a variable, with possible modifiers, and evaluates to true if
992 the expansion of the variable would result in an empty string.
994 Takes a file name as an argument and evaluates to true if the file exists.
995 The file is searched for on the system search path (see
998 Takes a target name as an argument and evaluates to true if the target
1004 may also be an arithmetic or string comparison, with the left-hand side
1005 being a variable expansion.
1006 Variable expansion is
1007 performed on both sides of the comparison, after which the integral
1008 values are compared.
1009 A value is interpreted as hexadecimal if it is
1010 preceded by 0x, otherwise it is decimal; octal numbers are not supported.
1011 The standard C relational operators are all supported.
1013 variable expansion, either the left or right hand side of a
1017 operator is not an integral value, then
1018 string comparison is performed between the expanded
1020 If no relational operator is given, it is assumed that the expanded
1021 variable is being compared against 0.
1025 is evaluating one of these conditional expressions, and it encounters
1026 a word it does not recognize, either the
1030 expression is applied to it, depending on the form of the conditional.
1038 expression is applied.
1039 Similarly, if the form is
1045 expression is applied.
1047 If the conditional evaluates to true the parsing of the makefile continues
1049 If it evaluates to false, the following lines are skipped.
1050 In both cases this continues until a
1056 For loops are typically used to apply a set of rules to a list of files.
1057 The syntax of a for loop is:
1059 .Bl -tag -width indent -compact
1060 .It Ic .for Ar variable Ic in Ar expression
1067 is evaluated, it is split into words.
1071 is successively set to each word, and substituted in the
1073 inside the body of the for loop.
1075 Comments begin with a hash
1077 character, anywhere but in a shell
1078 command line, and continue to the end of the line.
1082 Ignore any errors from the commands associated with this target, exactly
1083 as if they all were preceded by a dash
1086 Execute the commands associated with this target even if the
1090 options were specified.
1091 Normally used to mark recursive
1096 selects the first target it encounters as the default target to be built
1097 if no target was specified.
1098 This source prevents this target from being selected.
1100 If a target is marked with this attribute and
1102 cannot figure out how to create it, it will ignore this fact and assume
1103 the file is not needed or already exists.
1107 is interrupted, it removes any partially made targets.
1108 This source prevents the target from being removed.
1110 Do not echo any of the commands associated with this target, exactly
1111 as if they all were preceded by an at sign
1114 Turn the target into
1117 When the target is used as a source for another target, the other target
1118 acquires the commands, sources, and attributes (except for
1122 If the target already has commands, the
1124 target's commands are appended
1129 source is appears in a dependency line, the sources that precede it are
1130 made before the sources that succeed it in the line.
1132 detected and targets that form loops will be silently ignored.
1134 .Sh "SPECIAL TARGETS"
1135 Special targets may not be included with other targets, i.e., they must be
1136 the only target specified.
1139 Any command lines attached to this target are executed before anything
1144 rule for any target (that was used only as a
1147 cannot figure out any other way to create.
1148 Only the shell script is used.
1151 variable of a target that inherits
1154 to the target's own name.
1156 Any command lines attached to this target are executed after everything
1159 Mark each of the sources with the
1162 If no sources are specified, this is the equivalent of specifying the
1166 A list of suffixes that indicate files that can be included in a source
1168 The suffix must have already been declared with
1170 any suffix so declared will have the directories on its search path (see
1174 special variable, each preceded by a
1180 is interrupted, the commands for this target will be executed.
1182 This does for libraries what
1184 does for include files, except that the flag used is
1187 If no target is specified when
1189 is invoked, this target will be built.
1190 This is always set, either
1191 explicitly, or implicitly when
1193 selects the default target, to give the user a way to refer to the default
1194 target on the command line.
1196 This target provides a way to specify flags for
1198 when the makefile is used.
1199 The flags are as if typed to the shell, though the
1205 and variable assignments specified as the source
1206 for this target are also appended to the
1209 Please note the difference between this target and the
1211 internal variable: specifying an option or variable
1212 assignment as the source for this target will affect
1214 the current makefile and all processes that
1218 Same as above, for backward compatibility.
1219 .\" XXX: NOT YET!!!!
1220 .\" .It Ic .NOTPARALLEL
1221 .\" The named targets are executed in non parallel mode. If no targets are
1222 .\" specified, then all targets are executed in non parallel mode.
1224 Disable parallel mode.
1226 Same as above, for compatibility with other
1230 The named targets are made in sequence.
1231 .\" XXX: NOT YET!!!!
1232 .\" .It Ic .PARALLEL
1233 .\" The named targets are executed in parallel mode. If no targets are
1234 .\" specified, then all targets are executed in parallel mode.
1236 The sources are directories which are to be searched for files not
1237 found in the current directory.
1238 If no sources are specified, any previously specified directories are
1240 Where possible, use of
1242 is preferred over use of the
1245 .It Ic .PATH\fIsuffix\fR
1246 The sources are directories which are to be searched for suffixed files
1247 not found in the current directory.
1251 first searches the suffixed search path, before reverting to the default
1252 path if the file is not found there.
1253 This form is required for
1261 attribute to any specified sources.
1262 Targets with this attribute are always
1263 considered to be out of date.
1267 attribute to any specified sources.
1268 If no sources are specified, the
1270 attribute is applied to every
1273 Select another shell.
1274 The sources of this target have the format
1275 .Ar key Ns = Ns Ar value .
1279 .Bl -tag -width ".Va hasErrCtl"
1281 Specify the path to the new shell.
1283 Specify the name of the new shell.
1284 This may be either one of the three builtin shells (see below) or any
1287 Specify the shell command to turn echoing off.
1289 Specify the shell command to turn echoing on.
1291 Usually shells print the echo off command before turning echoing off.
1292 This is the exact string that will be printed by the shell and is used
1293 to filter the shell output to remove the echo off command.
1295 The shell option that turns echoing on.
1297 The shell option to turn on error checking.
1298 If error checking is on, the shell should exit if a command returns
1301 True if the shell has error control.
1305 is true then this is the shell command to turn error checking on.
1308 is false then this is a command template to echo commands for which error
1309 checking is disabled.
1310 The template must contain a
1315 is true, this is the shell command to turn error checking off.
1318 is false, this is a command template to execute a command so that errors
1320 The template must contain a
1323 This is a string of meta characters of the shell.
1325 This is a string holding all the shell's builtin commands separated by blanks.
1330 strings are used in compat mode.
1331 When a command line contains neither a meta
1332 character nor starts with a shell builtin, it is executed directly without
1334 When one of these strings (or both) is empty all commands are executed
1339 environment variable before executing any command.
1340 This is useful for the Korn-shell
1344 Values that are strings must be surrounded by double quotes.
1345 Boolean values are specified as
1349 (in either case) to mean true.
1350 Any other value is taken to mean false.
1352 There are several uses of the
1357 Selecting one of the builtin shells.
1358 This is done by just specifying the name of the shell with the
1361 It is also possible to modify the parameters of the builtin shell by just
1362 specifying other keywords (except for
1365 Using another executable for one of the builtin shells.
1366 This is done by specifying the path to the executable with the
1369 If the last component is the same as the name of the builtin shell, no
1370 name needs to be specified; if it is different, the name must be given:
1371 .Bd -literal -offset indent
1372 \&.SHELL: path="/usr/local/bin/sh"
1375 selects the builtin shell
1377 but will execute it from
1378 .Pa /usr/local/bin/sh .
1379 Like in the previous case, it is possible to modify parameters of the builtin
1380 shell by just specifying them.
1382 Using an entirely different shell.
1383 This is done by specifying all keywords.
1386 The builtin shells are
1397 it is unwise to specify
1398 .Va name Ns = Ns Qq Li ksh
1399 without also specifying a path.
1403 attribute to any specified sources.
1404 If no sources are specified, the
1406 attribute is applied to every
1407 command in the file.
1409 Each source specifies a suffix to
1411 If no sources are specified, any previous specified suffices are deleted.
1413 Each source specifies a warning flag as previously described for the
1415 command line option.
1416 Warning flags specified on the command line take precedence over flags
1417 specified in the makefile.
1418 Also, command line warning flags are pushed to sub-makes through the
1420 environment variables so that a warning flag specified on the command
1421 line will influence all sub-makes.
1422 Several flags can be specified on a single
1424 target by seperating them with blanks.
1429 utility uses the following environment variables, if they exist:
1435 .Ev MAKEOBJDIRPREFIX .
1437 .Bl -tag -width /usr/share/doc/psd/12.make -compact
1439 list of dependencies
1441 list of dependencies
1443 list of dependencies
1447 system makefile (processed before any other file, including
1451 .It Pa /usr/share/mk
1452 system makefile directory
1453 .It /usr/share/doc/psd/12.make
1457 .Ev MAKEOBJDIRPREFIX
1461 List all included makefiles in order visited:
1463 .Dl "make -V .MAKEFILE_LIST | tr \e\ \e\en"
1471 This was removed for POSIX compatibility.
1472 The internal variable
1474 is set to the same value as
1476 support for this may be removed in the future.
1478 Most of the more esoteric features of
1480 should probably be avoided for greater compatibility.
1485 .%T "PMake - A Tutorial"
1488 .Pa /usr/share/doc/psd/12.make
1492 command appeared in PWB UNIX.
1494 The determination of
1496 is contorted to the point of absurdity.
1498 In the presence of several
1502 silently ignores all but the first.
1505 is not set to the default target when
1507 is invoked without a target name and no
1509 special target exists.
1513 in a test is very simple-minded.
1514 Currently, the only form that works is
1515 .Ql .if ${VAR} op something
1516 For instance, you should write tests as
1517 .Ql .if ${VAR} == "string"
1518 not the other way around, which would give you an error.
1520 For loops are expanded before tests, so a fragment such as:
1521 .Bd -literal -offset indent
1522 \&.for ARCH in ${SHARED_ARCHS}
1523 \&.if ${ARCH} == ${MACHINE}
1529 will not work, and should be rewritten as:
1530 .Bd -literal -offset indent
1531 \&.for ARCH in ${SHARED_ARCHS}
1532 \&.if ${MACHINE} == ${ARCH}
1538 The parsing code is broken with respect to handling a semicolon
1539 after a colon, so a fragment like this will fail:
1540 .Bd -literal -offset indent
1544 \&.for h in ${HDRS:S;^;${.CURDIR}/;}
1549 A trailing backslash in a variable value defined on the command line causes
1550 the delimiting space in the
1552 environment variable to be preceeded by that backslash.
1553 That causes a submake to not treat that space as a word delimiter.
1554 Fixing this requires a larger rewrite of the code handling command line
1555 macros and assignments to