summaryrefslogtreecommitdiffstats
path: root/contrib/bmake
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2012-11-16 01:37:25 +0000
committersjg <sjg@FreeBSD.org>2012-11-16 01:37:25 +0000
commitd281294411049c9ca9fad03441663d96ccb73476 (patch)
treef309932499193bc9bb630ead5d6aeb07eeb582a8 /contrib/bmake
parent48176b8f78106dce8ff54e657c3116365c3506d8 (diff)
parentb9451e8e2e7c949c7a89c32cfed6b2399aef0115 (diff)
downloadFreeBSD-src-d281294411049c9ca9fad03441663d96ccb73476.zip
FreeBSD-src-d281294411049c9ca9fad03441663d96ccb73476.tar.gz
Merge bmake-20121111
Also pay attention to MK_SHARED_TOOLCHAIN. Approved by: marcel (mentor)
Diffstat (limited to 'contrib/bmake')
-rw-r--r--contrib/bmake/ChangeLog25
-rw-r--r--contrib/bmake/FILES1
-rw-r--r--contrib/bmake/Makefile.in6
-rw-r--r--contrib/bmake/cond.c37
-rw-r--r--contrib/bmake/make.c10
-rw-r--r--contrib/bmake/unit-tests/Makefile.in6
-rw-r--r--contrib/bmake/unit-tests/order20
-rw-r--r--contrib/bmake/unit-tests/test.exp3
8 files changed, 81 insertions, 27 deletions
diff --git a/contrib/bmake/ChangeLog b/contrib/bmake/ChangeLog
index 933e435..b17fcb5 100644
--- a/contrib/bmake/ChangeLog
+++ b/contrib/bmake/ChangeLog
@@ -1,3 +1,28 @@
+2012-11-11 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): 20121111
+ fix generation of bmake.cat1
+
+2012-11-09 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): 20121109
+ Merge with NetBSD make, pick up
+ o make.c: MakeBuildChild: return 0 so search continues if a
+ .ORDER dependency is detected.
+ o unit-tests/order: test the above
+
+2012-11-02 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): 20121102
+ Merge with NetBSD make, pick up
+ o cond.c: allow cond_state[] to grow.
+ In meta mode with a very large tree, we can hit the limit
+ while processing dirdeps.
+
+2012-10-25 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in: we need to use ${srcdir} not ${.CURDIR}
+
2012-10-10 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile.in (MAKE_VERSION): 20121010
diff --git a/contrib/bmake/FILES b/contrib/bmake/FILES
index 397d3a2..e7c7861 100644
--- a/contrib/bmake/FILES
+++ b/contrib/bmake/FILES
@@ -110,6 +110,7 @@ unit-tests/modmisc
unit-tests/modorder
unit-tests/modts
unit-tests/modword
+unit-tests/order
unit-tests/phony-end
unit-tests/posix
unit-tests/qequals
diff --git a/contrib/bmake/Makefile.in b/contrib/bmake/Makefile.in
index 4cb55dd..7936d3b 100644
--- a/contrib/bmake/Makefile.in
+++ b/contrib/bmake/Makefile.in
@@ -1,7 +1,7 @@
# $NetBSD: Makefile,v 1.56 2012/05/30 21:54:23 sjg Exp $
# @(#)Makefile 5.2 (Berkeley) 12/28/90
-# $Id: Makefile.in,v 1.174 2012/10/10 18:46:24 sjg Exp $
+# $Id: Makefile.in,v 1.178 2012/11/15 16:48:59 sjg Exp $
PROG= bmake
SRCS= arch.c buf.c compat.c cond.c dir.c for.c hash.c job.c main.c \
@@ -21,7 +21,7 @@ srcdir= @srcdir@
CC?= @CC@
# Base version on src date
-MAKE_VERSION= 20121010
+MAKE_VERSION= 20121111
MACHINE=@machine@
MACHINE_ARCH=@machine_arch@
DEFAULT_SYS_PATH = @default_sys_path@
@@ -114,7 +114,7 @@ ${MAN}: make.1 my.history
@echo making ${PROG}.1
@sed -e 's/^.Nx/NetBSD/' -e '/^.Nm/s/make/${PROG}/' \
-e '/^.Sh HISTORY/rmy.history' \
- -e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${.CURDIR}/make.1 > $@
+ -e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1 > $@
.endif
diff --git a/contrib/bmake/cond.c b/contrib/bmake/cond.c
index 6d0b965..a1c6705 100644
--- a/contrib/bmake/cond.c
+++ b/contrib/bmake/cond.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cond.c,v 1.64 2012/06/12 19:21:50 joerg Exp $ */
+/* $NetBSD: cond.c,v 1.67 2012/11/03 13:59:27 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: cond.c,v 1.64 2012/06/12 19:21:50 joerg Exp $";
+static char rcsid[] = "$NetBSD: cond.c,v 1.67 2012/11/03 13:59:27 christos Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94";
#else
-__RCSID("$NetBSD: cond.c,v 1.64 2012/06/12 19:21:50 joerg Exp $");
+__RCSID("$NetBSD: cond.c,v 1.67 2012/11/03 13:59:27 christos Exp $");
#endif
#endif /* not lint */
#endif
@@ -1227,7 +1227,8 @@ do_Cond_EvalExpression(Boolean *value)
int
Cond_Eval(char *line)
{
- #define MAXIF 128 /* maximum depth of .if'ing */
+#define MAXIF 128 /* maximum depth of .if'ing */
+#define MAXIF_BUMP 32 /* how much to grow by */
enum if_states {
IF_ACTIVE, /* .if or .elif part active */
ELSE_ACTIVE, /* .else part active */
@@ -1235,7 +1236,8 @@ Cond_Eval(char *line)
SKIP_TO_ELSE, /* has been true, but not seen '.else' */
SKIP_TO_ENDIF /* nothing else to execute */
};
- static enum if_states cond_state[MAXIF + 1] = { IF_ACTIVE };
+ static enum if_states *cond_state = NULL;
+ static unsigned int max_if_depth = MAXIF;
const struct If *ifp;
Boolean isElif;
@@ -1244,7 +1246,10 @@ Cond_Eval(char *line)
enum if_states state;
level = PARSE_FATAL;
-
+ if (!cond_state) {
+ cond_state = bmake_malloc(max_if_depth * sizeof(*cond_state));
+ cond_state[0] = IF_ACTIVE;
+ }
/* skip leading character (the '.') and any whitespace */
for (line++; *line == ' ' || *line == '\t'; line++)
continue;
@@ -1261,8 +1266,6 @@ Cond_Eval(char *line)
}
/* Return state for previous conditional */
cond_depth--;
- if (cond_depth > MAXIF)
- return COND_SKIP;
return cond_state[cond_depth] <= ELSE_ACTIVE ? COND_PARSE : COND_SKIP;
}
@@ -1275,8 +1278,6 @@ Cond_Eval(char *line)
return COND_PARSE;
}
- if (cond_depth > MAXIF)
- return COND_SKIP;
state = cond_state[cond_depth];
switch (state) {
case SEARCH_FOR_ELIF:
@@ -1325,9 +1326,6 @@ Cond_Eval(char *line)
Parse_Error(level, "if-less elif");
return COND_PARSE;
}
- if (cond_depth > MAXIF)
- /* Error reported when we saw the .if ... */
- return COND_SKIP;
state = cond_state[cond_depth];
if (state == SKIP_TO_ENDIF || state == ELSE_ACTIVE) {
Parse_Error(PARSE_WARNING, "extra elif");
@@ -1341,10 +1339,15 @@ Cond_Eval(char *line)
}
} else {
/* Normal .if */
- if (cond_depth >= MAXIF) {
- cond_depth++;
- Parse_Error(PARSE_FATAL, "Too many nested if's. %d max.", MAXIF);
- return COND_SKIP;
+ if (cond_depth + 1 >= max_if_depth) {
+ /*
+ * This is rare, but not impossible.
+ * In meta mode, dirdeps.mk (only runs at level 0)
+ * can need more than the default.
+ */
+ max_if_depth += MAXIF_BUMP;
+ cond_state = bmake_realloc(cond_state, max_if_depth *
+ sizeof(*cond_state));
}
state = cond_state[cond_depth];
cond_depth++;
diff --git a/contrib/bmake/make.c b/contrib/bmake/make.c
index 4fa4ff9..7905f8c 100644
--- a/contrib/bmake/make.c
+++ b/contrib/bmake/make.c
@@ -1,4 +1,4 @@
-/* $NetBSD: make.c,v 1.87 2012/06/12 19:21:51 joerg Exp $ */
+/* $NetBSD: make.c,v 1.88 2012/11/09 18:53:05 sjg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: make.c,v 1.87 2012/06/12 19:21:51 joerg Exp $";
+static char rcsid[] = "$NetBSD: make.c,v 1.88 2012/11/09 18:53:05 sjg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)make.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: make.c,v 1.87 2012/06/12 19:21:51 joerg Exp $");
+__RCSID("$NetBSD: make.c,v 1.88 2012/11/09 18:53:05 sjg Exp $");
#endif
#endif /* not lint */
#endif
@@ -1032,7 +1032,7 @@ MakeBuildChild(void *v_cn, void *toBeMade_next)
if (cn->order_pred && Lst_ForEach(cn->order_pred, MakeCheckOrder, 0)) {
/* Can't build this (or anything else in this child list) yet */
cn->made = DEFERRED;
- return 1;
+ return 0; /* but keep looking */
}
if (DEBUG(MAKE))
@@ -1055,7 +1055,7 @@ MakeBuildChild(void *v_cn, void *toBeMade_next)
return cn->type & OP_WAIT && cn->unmade > 0;
}
-/* When a .ORDER RHS node completes we do this on each LHS */
+/* When a .ORDER LHS node completes we do this on each RHS */
static int
MakeBuildParent(void *v_pn, void *toBeMade_next)
{
diff --git a/contrib/bmake/unit-tests/Makefile.in b/contrib/bmake/unit-tests/Makefile.in
index 4e3592d..e5bf9b2 100644
--- a/contrib/bmake/unit-tests/Makefile.in
+++ b/contrib/bmake/unit-tests/Makefile.in
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.38 2012/06/19 23:38:48 sjg Exp $
+# $Id: Makefile.in,v 1.39 2012/11/09 19:16:10 sjg Exp $
#
-# $NetBSD: Makefile,v 1.34 2012/06/19 23:25:53 sjg Exp $
+# $NetBSD: Makefile,v 1.35 2012/11/09 19:08:28 sjg Exp $
#
# Unit tests for make(1)
# The main targets are:
@@ -40,6 +40,7 @@ SUBFILES= \
modorder \
modts \
modword \
+ order \
phony-end \
posix \
qequals \
@@ -52,6 +53,7 @@ SUBFILES= \
all: ${SUBFILES}
flags.doterror=
+flags.order=-j1
# the tests are actually done with sub-makes.
.PHONY: ${SUBFILES}
diff --git a/contrib/bmake/unit-tests/order b/contrib/bmake/unit-tests/order
new file mode 100644
index 0000000..175da47
--- /dev/null
+++ b/contrib/bmake/unit-tests/order
@@ -0,0 +1,20 @@
+# $NetBSD: order,v 1.1 2012/11/09 19:08:28 sjg Exp $
+
+# Test that .ORDER is handled correctly.
+# The explicit dependency the.o: the.h will make us examine the.h
+# the .ORDER will prevent us building it immediately,
+# we should then examine the.c rather than stop.
+
+all: the.o
+
+.ORDER: the.c the.h
+
+the.c the.h:
+ @echo Making $@
+
+.SUFFIXES: .o .c
+
+.c.o:
+ @echo Making $@ from $?
+
+the.o: the.h
diff --git a/contrib/bmake/unit-tests/test.exp b/contrib/bmake/unit-tests/test.exp
index 932d84e..368dc31 100644
--- a/contrib/bmake/unit-tests/test.exp
+++ b/contrib/bmake/unit-tests/test.exp
@@ -310,6 +310,9 @@ LIST:tw:C/ /,/g="one two three four five six"
LIST:tw:C/ /,/1g="one two three four five six"
LIST:tw:tW:C/ /,/="one,two three four five six"
LIST:tW:tw:C/ /,/="one two three four five six"
+Making the.c
+Making the.h
+Making the.o from the.h the.c
.TARGET="phony" .PREFIX="phony" .IMPSRC=""
.TARGET="all" .PREFIX="all" .IMPSRC=""
.TARGET="ok" .PREFIX="ok" .IMPSRC=""
OpenPOWER on IntegriCloud