aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/make.1
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2017-03-06 23:02:33 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2017-03-06 23:02:33 +0000
commit1ce939a7b7d30f1aa727b010174ae92a0790f17a (patch)
treefb4beecbbac33849d93a668d5bca9c9456e54d0d /contrib/bmake/make.1
parent7532a6570b0fcf18ba057a129a405b677c2caead (diff)
parent60a7ffecc77c5e3bf4aa5462ebf16bbd377a5af8 (diff)
downloadsrc-1ce939a7b7d30f1aa727b010174ae92a0790f17a.tar.gz
src-1ce939a7b7d30f1aa727b010174ae92a0790f17a.zip
Merge bmake-20170301
Notes
Notes: svn path=/head/; revision=314808
Diffstat (limited to 'contrib/bmake/make.1')
-rw-r--r--contrib/bmake/make.143
1 files changed, 37 insertions, 6 deletions
diff --git a/contrib/bmake/make.1 b/contrib/bmake/make.1
index 1cadff29db96..807c6fe2c2b8 100644
--- a/contrib/bmake/make.1
+++ b/contrib/bmake/make.1
@@ -1,4 +1,4 @@
-.\" $NetBSD: make.1,v 1.263 2016/08/26 23:37:54 dholland Exp $
+.\" $NetBSD: make.1,v 1.266 2017/02/01 18:39:27 sjg Exp $
.\"
.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" from: @(#)make.1 8.4 (Berkeley) 3/19/94
.\"
-.Dd August 26, 2016
+.Dd February 1, 2017
.Dt MAKE 1
.Os
.Sh NAME
@@ -1216,18 +1216,28 @@ safely through recursive invocations of
.Nm .
.It Cm \&:R
Replaces each word in the variable with everything but its suffix.
-.It Cm \&:gmtime
+.It Cm \&:range[=count]
+The value is an integer sequence representing the words of the original
+value, or the supplied
+.Va count .
+.It Cm \&:gmtime[=utc]
The value is a format string for
.Xr strftime 3 ,
-using the current
+using
.Xr gmtime 3 .
+If a
+.Va utc
+value is not provided or is 0, the current time is used.
.It Cm \&:hash
Compute a 32-bit hash of the value and encode it as hex digits.
-.It Cm \&:localtime
+.It Cm \&:localtime[=utc]
The value is a format string for
.Xr strftime 3 ,
-using the current
+using
.Xr localtime 3 .
+If a
+.Va utc
+value is not provided or is 0, the current time is used.
.It Cm \&:tA
Attempt to convert variable to an absolute path using
.Xr realpath 3 ,
@@ -1427,6 +1437,27 @@ For example.
.Pp
However a single character variable is often more readable:
.Dl ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@}
+.It Cm \&:_[=var]
+Save the current variable value in
+.Ql $_
+or the named
+.Va var
+for later reference.
+Example usage:
+.Bd -literal -offset indent
+M_cmpv.units = 1 1000 1000000
+M_cmpv = S,., ,g:_:range:@i@+ $${_:[-$$i]} \&\\
+\\* $${M_cmpv.units:[$$i]}@:S,^,expr 0 ,1:sh
+
+.Dv .if ${VERSION:${M_cmpv}} < ${3.1.12:L:${M_cmpv}}
+
+.Ed
+Here
+.Ql $_
+is used to save the result of the
+.Ql :S
+modifier which is later referenced using the index values from
+.Ql :range .
.It Cm \&:U Ns Ar newval
If the variable is undefined
.Ar newval