From 9bd2d6eee4d62856ab91eb90d01ccb4d2f0378b1 Mon Sep 17 00:00:00 2001 From: Tim Vanderhoek Date: Tue, 17 Aug 1999 00:39:26 +0000 Subject: Merge style- and trivial- only changes from OpenBSD (dated 1999/07/29-19:55+1). Obtained from: OpenBSD, sometimes indirected from NetBSD; myself --- usr.bin/make/arch.c | 84 ++++----- usr.bin/make/buf.c | 11 +- usr.bin/make/buf.h | 6 +- usr.bin/make/compat.c | 23 ++- usr.bin/make/cond.c | 10 +- usr.bin/make/dir.c | 7 +- usr.bin/make/for.c | 7 +- usr.bin/make/hash.c | 7 +- usr.bin/make/job.c | 14 +- usr.bin/make/lst.h | 6 +- usr.bin/make/lst.lib/lstInt.h | 4 +- usr.bin/make/main.c | 38 ++-- usr.bin/make/make.1 | 423 +++++++++++++++++++++++++++++------------- usr.bin/make/make.c | 28 +-- usr.bin/make/make.h | 35 ++-- usr.bin/make/nonints.h | 5 +- usr.bin/make/parse.c | 25 +-- usr.bin/make/pathnames.h | 12 +- usr.bin/make/sprite.h | 8 +- usr.bin/make/str.c | 11 +- usr.bin/make/suff.c | 18 +- usr.bin/make/targ.c | 21 +-- usr.bin/make/var.c | 22 ++- 23 files changed, 535 insertions(+), 290 deletions(-) (limited to 'usr.bin/make') diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c index e886af095b624..7f70daddfef68 100644 --- a/usr.bin/make/arch.c +++ b/usr.bin/make/arch.c @@ -35,11 +35,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: arch.c,v 1.9 1998/10/15 13:00:34 jkoshy Exp $ + * $Id: arch.c,v 1.10 1998/10/15 16:09:56 jdp Exp $ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; +#else +static const char rcsid[] = + "$Id"; +#endif #endif /* not lint */ /*- @@ -146,13 +151,12 @@ ArchFree(ap) /* Free memory from hash entries */ for (entry = Hash_EnumFirst(&a->members, &search); - entry != (Hash_Entry *)NULL; + entry != NULL; entry = Hash_EnumNext(&search)) free((Address) Hash_GetValue (entry)); free(a->name); - if (a->fnametab) - free(a->fnametab); + efree(a->fnametab); Hash_DeleteTable(&a->members); free((Address) a); } @@ -474,9 +478,8 @@ ArchStatMember (archive, member, hash) * the comparisons easier... */ cp = strrchr (member, '/'); - if (cp != (char *) NULL) { + if (cp != NULL) member = cp + 1; - } ln = Lst_Find (archives, (ClientData) archive, ArchFindArchive); if (ln != NILLNODE) { @@ -484,7 +487,7 @@ ArchStatMember (archive, member, hash) he = Hash_FindEntry (&ar->members, member); - if (he != (Hash_Entry *) NULL) { + if (he != NULL) { return ((struct ar_hdr *) Hash_GetValue (he)); } else { /* Try truncated name */ @@ -498,7 +501,7 @@ ArchStatMember (archive, member, hash) } if ((he = Hash_FindEntry (&ar->members, copy)) != NULL) return ((struct ar_hdr *) Hash_GetValue (he)); - return ((struct ar_hdr *) NULL); + return (NULL); } } @@ -514,8 +517,8 @@ ArchStatMember (archive, member, hash) arch = ArchFindMember(archive, member, &sarh, "r"); - if (arch == (FILE *)NULL) { - return ((struct ar_hdr *)NULL); + if (arch == NULL) { + return (NULL); } else { fclose(arch); return (&sarh); @@ -527,8 +530,8 @@ ArchStatMember (archive, member, hash) * everything that's in it and cache it so we can get at it quickly. */ arch = fopen (archive, "r"); - if (arch == (FILE *) NULL) { - return ((struct ar_hdr *) NULL); + if (arch == NULL) { + return (NULL); } /* @@ -538,7 +541,7 @@ ArchStatMember (archive, member, hash) if ((fread (magic, SARMAG, 1, arch) != 1) || (strncmp (magic, ARMAG, SARMAG) != 0)) { fclose (arch); - return ((struct ar_hdr *) NULL); + return (NULL); } ar = (Arch *)emalloc (sizeof (Arch)); @@ -609,19 +612,19 @@ ArchStatMember (archive, member, hash) if (fread (memName, elen, 1, arch) != 1) goto badarch; memName[elen] = '\0'; - fseek (arch, -elen, 1); + fseek (arch, -elen, SEEK_CUR); if (DEBUG(ARCH) || DEBUG(MAKE)) { printf("ArchStat: Extended format entry for %s\n", memName); } } #endif - he = Hash_CreateEntry (&ar->members, memName, (Boolean *)NULL); + he = Hash_CreateEntry (&ar->members, memName, NULL); Hash_SetValue (he, (ClientData)emalloc (sizeof (struct ar_hdr))); memcpy ((Address)Hash_GetValue (he), (Address)&arh, sizeof (struct ar_hdr)); } - fseek (arch, (size + 1) & ~1, 1); + fseek (arch, (size + 1) & ~1, SEEK_CUR); } fclose (arch); @@ -634,19 +637,18 @@ ArchStatMember (archive, member, hash) */ he = Hash_FindEntry (&ar->members, member); - if (he != (Hash_Entry *) NULL) { + if (he != NULL) { return ((struct ar_hdr *) Hash_GetValue (he)); } else { - return ((struct ar_hdr *) NULL); + return (NULL); } badarch: fclose (arch); Hash_DeleteTable (&ar->members); - if (ar->fnametab) - free(ar->fnametab); + efree(ar->fnametab); free ((Address)ar); - return ((struct ar_hdr *) NULL); + return (NULL); } #ifdef SVR4ARCHIVES @@ -786,8 +788,8 @@ ArchFindMember (archive, member, arhPtr, mode) int len, tlen; arch = fopen (archive, mode); - if (arch == (FILE *) NULL) { - return ((FILE *) NULL); + if (arch == NULL) { + return (NULL); } /* @@ -797,7 +799,7 @@ ArchFindMember (archive, member, arhPtr, mode) if ((fread (magic, SARMAG, 1, arch) != 1) || (strncmp (magic, ARMAG, SARMAG) != 0)) { fclose (arch); - return ((FILE *) NULL); + return (NULL); } /* @@ -822,7 +824,7 @@ ArchFindMember (archive, member, arhPtr, mode) * and there's no way we can recover... */ fclose (arch); - return ((FILE *) NULL); + return (NULL); } else if (strncmp (member, arhPtr->ar_name, tlen) == 0) { /* * If the member's name doesn't take up the entire 'name' field, @@ -841,7 +843,7 @@ ArchFindMember (archive, member, arhPtr, mode) * the file at the actual member, rather than its header, but * not here... */ - fseek (arch, -sizeof(struct ar_hdr), 1); + fseek (arch, -sizeof(struct ar_hdr), SEEK_CUR); return (arch); } } else @@ -871,10 +873,10 @@ ArchFindMember (archive, member, arhPtr, mode) } if (strncmp(ename, member, len) == 0) { /* Found as extended name */ - fseek (arch, -sizeof(struct ar_hdr) - elen, 1); + fseek (arch, -sizeof(struct ar_hdr) - elen, SEEK_CUR); return (arch); } - fseek (arch, -elen, 1); + fseek (arch, -elen, SEEK_CUR); goto skip; } else #endif @@ -889,7 +891,7 @@ skip: */ arhPtr->ar_size[sizeof(arhPtr->ar_size)-1] = '\0'; size = (int) strtol(arhPtr->ar_size, NULL, 10); - fseek (arch, (size + 1) & ~1, 1); + fseek (arch, (size + 1) & ~1, SEEK_CUR); } } @@ -898,7 +900,7 @@ skip: * archive and return NULL -- an error. */ fclose (arch); - return ((FILE *) NULL); + return (NULL); } /*- @@ -927,13 +929,11 @@ Arch_Touch (gn) arch = ArchFindMember(Var_Value (ARCHIVE, gn, &p1), Var_Value (TARGET, gn, &p2), &arh, "r+"); - if (p1) - free(p1); - if (p2) - free(p2); + efree(p1); + efree(p2); sprintf(arh.ar_date, "%-12ld", (long) now); - if (arch != (FILE *) NULL) { + if (arch != NULL) { (void)fwrite ((char *)&arh, sizeof (struct ar_hdr), 1, arch); fclose (arch); } @@ -966,7 +966,7 @@ Arch_TouchLib (gn) arch = ArchFindMember (gn->path, RANLIBMAG, &arh, "r+"); sprintf(arh.ar_date, "%-12ld", (long) now); - if (arch != (FILE *) NULL) { + if (arch != NULL) { (void)fwrite ((char *)&arh, sizeof (struct ar_hdr), 1, arch); fclose (arch); @@ -1001,12 +1001,10 @@ Arch_MTime (gn) arhPtr = ArchStatMember (Var_Value (ARCHIVE, gn, &p1), Var_Value (TARGET, gn, &p2), TRUE); - if (p1) - free(p1); - if (p2) - free(p2); + efree(p1); + efree(p2); - if (arhPtr != (struct ar_hdr *) NULL) { + if (arhPtr != NULL) { modTime = (int) strtol(arhPtr->ar_date, NULL, 10); } else { modTime = 0; @@ -1113,7 +1111,7 @@ Arch_FindLib (gn, path) #ifdef LIBRARIES Var_Set (TARGET, gn->name, gn); #else - Var_Set (TARGET, gn->path == (char *) NULL ? gn->name : gn->path, gn); + Var_Set (TARGET, gn->path == NULL ? gn->name : gn->path, gn); #endif /* LIBRARIES */ } @@ -1170,7 +1168,7 @@ Arch_LibOODate (gn) arhPtr = ArchStatMember (gn->path, RANLIBMAG, FALSE); - if (arhPtr != (struct ar_hdr *)NULL) { + if (arhPtr != NULL) { modTimeTOC = (int) strtol(arhPtr->ar_date, NULL, 10); if (DEBUG(ARCH) || DEBUG(MAKE)) { diff --git a/usr.bin/make/buf.c b/usr.bin/make/buf.c index 462cbeff0713a..8ed5aa754a92f 100644 --- a/usr.bin/make/buf.c +++ b/usr.bin/make/buf.c @@ -35,11 +35,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: buf.c,v 1.8 1997/02/22 19:27:06 peter Exp $ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)buf.c 8.1 (Berkeley) 6/6/93"; +#else +static const char rcsid[] = + "$Id"; +#endif #endif /* not lint */ /*- @@ -126,7 +131,7 @@ void Buf_AddBytes (bp, numBytes, bytesPtr) register Buffer bp; int numBytes; - Byte *bytesPtr; + const Byte *bytesPtr; { BufExpand (bp, numBytes); @@ -454,7 +459,7 @@ Buf_Destroy (buf, freeData) void Buf_ReplaceLastByte (buf, byte) Buffer buf; /* buffer to augment */ - Byte byte; /* byte to be written */ + int byte; /* byte to be written */ { if (buf->inPtr == buf->outPtr) Buf_AddByte(buf, byte); diff --git a/usr.bin/make/buf.h b/usr.bin/make/buf.h index 562739d55765e..8721bfb6ac20b 100644 --- a/usr.bin/make/buf.h +++ b/usr.bin/make/buf.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)buf.h 8.1 (Berkeley) 6/6/93 - * $Id$ + * $Id: buf.h,v 1.7 1997/02/22 19:27:06 peter Exp $ */ /*- @@ -67,7 +67,7 @@ typedef struct Buffer { #define BUF_ERROR 256 void Buf_OvAddByte __P((Buffer, int)); -void Buf_AddBytes __P((Buffer, int, Byte *)); +void Buf_AddBytes __P((Buffer, int, const Byte *)); void Buf_UngetByte __P((Buffer, int)); void Buf_UngetBytes __P((Buffer, int, Byte *)); int Buf_GetByte __P((Buffer)); @@ -77,6 +77,6 @@ void Buf_Discard __P((Buffer, int)); int Buf_Size __P((Buffer)); Buffer Buf_Init __P((int)); void Buf_Destroy __P((Buffer, Boolean)); -void Buf_ReplaceLastByte __P((Buffer, Byte)); +void Buf_ReplaceLastByte __P((Buffer, int)); #endif /* _BUF_H */ diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c index 8424e9bfedfde..e894699d25f81 100644 --- a/usr.bin/make/compat.c +++ b/usr.bin/make/compat.c @@ -35,11 +35,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: compat.c,v 1.12 1998/09/09 05:15:38 jkoshy Exp $ + * $Id: compat.c,v 1.13 1999/07/31 20:38:22 hoek Exp $ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; +#else +static const char rcsid[] = + "$Id$"; +#endif #endif /* not lint */ /*- @@ -115,8 +120,7 @@ CompatInterrupt (signo) if (!noExecute && eunlink(file) != -1) { printf ("*** %s removed\n", file); } - if (p1) - free(p1); + efree(p1); /* * Run .INTERRUPT only if hit with interrupt signal @@ -214,7 +218,7 @@ CompatRunCommand (cmdp, gnp) cmdStart = Var_Subst (NULL, cmd, gn, FALSE); /* - * brk_string will return an argv with a NULL in av[1], thus causing + * brk_string will return an argv with a NULL in av[0], thus causing * execvp to choke and die horribly. Besides, how can we execute a null * command? In any case, we warn the user that the command expanded to * nothing (is this the right thing to do?). @@ -448,8 +452,7 @@ CompatMake (gnp, pgnp) if (Lst_Member (gn->iParents, pgn) != NILLNODE) { char *p1; Var_Set (IMPSRC, Var_Value(TARGET, gn, &p1), pgn); - if (p1) - free(p1); + efree(p1); } /* @@ -586,7 +589,10 @@ CompatMake (gnp, pgnp) } else if (keepgoing) { pgn->make = FALSE; } else { - printf ("\n\nStop.\n"); + char *p1; + + printf ("\n\nStop in %s.\n", Var_Value(".CURDIR", gn, &p1)); + efree(p1); exit (1); } } else if (gn->made == ERROR) { @@ -599,8 +605,7 @@ CompatMake (gnp, pgnp) if (Lst_Member (gn->iParents, pgn) != NILLNODE) { char *p1; Var_Set (IMPSRC, Var_Value(TARGET, gn, &p1), pgn); - if (p1) - free(p1); + efree(p1); } switch(gn->made) { case BEINGMADE: diff --git a/usr.bin/make/cond.c b/usr.bin/make/cond.c index 5eb420e1b645e..f19b93a71ce99 100644 --- a/usr.bin/make/cond.c +++ b/usr.bin/make/cond.c @@ -35,11 +35,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cond.c,v 1.8 1999/05/25 13:45:08 hoek Exp $ + * $Id: cond.c,v 1.9 1999/08/12 13:30:08 hoek Exp $ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94"; +#else +static const char rcsid[] = + "$Id"; +#endif #endif /* not lint */ /*- @@ -290,8 +295,7 @@ CondDoDefined (argLen, arg) } else { result = FALSE; } - if (p1) - free(p1); + efree(p1); arg[argLen] = savec; return (result); } diff --git a/usr.bin/make/dir.c b/usr.bin/make/dir.c index 9fcf94f91ca31..eb059993186bb 100644 --- a/usr.bin/make/dir.c +++ b/usr.bin/make/dir.c @@ -35,11 +35,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: dir.c,v 1.7 1997/02/22 19:27:08 peter Exp $ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; +#else +static const char rcsid[] = + "$Id"; +#endif #endif /* not lint */ /*- diff --git a/usr.bin/make/for.c b/usr.bin/make/for.c index 3d8617f1420f3..983b9fdba8988 100644 --- a/usr.bin/make/for.c +++ b/usr.bin/make/for.c @@ -30,11 +30,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: for.c,v 1.7 1997/02/22 19:27:09 peter Exp $ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)for.c 8.1 (Berkeley) 6/6/93"; +#else +static const char rcsid[] = + "$Id"; +#endif #endif /* not lint */ /*- diff --git a/usr.bin/make/hash.c b/usr.bin/make/hash.c index a8250a41402e2..12dfbd9cd4153 100644 --- a/usr.bin/make/hash.c +++ b/usr.bin/make/hash.c @@ -35,11 +35,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: hash.c,v 1.6 1997/02/22 19:27:10 peter Exp $ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)hash.c 8.1 (Berkeley) 6/6/93"; +#else +static const char rcsid[] = + "$Id"; +#endif #endif /* not lint */ /* hash.c -- diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c index 1525b7c5577bc..d102c53c81c13 100644 --- a/usr.bin/make/job.c +++ b/usr.bin/make/job.c @@ -35,11 +35,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: job.c,v 1.11 1998/11/14 16:15:04 dg Exp $ + * $Id: job.c,v 1.12 1999/02/14 22:22:42 dt Exp $ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; +#else +static const char rcsid[] = + "$Id"; +#endif #endif /* not lint */ #ifndef OLD_JOKE @@ -1054,7 +1059,7 @@ Job_Touch(gn, silent) * modification time, then close the file. */ if (read(streamID, &c, 1) == 1) { - (void) lseek(streamID, 0L, L_SET); + (void) lseek(streamID, 0L, SEEK_SET); (void) write(streamID, &c, 1); } @@ -1107,8 +1112,7 @@ Job_CheckCommands(gn, abortProc) */ Make_HandleUse(DEFAULT, gn); Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), gn); - if (p1) - free(p1); + efree(p1); } else if (Dir_MTime(gn) == 0) { /* * The node wasn't the target of an operator we have no .DEFAULT @@ -1228,7 +1232,7 @@ JobExec(job, argv) if (dup2(FILENO(job->cmdFILE), 0) == -1) Punt("Cannot dup2: %s", strerror(errno)); (void) fcntl(0, F_SETFD, 0); - (void) lseek(0, 0, L_SET); + (void) lseek(0, 0, SEEK_SET); if (usePipes) { /* diff --git a/usr.bin/make/lst.h b/usr.bin/make/lst.h index 2d1d8674bc410..3cb3ee1909bbd 100644 --- a/usr.bin/make/lst.h +++ b/usr.bin/make/lst.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)lst.h 8.1 (Berkeley) 6/6/93 - * $Id$ + * $Id: lst.h,v 1.7 1997/02/22 19:27:13 peter Exp $ */ /*- @@ -46,11 +46,11 @@ #ifndef _LST_H_ #define _LST_H_ -#include #include -#if __STDC__ +#ifdef __STDC__ #include #endif +#include "sprite.h" /* * basic typedef. This is what the Lst_ functions handle diff --git a/usr.bin/make/lst.lib/lstInt.h b/usr.bin/make/lst.lib/lstInt.h index 4260940680997..dd38bf0eaa69e 100644 --- a/usr.bin/make/lst.lib/lstInt.h +++ b/usr.bin/make/lst.lib/lstInt.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)lstInt.h 8.1 (Berkeley) 6/6/93 - * $Id$ + * $Id: lstInt.h,v 1.5 1997/02/22 19:27:40 peter Exp $ */ /*- @@ -109,4 +109,4 @@ typedef struct { */ #define LstIsEmpty(l) (((List)l)->firstPtr == NilListNode) -#endif _LSTINT_H_ +#endif /* _LSTINT_H_ */ diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index ea478236e5c4b..3aecd8332fe45 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -45,9 +45,10 @@ static const char copyright[] = #ifndef lint #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; -#endif +#else static const char rcsid[] = - "$Id: main.c,v 1.31 1999/07/31 20:40:23 hoek Exp $"; + "$Id: main.c,v 1.32 1999/07/31 20:53:01 hoek Exp $"; +#endif #endif /* not lint */ /*- @@ -96,7 +97,7 @@ static const char rcsid[] = #include #include #include -#if __STDC__ +#ifdef __STDC__ #include #else #include @@ -211,8 +212,9 @@ rearg: while((c = getopt(argc, argv, OPTFLAGS)) != -1) { maxLocal = strtol(optarg, &endptr, 10); if (maxLocal < 0 || *endptr != '\0') { - errx(EX_USAGE, - "illegal argument to -L -- %s", optarg); + warnx("illegal number, -L argument -- %s", + optarg); + usage(); } Var_Append(MAKEFLAGS, "-L", VAR_GLOBAL); Var_Append(MAKEFLAGS, optarg, VAR_GLOBAL); @@ -306,8 +308,9 @@ rearg: while((c = getopt(argc, argv, OPTFLAGS)) != -1) { forceJobs = TRUE; maxJobs = strtol(optarg, &endptr, 10); if (maxJobs <= 0 || *endptr != '\0') { - errx(EX_USAGE, - "illegal argument to -j -- %s", optarg); + warnx("illegal number, -j argument -- %s", + optarg); + usage(); } #ifndef REMOTE maxLocal = maxJobs; @@ -570,9 +573,10 @@ main(argc, argv) * 2. MAKEOBJDIR * 3. _PATH_OBJDIR.${MACHINE} * 4. _PATH_OBJDIR - * 5. _PATH_OBJDIRPREFIX${MACHINE} + * 5. _PATH_OBJDIRPREFIX`cwd` * - * If all fails, use the current directory to build. + * If one of the first two fails, use the current directory. + * If the remaining three all fail, use the current directory. * * Once things are initted, * have to add the original directory to the search path, @@ -759,8 +763,7 @@ main(argc, argv) (void)ReadMakefile(".depend", NULL); Var_Append("MFLAGS", Var_Value(MAKEFLAGS, VAR_GLOBAL, &p1), VAR_GLOBAL); - if (p1) - free(p1); + efree(p1); /* Install all the flags into the MAKE envariable. */ if (((p = Var_Value(MAKEFLAGS, VAR_GLOBAL, &p1)) != NULL) && *p) @@ -769,8 +772,7 @@ main(argc, argv) #else setenv("MAKE", p, 1); #endif - if (p1) - free(p1); + efree(p1); /* * For compatibility, look at the directories in the VPATH variable @@ -1083,7 +1085,7 @@ bad: */ /* VARARGS */ void -#if __STDC__ +#ifdef __STDC__ Error(char *fmt, ...) #else Error(va_alist) @@ -1091,7 +1093,7 @@ Error(va_alist) #endif { va_list ap; -#if __STDC__ +#ifdef __STDC__ va_start(ap, fmt); #else char *fmt; @@ -1118,7 +1120,7 @@ Error(va_alist) */ /* VARARGS */ void -#if __STDC__ +#ifdef __STDC__ Fatal(char *fmt, ...) #else Fatal(va_alist) @@ -1126,7 +1128,7 @@ Fatal(va_alist) #endif { va_list ap; -#if __STDC__ +#ifdef __STDC__ va_start(ap, fmt); #else char *fmt; @@ -1160,7 +1162,7 @@ Fatal(va_alist) */ /* VARARGS */ void -#if __STDC__ +#ifdef __STDC__ Punt(char *fmt, ...) #else Punt(va_alist) diff --git a/usr.bin/make/make.1 b/usr.bin/make/make.1 index 96897c94c7b9a..ff3e617863541 100644 --- a/usr.bin/make/make.1 +++ b/usr.bin/make/make.1 @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 -.\" $Id: make.1,v 1.21 1999/08/12 20:49:20 chris Exp $ +.\" $Id: make.1,v 1.22 1999/08/14 06:47:13 chris Exp $ .\" .Dd March 19, 1994 .Dt MAKE 1 @@ -40,7 +40,7 @@ .Nd maintain program dependencies .Sh SYNOPSIS .Nm make -.Op Fl Beiknqrstv +.Op Fl BPSeiknqrstv .Op Fl D Ar variable .Op Fl d Ar flags .Op Fl E Ar variable @@ -51,29 +51,30 @@ .Op Fl m Ar directory .Ek .Op Fl V Ar variable -.Op Ar variable=value +.Op Ar variable Ns No = Ns Ar value .Op Ar target ... .Sh DESCRIPTION .Nm Make is a program designed to simplify the maintenance of other programs. -Its input is a list of specifications as to the files upon which programs -and other files depend. -.Nm Make -searches a built-in path for this list. -If the file +Its input is a list of specifications +describing dependency relationships between the generation of +files and programs. +The first of .Ql Pa makefile -exists along this path, it is read for this list of specifications. -If it does not exist, the file +and .Ql Pa Makefile -is used. +that can be found in either the current directory or a special object directory +(see +.Ql Va .OBJDIR ) +will be read for this list of specifications. If the file .Ql Pa .depend -exists, it is also read (see +can be found, it is also read (see .Xr mkdep 1) . .Pp This manual page is intended as a reference document only. -For a more thorough description of -.Nm make +For a more thorough introduction to +.Nm and makefiles, please refer to .%T "Make \- A Tutorial" . .Pp @@ -82,15 +83,19 @@ The options are as follows: .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. +This is turned on by default unless +.Fl j +is used. .It Fl D Ar variable Define .Ar variable to be 1, in the global context. .It Fl d Ar flags Turn on debugging, and specify which portions of -.Nm make +.Nm are to print debugging information. -.Ar Flags +Argument +.Ar flags is one or more of the following: .Bl -tag -width Ds .It Ar A @@ -102,6 +107,9 @@ Print debugging information about archive searching and caching. Print debugging information about conditional evaluation. .It Ar d 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" @@ -133,9 +141,9 @@ and If .Ar makefile is -.Ql Fl , +.Ql \- , standard input is read. -Multiple makefile's may be specified, and are read in the order specified. +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 @@ -144,11 +152,11 @@ 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 Fl +.Ql \- before each command line in the makefile. .It Fl j Ar max_jobs Specify the maximum number of jobs that -.Nm make +.Nm may have running at any one time. Turns compatibility mode off, unless the .Ar B flag is also specified. @@ -158,19 +166,31 @@ 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 sys.mk and makefiles included via the <...> style. Multiple directories can be added to form a search path. -This path will override the default system include path: /usr/share/mk. -Furthermore the system include path will be appended to the search path used +This path will override the default system include path: +.Pa /usr/share/mk . +Furthermore, the system include path will be appended to the search path used 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 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 behaviour. This is needed to negate the +.Fl k +option during recursive builds. .It Fl s Do not echo any commands as they are executed. Equivalent to specifying @@ -192,7 +212,7 @@ with a blank line for each null or undefined variable. .It Fl v Be extra verbose. For multi-job makes, this will cause file banners to be generated. -.It Ar variable=value +.It Ar variable Ns No = Ns Ar value Set the value of the variable .Ar variable to @@ -211,7 +231,9 @@ line are compressed into a single space. .Sh FILE DEPENDENCY SPECIFICATIONS Dependency lines consist of one or more targets, an operator, and zero or more sources. -This creates a relationship where the targets ``depend'' on the sources +This creates a relationship where the targets +.Dq depend +on the sources and are usually created from them. The exact relationship between the target and the source is determined by the operator that separates them. @@ -223,7 +245,7 @@ those of any of its sources. Sources for a target accumulate over dependency lines when this operator is used. The target is removed if -.Nm make +.Nm is interrupted. .It Ic \&! Targets are always re-created, but not until all sources have been @@ -231,7 +253,7 @@ examined and re-created as necessary. Sources for a target accumulate over dependency lines when this operator is used. The target is removed if -.Nm make +.Nm is interrupted. .It Ic \&:: If no sources are specified, the target is always re-created. @@ -240,17 +262,17 @@ been modified more recently than the target. Sources for a target do not accumulate over dependency lines when this operator is used. The target will not be removed if -.Nm make +.Nm is interrupted. .El .Pp -Targets and sources may contain the shell wildcard values +Targets and sources may contain the shell wildcard expressions .Ql ? , .Ql * , .Ql [] and .Ql {} . -The values +The expressions .Ql ? , .Ql * and @@ -258,7 +280,7 @@ and may only be used as part of the final component of the target or source, and must be used to describe existing files. -The value +The expression .Ql {} need not necessarily be used to describe existing files. Expansion is in directory order, not alphabetically as done in the shell. @@ -285,7 +307,9 @@ A .Ql Ic \- causes any non-zero exit status of the command line to be ignored. .Sh VARIABLE ASSIGNMENTS -Variables in make are much like variables in the shell, and, by tradition, +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: @@ -307,7 +331,7 @@ the result to the variable. Any newlines in the result are replaced with spaces. .El .Pp -Any white-space before the assigned +Any whitespace before the assigned .Ar value is removed; if the value is being appended, a single space is inserted between the previous contents of the variable and the appended value. @@ -349,13 +373,17 @@ The seven local variables are as follows: The list of all sources for this target; also known as .Ql Va \&> . .It Va .ARCHIVE -The name of the archive file. +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 ``implied'' source); also known as +(the +.Dq implied +source); also known as .Ql Va \&< . .It Va .MEMBER -The name of the archive 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 @@ -371,8 +399,11 @@ The name of the target; also known as .Pp The shorter forms .Ql Va @ , +.Ql Va ! , +.Ql Va \&< , +.Ql Va \&% , .Ql Va ? , -.Ql Va \&> +.Ql Va \&> , and .Ql Va * are permitted for backward @@ -382,7 +413,7 @@ The six variables .Ql Va "@D" , .Ql Va "make && !(gn->type & OP_USE)) { (void)Lst_EnQueue (l, (ClientData)gn); } return (0); } - + /*- *----------------------------------------------------------------------- * Make_HandleUse -- @@ -325,7 +331,7 @@ Make_HandleUse (cgn, pgn) register GNode *cgn; /* The .USE node */ register GNode *pgn; /* The target of the .USE node */ { - register GNode *gn; /* A child of the .USE node */ + register GNode *gn; /* A child of the .USE node */ register LstNode ln; /* An element in the children list */ if (cgn->type & (OP_USE|OP_TRANSFORM)) { @@ -360,7 +366,7 @@ Make_HandleUse (cgn, pgn) * whether to queue the parent or examine its children... */ if (cgn->type & OP_USE) { - pgn->unmade -= 1; + pgn->unmade--; } } return (0); @@ -408,8 +414,7 @@ Make_Update (cgn) char *p1; cname = Var_Value (TARGET, cgn, &p1); - if (p1) - free(p1); + efree(p1); /* * If the child was actually made, see what its modification time is @@ -538,8 +543,7 @@ Make_Update (cgn) Var_Set (PREFIX, cpref, pgn); } } - if (p1) - free(p1); + efree(p1); Lst_Close (cgn->iParents); } } @@ -610,8 +614,7 @@ MakeAddAllSrc (cgnp, pgnp) */ Var_Append(OODATE, child, pgn); } - if (p1) - free(p1); + efree(p1); } return (0); } @@ -654,8 +657,7 @@ Make_DoAllVar (gn) if (gn->type & OP_JOIN) { char *p1; Var_Set (TARGET, Var_Value (ALLSRC, gn, &p1), gn); - if (p1) - free(p1); + efree(p1); } } diff --git a/usr.bin/make/make.h b/usr.bin/make/make.h index fad9a9ddd599a..3845e7dafa0ad 100644 --- a/usr.bin/make/make.h +++ b/usr.bin/make/make.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)make.h 8.3 (Berkeley) 6/13/95 - * $Id: make.h,v 1.8 1998/11/14 16:15:04 dg Exp $ + * $Id: make.h,v 1.9 1999/07/31 20:53:02 hoek Exp $ */ /*- @@ -48,21 +48,32 @@ #define _MAKE_H_ #include +#include #include #include #include -#if !defined(MAKE_BOOTSTRAP) && defined(BSD) -#include -#else -#ifndef __P -#if defined(__STDC__) || defined(__cplusplus) -#define __P(protos) protos /* full-blown ANSI C */ + +#if !defined(MAKE_BOOTSTRAP) && defined(BSD4_4) +# include #else -#define __P(protos) () /* traditional C preprocessor */ -#endif +# ifndef __P +# if defined(__STDC__) || defined(__cplusplus) +# define __P(protos) protos /* full-blown ANSI C */ +# else +# define __P(protos) () /* traditional C preprocessor */ +# endif +# endif +# ifndef __STDC__ +# ifndef const +# define const +# endif +# ifndef volatile +# define volatile +# endif +# endif #endif -#endif -#if __STDC__ + +#ifdef __STDC__ #include #include #endif @@ -108,7 +119,7 @@ typedef struct GNode { Boolean make; /* TRUE if this target needs to be remade */ enum { UNMADE, BEINGMADE, MADE, UPTODATE, ERROR, ABORTED, - CYCLE, ENDCYCLE, + CYCLE, ENDCYCLE } made; /* Set to reflect the state of processing * on this node: * UNMADE - Not examined yet diff --git a/usr.bin/make/nonints.h b/usr.bin/make/nonints.h index 1c56450dbc72a..4b8b21152b0e7 100644 --- a/usr.bin/make/nonints.h +++ b/usr.bin/make/nonints.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)nonints.h 8.3 (Berkeley) 3/19/94 - * $Id$ + * $Id: nonints.h,v 1.6 1997/02/22 19:27:17 peter Exp $ */ /* arch.c */ @@ -73,6 +73,9 @@ int PrintAddr __P((ClientData, ClientData)); void Finish __P((int)); char *estrdup __P((const char *)); void *emalloc __P((size_t)); +/* efree(x) works when x==NULL. STDC behavior, may need some different + * definition for cross-builds on deficient systems */ +#define efree free void *erealloc __P((void *, size_t)); void enomem __P((void)); int eunlink __P((const char *)); diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index fda738a8a6a9f..5b2ceb79781d4 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -39,9 +39,10 @@ #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; -#endif +#else static const char rcsid[] = - "$Id: parse.c,v 1.19 1998/05/25 03:28:37 steve Exp $"; + "$Id: parse.c,v 1.20 1999/01/08 18:37:34 jkh Exp $"; +#endif #endif /* not lint */ /*- @@ -86,7 +87,7 @@ static const char rcsid[] = * Parse_MainName Returns a Lst of the main target to create. */ -#if __STDC__ +#ifdef __STDC__ #include #else #include @@ -313,7 +314,7 @@ ParseFindKeyword (str) */ /* VARARGS */ void -#if __STDC__ +#ifdef __STDC__ Parse_Error(int type, char *fmt, ...) #else Parse_Error(va_alist) @@ -321,7 +322,7 @@ Parse_Error(va_alist) #endif { va_list ap; -#if __STDC__ +#ifdef __STDC__ va_start(ap, fmt); #else int type; /* Error type (PARSE_WARNING, PARSE_FATAL) */ @@ -470,7 +471,7 @@ ParseDoOp (gnp, opp) * *--------------------------------------------------------------------- */ -int +static int ParseAddDep(pp, sp) ClientData pp; ClientData sp; @@ -2615,18 +2616,18 @@ Parse_End() Lst Parse_MainName() { - Lst main; /* result list */ + Lst listmain; /* result list */ - main = Lst_Init (FALSE); + listmain = Lst_Init (FALSE); if (mainNode == NILGNODE) { Punt ("no target to make."); /*NOTREACHED*/ } else if (mainNode->type & OP_DOUBLEDEP) { - (void) Lst_AtEnd (main, (ClientData)mainNode); - Lst_Concat(main, mainNode->cohorts, LST_CONCNEW); + (void) Lst_AtEnd (listmain, (ClientData)mainNode); + Lst_Concat(listmain, mainNode->cohorts, LST_CONCNEW); } else - (void) Lst_AtEnd (main, (ClientData)mainNode); - return (main); + (void) Lst_AtEnd (listmain, (ClientData)mainNode); + return (listmain); } diff --git a/usr.bin/make/pathnames.h b/usr.bin/make/pathnames.h index 4405682936d1b..d456c357ff2d0 100644 --- a/usr.bin/make/pathnames.h +++ b/usr.bin/make/pathnames.h @@ -31,11 +31,21 @@ * SUCH DAMAGE. * * from: @(#)pathnames.h 5.2 (Berkeley) 6/1/90 - * $Id$ + * $Id: pathnames.h,v 1.7 1997/02/22 19:27:20 peter Exp $ */ +#ifndef _PATH_OBJDIR #define _PATH_OBJDIR "obj" +#endif /* ! _PATH_OBJDIR */ +#ifndef _PATH_OBJDIRPREFIX #define _PATH_OBJDIRPREFIX "/usr/obj" +#endif /* ! _PATH_OBJDIRPREFIX */ +#ifndef _PATH_DEFSHELLDIR #define _PATH_DEFSHELLDIR "/bin" +#endif /* ! _PATH_DEFSHELLDIR */ +#ifndef _PATH_DEFSYSMK #define _PATH_DEFSYSMK "sys.mk" +#endif /* ! _PATH_DEFSYSMK */ +#ifndef _PATH_DEFSYSPATH #define _PATH_DEFSYSPATH "/usr/share/mk" +#endif /* ! _PATH_DEFSYSPATH */ diff --git a/usr.bin/make/sprite.h b/usr.bin/make/sprite.h index d2646f4ba4fa3..ca55509e22e60 100644 --- a/usr.bin/make/sprite.h +++ b/usr.bin/make/sprite.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)sprite.h 8.1 (Berkeley) 6/6/93 - * $Id$ + * $Id: sprite.h,v 1.7 1997/02/22 19:27:21 peter Exp $ */ /* @@ -57,10 +57,10 @@ typedef int Boolean; #ifndef TRUE #define TRUE 1 -#endif TRUE +#endif /* TRUE */ #ifndef FALSE #define FALSE 0 -#endif FALSE +#endif /* FALSE */ /* * Functions that must return a status can return a ReturnStatus to @@ -91,7 +91,7 @@ typedef int ReturnStatus; #define USER_NIL 0 #ifndef NULL #define NULL 0 -#endif NULL +#endif /* NULL */ /* * An address is just a pointer in C. It is defined as a character pointer diff --git a/usr.bin/make/str.c b/usr.bin/make/str.c index 03ea87a5d4733..7d17dd621ea4e 100644 --- a/usr.bin/make/str.c +++ b/usr.bin/make/str.c @@ -35,11 +35,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: str.c,v 1.9 1997/02/22 19:27:23 peter Exp $ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)str.c 5.8 (Berkeley) 6/1/90"; +#else +static const char rcsid[] = + "$Id$"; +#endif #endif /* not lint */ #include "make.h" @@ -165,12 +170,12 @@ brk_string(str, store_argc, expand) switch(ch = *p) { case '"': case '\'': - if (inquote) + if (inquote) { if (inquote == ch) inquote = '\0'; else break; - else { + } else { inquote = (char) ch; /* Don't miss "" or '' */ if (start == NULL && p[1] == inquote) { diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c index 040f9c560852d..898cc9e1bdf8b 100644 --- a/usr.bin/make/suff.c +++ b/usr.bin/make/suff.c @@ -35,11 +35,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: suff.c,v 1.8 1997/02/22 19:27:23 peter Exp $ + * $Id: suff.c,v 1.9 1998/04/26 09:44:48 phk Exp $ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; +#else +static const char rcsid[] = + "$Id"; +#endif #endif /* not lint */ /*- @@ -660,7 +665,7 @@ Suff_EndTransform(gnp, dummy) (void)SuffParseTransform(gn->name, &s, &t); if (DEBUG(SUFF)) { - printf("deleting transformation from %s to %s\n", + printf("deleting transformation from `%s' to `%s'\n", s->name, t->name); } @@ -1697,8 +1702,7 @@ SuffFindArchiveDeps(gn, slst) for (i = (sizeof(copy)/sizeof(copy[0]))-1; i >= 0; i--) { char *p1; Var_Set(copy[i], Var_Value(copy[i], mem, &p1), gn); - if (p1) - free(p1); + efree(p1); } @@ -2032,8 +2036,7 @@ sfnd_abort: gn->suffix = (targ == NULL) ? NULL : targ->suff; if (gn->suffix) gn->suffix->refCount++; - if (gn->path != NULL) - free(gn->path); + efree(gn->path); gn->path = estrdup(gn->name); } @@ -2133,8 +2136,7 @@ sfnd_abort: /* * So Dir_MTime doesn't go questing for it... */ - if (gn->path) - free(gn->path); + efree(gn->path); gn->path = estrdup(gn->name); /* diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c index 3fdc65b2ed184..21aaa64dbe31e 100644 --- a/usr.bin/make/targ.c +++ b/usr.bin/make/targ.c @@ -35,11 +35,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: targ.c,v 1.7 1997/02/22 19:27:24 peter Exp $ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)targ.c 8.2 (Berkeley) 3/19/94"; +#else +static const char rcsid[] = + "$Id"; +#endif #endif /* not lint */ /*- @@ -210,8 +215,7 @@ TargFreeGN (gnp) free(gn->name); - if (gn->path) - free(gn->path); + efree(gn->path); Lst_Destroy(gn->iParents, NOFREE); Lst_Destroy(gn->cohorts, NOFREE); @@ -462,17 +466,12 @@ Targ_FmtTime (time) time_t time; { struct tm *parts; - static char buf[40]; - static char *months[] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" - }; + static char buf[128]; parts = localtime(&time); - sprintf (buf, "%d:%02d:%02d %s %d, %d", - parts->tm_hour, parts->tm_min, parts->tm_sec, - months[parts->tm_mon], parts->tm_mday, 1900 + parts->tm_year); + strftime(buf, sizeof buf, "%k:%M:%S %b %d, %Y", parts); + buf[sizeof(buf) - 1] = '\0'; return(buf); } diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index 92b35b8a7602b..2f29567b4e508 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -35,11 +35,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: var.c,v 1.12 1999/04/19 07:30:04 imp Exp $ + * $Id: var.c,v 1.13 1999/07/31 20:53:02 hoek Exp $ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; +#else +static const char rcsid[] = + "$Id"; +#endif #endif /* not lint */ /*- @@ -141,15 +146,17 @@ typedef struct Var { * modified variables */ } Var; +/* Var*Pattern flags */ +#define VAR_SUB_GLOBAL 0x01 /* Apply substitution globally */ +#define VAR_MATCH_START 0x08 /* Match at start of word */ +#define VAR_MATCH_END 0x10 /* Match at end of word */ + typedef struct { char *lhs; /* String to match */ int leftLen; /* Length of string */ char *rhs; /* Replacement string (w/ &'s removed) */ int rightLen; /* Length of replacement */ int flags; -#define VAR_SUB_GLOBAL 1 /* Apply substitution globally */ -#define VAR_MATCH_START 2 /* Match at start of word */ -#define VAR_MATCH_END 4 /* Match at end of word */ } VarPattern; static int VarCmp __P((ClientData, ClientData)); @@ -266,8 +273,7 @@ VarFind (name, ctxt, flags) (int (*)(ClientData, ClientData)) strcmp) != NILLNODE) { localCheckEnvFirst = TRUE; - } - else { + } else { localCheckEnvFirst = FALSE; } @@ -1150,7 +1156,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) { register char *tstr; /* Pointer into str */ Var *v; /* Variable in invocation */ - register char *cp; /* Secondary pointer into str (place marker + char *cp; /* Secondary pointer into str (place marker * for tstr) */ Boolean haveModifier;/* TRUE if have modifiers for the variable */ register char endc; /* Ending character when variable in parens @@ -1196,6 +1202,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) * specially as they are the only four that will be set * when dynamic sources are expanded. */ + /* XXX: It looks like $% and $! are reversed here */ switch (str[1]) { case '@': return("$(.TARGET)"); @@ -1501,6 +1508,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) pattern.flags = 0; delim = tstr[1]; tstr += 2; + /* * If pattern begins with '^', it is anchored to the * start of the word -- skip over it and flag pattern. -- cgit v1.3