From 6065a492429dafaf59133e2ee09822d131deed5b Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Wed, 24 Nov 2004 07:20:51 +0000 Subject: [PATCH] o Fix proto type o Mention that the left-hand side of the comparison conditional must always be a variable expansion. Do not lie that debugging .for loops is a no-op. o Update tutorial. o Update man page. o Fixed the abuses of .Ql visible on stderr in troff mode. o Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/ Add FreeBSD Id tag where missing. Submitted-by: Max Okumoto Taken-from: FreeBSD --- usr.bin/make/PSD.doc/tutorial.ms | 3 +- usr.bin/make/make.1 | 132 +++++++++++++++---------------- usr.bin/make/nonints.h | 4 +- usr.bin/make/parse.c | 41 ++-------- usr.bin/make/suff.c | 4 +- usr.bin/make/var.c | 20 ++++- 6 files changed, 93 insertions(+), 111 deletions(-) diff --git a/usr.bin/make/PSD.doc/tutorial.ms b/usr.bin/make/PSD.doc/tutorial.ms index ab7a2fb77e..bf508fa964 100644 --- a/usr.bin/make/PSD.doc/tutorial.ms +++ b/usr.bin/make/PSD.doc/tutorial.ms @@ -36,9 +36,8 @@ .\" .\" @(#)tutorial.ms 8.1 (Berkeley) 8/18/93 .\" $FreeBSD: src/usr.bin/make/PSD.doc/tutorial.ms,v 1.8.2.2 2000/11/24 10:08:45 ru Exp $ -.\" $DragonFly: src/usr.bin/make/PSD.doc/tutorial.ms,v 1.4 2004/11/14 20:05:26 dillon Exp $ +.\" $DragonFly: src/usr.bin/make/PSD.doc/tutorial.ms,v 1.5 2004/11/24 07:20:51 dillon Exp $ .\" -.so stubs .EH 'PSD:12-%''PMake \*- A Tutorial' .OH 'PMake \*- A Tutorial''PSD:12-%' .\" xH is a macro to provide numbered headers that are automatically stuffed diff --git a/usr.bin/make/make.1 b/usr.bin/make/make.1 index b5bc2274f6..458a1ee3cb 100644 --- a/usr.bin/make/make.1 +++ b/usr.bin/make/make.1 @@ -31,7 +31,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" $FreeBSD: src/usr.bin/make/make.1,v 1.29.2.15 2002/12/17 19:01:18 seanc Exp $ -.\" $DragonFly: src/usr.bin/make/make.1,v 1.7 2004/11/24 07:15:46 dillon Exp $ +.\" $DragonFly: src/usr.bin/make/make.1,v 1.8 2004/11/24 07:20:50 dillon Exp $ .\" .Dd July 2, 2004 .Dt MAKE 1 @@ -63,16 +63,16 @@ Its input is a list of specifications describing dependency relationships between the generation of files and programs. The first of -.Ql Pa BSDmakefile , -.Ql Pa makefile +.Pa BSDmakefile , +.Pa makefile and -.Ql Pa Makefile +.Pa Makefile that can be found in either the current directory or a special object directory (see -.Ql Va .OBJDIR ) +.Va .OBJDIR ) will be read for this list of specifications. If the file -.Ql Pa .depend +.Pa .depend can be found, it is also read (see .Xr mkdep 1 ) . .Pp @@ -117,8 +117,6 @@ Print debugging information about conditional evaluation. Print debugging information about directory searching and caching. .It Ar f Print debugging information about the execution of for loops. -Currently a -no-op. .It Ar "g1" Print the input graph before making anything. .It Ar "g2" @@ -148,13 +146,13 @@ Specify that environment values override macro assignments within makefiles for all variables. .It Fl f Ar makefile Specify a makefile to read instead of the default -.Ql Pa makefile +.Pa makefile and -.Ql Pa Makefile . +.Pa Makefile . If .Ar makefile is -.Ql \- , +.Sq Fl , standard input is read. Multiple makefiles may be specified, and are read in the order specified. .It Fl I Ar directory @@ -165,7 +163,7 @@ 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 \- +.Sq Ic \- before each command line in the makefile. .It Fl j Ar max_jobs Specify the maximum number of jobs that @@ -211,7 +209,7 @@ option during recursive builds. .It Fl s Do not echo any commands as they are executed. Equivalent to specifying -.Ql Ic @ +.Sq Ic @ before each command line in the makefile. .It Fl t Rather than re-building a target as specified in the makefile, create it @@ -314,19 +312,19 @@ Each of the commands in this script be preceded by a tab. While any target may appear on a dependency line, only one of these dependencies may be followed by a creation script, unless the -.Ql Ic :: +.Sq Ic :: operator is used. .Pp If the first or first two characters of the command line are -.Ql Ic @ +.Sq Ic @ and/or -.Ql Ic \- , +.Sq Ic \- , the command is treated specially. A -.Ql Ic @ +.Sq Ic @ causes the command not to be echoed before it is executed. A -.Ql Ic \- +.Sq Ic \- causes any non-zero exit status of the command line to be ignored. .Sh VARIABLE ASSIGNMENTS Variables in @@ -393,51 +391,51 @@ 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 \&> . +.Sq Va \&> . .It Va .ARCHIVE The name of the archive file; also known as -.Ql Va \&! . +.Sq 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 \&< . +.Sq Va \&< . .It Va .MEMBER The name of the archive member; also known as -.Ql Va \&% . +.Sq Va \&% . .It Va .OODATE The list of sources for this target that were deemed out-of-date; also known as -.Ql Va \&? . +.Sq 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 * . +.Sq Va * . .It Va .TARGET The name of the target; also known as -.Ql Va @ . +.Sq Va @ . .El .Pp The shorter forms -.Ql Va @ , -.Ql Va \&! , -.Ql Va \&< , -.Ql Va \&% , -.Ql Va \&? , -.Ql Va \&> , +.Sq Va @ , +.Sq Va \&! , +.Sq Va \&< , +.Sq Va \&% , +.Sq Va \&? , +.Sq Va \&> , and -.Ql Va * +.Sq Va * are permitted for backward compatibility and are not recommended. The six variables -.Ql Va "@F" , -.Ql Va "@D" , -.Ql Va "name); Buf_Destroy(v->val, destroy); free(v); } else if (v->flags & VAR_JUNK) { @@ -1647,6 +1660,7 @@ Var_Parse(char *str, GNode *ctxt, Boolean err, int *lengthPtr, Boolean *freePtr) free(str); } *freePtr = FALSE; + free(v->name); Buf_Destroy(v->val, TRUE); free(v); if (dynamic) { @@ -1714,7 +1728,7 @@ Var_Subst (char *var, char *str, GNode *ctxt, Boolean undefErr) int expand; for (;;) { if (str[1] != '(' && str[1] != '{') { - if (str[1] != *var) { + if (str[1] != *var || var[1] != '\0') { Buf_AddBytes(buf, 2, (Byte *) str); str += 2; expand = FALSE; -- 2.41.0