svn commit: r310299 - in vendor/NetBSD/bmake/dist: . mk
Simon J. Gerraty
sjg at FreeBSD.org
Mon Dec 19 21:51:02 UTC 2016
Author: sjg
Date: Mon Dec 19 21:50:59 2016
New Revision: 310299
URL: https://svnweb.freebsd.org/changeset/base/310299
Log:
Import bmake-20161212
From ChangeLog
2016-12-12 Simon J. Gerraty <sjg at bad.crufty.net>
* Makefile (_MAKE_VERSION): 20161212
Merge with NetBSD make, pick up
o main.c: look for obj.${MACHINE}-${MACHINE_ARCH} too.
2016-12-09 Simon J. Gerraty <sjg at bad.crufty.net>
* Makefile (_MAKE_VERSION): 20161209
Merge with NetBSD make, pick up
o main.c: cleanup setting of .OBJDIR
o parse.c: avoid coredump from (var)=val
2016-11-26 Simon J. Gerraty <sjg at bad.crufty.net>
* Makefile (_MAKE_VERSION): 20161126
Merge with NetBSD make, pick up
o make.c: Make_OODate: report src node name if path not set
2016-09-26 Simon J. Gerraty <sjg at bad.crufty.net>
* Makefile (_MAKE_VERSION): 20160926
Merge with NetBSD make, pick up
o support for .DELETE_ON_ERROR: (remove targets that fail)
2016-09-26 Simon J. Gerraty <sjg at bad.crufty.net>
* Makefile MAN: tweak .Dt to match ${PROG}
mk/ChangeLog
2016-12-12 Simon J. Gerraty <sjg at bad.crufty.net>
* install-mk (MK_VERSION): 20161212
* meta2deps.py: set pid_cwd[pid] when we process 'C'hdir,
rather than when we detect pid change.
2016-12-07 Simon J. Gerraty <sjg at bad.crufty.net>
* install-mk (MK_VERSION): 20161207
* meta.stage.mk: add stage_as_and_symlink for staging packages.
We build foo.tgz stage_as foo-${VERSION}.tgz but want to be able
to use foo.tgz to reference the latest staged version - so we
make foo.tgz a symlink to it.
Using a target to do both operations ensures we stay in sync.
2016-11-26 Simon J. Gerraty <sjg at bad.crufty.net>
* install-mk (MK_VERSION): 20161126
* dirdeps.mk: set DIRDEPS_CACHE before we include local.dirdeps.mk
so it can add dependencies.
2016-10-10 Simon J. Gerraty <sjg at bad.crufty.net>
* dirdeps.mk: set DEP_* before we expand .MAKE.DEPENDFILE_PREFERENCE
do that they can influence the result correctly.
* dirdeps.mk (${DIRDEPS_CACHE}): make sure we pass on TARGET_SPEC
* dirdeps.mk: Add ONLY_TARGET_SPEC_LIST and NOT_TARGET_SPEC_LIST
similar to ONLY_MACHINE_LIST and NOT_MACHINE_LIST
2016-10-05 Simon J. Gerraty <sjg at bad.crufty.net>
* dirdeps.mk: remove dependence on jot (normal situations anyway).
Before we read another Makefile.depend* set DEP_* vars from
_DEP_TARGET_SPEC in case it uses any of them with :=
When bootstrapping, trim any ,* from extention of chosen _src
Makefile.depend* to get the machine value we subst for.
2016-09-30 Simon J. Gerraty <sjg at bad.crufty.net>
* dirdeps.mk: use TARGET_SPEC_VARS to qualify components added to
DEP_SKIP_DIR and DEP_DIRDEPS_FILTER
* sys.mk: extract some bits to sys.{debug,vars}.mk
for easier re-use by others.
2016-09-23 Simon Gerraty <sjg at sjg-mba13>
* lib.mk: Use ${PICO} for extension for PIC objects.
default to .pico (like NetBSD) safe on case insensitive filesystem.
2016-08-19 Simon J. Gerraty <sjg at bad.crufty.net>
* meta.sys.mk (META_COOKIE_TOUCH): use ${.OBJDIR}/${.TARGET:T} as default
Added:
vendor/NetBSD/bmake/dist/mk/sys.debug.mk (contents, props changed)
vendor/NetBSD/bmake/dist/mk/sys.vars.mk (contents, props changed)
Modified:
vendor/NetBSD/bmake/dist/ChangeLog
vendor/NetBSD/bmake/dist/Makefile
vendor/NetBSD/bmake/dist/bmake.1
vendor/NetBSD/bmake/dist/bmake.cat1
vendor/NetBSD/bmake/dist/compat.c
vendor/NetBSD/bmake/dist/job.c
vendor/NetBSD/bmake/dist/main.c
vendor/NetBSD/bmake/dist/make.1
vendor/NetBSD/bmake/dist/make.c
vendor/NetBSD/bmake/dist/make.h
vendor/NetBSD/bmake/dist/mk/ChangeLog
vendor/NetBSD/bmake/dist/mk/FILES
vendor/NetBSD/bmake/dist/mk/dirdeps.mk
vendor/NetBSD/bmake/dist/mk/gendirdeps.mk
vendor/NetBSD/bmake/dist/mk/install-mk
vendor/NetBSD/bmake/dist/mk/lib.mk
vendor/NetBSD/bmake/dist/mk/meta.stage.mk
vendor/NetBSD/bmake/dist/mk/meta.sys.mk
vendor/NetBSD/bmake/dist/mk/meta2deps.py
vendor/NetBSD/bmake/dist/mk/meta2deps.sh
vendor/NetBSD/bmake/dist/mk/sys.mk
vendor/NetBSD/bmake/dist/nonints.h
vendor/NetBSD/bmake/dist/parse.c
Modified: vendor/NetBSD/bmake/dist/ChangeLog
==============================================================================
--- vendor/NetBSD/bmake/dist/ChangeLog Mon Dec 19 21:27:18 2016 (r310298)
+++ vendor/NetBSD/bmake/dist/ChangeLog Mon Dec 19 21:50:59 2016 (r310299)
@@ -1,3 +1,32 @@
+2016-12-12 Simon J. Gerraty <sjg at bad.crufty.net>
+
+ * Makefile (_MAKE_VERSION): 20161212
+ Merge with NetBSD make, pick up
+ o main.c: look for obj.${MACHINE}-${MACHINE_ARCH} too.
+
+2016-12-09 Simon J. Gerraty <sjg at bad.crufty.net>
+
+ * Makefile (_MAKE_VERSION): 20161209
+ Merge with NetBSD make, pick up
+ o main.c: cleanup setting of .OBJDIR
+ o parse.c: avoid coredump from (var)=val
+
+2016-11-26 Simon J. Gerraty <sjg at bad.crufty.net>
+
+ * Makefile (_MAKE_VERSION): 20161126
+ Merge with NetBSD make, pick up
+ o make.c: Make_OODate: report src node name if path not set
+
+2016-09-26 Simon J. Gerraty <sjg at bad.crufty.net>
+
+ * Makefile (_MAKE_VERSION): 20160926
+ Merge with NetBSD make, pick up
+ o support for .DELETE_ON_ERROR: (remove targets that fail)
+
+2016-09-26 Simon J. Gerraty <sjg at bad.crufty.net>
+
+ * Makefile MAN: tweak .Dt to match ${PROG}
+
2016-08-18 Simon J. Gerraty <sjg at bad.crufty.net>
* Makefile (_MAKE_VERSION): 20160818
Modified: vendor/NetBSD/bmake/dist/Makefile
==============================================================================
--- vendor/NetBSD/bmake/dist/Makefile Mon Dec 19 21:27:18 2016 (r310298)
+++ vendor/NetBSD/bmake/dist/Makefile Mon Dec 19 21:50:59 2016 (r310299)
@@ -1,7 +1,7 @@
-# $Id: Makefile,v 1.72 2016/08/18 23:02:26 sjg Exp $
+# $Id: Makefile,v 1.77 2016/12/12 07:34:19 sjg Exp $
# Base version on src date
-_MAKE_VERSION= 20160818
+_MAKE_VERSION= 20161212
PROG= bmake
@@ -156,7 +156,10 @@ my.history: ${MAKEFILE}
.NOPATH: ${MAN}
${MAN}: make.1 my.history
@echo making $@
- @sed -e 's/^.Nx/NetBSD/' -e '/^.Nm/s/make/${PROG}/' \
+ @sed \
+ -e '/^.Dt/s/MAKE/${PROG:tu}/' \
+ -e 's/^.Nx/NetBSD/' \
+ -e '/^.Nm/s/make/${PROG}/' \
-e '/^.Sh HISTORY/rmy.history' \
-e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1 > $@
Modified: vendor/NetBSD/bmake/dist/bmake.1
==============================================================================
--- vendor/NetBSD/bmake/dist/bmake.1 Mon Dec 19 21:27:18 2016 (r310298)
+++ vendor/NetBSD/bmake/dist/bmake.1 Mon Dec 19 21:50:59 2016 (r310299)
@@ -1,4 +1,4 @@
-.\" $NetBSD: make.1,v 1.262 2016/08/18 19:23:20 wiz Exp $
+.\" $NetBSD: make.1,v 1.263 2016/08/26 23:37:54 dholland Exp $
.\"
.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,8 +29,8 @@
.\"
.\" from: @(#)make.1 8.4 (Berkeley) 3/19/94
.\"
-.Dd August 15, 2016
-.Dt MAKE 1
+.Dd August 26, 2016
+.Dt BMAKE 1
.Os
.Sh NAME
.Nm bmake
@@ -2011,6 +2011,14 @@ variable of a target that inherits
.Ic .DEFAULT Ns 's
commands is set
to the target's own name.
+.It Ic .DELETE_ON_ERROR
+If this target is present in the makefile, it globally causes make to
+delete targets whose commands fail.
+(By default, only targets whose commands are interrupted during
+execution are deleted.
+This is the historical behavior.)
+This setting can be used to help prevent half-finished or malformed
+targets from being left around and corrupting future rebuilds.
.It Ic .END
Any command lines attached to this target are executed after everything
else is done.
Modified: vendor/NetBSD/bmake/dist/bmake.cat1
==============================================================================
--- vendor/NetBSD/bmake/dist/bmake.cat1 Mon Dec 19 21:27:18 2016 (r310298)
+++ vendor/NetBSD/bmake/dist/bmake.cat1 Mon Dec 19 21:50:59 2016 (r310299)
@@ -1,4 +1,4 @@
-MAKE(1) NetBSD General Commands Manual MAKE(1)
+BMAKE(1) NetBSD General Commands Manual BMAKE(1)
NNAAMMEE
bbmmaakkee -- maintain program dependencies
@@ -1285,6 +1285,14 @@ SSPPEECCIIAALL TTAARRGGEETT
target that inherits ..DDEEFFAAUULLTT's commands is set to the target's
own name.
+ ..DDEELLEETTEE__OONN__EERRRROORR
+ If this target is present in the makefile, it globally causes
+ make to delete targets whose commands fail. (By default, only
+ targets whose commands are interrupted during execution are
+ deleted. This is the historical behavior.) This setting can be
+ used to help prevent half-finished or malformed targets from
+ being left around and corrupting future rebuilds.
+
..EENNDD Any command lines attached to this target are executed after
everything else is done.
@@ -1498,4 +1506,4 @@ BBUUGGSS
There is no way of escaping a space character in a filename.
-NetBSD 5.1 August 15, 2016 NetBSD 5.1
+NetBSD 5.1 August 26, 2016 NetBSD 5.1
Modified: vendor/NetBSD/bmake/dist/compat.c
==============================================================================
--- vendor/NetBSD/bmake/dist/compat.c Mon Dec 19 21:27:18 2016 (r310298)
+++ vendor/NetBSD/bmake/dist/compat.c Mon Dec 19 21:50:59 2016 (r310299)
@@ -1,4 +1,4 @@
-/* $NetBSD: compat.c,v 1.105 2016/05/12 20:28:34 sjg Exp $ */
+/* $NetBSD: compat.c,v 1.106 2016/08/26 23:28:39 dholland Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: compat.c,v 1.105 2016/05/12 20:28:34 sjg Exp $";
+static char rcsid[] = "$NetBSD: compat.c,v 1.106 2016/08/26 23:28:39 dholland Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: compat.c,v 1.105 2016/05/12 20:28:34 sjg Exp $");
+__RCSID("$NetBSD: compat.c,v 1.106 2016/08/26 23:28:39 dholland Exp $");
#endif
#endif /* not lint */
#endif
@@ -119,6 +119,25 @@ static GNode *curTarg = NULL;
static GNode *ENDNode;
static void CompatInterrupt(int);
+/*
+ * CompatDeleteTarget -- delete a failed, interrupted, or otherwise
+ * duffed target if not inhibited by .PRECIOUS.
+ */
+static void
+CompatDeleteTarget(GNode *gn)
+{
+ if ((gn != NULL) && !Targ_Precious (gn)) {
+ char *p1;
+ char *file = Var_Value(TARGET, gn, &p1);
+
+ if (!noExecute && eunlink(file) != -1) {
+ Error("*** %s removed", file);
+ }
+
+ free(p1);
+ }
+}
+
/*-
*-----------------------------------------------------------------------
* CompatInterrupt --
@@ -132,6 +151,9 @@ static void CompatInterrupt(int);
* The target is removed and the process exits. If .INTERRUPT exists,
* its commands are run first WITH INTERRUPTS IGNORED..
*
+ * XXX: is .PRECIOUS supposed to inhibit .INTERRUPT? I doubt it, but I've
+ * left the logic alone for now. - dholland 20160826
+ *
*-----------------------------------------------------------------------
*/
static void
@@ -139,16 +161,9 @@ CompatInterrupt(int signo)
{
GNode *gn;
- if ((curTarg != NULL) && !Targ_Precious (curTarg)) {
- char *p1;
- char *file = Var_Value(TARGET, curTarg, &p1);
-
- if (!noExecute && eunlink(file) != -1) {
- Error("*** %s removed", file);
- }
-
- free(p1);
+ CompatDeleteTarget(curTarg);
+ if ((curTarg != NULL) && !Targ_Precious (curTarg)) {
/*
* Run .INTERRUPT only if hit with interrupt signal
*/
@@ -158,7 +173,6 @@ CompatInterrupt(int signo)
Compat_Make(gn, gn);
}
}
-
}
if (signo == SIGQUIT)
_exit(signo);
@@ -447,6 +461,11 @@ again:
* continue.
*/
printf(" (continuing)\n");
+ } else {
+ printf("\n");
+ }
+ if (deleteOnError) {
+ CompatDeleteTarget(gn);
}
} else {
/*
@@ -607,7 +626,7 @@ Compat_Make(void *gnp, void *pgnp)
} else if (keepgoing) {
pgn->flags &= ~REMAKE;
} else {
- PrintOnError(gn, "\n\nStop.");
+ PrintOnError(gn, "\nStop.");
exit(1);
}
} else if (gn->made == ERROR) {
@@ -698,7 +717,7 @@ Compat_Run(Lst targs)
if (gn != NULL) {
Compat_Make(gn, gn);
if (gn->made == ERROR) {
- PrintOnError(gn, "\n\nStop.");
+ PrintOnError(gn, "\nStop.");
exit(1);
}
}
@@ -739,7 +758,7 @@ Compat_Run(Lst targs)
if (errors == 0) {
Compat_Make(ENDNode, ENDNode);
if (gn->made == ERROR) {
- PrintOnError(gn, "\n\nStop.");
+ PrintOnError(gn, "\nStop.");
exit(1);
}
}
Modified: vendor/NetBSD/bmake/dist/job.c
==============================================================================
--- vendor/NetBSD/bmake/dist/job.c Mon Dec 19 21:27:18 2016 (r310298)
+++ vendor/NetBSD/bmake/dist/job.c Mon Dec 19 21:50:59 2016 (r310299)
@@ -1,4 +1,4 @@
-/* $NetBSD: job.c,v 1.187 2016/05/12 20:28:34 sjg Exp $ */
+/* $NetBSD: job.c,v 1.188 2016/08/26 23:28:39 dholland Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: job.c,v 1.187 2016/05/12 20:28:34 sjg Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.188 2016/08/26 23:28:39 dholland Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: job.c,v 1.187 2016/05/12 20:28:34 sjg Exp $");
+__RCSID("$NetBSD: job.c,v 1.188 2016/08/26 23:28:39 dholland Exp $");
#endif
#endif /* not lint */
#endif
@@ -388,6 +388,21 @@ job_table_dump(const char *where)
}
/*
+ * Delete the target of a failed, interrupted, or otherwise
+ * unsuccessful job unless inhibited by .PRECIOUS.
+ */
+static void
+JobDeleteTarget(GNode *gn)
+{
+ if ((gn->type & (OP_JOIN|OP_PHONY)) == 0 && !Targ_Precious(gn)) {
+ char *file = (gn->path == NULL ? gn->name : gn->path);
+ if (!noExecute && eunlink(file) != -1) {
+ Error("*** %s removed", file);
+ }
+ }
+}
+
+/*
* JobSigLock/JobSigUnlock
*
* Signal lock routines to get exclusive access. Currently used to
@@ -1033,6 +1048,9 @@ JobFinish (Job *job, WAIT_T status)
if (job->flags & JOB_IGNERR) {
WAIT_STATUS(status) = 0;
} else {
+ if (deleteOnError) {
+ JobDeleteTarget(job->node);
+ }
PrintOnError(job->node, NULL);
}
} else if (DEBUG(JOB)) {
@@ -1050,6 +1068,9 @@ JobFinish (Job *job, WAIT_T status)
}
(void)printf("*** [%s] Signal %d\n",
job->node->name, WTERMSIG(status));
+ if (deleteOnError) {
+ JobDeleteTarget(job->node);
+ }
}
(void)fflush(stdout);
}
@@ -2578,12 +2599,7 @@ JobInterrupt(int runINTERRUPT, int signo
gn = job->node;
- if ((gn->type & (OP_JOIN|OP_PHONY)) == 0 && !Targ_Precious(gn)) {
- char *file = (gn->path == NULL ? gn->name : gn->path);
- if (!noExecute && eunlink(file) != -1) {
- Error("*** %s removed", file);
- }
- }
+ JobDeleteTarget(gn);
if (job->pid) {
if (DEBUG(JOB)) {
(void)fprintf(debug_file,
Modified: vendor/NetBSD/bmake/dist/main.c
==============================================================================
--- vendor/NetBSD/bmake/dist/main.c Mon Dec 19 21:27:18 2016 (r310298)
+++ vendor/NetBSD/bmake/dist/main.c Mon Dec 19 21:50:59 2016 (r310299)
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.250 2016/08/11 19:53:17 sjg Exp $ */
+/* $NetBSD: main.c,v 1.254 2016/12/10 23:12:39 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.250 2016/08/11 19:53:17 sjg Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.254 2016/12/10 23:12:39 christos Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
@@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
#if 0
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: main.c,v 1.250 2016/08/11 19:53:17 sjg Exp $");
+__RCSID("$NetBSD: main.c,v 1.254 2016/12/10 23:12:39 christos Exp $");
#endif
#endif /* not lint */
#endif
@@ -155,6 +155,7 @@ Lst create; /* Targets to be made */
time_t now; /* Time at start of make */
GNode *DEFAULT; /* .DEFAULT node */
Boolean allPrecious; /* .PRECIOUS given on line by itself */
+Boolean deleteOnError; /* .DELETE_ON_ERROR: set */
static Boolean noBuiltins; /* -r flag */
static Lst makefiles; /* ordered list of makefiles to read */
@@ -711,18 +712,24 @@ Main_ParseArgLine(const char *line)
}
Boolean
-Main_SetObjdir(const char *path)
+Main_SetObjdir(const char *fmt, ...)
{
struct stat sb;
- char *p = NULL;
- char buf[MAXPATHLEN + 1];
+ char *p, *path;
+ char buf[MAXPATHLEN + 1], pbuf[MAXPATHLEN + 1];
Boolean rc = FALSE;
+ va_list ap;
+
+ va_start(ap, fmt);
+ vsnprintf(path = pbuf, MAXPATHLEN, fmt, ap);
+ va_end(ap);
/* expand variable substitutions */
if (strchr(path, '$') != 0) {
snprintf(buf, MAXPATHLEN, "%s", path);
path = p = Var_Subst(NULL, buf, VAR_GLOBAL, VARF_WANTRES);
- }
+ } else
+ p = NULL;
if (path[0] != '/') {
snprintf(buf, MAXPATHLEN, "%s/%s", curdir, path);
@@ -749,6 +756,18 @@ Main_SetObjdir(const char *path)
return rc;
}
+static Boolean
+Main_SetVarObjdir(const char *var, const char *suffix)
+{
+ char *p1, *path;
+ if ((path = Var_Value(var, VAR_CMD, &p1)) == NULL)
+ return FALSE;
+
+ (void)Main_SetObjdir("%s%s", path, suffix);
+ free(p1);
+ return TRUE;
+}
+
/*-
* ReadAllMakefiles --
* wrapper around ReadMakefile() to read all.
@@ -979,6 +998,7 @@ main(int argc, char **argv)
noRecursiveExecute = FALSE; /* Execute all .MAKE targets */
keepgoing = FALSE; /* Stop on error */
allPrecious = FALSE; /* Remove targets when interrupted */
+ deleteOnError = FALSE; /* Historical default behavior */
queryFlag = FALSE; /* This is not just a check-run */
noBuiltins = FALSE; /* Read the built-in rules */
touchFlag = FALSE; /* Actually update targets */
@@ -1128,28 +1148,19 @@ main(int argc, char **argv)
* MAKEOBJDIR is set in the environment, try only that value
* and fall back to .CURDIR if it does not exist.
*
- * Otherwise, try _PATH_OBJDIR.MACHINE, _PATH_OBJDIR, and
- * finally _PATH_OBJDIRPREFIX`pwd`, in that order. If none
+ * Otherwise, try _PATH_OBJDIR.MACHINE-MACHINE_ARCH, _PATH_OBJDIR.MACHINE,
+ * and * finally _PATH_OBJDIRPREFIX`pwd`, in that order. If none
* of these paths exist, just use .CURDIR.
*/
Dir_Init(curdir);
- (void)Main_SetObjdir(curdir);
+ (void)Main_SetObjdir("%s", curdir);
- if ((path = Var_Value("MAKEOBJDIRPREFIX", VAR_CMD, &p1)) != NULL) {
- (void)snprintf(mdpath, MAXPATHLEN, "%s%s", path, curdir);
- (void)Main_SetObjdir(mdpath);
- free(p1);
- } else if ((path = Var_Value("MAKEOBJDIR", VAR_CMD, &p1)) != NULL) {
- (void)Main_SetObjdir(path);
- free(p1);
- } else {
- (void)snprintf(mdpath, MAXPATHLEN, "%s.%s", _PATH_OBJDIR, machine);
- if (!Main_SetObjdir(mdpath) && !Main_SetObjdir(_PATH_OBJDIR)) {
- (void)snprintf(mdpath, MAXPATHLEN, "%s%s",
- _PATH_OBJDIRPREFIX, curdir);
- (void)Main_SetObjdir(mdpath);
- }
- }
+ if (!Main_SetVarObjdir("MAKEOBJDIRPREFIX", curdir) &&
+ !Main_SetVarObjdir("MAKEOBJDIR", "") &&
+ !Main_SetObjdir("%s.%s-%s", _PATH_OBJDIR, machine, machine_arch) &&
+ !Main_SetObjdir("%s.%s", _PATH_OBJDIR, machine) &&
+ !Main_SetObjdir("%s", _PATH_OBJDIR))
+ (void)Main_SetObjdir("%s%s", _PATH_OBJDIRPREFIX, curdir);
/*
* Initialize archive, target and suffix modules in preparation for
Modified: vendor/NetBSD/bmake/dist/make.1
==============================================================================
--- vendor/NetBSD/bmake/dist/make.1 Mon Dec 19 21:27:18 2016 (r310298)
+++ vendor/NetBSD/bmake/dist/make.1 Mon Dec 19 21:50:59 2016 (r310299)
@@ -1,4 +1,4 @@
-.\" $NetBSD: make.1,v 1.262 2016/08/18 19:23:20 wiz Exp $
+.\" $NetBSD: make.1,v 1.263 2016/08/26 23:37:54 dholland Exp $
.\"
.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" from: @(#)make.1 8.4 (Berkeley) 3/19/94
.\"
-.Dd August 15, 2016
+.Dd August 26, 2016
.Dt MAKE 1
.Os
.Sh NAME
@@ -2011,6 +2011,14 @@ variable of a target that inherits
.Ic .DEFAULT Ns 's
commands is set
to the target's own name.
+.It Ic .DELETE_ON_ERROR
+If this target is present in the makefile, it globally causes make to
+delete targets whose commands fail.
+(By default, only targets whose commands are interrupted during
+execution are deleted.
+This is the historical behavior.)
+This setting can be used to help prevent half-finished or malformed
+targets from being left around and corrupting future rebuilds.
.It Ic .END
Any command lines attached to this target are executed after everything
else is done.
Modified: vendor/NetBSD/bmake/dist/make.c
==============================================================================
--- vendor/NetBSD/bmake/dist/make.c Mon Dec 19 21:27:18 2016 (r310298)
+++ vendor/NetBSD/bmake/dist/make.c Mon Dec 19 21:50:59 2016 (r310299)
@@ -1,4 +1,4 @@
-/* $NetBSD: make.c,v 1.95 2016/02/18 18:29:14 christos Exp $ */
+/* $NetBSD: make.c,v 1.96 2016/11/10 23:41:58 sjg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: make.c,v 1.95 2016/02/18 18:29:14 christos Exp $";
+static char rcsid[] = "$NetBSD: make.c,v 1.96 2016/11/10 23:41:58 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.95 2016/02/18 18:29:14 christos Exp $");
+__RCSID("$NetBSD: make.c,v 1.96 2016/11/10 23:41:58 sjg Exp $");
#endif
#endif /* not lint */
#endif
@@ -308,7 +308,7 @@ Make_OODate(GNode *gn)
if (DEBUG(MAKE)) {
if (gn->cmgn != NULL && gn->mtime < gn->cmgn->mtime) {
fprintf(debug_file, "modified before source %s...",
- gn->cmgn->path);
+ gn->cmgn->path ? gn->cmgn->path : gn->cmgn->name);
} else if (gn->mtime == 0) {
fprintf(debug_file, "non-existent and no sources...");
} else {
Modified: vendor/NetBSD/bmake/dist/make.h
==============================================================================
--- vendor/NetBSD/bmake/dist/make.h Mon Dec 19 21:27:18 2016 (r310298)
+++ vendor/NetBSD/bmake/dist/make.h Mon Dec 19 21:50:59 2016 (r310299)
@@ -1,4 +1,4 @@
-/* $NetBSD: make.h,v 1.100 2016/06/07 00:40:00 sjg Exp $ */
+/* $NetBSD: make.h,v 1.102 2016/12/07 15:00:46 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -389,6 +389,7 @@ extern Boolean beSilent; /* True if
extern Boolean noExecute; /* True if should execute nothing */
extern Boolean noRecursiveExecute; /* True if should execute nothing */
extern Boolean allPrecious; /* True if every target is precious */
+extern Boolean deleteOnError; /* True if failed targets should be deleted */
extern Boolean keepgoing; /* True if should continue on unaffected
* portions of the graph when have an error
* in one portion */
@@ -503,7 +504,7 @@ char * Check_Cwd_Cmd(const char *);
void Check_Cwd(const char **);
void PrintOnError(GNode *, const char *);
void Main_ExportMAKEFLAGS(Boolean);
-Boolean Main_SetObjdir(const char *);
+Boolean Main_SetObjdir(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2);
int mkTempFile(const char *, char **);
int str2Lst_Append(Lst, char *, const char *);
int cached_lstat(const char *, void *);
Modified: vendor/NetBSD/bmake/dist/mk/ChangeLog
==============================================================================
--- vendor/NetBSD/bmake/dist/mk/ChangeLog Mon Dec 19 21:27:18 2016 (r310298)
+++ vendor/NetBSD/bmake/dist/mk/ChangeLog Mon Dec 19 21:50:59 2016 (r310299)
@@ -1,3 +1,62 @@
+2016-12-12 Simon J. Gerraty <sjg at bad.crufty.net>
+
+ * install-mk (MK_VERSION): 20161212
+
+ * meta2deps.py: set pid_cwd[pid] when we process 'C'hdir,
+ rather than when we detect pid change.
+
+2016-12-07 Simon J. Gerraty <sjg at bad.crufty.net>
+
+ * install-mk (MK_VERSION): 20161207
+
+ * meta.stage.mk: add stage_as_and_symlink for staging packages.
+ We build foo.tgz stage_as foo-${VERSION}.tgz but want to be able
+ to use foo.tgz to reference the latest staged version - so we
+ make foo.tgz a symlink to it.
+ Using a target to do both operations ensures we stay in sync.
+
+2016-11-26 Simon J. Gerraty <sjg at bad.crufty.net>
+
+ * install-mk (MK_VERSION): 20161126
+
+ * dirdeps.mk: set DIRDEPS_CACHE before we include local.dirdeps.mk
+ so it can add dependencies.
+
+2016-10-10 Simon J. Gerraty <sjg at bad.crufty.net>
+
+ * dirdeps.mk: set DEP_* before we expand .MAKE.DEPENDFILE_PREFERENCE
+ do that they can influence the result correctly.
+
+ * dirdeps.mk (${DIRDEPS_CACHE}): make sure we pass on TARGET_SPEC
+
+ * dirdeps.mk: Add ONLY_TARGET_SPEC_LIST and NOT_TARGET_SPEC_LIST
+ similar to ONLY_MACHINE_LIST and NOT_MACHINE_LIST
+
+2016-10-05 Simon J. Gerraty <sjg at bad.crufty.net>
+
+ * dirdeps.mk: remove dependence on jot (normal situations anyway).
+ Before we read another Makefile.depend* set DEP_* vars from
+ _DEP_TARGET_SPEC in case it uses any of them with :=
+ When bootstrapping, trim any ,* from extention of chosen _src
+ Makefile.depend* to get the machine value we subst for.
+
+2016-09-30 Simon J. Gerraty <sjg at bad.crufty.net>
+
+ * dirdeps.mk: use TARGET_SPEC_VARS to qualify components added to
+ DEP_SKIP_DIR and DEP_DIRDEPS_FILTER
+
+ * sys.mk: extract some bits to sys.{debug,vars}.mk
+ for easier re-use by others.
+
+2016-09-23 Simon Gerraty <sjg at sjg-mba13>
+
+ * lib.mk: Use ${PICO} for extension for PIC objects.
+ default to .pico (like NetBSD) safe on case insensitive filesystem.
+
+2016-08-19 Simon J. Gerraty <sjg at bad.crufty.net>
+
+ * meta.sys.mk (META_COOKIE_TOUCH): use ${.OBJDIR}/${.TARGET:T} as default
+
2016-08-15 Simon J. Gerraty <sjg at bad.crufty.net>
* install-mk (MK_VERSION): 20160815
Modified: vendor/NetBSD/bmake/dist/mk/FILES
==============================================================================
--- vendor/NetBSD/bmake/dist/mk/FILES Mon Dec 19 21:27:18 2016 (r310298)
+++ vendor/NetBSD/bmake/dist/mk/FILES Mon Dec 19 21:50:59 2016 (r310299)
@@ -38,7 +38,9 @@ stage-install.sh
subdir.mk
sys.mk
sys.clean-env.mk
+sys.debug.mk
sys.dependfile.mk
+sys.vars.mk
sys/AIX.mk
sys/Darwin.mk
sys/Generic.mk
Modified: vendor/NetBSD/bmake/dist/mk/dirdeps.mk
==============================================================================
--- vendor/NetBSD/bmake/dist/mk/dirdeps.mk Mon Dec 19 21:27:18 2016 (r310298)
+++ vendor/NetBSD/bmake/dist/mk/dirdeps.mk Mon Dec 19 21:50:59 2016 (r310299)
@@ -1,4 +1,4 @@
-# $Id: dirdeps.mk,v 1.73 2016/08/15 19:28:13 sjg Exp $
+# $Id: dirdeps.mk,v 1.84 2016/11/27 02:44:34 sjg Exp $
# Copyright (c) 2010-2013, Juniper Networks, Inc.
# All rights reserved.
@@ -56,9 +56,12 @@
# .MAKE.DEPENDFILE_PREFIX) to refer to these makefiles to
# distinguish them from others.
#
-# Each Makefile.depend file sets DEP_RELDIR to be the
-# the RELDIR (path relative to SRCTOP) for its directory, and
-# since each Makefile.depend file includes dirdeps.mk, this
+# Before each Makefile.depend file is read, we set
+# DEP_RELDIR to be the the RELDIR (path relative to SRCTOP) for
+# its directory, and DEP_MACHINE etc according to the .<target_spec>
+# represented by the suffix of the corresponding target.
+#
+# Since each Makefile.depend file includes dirdeps.mk, this
# processing is recursive and results in .MAKE.LEVEL 0 learning the
# dependencies of the tree wrt the initial directory (_DEP_RELDIR).
#
@@ -110,6 +113,29 @@
# # as we may need it to find Makefile.depend*
# TARGET_SPEC = ${TARGET_SPEC_VARS:@v@${$v:U}@:ts,}
#
+# The following variables can influence the initial DIRDEPS
+# computation with regard to the TARGET_SPECs that will be
+# built.
+# Most should also be considered by init.mk
+#
+# ONLY_TARGET_SPEC_LIST
+# Defines a list of TARGET_SPECs for which the current
+# directory can be built.
+# If ALL_MACHINES is defined, we build for all the
+# TARGET_SPECs listed.
+#
+# ONLY_MACHINE_LIST
+# As for ONLY_TARGET_SPEC_LIST but only specifies
+# MACHINEs.
+#
+# NOT_TARGET_SPEC_LIST
+# A list of TARGET_SPECs for which the current
+# directory should not be built.
+#
+# NOT_MACHINE_LIST
+# A list of MACHINEs the current directory should not be
+# built for.
+#
# touch this at your peril
_DIRDEP_USE_LEVEL?= 0
@@ -171,9 +197,13 @@ DEP_$v ?= ${$v}
# we compute below are fully qualified wrt DEP_TARGET_SPEC.
# The makefiles may only partially specify (eg. MACHINE only),
# so we need to construct a set of modifiers to fill in the gaps.
-# jot 10 should output 1 2 3 .. 10
-JOT ?= jot
-_tspec_x := ${${JOT} ${TARGET_SPEC_VARS:[#]}:L:sh}
+.if ${TARGET_SPEC_VARS:[#]} > 10
+# seriously? better have jot(1) or equivalent to produce suitable sequence
+_tspec_x := ${${JOT:Ujot} ${TARGET_SPEC_VARS:[#]}:L:sh}
+.else
+# we can provide the sequence ourselves
+_tspec_x := ${1 2 3 4 5 6 7 8 9 10:L:[1..${TARGET_SPEC_VARS:[#]}]}
+.endif
# this handles unqualified entries
M_dep_qual_fixes = C;(/[^/.,]+)$$;\1.$${DEP_TARGET_SPEC};
# there needs to be at least one item missing for these to make sense
@@ -287,6 +317,18 @@ _DEP_RELDIR := ${DEP_RELDIR}
.endif
+# DIRDEPS_CACHE can be very handy for debugging.
+# Also if repeatedly building the same target,
+# we can avoid the overhead of re-computing the tree dependencies.
+MK_DIRDEPS_CACHE ?= no
+BUILD_DIRDEPS_CACHE ?= no
+BUILD_DIRDEPS ?= yes
+
+.if ${MK_DIRDEPS_CACHE} == "yes"
+# this is where we will cache all our work
+DIRDEPS_CACHE ?= ${_OBJDIR:tA}/dirdeps.cache${.TARGETS:Nall:O:u:ts-:S,/,_,g:S,^,.,:N.}
+.endif
+
# pickup customizations
# as below you can use !target(_DIRDEP_USE) to protect things
# which should only be done once.
@@ -305,8 +347,10 @@ SKIP_DIR.host += ${SKIP_HOSTDIR}
DEP_SKIP_DIR = ${SKIP_DIR} \
${SKIP_DIR.${DEP_TARGET_SPEC}:U} \
- ${SKIP_DIR.${DEP_MACHINE}:U} \
- ${SKIP_DIRDEPS.${DEP_MACHINE}:U}
+ ${TARGET_SPEC_VARS:@v@${SKIP_DIR.${DEP_$v}:U}@} \
+ ${SKIP_DIRDEPS.${DEP_TARGET_SPEC}:U} \
+ ${TARGET_SPEC_VARS:@v@${SKIP_DIRDEPS.${DEP_$v}:U}@}
+
NSkipDir = ${DEP_SKIP_DIR:${M_ListToSkip}}
@@ -344,7 +388,7 @@ _DIRDEP_USE: .USE .MAKE
.ifdef ALL_MACHINES
# this is how you limit it to only the machines we have been built for
# previously.
-.if empty(ONLY_MACHINE_LIST)
+.if empty(ONLY_TARGET_SPEC_LIST) && empty(ONLY_MACHINE_LIST)
.if !empty(ALL_MACHINE_LIST)
# ALL_MACHINE_LIST is the list of all legal machines - ignore anything else
_machine_list != cd ${_CURDIR} && 'ls' -1 ${ALL_MACHINE_LIST:O:u:@m@${.MAKE.DEPENDFILE:T:R}.$m@} 2> /dev/null; echo
@@ -353,7 +397,7 @@ _machine_list != 'ls' -1 ${_CURDIR}/${.M
.endif
_only_machines := ${_machine_list:${NIgnoreFiles:UN*.bak}:E:O:u}
.else
-_only_machines := ${ONLY_MACHINE_LIST}
+_only_machines := ${ONLY_TARGET_SPEC_LIST:U} ${ONLY_MACHINE_LIST:U}
.endif
.if empty(_only_machines)
@@ -362,30 +406,35 @@ _only_machines := ${TARGET_MACHINE:U${AL
.endif
.else # ! ALL_MACHINES
-# if ONLY_MACHINE_LIST is set, we are limited to that
+# if ONLY_TARGET_SPEC_LIST or ONLY_MACHINE_LIST is set, we are limited to that.
+# Note that ONLY_TARGET_SPEC_LIST should be fully qualified.
# if TARGET_MACHINE is set - it is really the same as ONLY_MACHINE_LIST
# otherwise DEP_MACHINE is it - so DEP_MACHINE will match.
+_only_machines := ${ONLY_TARGET_SPEC_LIST:U:M${DEP_MACHINE},*}
+.if empty(_only_machines)
_only_machines := ${ONLY_MACHINE_LIST:U${TARGET_MACHINE:U${DEP_MACHINE}}:M${DEP_MACHINE}}
.endif
+.endif
.if !empty(NOT_MACHINE_LIST)
_only_machines := ${_only_machines:${NOT_MACHINE_LIST:${M_ListToSkip}}}
.endif
+.if !empty(NOT_TARGET_SPEC_LIST)
+# we must first qualify
+_dm := ${DEP_MACHINE}
+_only_machines := ${_only_machines:M*,*} ${_only_machines:N*,*:@DEP_MACHINE@${DEP_TARGET_SPEC}@:S,^,.,:${M_dep_qual_fixes:ts:}:O:u:S,^.,,}
+DEP_MACHINE := ${_dm}
+_only_machines := ${_only_machines:${NOT_TARGET_SPEC_LIST:${M_ListToSkip}}}
+.endif
+# clean up
+_only_machines := ${_only_machines:O:u}
# make sure we have a starting place?
DIRDEPS ?= ${RELDIR}
.endif # target
-# if repeatedly building the same target,
-# we can avoid the overhead of re-computing the tree dependencies.
-MK_DIRDEPS_CACHE ?= no
-BUILD_DIRDEPS_CACHE ?= no
-BUILD_DIRDEPS ?= yes
-
.if !defined(NO_DIRDEPS) && !defined(NO_DIRDEPS_BELOW)
.if ${MK_DIRDEPS_CACHE} == "yes"
-# this is where we will cache all our work
-DIRDEPS_CACHE?= ${_OBJDIR:tA}/dirdeps.cache${.TARGETS:Nall:O:u:ts-:S,/,_,g:S,^,.,:N.}
# just ensure this exists
build-dirdeps:
@@ -420,6 +469,7 @@ ${DIRDEPS_CACHE}: .META .NOMETA_CMP
} > ${.TARGET}.new
+ at MAKELEVEL=${.MAKE.LEVEL} DIRDEPS_CACHE=${DIRDEPS_CACHE} \
DIRDEPS="${DIRDEPS}" \
+ TARGET_SPEC=${TARGET_SPEC} \
MAKEFLAGS= ${.MAKE} -C ${_CURDIR} -f ${BUILD_DIRDEPS_MAKEFILE} \
${BUILD_DIRDEPS_TARGETS} BUILD_DIRDEPS_CACHE=yes \
.MAKE.DEPENDFILE=.none \
@@ -489,8 +539,10 @@ _machines := ${_machines:O:u}
_dm := ${DEP_MACHINE}
# apply the same filtering that we do when qualifying DIRDEPS.
# M_dep_qual_fixes expects .${MACHINE}* so add (and remove) '.'
-_machines := ${_machines:@DEP_MACHINE@${DEP_TARGET_SPEC}@:S,^,.,:${M_dep_qual_fixes:ts:}:O:u:S,^.,,}
+# Again we expect that any already qualified machines are fully qualified.
+_machines := ${_machines:M*,*} ${_machines:N*,*:@DEP_MACHINE@${DEP_TARGET_SPEC}@:S,^,.,:${M_dep_qual_fixes:ts:}:O:u:S,^.,,}
DEP_MACHINE := ${_dm}
+_machines := ${_machines:O:u}
.endif
# reset each time through
@@ -522,7 +574,7 @@ _build_dirs += ${_machines:N${DEP_TARGET
# these we reset each time through as they can depend on DEP_MACHINE
DEP_DIRDEPS_FILTER = \
${DIRDEPS_FILTER.${DEP_TARGET_SPEC}:U} \
- ${DIRDEPS_FILTER.${DEP_MACHINE}:U} \
+ ${TARGET_SPEC_VARS:@v@${DIRDEPS_FILTER.${DEP_$v}:U}@} \
${DIRDEPS_FILTER:U}
.if empty(DEP_DIRDEPS_FILTER)
# something harmless
@@ -621,6 +673,19 @@ _dirdeps_checked.$d:
.endif
# Note: _build_all_dirs is fully qualifed so d:R is always the directory
.if exists(${d:R})
+# we pass _DEP_TARGET_SPEC to tell the next step what we want
+_DEP_TARGET_SPEC := ${d:E}
+# some makefiles may still look at this
+_DEP_MACHINE := ${d:E:C/,.*//}
+# set these too in case Makefile.depend* uses them
+.if ${TARGET_SPEC_VARS:[#]} > 1
+_dtspec := ${_DEP_TARGET_SPEC:S/,/ /g}
+.for i in ${_tspec_x}
+DEP_${TARGET_SPEC_VARS:[$i]} := ${_dtspec:[$i]}
+.endfor
+.else
+DEP_MACHINE := ${_DEP_MACHINE}
+.endif
# Warning: there is an assumption here that MACHINE is always
# the first entry in TARGET_SPEC_VARS.
# If TARGET_SPEC and MACHINE are insufficient, you have a problem.
@@ -631,10 +696,6 @@ _qm := ${_m:C;(\.depend)$;\1.${d:E};:${M
.if ${_debug_search}
.info Looking for ${_qm}
.endif
-# we pass _DEP_TARGET_SPEC to tell the next step what we want
-_DEP_TARGET_SPEC := ${d:E}
-# some makefiles may still look at this
-_DEP_MACHINE := ${d:E:C/,.*//}
# set this "just in case"
# we can skip :tA since we computed the path above
DEP_RELDIR := ${_m:H:S,${SRCTOP}/,,}
@@ -687,7 +748,7 @@ _src != cd ${.CURDIR} && for m in ${.MAK
_src?= ${.MAKE.DEPENDFILE}
-.MAKE.DEPENDFILE_BOOTSTRAP_SED+= -e 's,${_src:E},${MACHINE},g'
+.MAKE.DEPENDFILE_BOOTSTRAP_SED+= -e 's/${_src:E:C/,.*//}/${MACHINE}/g'
# just create Makefile.depend* for this dir
bootstrap-this: .NOTMAIN
@@ -696,7 +757,7 @@ bootstrap-this: .NOTMAIN
.if ${_src:T} != ${.MAKE.DEPENDFILE_PREFIX:T}
(cd ${.CURDIR} && sed ${.MAKE.DEPENDFILE_BOOTSTRAP_SED} ${_src} > ${_want})
.else
- cp ${.CURDIR}/${_src} ${_want}
+ cp ${.CURDIR}/${_src:T} ${_want}
.endif
# create Makefile.depend* for this dir and its dependencies
Modified: vendor/NetBSD/bmake/dist/mk/gendirdeps.mk
==============================================================================
--- vendor/NetBSD/bmake/dist/mk/gendirdeps.mk Mon Dec 19 21:27:18 2016 (r310298)
+++ vendor/NetBSD/bmake/dist/mk/gendirdeps.mk Mon Dec 19 21:50:59 2016 (r310299)
@@ -1,4 +1,4 @@
-# $Id: gendirdeps.mk,v 1.32 2016/04/05 15:58:37 sjg Exp $
+# $Id: gendirdeps.mk,v 1.33 2016/10/11 22:37:28 sjg Exp $
# Copyright (c) 2010-2013, Juniper Networks, Inc.
# All rights reserved.
@@ -146,6 +146,9 @@ M2D_OBJROOTS += ${OBJTOP} ${_OBJROOT} ${
.if defined(SB_OBJROOT)
M2D_OBJROOTS += ${SB_OBJROOT}
.endif
+.if defined(STAGE_ROOT)
+M2D_OBJROOTS += ${STAGE_ROOT}
+.endif
.if ${.MAKE.DEPENDFILE_PREFERENCE:U${.MAKE.DEPENDFILE}:M*.${MACHINE}} == ""
# meta2deps.py only groks objroot
# so we need to give it what it expects
Modified: vendor/NetBSD/bmake/dist/mk/install-mk
==============================================================================
--- vendor/NetBSD/bmake/dist/mk/install-mk Mon Dec 19 21:27:18 2016 (r310298)
+++ vendor/NetBSD/bmake/dist/mk/install-mk Mon Dec 19 21:50:59 2016 (r310299)
@@ -55,7 +55,7 @@
# Simon J. Gerraty <sjg at crufty.net>
# RCSid:
-# $Id: install-mk,v 1.130 2016/08/15 19:28:13 sjg Exp $
+# $Id: install-mk,v 1.135 2016/12/12 19:07:42 sjg Exp $
#
# @(#) Copyright (c) 1994 Simon J. Gerraty
#
@@ -70,7 +70,7 @@
# sjg at crufty.net
#
-MK_VERSION=20160815
+MK_VERSION=20161212
OWNER=
GROUP=
MODE=444
Modified: vendor/NetBSD/bmake/dist/mk/lib.mk
==============================================================================
--- vendor/NetBSD/bmake/dist/mk/lib.mk Mon Dec 19 21:27:18 2016 (r310298)
+++ vendor/NetBSD/bmake/dist/mk/lib.mk Mon Dec 19 21:50:59 2016 (r310299)
@@ -1,4 +1,4 @@
-# $Id: lib.mk,v 1.54 2016/08/02 20:52:17 sjg Exp $
+# $Id: lib.mk,v 1.55 2016/09/23 23:04:51 sjg Exp $
.if !target(__${.PARSEFILE}__)
__${.PARSEFILE}__:
@@ -9,39 +9,30 @@ __${.PARSEFILE}__:
NEED_SOLINKS?= yes
.endif
-.if exists(${.CURDIR}/shlib_version)
-SHLIB_MAJOR != . ${.CURDIR}/shlib_version ; echo $$major
-SHLIB_MINOR != . ${.CURDIR}/shlib_version ; echo $$minor
-.endif
-
-print-shlib-major:
-.if defined(SHLIB_MAJOR) && ${MK_PIC} != "no"
- @echo ${SHLIB_MAJOR}
-.else
- @false
+SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version
+.if !defined(SHLIB_MAJOR) && exists(${SHLIB_VERSION_FILE})
+SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major
+SHLIB_MINOR != . ${SHLIB_VERSION_FILE} ; echo $$minor
+SHLIB_TEENY != . ${SHLIB_VERSION_FILE} ; echo $$teeny
.endif
-print-shlib-minor:
-.if defined(SHLIB_MINOR) && ${MK_PIC} != "no"
- @echo ${SHLIB_MINOR}
-.else
- @false
-.endif
-
-print-shlib-teeny:
-.if defined(SHLIB_TEENY) && ${MK_PIC} != "no"
- @echo ${SHLIB_TEENY}
+.for x in major minor teeny
+print-shlib-$x:
+.if defined(SHLIB_${x:tu}) && ${MK_PIC} != "no"
+ @echo ${SHLIB_${x:tu}}
.else
@false
.endif
+.endfor
SHLIB_FULLVERSION ?= ${${SHLIB_MAJOR} ${SHLIB_MINOR} ${SHLIB_TEENY}:L:ts.}
SHLIB_FULLVERSION := ${SHLIB_FULLVERSION}
# add additional suffixes not exported.
# .po is used for profiling object files.
-# .So is used for PIC object files.
-.SUFFIXES: .out .a .ln .So .po .o .s .S .c .cc .C .m .F .f .r .y .l .cl .p .h
+# ${PICO} is used for PIC object files.
+PICO?= .pico
+.SUFFIXES: .out .a .ln ${PICO} .po .o .s .S .c .cc .C .m .F .f .r .y .l .cl .p .h
.SUFFIXES: .sh .m4 .m
CFLAGS+= ${COPTS}
@@ -62,12 +53,12 @@ CFLAGS+= ${COPTS}
# with ELF, also set shared-lib version for ld.so.
# SHLIB_LDSTARTFILE: support .o file, call C++ file-level constructors
# SHLIB_LDENDFILE: support .o file, call C++ file-level destructors
-# FPICFLAGS: flags for ${FC} to compile .[fF] files to .So objects.
+# FPICFLAGS: flags for ${FC} to compile .[fF] files to ${PICO} objects.
# CPPICFLAGS: flags for ${CPP} to preprocess .[sS] files for ${AS}
-# CPICFLAGS: flags for ${CC} to compile .[cC] files to .So objects.
+# CPICFLAGS: flags for ${CC} to compile .[cC] files to ${PICO} objects.
# CAPICFLAGS flags for {$CC} to compiling .[Ss] files
# (usually just ${CPPPICFLAGS} ${CPICFLAGS})
-# APICFLAGS: flags for ${AS} to assemble .[sS] to .So objects.
+# APICFLAGS: flags for ${AS} to assemble .[sS] to ${PICO} objects.
.if ${TARGET_OSNAME} == "NetBSD"
.if ${MACHINE_ARCH} == "alpha"
@@ -162,14 +153,14 @@ LD_shared=-b
LD_so=sl
DLLIB=
# HPsUX lorder does not grok anything but .o
-LD_sobjs=`${LORDER} ${OBJS} | ${TSORT} | sed 's,\.o,.So,'`
+LD_sobjs=`${LORDER} ${OBJS} | ${TSORT} | sed 's,\.o,${PICO},'`
LD_pobjs=`${LORDER} ${OBJS} | ${TSORT} | sed 's,\.o,.po,'`
.elif ${TARGET_OSNAME} == "OSF1"
LD_shared= -msym -shared -expect_unresolved '*'
LD_solib= -all lib${LIB}_pic.a
DLLIB=
# lorder does not grok anything but .o
-LD_sobjs=`${LORDER} ${OBJS} | ${TSORT} | sed 's,\.o,.So,'`
+LD_sobjs=`${LORDER} ${OBJS} | ${TSORT} | sed 's,\.o,${PICO},'`
LD_pobjs=`${LORDER} ${OBJS} | ${TSORT} | sed 's,\.o,.po,'`
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-vendor
mailing list