aboutsummaryrefslogtreecommitdiff
path: root/man/man1/mk.1
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-01-13 04:49:19 +0000
committerrsc <devnull@localhost>2005-01-13 04:49:19 +0000
commitc8b6342d3c2a167dec16931815926e9e4387e7ef (patch)
tree80d3ec6ea074462b30639168113def880476dad6 /man/man1/mk.1
parent741f510ce758f77ed5193256fb693a09a7daecce (diff)
downloadplan9port-c8b6342d3c2a167dec16931815926e9e4387e7ef.tar.gz
plan9port-c8b6342d3c2a167dec16931815926e9e4387e7ef.tar.bz2
plan9port-c8b6342d3c2a167dec16931815926e9e4387e7ef.zip
Many small edits.
Diffstat (limited to 'man/man1/mk.1')
-rw-r--r--man/man1/mk.169
1 files changed, 46 insertions, 23 deletions
diff --git a/man/man1/mk.1 b/man/man1/mk.1
index 59b1d0ea..caa2d176 100644
--- a/man/man1/mk.1
+++ b/man/man1/mk.1
@@ -1,21 +1,4 @@
.TH MK 1
-.de EX
-.nf
-.ft B
-..
-.de EE
-.fi
-.ft R
-..
-.de LR
-.if t .BR \\$1 \\$2
-.if n .RB ` \\$1 '\\$2
-..
-.de L
-.nh
-.if t .B \\$1
-.if n .RB ` \\$1 '
-..
.SH NAME
mk, membername \- maintain (make) related files
.SH SYNOPSIS
@@ -313,6 +296,7 @@ and any command line assignment as an argument to
.IR mk .
A variable assignment argument overrides the first (but not any subsequent)
assignment to that variable.
+.PP
The variable
.B MKFLAGS
contains all the option arguments (arguments starting with
@@ -324,6 +308,45 @@ and
contains all the targets in the call to
.IR mk .
.PP
+The variable
+.B MKSHELL
+contains the shell command line
+.I mk
+uses to run recipes.
+If the first word of the command ends in
+.B rc
+or
+.BR rcsh ,
+.I mk
+uses
+.IR rc (1)'s
+quoting rules; otherwise it uses
+.IR sh (1)'s.
+The
+.B MKSHELL
+variable is consulted when the mkfile is read, not when it is executed,
+so that different shells can be used within a single mkfile:
+.IP
+.EX
+MKSHELL=$PLAN9/bin/rc
+use-rc:V:
+ for(i in a b c) echo $i
+
+MKSHELL=sh
+use-sh:V:
+ for i in a b c; do echo $i; done
+.EE
+.LP
+Mkfiles included via
+.B <
+or
+.B <|
+.RI ( q.v. )
+see their own private copy of
+.BR MKSHELL ,
+which always starts set to
+.B sh .
+.PP
Dynamic information may be included in the mkfile by using a line of the form
.IP
\fR<|\fIcommand\fR \fIargs\fR
@@ -510,6 +533,7 @@ archives.
.I Membername
echoes just the member names of a list of aggregate names.
It is useful in recipes like:
+.IP
.EX
OFILES=a.o b.o
libc.a(%):N: %
@@ -647,7 +671,7 @@ x.tab.h:Pcmp -s: y.tab.h
.EE
.SH SEE ALSO
.IR sh (1),
-.IR regexp9 (7)
+.IR regexp (7)
.PP
A. Hume,
``Mk: a Successor to Make''
@@ -664,19 +688,18 @@ It was later ported to Plan 9.
This software is a port of the Plan 9 version back to Unix.
.SH BUGS
Identical recipes for regular expression meta-rules only have one target.
-.br
+.PP
Seemingly appropriate input like
.B CFLAGS=-DHZ=60
is parsed as an erroneous attribute; correct it by inserting
a space after the first
.LR = .
-.br
+.PP
The recipes printed by
.I mk
before being passed to
-.I sh
+the shell
for execution are sometimes erroneously expanded
for printing. Don't trust what's printed; rely
-on what
-.I sh
+on what the shell
does.