=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/make.1,v retrieving revision 1.42 retrieving revision 1.43 diff -c -r1.42 -r1.43 *** src/usr.bin/make/make.1 2001/08/20 05:57:55 1.42 --- src/usr.bin/make/make.1 2002/03/06 17:48:33 1.43 *************** *** 1,4 **** ! .\" $OpenBSD: make.1,v 1.42 2001/08/20 05:57:55 mpech Exp $ .\" $OpenPackages$ .\" $NetBSD: make.1,v 1.18 1997/03/10 21:19:53 christos Exp $ .\" --- 1,4 ---- ! .\" $OpenBSD: make.1,v 1.43 2002/03/06 17:48:33 espie Exp $ .\" $OpenPackages$ .\" $NetBSD: make.1,v 1.18 1997/03/10 21:19:53 christos Exp $ .\" *************** *** 73,86 **** exists, it is read in addition to the makefile (see .Xr mkdep 1 ) . .Pp ! This manual page is intended as a reference document only. ! For a more thorough introduction to ! .Nm ! and makefiles, please refer to ! .%T "Make \- A Tutorial" . .Pp ! The options are as follows: .Bl -tag -width Ds .It Fl B Try to be backwards compatible by executing a single shell per command and by executing the commands to make the sources of a dependency line in sequence. --- 73,139 ---- exists, it is read in addition to the makefile (see .Xr mkdep 1 ) . .Pp ! The handling of ! .Ql Pa BSDmakefile ! and ! .Ql Pa .depend ! are BSD extensions. .Pp ! Standard options are as follows: .Bl -tag -width Ds + .It Fl e + Specify that environment variables override macro assignments within + makefiles. + .It Fl f Ar makefile + Specify a makefile to read instead of the default + .Ql Pa makefile + and + .Ql Pa Makefile . + If + .Ar makefile + is + .Ql \- , + standard input is read. + Multiple makefiles may be specified, and are read in the order specified. + .It Fl i + Ignore non-zero exit of shell commands in the makefile. + Equivalent to specifying + .Ql \- + before each command line in the makefile. + .It Fl k + Continue processing after errors are encountered, but only on those targets + that do not depend on the target whose creation caused the error. + .It Fl n + Display the commands that would have been executed, but do not actually + execute them. + .It Fl q + Do not execute any commands, but exit with status 0 if the specified targets + are up-to-date, and 1 otherwise. + .It Fl r + Do not use the built-in rules specified in the system makefile. + .It Fl S + Stop processing when an error is encountered. + This is the default behavior. + This is needed to negate the + .Fl k + option during recursive builds. + .It Fl s + Do not echo commands as they are executed. + Equivalent to specifying + .Ql Ic @ + before each command line in the makefile. + .It Fl t + Rather than re-building a target as specified in the makefile, create it + or update its modification time to make it appear up-to-date. + .It Ar variable Ns No = Ns Ar value + Set the value of the variable + .Ar variable + to + .Ar value . + .El + .Pp + Extended options are as follows: + .Bl -tag -width Ds .It Fl B Try to be backwards compatible by executing a single shell per command and by executing the commands to make the sources of a dependency line in sequence. *************** *** 130,159 **** .It Ar v Print debugging information about variable assignment. .El - .It Fl e - Specify that environment variables override macro assignments within - makefiles. - .It Fl f Ar makefile - Specify a makefile to read instead of the default - .Ql Pa makefile - and - .Ql Pa Makefile . - If - .Ar makefile - is - .Ql \- , - standard input is read. - Multiple makefiles may be specified, and are read in the order specified. .It Fl I Ar directory Specify a directory in which to search for makefiles and included makefiles. The system makefile directory (or directories, see the .Fl m option) is automatically included as part of this list. - .It Fl i - Ignore non-zero exit of shell commands in the makefile. - Equivalent to specifying - .Ql \- - before each command line in the makefile. .It Fl j Ar max_jobs Specify the maximum number of jobs that .Nm --- 183,193 ---- *************** *** 161,169 **** Turns compatibility mode off, unless the .Ar B flag is also specified. - .It Fl k - Continue processing after errors are encountered, but only on those targets - that do not depend on the target whose creation caused the error. .It Fl m Ar directory Specify a directory in which to search for .Pa sys.mk --- 195,200 ---- *************** *** 176,209 **** for "..."-style inclusions (see the .Fl I option). - .It Fl n - Display the commands that would have been executed, but do not actually - execute them. .It Fl P Collate the output of a given job and display it only when the job finishes, instead of mixing the output of parallel jobs together. This option has no effect unless .Fl j is used too. - .It Fl q - Do not execute any commands, but exit with status 0 if the specified targets - are up-to-date, and 1 otherwise. - .It Fl r - Do not use the built-in rules specified in the system makefile. - .It Fl S - Stop processing when an error is encountered. - Default behavior. - This is needed to negate the - .Fl k - option during recursive builds. - .It Fl s - Do not echo commands as they are executed. - Equivalent to specifying - .Ql Ic @ - before each command line in the makefile. - .It Fl t - Rather than re-building a target as specified in the makefile, create it - or update its modification time to make it appear up-to-date. .It Fl V Ar variable Print .Nm make Ns 's --- 207,218 ---- *************** *** 213,228 **** Multiple instances of this option may be specified; the variables will be printed one per line, with a blank line for each null or undefined variable. - .It Ar variable Ns No = Ns Ar value - Set the value of the variable - .Ar variable - to - .Ar value . .El .Pp There are seven different types of lines in a makefile: file dependency specifications, shell commands, variable assignments, include statements, conditional directives, for loops, and comments. .Pp In general, lines may be continued from one line to the next by ending them with a backslash --- 222,234 ---- Multiple instances of this option may be specified; the variables will be printed one per line, with a blank line for each null or undefined variable. .El .Pp There are seven different types of lines in a makefile: file dependency specifications, shell commands, variable assignments, include statements, conditional directives, for loops, and comments. + Of these, include statements, conditional directives and for loops are + extensions. .Pp In general, lines may be continued from one line to the next by ending them with a backslash *************** *** 238,243 **** --- 244,275 ---- and are usually created from them. The exact relationship between the target and the source is determined by the operator that separates them. + Note that the use of several targets is merely a shorthand for duplicate + rules. + Specifically, + .Bd -literal + target1 target2: depa depb + cmd1 + cmd2 + .Ed + is just a short form of + .Bd -literal + target1: depa depb + cmd1 + cmd2 + target2: depa depb + cmd1 + cmd2 + .Ed + .Pp + .Nm + does not support Solaris syntax for true multiple targets: + .Bd -literal + target1 + target2: depa depb + cmd1 + cmd2 + .Ed + .Pp The operators are as follows: .Bl -tag -width flag .It Ic \&: *************** *** 267,273 **** is interrupted. .El .Pp ! Targets and sources may contain the shell wildcard expressions .Ql ? , .Ql * , .Ql [] --- 299,313 ---- is interrupted. .El .Pp ! The ! .Ic \&:: ! operator is a fairly standard extension. ! The ! .Ic \&! ! operator is a BSD extension. ! .Pp ! As an extension, targets and sources may contain the shell wildcard ! expressions .Ql ? , .Ql * , .Ql [] *************** *** 285,290 **** --- 325,333 ---- .Ql {} need not necessarily be used to describe existing files. Expansion is in directory order, not alphabetically as done in the shell. + .Pp + For maximum portability, target names should only consist of periods, + underscores, digits and alphabetic characters. .Sh SHELL COMMANDS Each target may have associated with it a series of shell commands, normally used to create the target. *************** *** 312,340 **** .Fl n has been specified (This can be useful to debug recursive Makefiles). .El .Sh VARIABLE ASSIGNMENTS Variables in .Nm are much like variables in the shell, and, by tradition, consist of all upper-case letters. The five operators that can be used to assign values to variables are as follows: .Bl -tag -width Ds .It Ic \&= Assign the value to the variable. Any previous value is overridden. - .It Ic \&+= - Append the value to the current value of the variable. - .It Ic \&?= - Assign the value to the variable if it is not already defined. .It Ic \&:= Assign with expansion, i.e., expand the value before assigning it ! to the variable. Normally, expansion is not done until the variable is referenced. .It Ic \&!= Expand the value and pass it to the shell for execution and assign the result to the variable. ! Any newlines in the result are replaced with spaces. .El .Pp Any whitespace before the assigned --- 355,392 ---- .Fl n has been specified (This can be useful to debug recursive Makefiles). .El + .Pp + The command is always executed using + .Pa /bin/sh + in + .Qq set -e + mode. .Sh VARIABLE ASSIGNMENTS Variables in .Nm are much like variables in the shell, and, by tradition, consist of all upper-case letters. + For portability, only periods, underscores, digits and letters should be + used for variable names. The five operators that can be used to assign values to variables are as follows: .Bl -tag -width Ds .It Ic \&= Assign the value to the variable. Any previous value is overridden. .It Ic \&:= Assign with expansion, i.e., expand the value before assigning it ! to the variable (extension) ! .It Ic \&+= ! Append the value to the current value of the variable (extension). ! .It Ic \&?= ! Assign the value to the variable if it is not already defined (BSD ! extension). Normally, expansion is not done until the variable is referenced. .It Ic \&!= Expand the value and pass it to the shell for execution and assign the result to the variable. ! Any newlines in the result are replaced with spaces (BSD extension). .El .Pp Any whitespace before the assigned *************** *** 373,440 **** Variables defined as part of the command line. .It Local variables Variables that are defined specific to a certain target. ! The seven local variables are as follows: .Bl -tag -width ".ARCHIVE" .It Va .ALLSRC ! The list of all sources for this target; also known as .Ql Va \&> . .It Va .ARCHIVE ! The name of the archive file; also known as .Ql Va \&! . .It Va .IMPSRC ! The name/path of the source from which the target is to be transformed ! (the ! .Dq implied ! source); also known as .Ql Va \&< . .It Va .MEMBER ! The name of the archive member; also known as .Ql Va \&% . .It Va .OODATE ! The list of sources for this target that were deemed out-of-date; also ! known as .Ql Va \&? . .It Va .PREFIX ! The file prefix of the file, containing only the file portion, no suffix ! or preceding directory components; also known as .Ql Va * . .It Va .TARGET ! The name of the target; also known as .Ql Va @ . .El .Pp ! The shorter forms ! .Ql Va @ , ! .Ql Va ! , ! .Ql Va \&< , ! .Ql Va \&% , ! .Ql Va ? , ! .Ql Va \&> , ! and ! .Ql Va * ! are permitted for backward ! compatibility with historical makefiles and are not recommended. ! The six variables ! .Ql Va "@F" , ! .Ql Va "@D" , ! .Ql Va " + The list of all sources for this target. .It Va .ALLSRC ! Synonym for .Ql Va \&> . .It Va .ARCHIVE ! Synonym for .Ql Va \&! . .It Va .IMPSRC ! Synonym for .Ql Va \&< . .It Va .MEMBER ! Synonym for .Ql Va \&% . .It Va .OODATE ! Synonym for .Ql Va \&? . .It Va .PREFIX ! Synonym for .Ql Va * . .It Va .TARGET ! Synonym for .Ql Va @ . .El .Pp ! These variables may be used on the dependency half of dependency ! lines, when they make sense. .El .Pp In addition, *************** *** 1189,1194 **** --- 1261,1270 ---- .Pp .%T "Make \- A Tutorial" . .Sh COMPATIBILITY + .Nm + mostly conforms to the Single Unix Specification, Version 2, + with some noted extensions and a few problems. + .Pp Older versions of .Nm used