aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1995-08-08 04:00:37 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1995-08-08 04:00:37 +0000
commit1d6a79bc33c7430c06233ffc8bbe081ad3635fea (patch)
treec0237573a48aa1380d8729841d3270822c839a48
parent90a2b819e31b3ef89db07412cf352a49e1d21c53 (diff)
Notes
-rw-r--r--usr.bin/make/Makefile4
-rw-r--r--usr.bin/make/make.c2
-rw-r--r--usr.bin/make/parse.c7
-rw-r--r--usr.bin/make/str.c9
-rw-r--r--usr.bin/make/suff.c15
-rw-r--r--usr.bin/make/var.c1
6 files changed, 29 insertions, 9 deletions
diff --git a/usr.bin/make/Makefile b/usr.bin/make/Makefile
index 04b5e673c80bf..c28b6f840dce8 100644
--- a/usr.bin/make/Makefile
+++ b/usr.bin/make/Makefile
@@ -1,8 +1,8 @@
# from: @(#)Makefile 5.2 (Berkeley) 12/28/90
-# $Id: Makefile,v 1.6 1994/06/30 05:33:39 cgd Exp $
+# $Id: Makefile,v 1.4 1995/06/16 22:46:38 ache Exp $
PROG= make
-CFLAGS+= -I${.CURDIR} -DPOSIX
+CFLAGS+= -I${.CURDIR} -DPOSIX -DSYSVINCLUDE
SRCS= arch.c buf.c compat.c cond.c dir.c for.c hash.c job.c main.c \
make.c parse.c str.c suff.c targ.c var.c
SRCS+= lstAppend.c lstAtEnd.c lstAtFront.c lstClose.c lstConcat.c \
diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c
index f4c83d650d87f..d6959a80e78ce 100644
--- a/usr.bin/make/make.c
+++ b/usr.bin/make/make.c
@@ -88,6 +88,8 @@ static int numNodes; /* Number of nodes to be processed. If this
static int MakeAddChild __P((ClientData, ClientData));
static int MakeAddAllSrc __P((ClientData, ClientData));
+static int MakeTimeStamp __P((ClientData, ClientData));
+static int MakeHandleUse __P((ClientData, ClientData));
static Boolean MakeStartJobs __P((void));
static int MakePrintStatus __P((ClientData, ClientData));
/*-
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index 27b3ff73a8065..a56e398d785e7 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -193,7 +193,6 @@ static struct {
} parseKeywords[] = {
{ ".BEGIN", Begin, 0 },
{ ".DEFAULT", Default, 0 },
-{ ".OPTIONAL", Attribute, OP_OPTIONAL },
{ ".END", End, 0 },
{ ".EXEC", Attribute, OP_EXEC },
{ ".IGNORE", Ignore, OP_IGNORE },
@@ -209,6 +208,7 @@ static struct {
{ ".NOTMAIN", Attribute, OP_NOTMAIN },
{ ".NOTPARALLEL", NotParallel, 0 },
{ ".NULL", Null, 0 },
+{ ".OPTIONAL", Attribute, OP_OPTIONAL },
{ ".ORDER", Order, 0 },
{ ".PATH", ExPath, 0 },
{ ".PRECIOUS", Precious, OP_PRECIOUS },
@@ -2256,8 +2256,8 @@ test_char:
ep = line;
while (*ep)
++ep;
- while (ep > line && (ep[-1] == ' ' || ep[-1] == '\t')) {
- if (ep > line + 1 && ep[-2] == '\\')
+ while (ep > line + 1 && (ep[-1] == ' ' || ep[-1] == '\t')) {
+ if (ep[-2] == '\\')
break;
--ep;
}
@@ -2437,6 +2437,7 @@ Parse_File(name, stream)
}
#ifdef SYSVINCLUDE
} else if (strncmp (line, "include", 7) == 0 &&
+ isspace(line[7]) &&
strchr(line, ':') == NULL) {
/*
* It's an S3/S5-style "include".
diff --git a/usr.bin/make/str.c b/usr.bin/make/str.c
index 35e50fe7dfff2..41dd195d89461 100644
--- a/usr.bin/make/str.c
+++ b/usr.bin/make/str.c
@@ -38,7 +38,7 @@
#ifndef lint
/* from: static char sccsid[] = "@(#)str.c 5.8 (Berkeley) 6/1/90"; */
-static char *rcsid = "$Id: str.c,v 1.3 1995/01/23 21:02:00 jkh Exp $";
+static char *rcsid = "$Id: str.c,v 1.5 1995/06/18 12:34:12 ache Exp $";
#endif /* not lint */
#include "make.h"
@@ -68,8 +68,11 @@ str_init()
void
str_end()
{
- free(argv[0]);
- free((Address) argv);
+ if (argv) {
+ if (argv[0])
+ free(argv[0]);
+ free((Address) argv);
+ }
if (buffer)
free(buffer);
}
diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c
index 1980bae9d09b6..7340383acd67e 100644
--- a/usr.bin/make/suff.c
+++ b/usr.bin/make/suff.c
@@ -1911,7 +1911,20 @@ SuffFindNormalDeps(gn, slst)
targ->cp = Lst_Init(FALSE);
#endif
- SuffAddLevel(srcs, targ);
+ /*
+ * Only use the default suffix rules if we don't have commands
+ * or dependencies defined for this gnode
+ */
+ if (Lst_IsEmpty(gn->commands) && Lst_IsEmpty(gn->children))
+ SuffAddLevel(srcs, targ);
+ else {
+ if (DEBUG(SUFF))
+ printf("not ");
+ }
+
+ if (DEBUG(SUFF))
+ printf("adding suffix rules\n");
+
(void)Lst_AtEnd(targs, (ClientData)targ);
}
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c
index 1019ab5423e70..851a80ccd4c29 100644
--- a/usr.bin/make/var.c
+++ b/usr.bin/make/var.c
@@ -536,6 +536,7 @@ Var_Exists(name, ctxt)
if (v == (Var *)NIL) {
return(FALSE);
} else if (v->flags & VAR_FROM_ENV) {
+ free(v->name);
Buf_Destroy(v->val, TRUE);
free((char *)v);
}