=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/make.1,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- src/usr.bin/make/make.1 1996/09/21 10:53:48 1.8 +++ src/usr.bin/make/make.1 1996/11/30 21:08:59 1.9 @@ -1,8 +1,8 @@ -.\" $OpenBSD: make.1,v 1.8 1996/09/21 10:53:48 deraadt Exp $ -.\" $NetBSD: make.1,v 1.15 1996/08/30 17:59:40 thorpej Exp $ +.\" $OpenBSD: make.1,v 1.9 1996/11/30 21:08:59 millert Exp $ +.\" $NetBSD: make.1,v 1.16 1996/11/06 17:59:13 christos Exp $ .\" -.\" Copyright (c) 1990 The Regents of the University of California. -.\" All rights reserved. +.\" Copyright (c) 1990, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -32,9 +32,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)make.1 5.7 (Berkeley) 7/24/91 +.\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd July 24, 1991 +.Dd March 19, 1994 .Dt MAKE 1 .Os .Sh NAME @@ -42,7 +42,7 @@ .Nd maintain program dependencies .Sh SYNOPSIS .Nm make -.Op Fl Beiknqrstv +.Op Fl Beiknqrst .Op Fl D Ar variable .Op Fl d Ar flags .Op Fl f Ar makefile @@ -51,6 +51,7 @@ .Op Fl j Ar max_jobs .Op Fl m Ar directory .Ek +.Op Fl V Ar variable .Op Ar variable=value .Op Ar target ... .Sh DESCRIPTION @@ -77,7 +78,7 @@ .Pp The options are as follows: .Bl -tag -width Ds -.It Fl B +.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. .It Fl D Ar variable @@ -144,7 +145,7 @@ .It Fl j Ar max_jobs Specify the maximum number of jobs that .Nm make -may have running at any one time. Turns compatibility mode off, unless the +may have running at any one time. Turns compatibility mode off, unless the .Ar B flag is also specified. .It Fl k @@ -174,6 +175,16 @@ .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 +idea of the value of +.Ar variable , +in the global context. +Do not build any targets. +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=value Set the value of the variable .Ar variable @@ -440,6 +451,28 @@ entered into the environment for all programs which .Nm make executes. +.It Ev PWD +Alternate path to the current directory. +.Nm make +normally sets +.Ql Va .CURDIR +to the canonical path given by +.Xr getcwd 2 . +However, if the environment variable +.Ql Ev PWD +is set and gives a path to the current directory, then +.Nm make +sets +.Ql Va .CURDIR +to the value of +.Ql Ev PWD +instead. +.Ql Ev PWD +is set to the value of +.Ql Va .OBJDIR +for all programs which +.Nm make +executes. .El .Pp Variable expansion may be modified to select or modify each word of the @@ -527,23 +560,23 @@ .At V style variable substitution. It must be the last modifier specified. -If +If .Ar old_string or .Ar new_string do not contain the pattern matching character .Ar % -then it is assumed that they are +then it is assumed that they are anchored at the end of each word, so only suffixes or entire -words may be replaced. Otherwise +words may be replaced. Otherwise .Ar % -is the substring of -.Ar old_string +is the substring of +.Ar old_string to be replaced in .Ar new_string .El .Sh INCLUDE STATEMENTS, CONDITIONALS AND FOR LOOPS -Makefile inclusion, conditional structures and for loops reminiscent +Makefile inclusion, conditional structures and for loops reminiscent of the C programming language are provided in .Nm make . All such structures are identified by a line beginning with a single @@ -669,7 +702,7 @@ .Nm make will only evaluate a conditional as far as is necessary to determine its value. -Parenthesis may be used to change the order of evaluation. +Parentheses may be used to change the order of evaluation. The boolean operator .Ql Ic \&! may be used to logically negate an entire @@ -745,14 +778,14 @@ or .Ql Ic .endif is found. -.Pp +.Pp For loops are typically used to apply a set of rules to a list of files. The syntax of a for loop is: .Bl -tag -width Ds .It Xo .Ic \&.for -.Ar variable -.Ic in +.Ar variable +.Ic in .Ar expression .Xc .It Xo @@ -763,12 +796,12 @@ .Xc .El After the for -.Ic expression -is evaluated, it is split into words. The +.Ic expression +is evaluated, it is split into words. The iteration .Ic variable -is successively set to each word, and substituted in the -.Ic make-rules +is successively set to each word, and substituted in the +.Ic make-rules inside the body of the for loop. .Sh COMMENTS Comments begin with a hash @@ -923,10 +956,12 @@ .Sh ENVIRONMENT .Nm Make utilizes the following environment variables, if they exist: +.Ev MACHINE , .Ev MAKE , -.Ev MAKEFLAGS +.Ev MAKEFLAGS , +.Ev MAKEOBJDIR , and -.Ev MAKEOBJDIR . +.Ev PWD . .Sh FILES .Bl -tag -width /usr/share/mk -compact .It .depend