aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2020-07-01 02:13:04 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2020-07-01 02:13:04 +0000
commit6e0296234fdf9b27f5b0d9f884223b7c2b5b3d03 (patch)
tree13809240717d272377e3fc610c2b7981d59b51ff
parentabd272d7cab9b0b2de6ab28d5bc664a8df7c5c85 (diff)
downloadsrc-6e0296234fdf9b27f5b0d9f884223b7c2b5b3d03.tar.gz
src-6e0296234fdf9b27f5b0d9f884223b7c2b5b3d03.zip
Import bmake-20200629vendor/NetBSD/bmake/20200629
from ChangeLog: o cond.c: do not eval unnecessary terms of conditionals. o meta.c: report error if lseek in filemon_read fails o str.c: performance improvement for Str_Match for multiple '*' o dieQuietly: supress the failure output from make when failing node is a sub-make or a sibling failed. This cuts down greatly on unhelpful noise at the end of build log. Disabled by -dj or .MAKE.DIE_QUIETLY=no o unit test for :Or
Notes
Notes: svn path=/vendor/NetBSD/bmake/dist/; revision=362821 svn path=/vendor/NetBSD/bmake/20200629/; revision=362822; tag=vendor/NetBSD/bmake/20200629
-rw-r--r--ChangeLog39
-rw-r--r--FILES3
-rw-r--r--LICENSE59
-rw-r--r--VERSION2
-rw-r--r--cond.c28
-rw-r--r--job.c17
-rw-r--r--main.c33
-rw-r--r--make.h3
-rw-r--r--meta.c20
-rw-r--r--mk/ChangeLog17
-rw-r--r--mk/FILES1
-rw-r--r--mk/gendirdeps.mk12
-rw-r--r--mk/install-mk4
-rwxr-xr-xmk/mkopt.sh7
-rw-r--r--mk/sys/AIX.mk94
-rw-r--r--mk/sys/Darwin.mk134
-rw-r--r--mk/sys/Generic.mk126
-rw-r--r--mk/sys/HP-UX.mk128
-rw-r--r--mk/sys/IRIX.mk108
-rw-r--r--mk/sys/Linux.mk98
-rw-r--r--mk/sys/NetBSD.mk124
-rw-r--r--mk/sys/OSF1.mk108
-rw-r--r--mk/sys/OpenBSD.mk112
-rw-r--r--mk/sys/SunOS.mk110
-rw-r--r--mk/sys/UnixWare.mk196
-rw-r--r--str.c36
-rw-r--r--unit-tests/Makefile5
-rw-r--r--unit-tests/cond-short.exp7
-rw-r--r--unit-tests/cond-short.mk62
-rw-r--r--unit-tests/modmatch.mk7
-rw-r--r--unit-tests/modorder.exp1
-rw-r--r--unit-tests/modorder.mk3
32 files changed, 971 insertions, 733 deletions
diff --git a/ChangeLog b/ChangeLog
index 68b1826ea2aa..ae57f180d82c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,42 @@
+2020-06-29 Simon J Gerraty <sjg@beast.crufty.net>
+
+ * VERSION (_MAKE_VERSION): 20200629
+ Merge with NetBSD make, pick up
+ o cond.c: do not eval unnecessary terms of conditionals.
+
+2020-06-25 Simon J Gerraty <sjg@beast.crufty.net>
+
+ * VERSION (_MAKE_VERSION): 20200625
+ Merge with NetBSD make, pick up
+ o meta.c: report error if lseek in filemon_read fails
+
+2020-06-22 Simon J Gerraty <sjg@beast.crufty.net>
+
+ * VERSION (_MAKE_VERSION): 20200622
+ Merge with NetBSD make, pick up
+ o dieQuietly: ignore OP_SUBMAKE as too aggressive
+
+2020-06-19 Simon J Gerraty <sjg@beast.crufty.net>
+
+ * VERSION (_MAKE_VERSION): 20200619
+ Merge with NetBSD make, pick up
+ o str.c: performance improvement for Str_Match for multiple '*'
+ o dieQuietly: supress the failure output from make
+ when failing node is a sub-make or a sibling failed.
+ This cuts down greatly on unhelpful noise at the end of
+ build log. Disabled by -dj or .MAKE.DIE_QUIETLY=no
+
+2020-06-10 Simon J Gerraty <sjg@beast.crufty.net>
+
+ * FILES: add LICENSE to appease some packagers.
+ This is an attempt to fairly represent the license on almost
+ 200 files, which are almost all BSD-3-Clause
+ The few exceptions being more liberal.
+
+ * VERSION (_MAKE_VERSION): 20200610
+ Merge with NetBSD make, pick up
+ o unit test for :Or
+
2020-06-06 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20200606
diff --git a/FILES b/FILES
index 5dd4eae97b16..0716bffa3c3b 100644
--- a/FILES
+++ b/FILES
@@ -1,5 +1,6 @@
ChangeLog
FILES
+LICENSE
Makefile
Makefile.config.in
PSD.doc/Makefile
@@ -107,6 +108,8 @@ unit-tests/cond2.exp
unit-tests/cond2.mk
unit-tests/cond-late.mk
unit-tests/cond-late.exp
+unit-tests/cond-short.mk
+unit-tests/cond-short.exp
unit-tests/dollar.exp
unit-tests/dollar.mk
unit-tests/doterror.exp
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000000000000..dbad0ec06a4d
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,59 @@
+The individual files in this distribution are copyright their
+original contributors or assignees.
+Including:
+
+ Copyright (c) 1993-2020, Simon J Gerraty
+ Copyright (c) 2009-2016, Juniper Networks, Inc.
+ Copyright (c) 2009, John Birrell.
+ Copyright (c) 1997-2020 The NetBSD Foundation, Inc.
+ Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ Copyright (c) 1989 by Berkeley Softworks
+ Copyright (c) 1988, 1989, 1990, 1992, 1993
+ The Regents of the University of California.
+ Copyright (c) 1988, 1989 by Adam de Boor
+
+With the exception of the GNU configure script, which states:
+
+ # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+ #
+ # This configure script is free software; the Free Software Foundation
+ # gives unlimited permission to copy, distribute and modify it.
+
+The license for this distribution is considered to be:
+
+ SPDX-License-Identifier: BSD-3-Clause
+
+example (from https://opensource.org/licenses/BSD-3-Clause):
+
+ Copyright <YEAR> <COPYRIGHT HOLDER>
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+
+ 3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
diff --git a/VERSION b/VERSION
index 161d8f01ef2c..77ce0141acef 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
# keep this compatible with sh and make
-_MAKE_VERSION=20200606
+_MAKE_VERSION=20200629
diff --git a/cond.c b/cond.c
index 7c9c96acc83b..27034189bfd7 100644
--- a/cond.c
+++ b/cond.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cond.c,v 1.75 2017/04/16 20:59:04 riastradh Exp $ */
+/* $NetBSD: cond.c,v 1.76 2020/06/28 11:06:26 rillig 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.75 2017/04/16 20:59:04 riastradh Exp $";
+static char rcsid[] = "$NetBSD: cond.c,v 1.76 2020/06/28 11:06:26 rillig 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.75 2017/04/16 20:59:04 riastradh Exp $");
+__RCSID("$NetBSD: cond.c,v 1.76 2020/06/28 11:06:26 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -146,7 +146,7 @@ typedef enum {
* last two fields are stored in condInvert and condDefProc, respectively.
*/
static void CondPushBack(Token);
-static int CondGetArg(char **, char **, const char *);
+static int CondGetArg(Boolean, char **, char **, const char *);
static Boolean CondDoDefined(int, const char *);
static int CondStrMatch(const void *, const void *);
static Boolean CondDoMake(int, const char *);
@@ -225,9 +225,6 @@ CondPushBack(Token t)
* CondGetArg --
* Find the argument of a built-in function.
*
- * Input:
- * parens TRUE if arg should be bounded by parens
- *
* Results:
* The length of the argument and the address of the argument.
*
@@ -238,7 +235,7 @@ CondPushBack(Token t)
*-----------------------------------------------------------------------
*/
static int
-CondGetArg(char **linePtr, char **argPtr, const char *func)
+CondGetArg(Boolean doEval, char **linePtr, char **argPtr, const char *func)
{
char *cp;
int argLen;
@@ -290,7 +287,8 @@ CondGetArg(char **linePtr, char **argPtr, const char *func)
int len;
void *freeIt;
- cp2 = Var_Parse(cp, VAR_CMD, VARF_UNDEFERR|VARF_WANTRES,
+ cp2 = Var_Parse(cp, VAR_CMD, VARF_UNDEFERR|
+ (doEval ? VARF_WANTRES : 0),
&len, &freeIt);
Buf_AddBytes(&buf, strlen(cp2), cp2);
free(freeIt);
@@ -577,7 +575,7 @@ CondGetString(Boolean doEval, Boolean *quoted, void **freeIt, Boolean strictLHS)
/* if we are in quotes, then an undefined variable is ok */
str = Var_Parse(condExpr, VAR_CMD,
((!qt && doEval) ? VARF_UNDEFERR : 0) |
- VARF_WANTRES, &len, freeIt);
+ (doEval ? VARF_WANTRES : 0), &len, freeIt);
if (str == var_Error) {
if (*freeIt) {
free(*freeIt);
@@ -813,7 +811,7 @@ done:
}
static int
-get_mpt_arg(char **linePtr, char **argPtr, const char *func MAKE_ATTR_UNUSED)
+get_mpt_arg(Boolean doEval, char **linePtr, char **argPtr, const char *func MAKE_ATTR_UNUSED)
{
/*
* Use Var_Parse to parse the spec in parens and return
@@ -827,7 +825,7 @@ get_mpt_arg(char **linePtr, char **argPtr, const char *func MAKE_ATTR_UNUSED)
/* We do all the work here and return the result as the length */
*argPtr = NULL;
- val = Var_Parse(cp - 1, VAR_CMD, VARF_WANTRES, &length, &freeIt);
+ val = Var_Parse(cp - 1, VAR_CMD, doEval ? VARF_WANTRES : 0, &length, &freeIt);
/*
* Advance *linePtr to beyond the closing ). Note that
* we subtract one because 'length' is calculated from 'cp - 1'.
@@ -864,7 +862,7 @@ compare_function(Boolean doEval)
static const struct fn_def {
const char *fn_name;
int fn_name_len;
- int (*fn_getarg)(char **, char **, const char *);
+ int (*fn_getarg)(Boolean, char **, char **, const char *);
Boolean (*fn_proc)(int, const char *);
} fn_defs[] = {
{ "defined", 7, CondGetArg, CondDoDefined },
@@ -892,7 +890,7 @@ compare_function(Boolean doEval)
if (*cp != '(')
break;
- arglen = fn_def->fn_getarg(&cp, &arg, fn_def->fn_name);
+ arglen = fn_def->fn_getarg(doEval, &cp, &arg, fn_def->fn_name);
if (arglen <= 0) {
condExpr = cp;
return arglen < 0 ? TOK_ERROR : TOK_FALSE;
@@ -917,7 +915,7 @@ compare_function(Boolean doEval)
* would be invalid if we did "defined(a)" - so instead treat as an
* expression.
*/
- arglen = CondGetArg(&cp, &arg, NULL);
+ arglen = CondGetArg(doEval, &cp, &arg, NULL);
for (cp1 = cp; isspace(*(unsigned char *)cp1); cp1++)
continue;
if (*cp1 == '=' || *cp1 == '!')
diff --git a/job.c b/job.c
index 0469a20b2e20..feaa3a63029d 100644
--- a/job.c
+++ b/job.c
@@ -1,4 +1,4 @@
-/* $NetBSD: job.c,v 1.197 2020/02/06 01:13:19 sjg Exp $ */
+/* $NetBSD: job.c,v 1.198 2020/06/19 21:17:48 sjg 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.197 2020/02/06 01:13:19 sjg Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.198 2020/06/19 21:17:48 sjg 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.197 2020/02/06 01:13:19 sjg Exp $");
+__RCSID("$NetBSD: job.c,v 1.198 2020/06/19 21:17:48 sjg Exp $");
#endif
#endif /* not lint */
#endif
@@ -1058,10 +1058,11 @@ JobFinish (Job *job, WAIT_T status)
meta_job_error(job, job->node, job->flags, WEXITSTATUS(status));
}
#endif
- (void)printf("*** [%s] Error code %d%s\n",
- job->node->name,
- WEXITSTATUS(status),
- (job->flags & JOB_IGNERR) ? " (ignored)" : "");
+ if (!dieQuietly(job->node, -1))
+ (void)printf("*** [%s] Error code %d%s\n",
+ job->node->name,
+ WEXITSTATUS(status),
+ (job->flags & JOB_IGNERR) ? " (ignored)" : "");
if (job->flags & JOB_IGNERR) {
WAIT_STATUS(status) = 0;
} else {
@@ -3039,6 +3040,8 @@ Job_TokenWithdraw(void)
/* And put the stopper back */
while (write(tokenWaitJob.outPipe, &tok, 1) == -1 && errno == EAGAIN)
continue;
+ if (dieQuietly(NULL, 1))
+ exit(2);
Fatal("A failure has been detected in another branch of the parallel make");
}
diff --git a/main.c b/main.c
index 1756f7a7d32f..3e28bd5bdc15 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.274 2020/03/30 02:41:06 sjg Exp $ */
+/* $NetBSD: main.c,v 1.276 2020/06/22 20:15:25 sjg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.274 2020/03/30 02:41:06 sjg Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.276 2020/06/22 20:15:25 sjg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
@@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\
#if 0
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: main.c,v 1.274 2020/03/30 02:41:06 sjg Exp $");
+__RCSID("$NetBSD: main.c,v 1.276 2020/06/22 20:15:25 sjg Exp $");
#endif
#endif /* not lint */
#endif
@@ -1889,6 +1889,8 @@ void
Finish(int errors)
/* number of errors encountered in Make_Make */
{
+ if (dieQuietly(NULL, -1))
+ exit(2);
Fatal("%d error%s", errors, errors == 1 ? "" : "s");
}
@@ -2041,6 +2043,27 @@ addErrorCMD(void *cmdp, void *gnp MAKE_ATTR_UNUSED)
return 0;
}
+/*
+ * Return true if we should die without noise.
+ * For example our failing child was a sub-make
+ * or failure happend elsewhere.
+ */
+int
+dieQuietly(GNode *gn, int bf)
+{
+ static int quietly = -1;
+
+ if (quietly < 0) {
+ if (DEBUG(JOB) || getBoolean(".MAKE.DIE_QUIETLY", 1) == 0)
+ quietly = 0;
+ else if (bf >= 0)
+ quietly = bf;
+ else
+ quietly = (gn) ? ((gn->type & (OP_MAKE)) != 0) : 0;
+ }
+ return quietly;
+}
+
void
PrintOnError(GNode *gn, const char *s)
{
@@ -2048,6 +2071,10 @@ PrintOnError(GNode *gn, const char *s)
char tmp[64];
char *cp;
+ /* we generally want to keep quiet if a sub-make died */
+ if (dieQuietly(gn, -1))
+ return;
+
if (s)
printf("%s", s);
diff --git a/make.h b/make.h
index 4a693f14a153..4057137c7a10 100644
--- a/make.h
+++ b/make.h
@@ -1,4 +1,4 @@
-/* $NetBSD: make.h,v 1.107 2020/04/03 03:35:16 sjg Exp $ */
+/* $NetBSD: make.h,v 1.108 2020/06/19 21:17:48 sjg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -503,6 +503,7 @@ void Make_DoAllVar(GNode *);
Boolean Make_Run(Lst);
char * Check_Cwd_Cmd(const char *);
void Check_Cwd(const char **);
+int dieQuietly(GNode *, int);
void PrintOnError(GNode *, const char *);
void Main_ExportMAKEFLAGS(Boolean);
Boolean Main_SetObjdir(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2);
diff --git a/meta.c b/meta.c
index ca40c6dd8224..03a67f19e87b 100644
--- a/meta.c
+++ b/meta.c
@@ -1,4 +1,4 @@
-/* $NetBSD: meta.c,v 1.81 2020/04/03 03:32:28 sjg Exp $ */
+/* $NetBSD: meta.c,v 1.82 2020/06/25 15:45:37 sjg Exp $ */
/*
* Implement 'meta' mode.
@@ -174,14 +174,18 @@ filemon_read(FILE *mfp, int fd)
return 0;
}
/* rewind */
- (void)lseek(fd, (off_t)0, SEEK_SET);
-
- error = 0;
- fprintf(mfp, "\n-- filemon acquired metadata --\n");
+ if (lseek(fd, (off_t)0, SEEK_SET) < 0) {
+ error = errno;
+ warn("Could not rewind filemon");
+ fprintf(mfp, "\n");
+ } else {
+ error = 0;
+ fprintf(mfp, "\n-- filemon acquired metadata --\n");
- while ((n = read(fd, buf, sizeof(buf))) > 0) {
- if ((int)fwrite(buf, 1, n, mfp) < n)
- error = EIO;
+ while ((n = read(fd, buf, sizeof(buf))) > 0) {
+ if ((int)fwrite(buf, 1, n, mfp) < n)
+ error = EIO;
+ }
}
fflush(mfp);
if (close(fd) < 0)
diff --git a/mk/ChangeLog b/mk/ChangeLog
index f061d43949e2..bd8b1b1f5b72 100644
--- a/mk/ChangeLog
+++ b/mk/ChangeLog
@@ -1,3 +1,20 @@
+2020-06-28 Simon J Gerraty <sjg@beast.crufty.net>
+
+ * sys/*.mk: make it easier for local*sys.mk to customize by
+ using ?=
+
+2020-06-22 Simon J Gerraty <sjg@beast.crufty.net>
+
+ * gendirdeps.mk (LOCAL_DEPENDS_GUARD): if we don't build at level 0
+ it is much safer to guard local depends with a simple check for
+ .MAKE.LEVEL > 0
+
+2020-06-10 Simon J Gerraty <sjg@beast.crufty.net>
+
+ * install-mk (MK_VERSION): 20200610
+
+ * mkopt.sh: this needs posix shell so #!/bin/sh should be ok
+
2020-06-06 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20200606
diff --git a/mk/FILES b/mk/FILES
index dcd00ec2f581..360fb613a15e 100644
--- a/mk/FILES
+++ b/mk/FILES
@@ -1,5 +1,6 @@
ChangeLog
FILES
+LICENSE
README
auto.obj.mk
autoconf.mk
diff --git a/mk/gendirdeps.mk b/mk/gendirdeps.mk
index d402cbcc4765..82618f2225a3 100644
--- a/mk/gendirdeps.mk
+++ b/mk/gendirdeps.mk
@@ -1,4 +1,4 @@
-# $Id: gendirdeps.mk,v 1.42 2020/05/16 23:21:48 sjg Exp $
+# $Id: gendirdeps.mk,v 1.44 2020/06/23 04:21:51 sjg Exp $
# Copyright (c) 2011-2020, Simon J. Gerraty
# Copyright (c) 2010-2018, Juniper Networks, Inc.
@@ -51,7 +51,7 @@ all:
_CURDIR ?= ${.CURDIR}
_OBJDIR ?= ${.OBJDIR}
_OBJTOP ?= ${OBJTOP}
-_OBJROOT ?= ${OBJROOT:U${_OBJTOP}}
+_OBJROOT ?= ${OBJROOT:U${_OBJTOP:H}}
.if ${_OBJROOT:M*/}
_slash=/
.else
@@ -339,6 +339,12 @@ CAT_DEPEND ?= .depend
.PHONY: ${_DEPENDFILE}
.endif
+.if ${BUILD_AT_LEVEL0:Uno:tl} == "no"
+LOCAL_DEPENDS_GUARD ?= _{.MAKE.LEVEL} > 0
+.else
+LOCAL_DEPENDS_GUARD ?= _{DEP_RELDIR} == _{_DEP_RELDIR}
+.endif
+
# 'cat .depend' should suffice, but if we are mixing build modes
# .depend may contain things we don't want.
# The sed command at the end of the stream, allows for the filters
@@ -350,7 +356,7 @@ ${_DEPENDFILE}: .NOMETA ${CAT_DEPEND:M.depend} ${META_FILES:O:u:@m@${exists($m):
${_include_src_dirdeps} \
echo '.include <dirdeps.mk>'; \
echo; \
- echo '.if $${DEP_RELDIR} == $${_DEP_RELDIR}'; \
+ echo '.if ${LOCAL_DEPENDS_GUARD}'; \
echo '# local dependencies - needed for -jN in clean tree'; \
[ -s ${CAT_DEPEND} ] && { grep : ${CAT_DEPEND} | grep -v '[/\\]'; }; \
echo '.endif' ) | sed 's,_\([{(]\),$$\1,g' > $@.new${.MAKE.PID}
diff --git a/mk/install-mk b/mk/install-mk
index 4c29ef294bd6..83542a945cd4 100644
--- a/mk/install-mk
+++ b/mk/install-mk
@@ -55,7 +55,7 @@
# Simon J. Gerraty <sjg@crufty.net>
# RCSid:
-# $Id: install-mk,v 1.172 2020/06/06 22:41:15 sjg Exp $
+# $Id: install-mk,v 1.173 2020/06/23 04:16:35 sjg Exp $
#
# @(#) Copyright (c) 1994 Simon J. Gerraty
#
@@ -70,7 +70,7 @@
# sjg@crufty.net
#
-MK_VERSION=20200606
+MK_VERSION=20200622
OWNER=
GROUP=
MODE=444
diff --git a/mk/mkopt.sh b/mk/mkopt.sh
index ad58479c2bf0..929a5aa83a66 100755
--- a/mk/mkopt.sh
+++ b/mk/mkopt.sh
@@ -1,7 +1,8 @@
-:
-# $Id: mkopt.sh,v 1.11 2017/03/18 21:36:42 sjg Exp $
+#!/bin/sh
+
+# $Id: mkopt.sh,v 1.12 2020/06/23 04:16:35 sjg Exp $
#
-# @(#) Copyright (c) 2014, Simon J. Gerraty
+# @(#) Copyright (c) 2014, 2020, Simon J. Gerraty
#
# This file is provided in the hope that it will
# be of use. There is absolutely NO WARRANTY.
diff --git a/mk/sys/AIX.mk b/mk/sys/AIX.mk
index a5c49584fe2c..b848d99fb4e8 100644
--- a/mk/sys/AIX.mk
+++ b/mk/sys/AIX.mk
@@ -1,80 +1,80 @@
# $NetBSD: sys.mk,v 1.19.2.1 1994/07/26 19:58:31 cgd Exp $
# @(#)sys.mk 5.11 (Berkeley) 3/13/91
-OS= AIX
-unix= We run ${OS}.
-ROOT_GROUP= system
+OS ?= AIX
+unix ?= We run ${OS}.
+ROOT_GROUP ?= system
# This needs a lot of work yet...
-NOPIC=no # no shared libs?
+NOPIC ?=no # no shared libs?
.SUFFIXES: .out .a .ln .o .c ${CXX_SUFFIXES} .F .f .r .y .l .s .S .cl .p .h .sh .m4
.LIBS: .a
-AR= ar
-ARFLAGS= rl
-RANLIB= ranlib
+AR ?= ar
+ARFLAGS ?= rl
+RANLIB ?= ranlib
-AS= as
+AS ?= as
AFLAGS=
-COMPILE.s= ${AS} ${AFLAGS}
-LINK.s= ${CC} ${AFLAGS} ${LDFLAGS}
-COMPILE.S= ${CC} ${AFLAGS} ${CPPFLAGS} -c
-LINK.S= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.s ?= ${AS} ${AFLAGS}
+LINK.s ?= ${CC} ${AFLAGS} ${LDFLAGS}
+COMPILE.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} -c
+LINK.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
.if exists(/usr/local/bin/gcc)
-CC= gcc
-DBG= -O -g
-STATIC?= -static
+CC ?= gcc
+DBG ?= -O -g
+STATIC ?= -static
.else
-CC= cc
-DBG= -g
-STATIC=
+CC ?= cc
+DBG ?= -g
+STATIC ?=
.endif
-CFLAGS= ${DBG}
-COMPILE.c= ${CC} ${CFLAGS} ${CPPFLAGS} -c
-LINK.c= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+CFLAGS ?= ${DBG}
+COMPILE.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
+LINK.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
-CXX= g++
-CXXFLAGS= ${CFLAGS}
-COMPILE.cc= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
-LINK.cc= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+CXX ?= g++
+CXXFLAGS ?= ${CFLAGS}
+COMPILE.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
+LINK.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
-CPP= cpp
+CPP ?= cpp
.if defined(DESTDIR)
CPPFLAGS+= -nostdinc -idirafter ${DESTDIR}/usr/include
.endif
-MK_DEP= mkdeps.sh -N
-FC= f77
-FFLAGS= -O
+MK_DEP ?= mkdeps.sh -N
+FC ?= f77
+FFLAGS ?= -O
RFLAGS=
-COMPILE.f= ${FC} ${FFLAGS} -c
-LINK.f= ${FC} ${FFLAGS} ${LDFLAGS}
-COMPILE.F= ${FC} ${FFLAGS} ${CPPFLAGS} -c
-LINK.F= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
-COMPILE.r= ${FC} ${FFLAGS} ${RFLAGS} -c
-LINK.r= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
-
-LEX= lex
+COMPILE.f ?= ${FC} ${FFLAGS} -c
+LINK.f ?= ${FC} ${FFLAGS} ${LDFLAGS}
+COMPILE.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
+LINK.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.r ?= ${FC} ${FFLAGS} ${RFLAGS} -c
+LINK.r ?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+
+LEX ?= lex
LFLAGS=
-LEX.l= ${LEX} ${LFLAGS}
+LEX.l ?= ${LEX} ${LFLAGS}
-LD= ld
+LD ?= ld
LDFLAGS=
-LINT= lint
-LINTFLAGS= -chapbx
+LINT ?= lint
+LINTFLAGS ?= -chapbx
-PC= pc
+PC ?= pc
PFLAGS=
-COMPILE.p= ${PC} ${PFLAGS} ${CPPFLAGS} -c
-LINK.p= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
+LINK.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
-YACC= yacc
-YFLAGS= -d
-YACC.y= ${YACC} ${YFLAGS}
+YACC ?= yacc
+YFLAGS ?= -d
+YACC.y ?= ${YACC} ${YFLAGS}
# C
.c:
diff --git a/mk/sys/Darwin.mk b/mk/sys/Darwin.mk
index 6d37127be13f..ea04b416ff3a 100644
--- a/mk/sys/Darwin.mk
+++ b/mk/sys/Darwin.mk
@@ -1,108 +1,108 @@
# $NetBSD: Darwin.sys.mk,v 1.3 2003/02/16 09:44:41 grant Exp $
# @(#)sys.mk 8.2 (Berkeley) 3/21/94
-OS= Darwin
-unix?= We run ${OS}.
+OS ?= Darwin
+unix ?= We run ${OS}.
.SUFFIXES: .out .a .ln .o .s .S .c .m ${CXX_SUFFIXES} .F .f .r .y .l .cl .p .h
.SUFFIXES: .sh .m4 .dylib
.LIBS: .a .dylib
-SHLIBEXT = .dylib
-HOST_LIBEXT = .dylib
-DSHLIBEXT = .dylib
+SHLIBEXT ?= .dylib
+HOST_LIBEXT ?= .dylib
+DSHLIBEXT ?= .dylib
-AR?= ar
-ARFLAGS?= rl
+AR ?= ar
+ARFLAGS ?= rl
RANLIB =
-AS?= as
-AFLAGS?=
-COMPILE.s?= ${AS} ${AFLAGS}
-LINK.s?= ${CC} ${AFLAGS} ${LDFLAGS}
-COMPILE.S?= ${CC} ${AFLAGS} ${CPPFLAGS} -c
-LINK.S?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+AS ?= as
+AFLAGS ?=
+COMPILE.s ?= ${AS} ${AFLAGS}
+LINK.s ?= ${CC} ${AFLAGS} ${LDFLAGS}
+COMPILE.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} -c
+LINK.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
-PIPE?= -pipe
+PIPE ?= -pipe
.if exists(/usr/bin/clang)
-CC?= cc ${PIPE}
-CXX?= c++
+CC ?= cc ${PIPE}
+CXX ?= c++
.elif exists(/usr/bin/gcc)
-CC?= gcc ${PIPE}
+CC ?= gcc ${PIPE}
.else
-CC?= cc ${PIPE}
+CC ?= cc ${PIPE}
.endif
-DBG?= -O2
-CFLAGS?= ${DBG}
-COMPILE.c?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
-LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+DBG ?= -O2
+CFLAGS ?= ${DBG}
+COMPILE.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
+LINK.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
.if exists(/usr/bin/g++)
-CXX?= g++
+CXX ?= g++
.else
-CXX?= c++
+CXX ?= c++
.endif
-CXXFLAGS?= ${CFLAGS}
-COMPILE.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
-LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+CXXFLAGS ?= ${CFLAGS}
+COMPILE.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
+LINK.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
-OBJC?= ${CC}
-OBJCFLAGS?= ${CFLAGS}
-COMPILE.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
-LINK.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
+OBJC ?= ${CC}
+OBJCFLAGS ?= ${CFLAGS}
+COMPILE.m ?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
+LINK.m ?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
-CPP?= cpp
-NOLINT= 1
-CPPFLAGS?=
+CPP ?= cpp
+NOLINT ?= 1
+CPPFLAGS ?=
-MK_DEP?= mkdep
+MK_DEP ?= mkdep
-FC?= f77
-FFLAGS?= -O
-RFLAGS?=
-COMPILE.f?= ${FC} ${FFLAGS} -c
-LINK.f?= ${FC} ${FFLAGS} ${LDFLAGS}
-COMPILE.F?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
-LINK.F?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
-COMPILE.r?= ${FC} ${FFLAGS} ${RFLAGS} -c
-LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+FC ?= f77
+FFLAGS ?= -O
+RFLAGS ?=
+COMPILE.f ?= ${FC} ${FFLAGS} -c
+LINK.f ?= ${FC} ${FFLAGS} ${LDFLAGS}
+COMPILE.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
+LINK.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.r ?= ${FC} ${FFLAGS} ${RFLAGS} -c
+LINK.r ?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
-INSTALL?= install
+INSTALL ?= install
-LEX?= lex
-LFLAGS?=
-LEX.l?= ${LEX} ${LFLAGS}
+LEX ?= lex
+LFLAGS ?=
+LEX.l ?= ${LEX} ${LFLAGS}
-LD?= ld
-LDFLAGS?=
+LD ?= ld
+LDFLAGS ?=
-SHLIB_TEENY = 0
-SHLIB_MINOR = 0
+SHLIB_TEENY ?= 0
+SHLIB_MINOR ?= 0
-MKPICLIB = no
-LIBEXT = .dylib
+MKPICLIB ?= no
+LIBEXT ?= .dylib
-LINT?= lint
-LINTFLAGS?= -chapbx
+LINT ?= lint
+LINTFLAGS ?= -chapbx
-LORDER?= lorder
+LORDER ?= lorder
-NM?= nm
+NM ?= nm
-PC?= pc
-PFLAGS?=
-COMPILE.p?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
-LINK.p?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+PC ?= pc
+PFLAGS ?=
+COMPILE.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
+LINK.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
-SIZE?= size
+SIZE ?= size
-TSORT?= tsort -q
+TSORT ?= tsort -q
-YACC?= bison -y
-YFLAGS?= -d
-YACC.y?= ${YACC} ${YFLAGS}
+YACC ?= bison -y
+YFLAGS ?= -d
+YACC.y ?= ${YACC} ${YFLAGS}
# C
.c:
diff --git a/mk/sys/Generic.mk b/mk/sys/Generic.mk
index aa92a6246411..9a3d3bffc183 100644
--- a/mk/sys/Generic.mk
+++ b/mk/sys/Generic.mk
@@ -1,4 +1,4 @@
-# $Id: Generic.mk,v 1.14 2020/04/17 21:08:17 sjg Exp $
+# $Id: Generic.mk,v 1.16 2020/06/29 14:34:42 sjg Exp $
#
# some reasonable defaults
@@ -7,7 +7,7 @@
.LIBS: .a
-tools = \
+tools ?= \
ar \
lorder \
ranlib \
@@ -27,71 +27,71 @@ MACHINE_ARCH = ${MACHINE_ARCH.${MACHINE}}
TSORT += -q
.endif
-ARFLAGS?= rl
+ARFLAGS ?= rl
-AS?= as
-AFLAGS?=
+AS ?= as
+AFLAGS ?=
.if ${MACHINE_ARCH} == "sparc64"
AFLAGS+= -Wa,-Av9a
.endif
-COMPILE.s?= ${CC} ${AFLAGS} -c
-LINK.s?= ${CC} ${AFLAGS} ${LDFLAGS}
-COMPILE.S?= ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
-LINK.S?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
-
-CC?= cc
-DBG?= -O2
-CFLAGS?= ${DBG}
-COMPILE.c?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
-LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
-
-CXX?= c++
-CXXFLAGS?= ${CFLAGS}
-COMPILE.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
-LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
-
-OBJC?= ${CC}
-OBJCFLAGS?= ${CFLAGS}
-COMPILE.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
-LINK.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
-
-CPP?= cpp
-CPPFLAGS?=
-
-FC?= f77
-FFLAGS?= -O
-RFLAGS?=
-COMPILE.f?= ${FC} ${FFLAGS} -c
-LINK.f?= ${FC} ${FFLAGS} ${LDFLAGS}
-COMPILE.F?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
-LINK.F?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
-COMPILE.r?= ${FC} ${FFLAGS} ${RFLAGS} -c
-LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
-
-INSTALL?= install
-
-LEX?= lex
-LFLAGS?=
-LEX.l?= ${LEX} ${LFLAGS}
-
-LD?= ld
-LDFLAGS?=
-
-LINT?= lint
-LINTFLAGS?= -chapbxzF
-
-NM?= nm
-
-PC?= pc
-PFLAGS?=
-COMPILE.p?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
-LINK.p?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
-
-SIZE?= size
-
-YACC?= yacc
-YFLAGS?=
-YACC.y?= ${YACC} ${YFLAGS}
+COMPILE.s ?= ${CC} ${AFLAGS} -c
+LINK.s ?= ${CC} ${AFLAGS} ${LDFLAGS}
+COMPILE.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
+LINK.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CC ?= cc
+DBG ?= -O2
+CFLAGS ?= ${DBG}
+COMPILE.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
+LINK.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CXX ?= c++
+CXXFLAGS ?= ${CFLAGS}
+COMPILE.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
+LINK.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+OBJC ?= ${CC}
+OBJCFLAGS ?= ${CFLAGS}
+COMPILE.m ?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
+LINK.m ?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CPP ?= cpp
+CPPFLAGS ?=
+
+FC ?= f77
+FFLAGS ?= -O
+RFLAGS ?=
+COMPILE.f ?= ${FC} ${FFLAGS} -c
+LINK.f ?= ${FC} ${FFLAGS} ${LDFLAGS}
+COMPILE.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
+LINK.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.r ?= ${FC} ${FFLAGS} ${RFLAGS} -c
+LINK.r ?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+
+INSTALL ?= install
+
+LEX ?= lex
+LFLAGS ?=
+LEX.l ?= ${LEX} ${LFLAGS}
+
+LD ?= ld
+LDFLAGS ?=
+
+LINT ?= lint
+LINTFLAGS ?= -chapbxzF
+
+NM ?= nm
+
+PC ?= pc
+PFLAGS ?=
+COMPILE.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
+LINK.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+SIZE ?= size
+
+YACC ?= yacc
+YFLAGS ?=
+YACC.y ?= ${YACC} ${YFLAGS}
# C
.c:
diff --git a/mk/sys/HP-UX.mk b/mk/sys/HP-UX.mk
index ac5ce37b85fc..34dd2881d83d 100644
--- a/mk/sys/HP-UX.mk
+++ b/mk/sys/HP-UX.mk
@@ -1,122 +1,122 @@
-# $Id: HP-UX.mk,v 1.12 2020/04/17 21:08:17 sjg Exp $
+# $Id: HP-UX.mk,v 1.14 2020/06/29 14:34:42 sjg Exp $
# $NetBSD: sys.mk,v 1.19.2.1 1994/07/26 19:58:31 cgd Exp $
# @(#)sys.mk 5.11 (Berkeley) 3/13/91
-OS= HP-UX
-ROOT_GROUP= root
-unix?= We run ${OS}.
+OS ?= HP-UX
+ROOT_GROUP ?= root
+unix ?= We run ${OS}.
# HP-UX's cc does not provide any clues as to wether this is 9.x or 10.x
# nor does sys/param.h, so we'll use the existence of /hp-ux
.if exists("/hp-ux")
-OSMAJOR?=9
+OSMAJOR ?=9
.endif
-OSMAJOR?=10
-__HPUX_VERSION?=${OSMAJOR}
+OSMAJOR ?=10
+__HPUX_VERSION ?=${OSMAJOR}
.SUFFIXES: .out .a .ln .o .c ${CXX_SUFFIXES} .F .f .r .y .l .s .S .cl .p .h .sh .m4
-LIBMODE= 755
-LIBCRT0= /lib/crt0.o
+LIBMODE ?= 755
+LIBCRT0 ?= /lib/crt0.o
.LIBS: .a
# +b<path> is needed to stop the binaries from insisting on having
# the build tree available :-)
# +s tells the dynamic loader to use SHLIB_PATH if set
-LD_bpath?=-Wl,+b/lib:/usr/lib:/usr/local/lib
-LD_spath?=-Wl,+s
+LD_bpath ?=-Wl,+b/lib:/usr/lib:/usr/local/lib
+LD_spath ?=-Wl,+s
LDADD+= ${LD_bpath} ${LD_spath}
.if exists(/usr/lib/end.o)
LDADD+= /usr/lib/end.o
.endif
-AR= ar
-ARFLAGS= rl
-RANLIB= :
+AR ?= ar
+ARFLAGS ?= rl
+RANLIB ?= :
AFLAGS=
-COMPILE.s= ${AS} ${AFLAGS}
-LINK.s= ${CC} ${AFLAGS} ${LDFLAGS}
-COMPILE.S= ${CC} ${AFLAGS} ${CPPFLAGS} -c
-LINK.S= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.s ?= ${AS} ${AFLAGS}
+LINK.s ?= ${CC} ${AFLAGS} ${LDFLAGS}
+COMPILE.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} -c
+LINK.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
.if exists(/usr/local/bin/gcc)
-PIPE?= -pipe
-CC?= gcc ${PIPE}
-AS= gas
-DBG?= -O -g
-STATIC?= -static
+PIPE ?= -pipe
+CC ?= gcc ${PIPE}
+AS ?= gas
+DBG ?= -O -g
+STATIC ?= -static
.if defined(DESTDIR)
CPPFLAGS+= -nostdinc -idirafter ${DESTDIR}/usr/include
.endif
.else
# HP's bundled compiler knows not -g or -O
-AS= as
-CC= cc
+AS ?= as
+CC ?= cc
.if exists(/opt/ansic/bin/cc)
-CCMODE?=-Ae +ESlit
-PICFLAG?= +z
+CCMODE ?=-Ae +ESlit
+PICFLAG ?= +z
LD_x=
-DBG?=-g -O
+DBG ?=-g -O
.endif
-DBG?=
-STATIC?= -Wl,-a,archive
+DBG ?=
+STATIC ?= -Wl,-a,archive
.endif
.if (${__HPUX_VERSION} == "10")
-CCSOURCE_FLAGS?= -D_HPUX_SOURCE
+CCSOURCE_FLAGS ?= -D_HPUX_SOURCE
.else
-CCSOURCE_FLAGS?= -D_HPUX_SOURCE -D_INCLUDE_POSIX_SOURCE -D_INCLUDE_XOPEN_SOURCE -D_INCLUDE_XOPEN_SOURCE_EXTENDED
+CCSOURCE_FLAGS ?= -D_HPUX_SOURCE -D_INCLUDE_POSIX_SOURCE -D_INCLUDE_XOPEN_SOURCE -D_INCLUDE_XOPEN_SOURCE_EXTENDED
.endif
-CFLAGS= ${DBG}
-CFLAGS+= ${CCMODE} -D__hpux__ -D__HPUX_VERSION=${__HPUX_VERSION} ${CCSOURCE_FLAGS}
-COMPILE.c= ${CC} ${CFLAGS} ${CPPFLAGS} -c
-LINK.c= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+CFLAGS ?= ${DBG}
+CFLAGS+ ?= ${CCMODE} -D__hpux__ -D__HPUX_VERSION=${__HPUX_VERSION} ${CCSOURCE_FLAGS}
+COMPILE.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
+LINK.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
-CXX= g++
-CXXFLAGS= ${CFLAGS}
-COMPILE.cc= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
-LINK.cc= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+CXX ?= g++
+CXXFLAGS ?= ${CFLAGS}
+COMPILE.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
+LINK.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
-CPP= cpp
+CPP ?= cpp
-MK_DEP= mkdeps.sh -N
-FC= f77
-FFLAGS= -O
+MK_DEP ?= mkdeps.sh -N
+FC ?= f77
+FFLAGS ?= -O
RFLAGS=
-COMPILE.f= ${FC} ${FFLAGS} -c
-LINK.f= ${FC} ${FFLAGS} ${LDFLAGS}
-COMPILE.F= ${FC} ${FFLAGS} ${CPPFLAGS} -c
-LINK.F= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
-COMPILE.r= ${FC} ${FFLAGS} ${RFLAGS} -c
-LINK.r= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
-
-LEX= lex
+COMPILE.f ?= ${FC} ${FFLAGS} -c
+LINK.f ?= ${FC} ${FFLAGS} ${LDFLAGS}
+COMPILE.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
+LINK.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.r ?= ${FC} ${FFLAGS} ${RFLAGS} -c
+LINK.r ?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+
+LEX ?= lex
LFLAGS=
-LEX.l= ${LEX} ${LFLAGS}
+LEX.l ?= ${LEX} ${LFLAGS}
-LD= ld
+LD ?= ld
LDFLAGS=
-LINT= lint
-LINTFLAGS= -chapbx
+LINT ?= lint
+LINTFLAGS ?= -chapbx
-PC= pc
+PC ?= pc
PFLAGS=
-COMPILE.p= ${PC} ${PFLAGS} ${CPPFLAGS} -c
-LINK.p= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
+LINK.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
# HP's sh sucks
ENV=
-MAKE_SHELL= /bin/ksh
+MAKE_SHELL ?= /bin/ksh
.if exists(/usr/local/bin/bison)
-YACC= bison -y
+YACC ?= bison -y
.else
-YACC= yacc
+YACC ?= yacc
.endif
-YFLAGS= -d
-YACC.y= ${YACC} ${YFLAGS}
+YFLAGS ?= -d
+YACC.y ?= ${YACC} ${YFLAGS}
# C
.c:
diff --git a/mk/sys/IRIX.mk b/mk/sys/IRIX.mk
index b448fb5720cf..a194c1e78a11 100644
--- a/mk/sys/IRIX.mk
+++ b/mk/sys/IRIX.mk
@@ -7,7 +7,7 @@ OS!= uname -s
ROOT_GROUP!= sed -n /:0:/s/:.*//p /etc/group
.MAKEOVERRIDES+= OS ROOT_GROUP
.endif
-unix?= We run ${OS}.
+unix ?= We run ${OS}.
.endif
.SUFFIXES: .out .a .ln .o .s .S .c ${CXX_SUFFIXES} .F .f .r .y .l .cl .p .h
@@ -15,75 +15,75 @@ unix?= We run ${OS}.
.LIBS: .a
-AR?= ar
-ARFLAGS?= rl
-RANLIB?= ranlib
+AR ?= ar
+ARFLAGS ?= rl
+RANLIB ?= ranlib
-AS?= as
-AFLAGS?=
-COMPILE.s?= ${CC} ${AFLAGS} -c
-LINK.s?= ${CC} ${AFLAGS} ${LDFLAGS}
-COMPILE.S?= ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
-LINK.S?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+AS ?= as
+AFLAGS ?=
+COMPILE.s ?= ${CC} ${AFLAGS} -c
+LINK.s ?= ${CC} ${AFLAGS} ${LDFLAGS}
+COMPILE.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
+LINK.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
-CC?= cc
-NOGCCERROR?= # defined
-DBG?= -O2
-CFLAGS?= ${DBG}
-COMPILE.c?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
-LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+CC ?= cc
+NOGCCERROR ?= # defined
+DBG ?= -O2
+CFLAGS ?= ${DBG}
+COMPILE.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
+LINK.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
-CXX?= CC
-CXXFLAGS?= ${CFLAGS}
-COMPILE.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
-LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+CXX ?= CC
+CXXFLAGS ?= ${CFLAGS}
+COMPILE.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
+LINK.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
-OBJC?= ${CC}
-OBJCFLAGS?= ${CFLAGS}
-COMPILE.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
-LINK.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
+OBJC ?= ${CC}
+OBJCFLAGS ?= ${CFLAGS}
+COMPILE.m ?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
+LINK.m ?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
-CPP?= CC
-CPPFLAGS?=
+CPP ?= CC
+CPPFLAGS ?=
-FC?= f77
-FFLAGS?= -O
-RFLAGS?=
-COMPILE.f?= ${FC} ${FFLAGS} -c
-LINK.f?= ${FC} ${FFLAGS} ${LDFLAGS}
-COMPILE.F?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
-LINK.F?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
-COMPILE.r?= ${FC} ${FFLAGS} ${RFLAGS} -c
-LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+FC ?= f77
+FFLAGS ?= -O
+RFLAGS ?=
+COMPILE.f ?= ${FC} ${FFLAGS} -c
+LINK.f ?= ${FC} ${FFLAGS} ${LDFLAGS}
+COMPILE.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
+LINK.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.r ?= ${FC} ${FFLAGS} ${RFLAGS} -c
+LINK.r ?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
-INSTALL?= ${PREFIX}/bin/install-sh
+INSTALL ?= ${PREFIX}/bin/install-sh
-LEX?= lex
-LFLAGS?=
-LEX.l?= ${LEX} ${LFLAGS}
+LEX ?= lex
+LFLAGS ?=
+LEX.l ?= ${LEX} ${LFLAGS}
-LD?= ld
-LDFLAGS?=
+LD ?= ld
+LDFLAGS ?=
-LINT?= lint
-LINTFLAGS?= -chapbxzF
+LINT ?= lint
+LINTFLAGS ?= -chapbxzF
-LORDER?= lorder
+LORDER ?= lorder
-NM?= nm
+NM ?= nm
-PC?= pc
-PFLAGS?=
-COMPILE.p?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
-LINK.p?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+PC ?= pc
+PFLAGS ?=
+COMPILE.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
+LINK.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
-SIZE?= size
+SIZE ?= size
-TSORT?= tsort -q
+TSORT ?= tsort -q
-YACC?= yacc
-YFLAGS?=
-YACC.y?= ${YACC} ${YFLAGS}
+YACC ?= yacc
+YFLAGS ?=
+YACC.y ?= ${YACC} ${YFLAGS}
# C
.c:
diff --git a/mk/sys/Linux.mk b/mk/sys/Linux.mk
index 978aec098ca3..bf80bb3addce 100644
--- a/mk/sys/Linux.mk
+++ b/mk/sys/Linux.mk
@@ -1,83 +1,83 @@
-# $Id: Linux.mk,v 1.10 2020/04/17 21:08:17 sjg Exp $
+# $Id: Linux.mk,v 1.12 2020/06/29 14:34:42 sjg Exp $
# $NetBSD: sys.mk,v 1.19.2.1 1994/07/26 19:58:31 cgd Exp $
# @(#)sys.mk 5.11 (Berkeley) 3/13/91
-OS?= Linux
-unix?= We run ${OS}.
+OS ?= Linux
+unix ?= We run ${OS}.
-ROOT_GROUP= root
+ROOT_GROUP ?= root
# would be better to work out where it is...
-LIBCRT0= /dev/null
+LIBCRT0 ?= /dev/null
-NEED_SOLINKS=yes
+NEED_SOLINKS ?=yes
.SUFFIXES: .out .a .ln .o .c ${CXX_SUFFIXES} .F .f .r .y .l .s .S .cl .p .h .sh .m4
.LIBS: .a
-AR= ar
-ARFLAGS= rl
-RANLIB= ranlib
+AR ?= ar
+ARFLAGS ?= rl
+RANLIB ?= ranlib
-AS= as
+AS ?= as
AFLAGS=
-COMPILE.s= ${AS} ${AFLAGS}
-LINK.s= ${CC} ${AFLAGS} ${LDFLAGS}
-COMPILE.S= ${CC} ${AFLAGS} ${CPPFLAGS} -c
-LINK.S= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.s ?= ${AS} ${AFLAGS}
+LINK.s ?= ${CC} ${AFLAGS} ${LDFLAGS}
+COMPILE.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} -c
+LINK.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
.if exists(/usr/local/bin/gcc)
-CC= gcc -pipe
-DBG= -O -g
-STATIC?= -static
+CC ?= gcc -pipe
+DBG ?= -O -g
+STATIC ?= -static
.else
-CC= cc -pipe
-DBG= -g
-STATIC= -Bstatic
+CC ?= cc -pipe
+DBG ?= -g
+STATIC ?= -Bstatic
.endif
-CFLAGS= ${DBG}
-COMPILE.c= ${CC} ${CFLAGS} ${CPPFLAGS} -c
-LINK.c= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+CFLAGS ?= ${DBG}
+COMPILE.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
+LINK.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
-CXX= g++
-CXXFLAGS= ${CFLAGS}
-COMPILE.cc= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
-LINK.cc= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+CXX ?= g++
+CXXFLAGS ?= ${CFLAGS}
+COMPILE.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
+LINK.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
-CPP= cpp
+CPP ?= cpp
.if defined(DESTDIR)
CPPFLAGS+= -nostdinc -idirafter ${DESTDIR}/usr/include
.endif
-MK_DEP= mkdeps.sh -N
-FC= f77
-FFLAGS= -O
+MK_DEP ?= mkdeps.sh -N
+FC ?= f77
+FFLAGS ?= -O
RFLAGS=
-COMPILE.f= ${FC} ${FFLAGS} -c
-LINK.f= ${FC} ${FFLAGS} ${LDFLAGS}
-COMPILE.F= ${FC} ${FFLAGS} ${CPPFLAGS} -c
-LINK.F= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
-COMPILE.r= ${FC} ${FFLAGS} ${RFLAGS} -c
-LINK.r= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
-
-LEX= lex
+COMPILE.f ?= ${FC} ${FFLAGS} -c
+LINK.f ?= ${FC} ${FFLAGS} ${LDFLAGS}
+COMPILE.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
+LINK.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.r ?= ${FC} ${FFLAGS} ${RFLAGS} -c
+LINK.r ?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+
+LEX ?= lex
LFLAGS=
-LEX.l= ${LEX} ${LFLAGS}
+LEX.l ?= ${LEX} ${LFLAGS}
-LD= ld
+LD ?= ld
LDFLAGS=
-LINT= lint
-LINTFLAGS= -chapbx
+LINT ?= lint
+LINTFLAGS ?= -chapbx
-PC= pc
+PC ?= pc
PFLAGS=
-COMPILE.p= ${PC} ${PFLAGS} ${CPPFLAGS} -c
-LINK.p= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
+LINK.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
-YACC= yacc
-YFLAGS= -d
-YACC.y= ${YACC} ${YFLAGS}
+YACC ?= yacc
+YFLAGS ?= -d
+YACC.y ?= ${YACC} ${YFLAGS}
# C
.c:
diff --git a/mk/sys/NetBSD.mk b/mk/sys/NetBSD.mk
index a1711a5ec9db..2e72cc742e4f 100644
--- a/mk/sys/NetBSD.mk
+++ b/mk/sys/NetBSD.mk
@@ -1,21 +1,21 @@
# $NetBSD: sys.mk,v 1.66.2.1 2002/06/05 03:31:01 lukem Exp $
# @(#)sys.mk 8.2 (Berkeley) 3/21/94
-OS= NetBSD
-unix?= We run ${OS}.
+OS ?= NetBSD
+unix ?= We run ${OS}.
.if !defined(MAKE_VERSION)
# we are running native make
# which defined MAKE_VERSION between 20010609 and 20090324
# so we can make a rough guess
.if defined(.MAKE.LEVEL)
-MAKE_VERSION = 20090908
+MAKE_VERSION ?= 20090908
.elif defined(.MAKE.MAKEFILES)
# introduced 20071008
-MAKE_VERSION = 20090324
+MAKE_VERSION ?= 20090324
.else
# this just before when MAKE_VERSION was introduced
-MAKE_VERSION = 20010606
+MAKE_VERSION ?= 20010606
.endif
.endif
@@ -24,29 +24,29 @@ MAKE_VERSION = 20010606
.LIBS: .a
-AR?= ar
-ARFLAGS?= rl
-RANLIB?= ranlib
+AR ?= ar
+ARFLAGS ?= rl
+RANLIB ?= ranlib
-AS?= as
-AFLAGS?=
-COMPILE.s?= ${CC} ${AFLAGS} -c
-LINK.s?= ${CC} ${AFLAGS} ${LDFLAGS}
-COMPILE.S?= ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
-LINK.S?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+AS ?= as
+AFLAGS ?=
+COMPILE.s ?= ${CC} ${AFLAGS} -c
+LINK.s ?= ${CC} ${AFLAGS} ${LDFLAGS}
+COMPILE.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
+LINK.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
-CC?= cc
+CC ?= cc
# need to make sure this is set
MACHINE_ARCH.${MACHINE} ?= ${MACHINE}
.if empty(MACHINE_ARCH)
-MACHINE_ARCH = ${MACHINE_ARCH.${MACHINE}}
+MACHINE_ARCH ?= ${MACHINE_ARCH.${MACHINE}}
.endif
#
# CPU model, derived from MACHINE_ARCH
#
-MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:S/m68000/m68k/:S/armeb/arm/}
+MACHINE_CPU ?= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:S/m68000/m68k/:S/armeb/arm/}
.if ${MACHINE_CPU} == "alpha" || \
${MACHINE_CPU} == "arm" || \
@@ -56,69 +56,69 @@ MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3
${MACHINE_CPU} == "powerpc" || \
${MACHINE_CPU} == "sparc" || \
${MACHINE_CPU} == "vax"
-DBG?= -O2
+DBG ?= -O2
.elif ${MACHINE_ARCH} == "x86_64"
-DBG?=
+DBG ?=
.elif ${MACHINE_ARCH} == "sparc64"
-DBG?= -O -ffixed-g4 #Hack for embedany memory model compatibility
+DBG ?= -O -ffixed-g4 #Hack for embedany memory model compatibility
.else
-DBG?= -O
+DBG ?= -O
.endif
-CFLAGS?= ${DBG}
-COMPILE.c?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
-LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+CFLAGS ?= ${DBG}
+COMPILE.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
+LINK.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
-CXX?= c++
-CXXFLAGS?= ${CFLAGS}
-COMPILE.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
-LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+CXX ?= c++
+CXXFLAGS ?= ${CFLAGS}
+COMPILE.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
+LINK.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
-OBJC?= ${CC}
-OBJCFLAGS?= ${CFLAGS}
-COMPILE.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
-LINK.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
+OBJC ?= ${CC}
+OBJCFLAGS ?= ${CFLAGS}
+COMPILE.m ?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
+LINK.m ?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
-CPP?= cpp
-CPPFLAGS?=
+CPP ?= cpp
+CPPFLAGS ?=
-FC?= f77
-FFLAGS?= -O
-RFLAGS?=
-COMPILE.f?= ${FC} ${FFLAGS} -c
-LINK.f?= ${FC} ${FFLAGS} ${LDFLAGS}
-COMPILE.F?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
-LINK.F?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
-COMPILE.r?= ${FC} ${FFLAGS} ${RFLAGS} -c
-LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+FC ?= f77
+FFLAGS ?= -O
+RFLAGS ?=
+COMPILE.f ?= ${FC} ${FFLAGS} -c
+LINK.f ?= ${FC} ${FFLAGS} ${LDFLAGS}
+COMPILE.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
+LINK.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.r ?= ${FC} ${FFLAGS} ${RFLAGS} -c
+LINK.r ?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
-INSTALL?= install
+INSTALL ?= install
-LEX?= lex
-LFLAGS?=
-LEX.l?= ${LEX} ${LFLAGS}
+LEX ?= lex
+LFLAGS ?=
+LEX.l ?= ${LEX} ${LFLAGS}
-LD?= ld
-LDFLAGS?=
+LD ?= ld
+LDFLAGS ?=
-LINT?= lint
-LINTFLAGS?= -chapbxzF
+LINT ?= lint
+LINTFLAGS ?= -chapbxzF
-LORDER?= lorder
+LORDER ?= lorder
-NM?= nm
+NM ?= nm
-PC?= pc
-PFLAGS?=
-COMPILE.p?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
-LINK.p?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+PC ?= pc
+PFLAGS ?=
+COMPILE.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
+LINK.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
-SIZE?= size
+SIZE ?= size
-TSORT?= tsort -q
+TSORT ?= tsort -q
-YACC?= yacc
-YFLAGS?=
-YACC.y?= ${YACC} ${YFLAGS}
+YACC ?= yacc
+YFLAGS ?=
+YACC.y ?= ${YACC} ${YFLAGS}
# C
.c:
diff --git a/mk/sys/OSF1.mk b/mk/sys/OSF1.mk
index 0d0a73f40c98..4c1a09f6f5f7 100644
--- a/mk/sys/OSF1.mk
+++ b/mk/sys/OSF1.mk
@@ -1,15 +1,15 @@
-# $Id: OSF1.mk,v 1.9 2020/04/17 21:08:17 sjg Exp $
+# $Id: OSF1.mk,v 1.11 2020/06/29 14:34:42 sjg Exp $
# $NetBSD: sys.mk,v 1.19.2.1 1994/07/26 19:58:31 cgd Exp $
# @(#)sys.mk 5.11 (Berkeley) 3/13/91
-OS?= OSF1
-unix?= We run ${OS}.
-ROOT_GROUP= system
+OS ?= OSF1
+unix ?= We run ${OS}.
+ROOT_GROUP ?= system
# can't fine one anywhere, so just stop the dependency
-LIBCRT0= /dev/null
+LIBCRT0 ?= /dev/null
-PATH=/usr/sbin:/usr/bin:/usr/ucb:/opt/gnu/bin:/usr/ccs/bin
+PATH ?=/usr/sbin:/usr/bin:/usr/ucb:/opt/gnu/bin:/usr/ccs/bin
.SUFFIXES: .out .a .ln .o .c ${CXX_SUFFIXES} .F .f .r .y .l .s .S .cl .p .h .sh .m4
@@ -17,78 +17,78 @@ PATH=/usr/sbin:/usr/bin:/usr/ucb:/opt/gnu/bin:/usr/ccs/bin
# no -X
LD_X=
-LD_x= -x
-LD_r= -r
-AR= ar
-ARFLAGS= rl
-RANLIB= ranlib
-
-AS= as
-AS_STDIN= -
+LD_x ?= -x
+LD_r ?= -r
+AR ?= ar
+ARFLAGS ?= rl
+RANLIB ?= ranlib
+
+AS ?= as
+AS_STDIN ?= -
AFLAGS=
-COMPILE.s= ${AS} ${AFLAGS}
-LINK.s= ${CC} ${AFLAGS} ${LDFLAGS}
-COMPILE.S= ${CC} ${AFLAGS} ${CPPFLAGS} -c
-LINK.S= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.s ?= ${AS} ${AFLAGS}
+LINK.s ?= ${CC} ${AFLAGS} ${LDFLAGS}
+COMPILE.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} -c
+LINK.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
.if exists(/opt/gnu/bin/gcc) || exists(/usr/local/bin/gcc)
-CC?= gcc
+CC ?= gcc
.else
-CC?= cc -std
+CC ?= cc -std
.endif
.if (${CC:T} == "gcc")
-DBG= -O -g
-STATIC= -static
-DBG= -g
-STATIC= -non_shared
+DBG ?= -O -g
+STATIC ?= -static
+DBG ?= -g
+STATIC ?= -non_shared
.endif
-CFLAGS= ${DBG}
-COMPILE.c= ${CC} ${CFLAGS} ${CPPFLAGS} -c
-LINK.c= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+CFLAGS ?= ${DBG}
+COMPILE.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
+LINK.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
-CXX= g++
-CXXFLAGS= ${CFLAGS}
-COMPILE.cc= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
-LINK.cc= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+CXX ?= g++
+CXXFLAGS ?= ${CFLAGS}
+COMPILE.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
+LINK.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
-CPP= /usr/ccs/lib/cpp
+CPP ?= /usr/ccs/lib/cpp
.if defined(DESTDIR)
CPPFLAGS+= -nostdinc -idirafter ${DESTDIR}/usr/include
.endif
-MK_DEP= mkdeps.sh -N
-FC= f77
-FFLAGS= -O
+MK_DEP ?= mkdeps.sh -N
+FC ?= f77
+FFLAGS ?= -O
RFLAGS=
-COMPILE.f= ${FC} ${FFLAGS} -c
-LINK.f= ${FC} ${FFLAGS} ${LDFLAGS}
-COMPILE.F= ${FC} ${FFLAGS} ${CPPFLAGS} -c
-LINK.F= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
-COMPILE.r= ${FC} ${FFLAGS} ${RFLAGS} -c
-LINK.r= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
-
-LEX= lex
+COMPILE.f ?= ${FC} ${FFLAGS} -c
+LINK.f ?= ${FC} ${FFLAGS} ${LDFLAGS}
+COMPILE.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
+LINK.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.r ?= ${FC} ${FFLAGS} ${RFLAGS} -c
+LINK.r ?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+
+LEX ?= lex
LFLAGS=
-LEX.l= ${LEX} ${LFLAGS}
+LEX.l ?= ${LEX} ${LFLAGS}
-LD= ld
+LD ?= ld
LDFLAGS=
-LINT= lint
-LINTFLAGS= -chapbx
+LINT ?= lint
+LINTFLAGS ?= -chapbx
-PC= pc
+PC ?= pc
PFLAGS=
-COMPILE.p= ${PC} ${PFLAGS} ${CPPFLAGS} -c
-LINK.p= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
+LINK.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
.if exists(/usr/local/bin/bison) || exists(/opt/gnu/bin/bison)
-YACC= bison -y
+YACC ?= bison -y
.else
-YACC= yacc
+YACC ?= yacc
.endif
-YFLAGS= -d
-YACC.y= ${YACC} ${YFLAGS}
+YFLAGS ?= -d
+YACC.y ?= ${YACC} ${YFLAGS}
# C
.c:
diff --git a/mk/sys/OpenBSD.mk b/mk/sys/OpenBSD.mk
index 8b87ef3e85a4..d73bb0d82c9a 100644
--- a/mk/sys/OpenBSD.mk
+++ b/mk/sys/OpenBSD.mk
@@ -1,8 +1,8 @@
# $NetBSD: OpenBSD.sys.mk,v 1.1 2002/11/17 09:18:00 cjep Exp $
# @(#)sys.mk 8.2 (Berkeley) 3/21/94
-OS= OpenBSD
-unix?= We run ${OS}.
+OS ?= OpenBSD
+unix ?= We run ${OS}.
.SUFFIXES: .out .a .ln .o .s .S .c ${CXX_SUFFIXES} .F .f .r .y .l .cl .p .h
.SUFFIXES: .sh .m4
@@ -12,88 +12,88 @@ unix?= We run ${OS}.
# need to make sure this is set
MACHINE_ARCH.${MACHINE} ?= ${MACHINE}
.if empty(MACHINE_ARCH)
-MACHINE_ARCH = ${MACHINE_ARCH.${MACHINE}}
+MACHINE_ARCH ?= ${MACHINE_ARCH.${MACHINE}}
.endif
-AR?= ar
-ARFLAGS?= rl
-RANLIB?= ranlib
+AR ?= ar
+ARFLAGS ?= rl
+RANLIB ?= ranlib
-AS?= as
-AFLAGS?=
+AS ?= as
+AFLAGS ?=
.if ${MACHINE_ARCH} == "sparc64"
AFLAGS+= -Wa,-Av9a
.endif
-COMPILE.s?= ${CC} ${AFLAGS} -c
-LINK.s?= ${CC} ${AFLAGS} ${LDFLAGS}
-COMPILE.S?= ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
-LINK.S?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.s ?= ${CC} ${AFLAGS} -c
+LINK.s ?= ${CC} ${AFLAGS} ${LDFLAGS}
+COMPILE.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
+LINK.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
-CC?= cc
+CC ?= cc
.if ${MACHINE_ARCH} == "alpha" || \
${MACHINE_ARCH} == "i386" || \
${MACHINE_ARCH} == "m68k" || \
${MACHINE_ARCH} == "sparc" || \
${MACHINE_ARCH} == "vax"
-DBG?= -O2
+DBG ?= -O2
.else
-DBG?= -O
+DBG ?= -O
.endif
-CFLAGS?= ${DBG}
-COMPILE.c?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
-LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+CFLAGS ?= ${DBG}
+COMPILE.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
+LINK.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
-CXX?= c++
-CXXFLAGS?= ${CFLAGS}
-COMPILE.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
-LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+CXX ?= c++
+CXXFLAGS ?= ${CFLAGS}
+COMPILE.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
+LINK.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
-OBJC?= ${CC}
-OBJCFLAGS?= ${CFLAGS}
-COMPILE.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
-LINK.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
+OBJC ?= ${CC}
+OBJCFLAGS ?= ${CFLAGS}
+COMPILE.m ?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
+LINK.m ?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
-CPP?= cpp
-CPPFLAGS?=
+CPP ?= cpp
+CPPFLAGS ?=
-FC?= f77
-FFLAGS?= -O
-RFLAGS?=
-COMPILE.f?= ${FC} ${FFLAGS} -c
-LINK.f?= ${FC} ${FFLAGS} ${LDFLAGS}
-COMPILE.F?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
-LINK.F?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
-COMPILE.r?= ${FC} ${FFLAGS} ${RFLAGS} -c
-LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+FC ?= f77
+FFLAGS ?= -O
+RFLAGS ?=
+COMPILE.f ?= ${FC} ${FFLAGS} -c
+LINK.f ?= ${FC} ${FFLAGS} ${LDFLAGS}
+COMPILE.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
+LINK.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.r ?= ${FC} ${FFLAGS} ${RFLAGS} -c
+LINK.r ?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
-INSTALL?= install
+INSTALL ?= install
-LEX?= lex
-LFLAGS?=
-LEX.l?= ${LEX} ${LFLAGS}
+LEX ?= lex
+LFLAGS ?=
+LEX.l ?= ${LEX} ${LFLAGS}
-LD?= ld
-LDFLAGS?=
+LD ?= ld
+LDFLAGS ?=
-LINT?= lint
-LINTFLAGS?= -chapbxzF
+LINT ?= lint
+LINTFLAGS ?= -chapbxzF
-LORDER?= lorder
+LORDER ?= lorder
-NM?= nm
+NM ?= nm
-PC?= pc
-PFLAGS?=
-COMPILE.p?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
-LINK.p?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+PC ?= pc
+PFLAGS ?=
+COMPILE.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
+LINK.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
-SIZE?= size
+SIZE ?= size
-TSORT?= tsort -q
+TSORT ?= tsort -q
-YACC?= yacc
-YFLAGS?=
-YACC.y?= ${YACC} ${YFLAGS}
+YACC ?= yacc
+YFLAGS ?=
+YACC.y ?= ${YACC} ${YFLAGS}
# C
.c:
diff --git a/mk/sys/SunOS.mk b/mk/sys/SunOS.mk
index 71c985204fc6..e79cd3a7dbd4 100644
--- a/mk/sys/SunOS.mk
+++ b/mk/sys/SunOS.mk
@@ -1,19 +1,19 @@
-# $Id: SunOS.mk,v 1.9 2020/04/17 21:08:17 sjg Exp $
+# $Id: SunOS.mk,v 1.11 2020/06/29 14:34:42 sjg Exp $
.if ${.PARSEFILE} == "sys.mk"
.include <host-target.mk>
-OS?= SunOS.${HOST_OSMAJOR}
-unix?= We run ${OS}.
+OS ?= SunOS.${HOST_OSMAJOR}
+unix ?= We run ${OS}.
.endif
.if ${HOST_OSMAJOR} > 4
-ROOT_GROUP= root
+ROOT_GROUP ?= root
-SHLIB_FULLVERSION = ${SHLIB_MAJOR}
+SHLIB_FULLVERSION ?= ${SHLIB_MAJOR}
# suppress the dependency
-LIBCRT0= /dev/null
+LIBCRT0 ?= /dev/null
.ifndef CC
# the PATH below may find an ancient gcc
@@ -22,21 +22,21 @@ CC := ${gcc:L:${M_whence}}
.endif
# the stuff in /usr/xpg4/bin is usually more sane.
-PATH=/usr/xpg4/bin:/usr/sbin:/usr/bin:/usr/ucb:/usr/sfw/bin:/opt/gnu/bin:/usr/ccs/bin:/usr/local/bin
+PATH ?=/usr/xpg4/bin:/usr/sbin:/usr/bin:/usr/ucb:/usr/sfw/bin:/opt/gnu/bin:/usr/ccs/bin:/usr/local/bin
.export PATH
-DSHLIBEXT = .so
-HOST_LIBDIRS = /usr/lib /lib /usr/sfw/lib
+DSHLIBEXT ?= .so
+HOST_LIBDIRS ?= /usr/lib /lib /usr/sfw/lib
# no -X
LD_X=
LD_x=
-RANLIB= :
-CPP= /usr/ccs/lib/cpp
+RANLIB ?= :
+CPP ?= /usr/ccs/lib/cpp
.else
-ROOT_GROUP= wheel
-RANLIB= ranlib
-CPP= cpp
+ROOT_GROUP ?= wheel
+RANLIB ?= ranlib
+CPP ?= cpp
.endif
# the rest is common
@@ -45,71 +45,71 @@ CPP= cpp
.LIBS: .a
-AR= ar
-ARFLAGS= rl
+AR ?= ar
+ARFLAGS ?= rl
-AS= as
-AS_STDIN= -
+AS ?= as
+AS_STDIN ?= -
AFLAGS=
-COMPILE.s= ${AS} ${AFLAGS}
-LINK.s= ${CC} ${AFLAGS} ${LDFLAGS}
-COMPILE.S= ${CC} ${AFLAGS} ${CPPFLAGS} -c
-LINK.S= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.s ?= ${AS} ${AFLAGS}
+LINK.s ?= ${CC} ${AFLAGS} ${LDFLAGS}
+COMPILE.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} -c
+LINK.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
.if exists(/opt/gnu/bin/gcc) || exists(/usr/local/bin/gcc)
CC ?= gcc -pipe
-DBG= -O -g
-STATIC= -static
+DBG ?= -O -g
+STATIC ?= -static
.else
CC ?= cc
-DBG= -g
-STATIC= -Bstatic
+DBG ?= -g
+STATIC ?= -Bstatic
.endif
-CFLAGS= ${DBG}
-COMPILE.c= ${CC} ${CFLAGS} ${CPPFLAGS} -c
-LINK.c= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+CFLAGS ?= ${DBG}
+COMPILE.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
+LINK.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
-CXX= g++
-CXXFLAGS= ${CFLAGS}
-COMPILE.cc= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
-LINK.cc= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+CXX ?= g++
+CXXFLAGS ?= ${CFLAGS}
+COMPILE.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
+LINK.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
.if defined(DESTDIR)
CPPFLAGS+= -nostdinc -idirafter ${DESTDIR}/usr/include
.endif
-MK_DEP= mkdeps.sh -N
-FC= f77
-FFLAGS= -O
+MK_DEP ?= mkdeps.sh -N
+FC ?= f77
+FFLAGS ?= -O
RFLAGS=
-COMPILE.f= ${FC} ${FFLAGS} -c
-LINK.f= ${FC} ${FFLAGS} ${LDFLAGS}
-COMPILE.F= ${FC} ${FFLAGS} ${CPPFLAGS} -c
-LINK.F= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
-COMPILE.r= ${FC} ${FFLAGS} ${RFLAGS} -c
-LINK.r= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
-
-LEX= lex
+COMPILE.f ?= ${FC} ${FFLAGS} -c
+LINK.f ?= ${FC} ${FFLAGS} ${LDFLAGS}
+COMPILE.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
+LINK.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.r ?= ${FC} ${FFLAGS} ${RFLAGS} -c
+LINK.r ?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+
+LEX ?= lex
LFLAGS=
-LEX.l= ${LEX} ${LFLAGS}
+LEX.l ?= ${LEX} ${LFLAGS}
-LD= ld
+LD ?= ld
LDFLAGS=
-LINT= lint
-LINTFLAGS= -chapbx
+LINT ?= lint
+LINTFLAGS ?= -chapbx
-PC= pc
+PC ?= pc
PFLAGS=
-COMPILE.p= ${PC} ${PFLAGS} ${CPPFLAGS} -c
-LINK.p= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
+LINK.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
.if exists(/usr/local/bin/bison) || exists(/opt/gnu/bin/bison)
-YACC= bison -y
+YACC ?= bison -y
.else
-YACC= yacc
+YACC ?= yacc
.endif
-YFLAGS= -d
-YACC.y= ${YACC} ${YFLAGS}
+YFLAGS ?= -d
+YACC.y ?= ${YACC} ${YFLAGS}
# C
.c:
diff --git a/mk/sys/UnixWare.mk b/mk/sys/UnixWare.mk
index 3b1e531515df..888f0d90c0b4 100644
--- a/mk/sys/UnixWare.mk
+++ b/mk/sys/UnixWare.mk
@@ -1,16 +1,16 @@
-# $Id: UnixWare.mk,v 1.4 2020/04/17 21:08:17 sjg Exp $
+# $Id: UnixWare.mk,v 1.6 2020/06/29 14:34:42 sjg Exp $
# based on "Id: SunOS.5.sys.mk,v 1.6 2003/09/30 16:42:23 sjg Exp "
# $NetBSD: sys.mk,v 1.19.2.1 1994/07/26 19:58:31 cgd Exp $
# @(#)sys.mk 5.11 (Berkeley) 3/13/91
-OS?= UnixWare
-unix?= We run ${OS}.
-ROOT_GROUP= root
+OS ?= UnixWare
+unix ?= We run ${OS}.
+ROOT_GROUP ?= root
# can't fine one anywhere, so just stop the dependency
-LIBCRT0= /dev/null
+LIBCRT0 ?= /dev/null
-PATH=/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/ccs/lib:/usr/ucb:/usr/local/bin
+PATH ?=/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/ccs/lib:/usr/ucb:/usr/local/bin
.SUFFIXES: .out .a .ln .o .c ${CXX_SUFFIXES} .F .f .r .y .l .s .S .cl .p .h .sh .m4
@@ -19,119 +19,119 @@ PATH=/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/ccs/lib:/usr/ucb:/usr/local/bin
# no -X
LD_X=
LD_x=
-AR?= ar
-ARFLAGS?= rl
-RANLIB?= :
-
-AS?= as
-AS_STDIN?= -
-AFLAGS?=
-COMPILE.s?= ${AS} ${AFLAGS}
-LINK.s?= ${CC} ${AFLAGS} ${LDFLAGS}
-COMPILE.S?= ${CC} ${AFLAGS} ${CPPFLAGS} -c
-LINK.S?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+AR ?= ar
+ARFLAGS ?= rl
+RANLIB ?= :
+
+AS ?= as
+AS_STDIN ?= -
+AFLAGS ?=
+COMPILE.s ?= ${AS} ${AFLAGS}
+LINK.s ?= ${CC} ${AFLAGS} ${LDFLAGS}
+COMPILE.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} -c
+LINK.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
# at least gcc 2.95 on UnixWare has no internal macro to identify the system
.if exists(/usr/local/bin/gcc)
-CC?= gcc -pipe -DUNIXWARE
-DBG?= -O -g
-STATIC?= -static
+CC ?= gcc -pipe -DUNIXWARE
+DBG ?= -O -g
+STATIC ?= -static
.else
-CC?= cc
-DBG?= -g
-STATIC?= -Bstatic # XXX: don't know about UDK compilers
+CC ?= cc
+DBG ?= -g
+STATIC ?= -Bstatic # XXX: don't know about UDK compilers
.endif
-CFLAGS?= ${DBG}
-COMPILE.c?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
-LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+CFLAGS ?= ${DBG}
+COMPILE.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
+LINK.c ?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
.if exists(/usr/local/bin/g++)
-CXX?= g++ -DUNIXWARE
+CXX ?= g++ -DUNIXWARE
.else
-CXX?= c++ # XXX: don't know about UDK compilers
+CXX ?= c++ # XXX: don't know about UDK compilers
.endif
-CXXFLAGS?= ${CFLAGS}
-COMPILE.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
-LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+CXXFLAGS ?= ${CFLAGS}
+COMPILE.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
+LINK.cc ?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
-CPP?= /usr/ccs/lib/cpp
+CPP ?= /usr/ccs/lib/cpp
.if defined(DESTDIR)
CPPFLAGS+= -nostdinc -idirafter ${DESTDIR}/usr/include
.endif
-MK_DEP?= mkdeps.sh -N
+MK_DEP ?= mkdeps.sh -N
.if exists(/usr/local/bin/g77)
-FC?= g77
+FC ?= g77
.else
-FC?= f77 # XXX: don't know about UDK compilers
+FC ?= f77 # XXX: don't know about UDK compilers
.endif
-FFLAGS?= -O
-RFLAGS?=
-COMPILE.f?= ${FC} ${FFLAGS} -c
-LINK.f?= ${FC} ${FFLAGS} ${LDFLAGS}
-COMPILE.F?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
-LINK.F?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
-COMPILE.r?= ${FC} ${FFLAGS} ${RFLAGS} -c
-LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
-
-INSTALL?= /usr/ucb/install # BSD install
-
-LEX?= lex
-LFLAGS?=
-LEX.l?= ${LEX} ${LFLAGS}
-
-LD?= ld
-LDFLAGS?=
-
-LIBC?= ${DESTDIR}/usr/ccs/lib/libc.a
-LIBCOMPAT?=
-LIBCRYPT?= ${DESTDIR}/usr/lib/libcrypt.a
-LIBCURSES?= ${DESTDIR}/usr/ccs/lib/libcurses.a
-LIBDBM?=
-LIBDES?=
-LIBEDIT?=
-LIBGCC?=
-LIBKDB?=
-LIBKRB?=
-LIBKVM?=
-LIBL?= ${DESTDIR}/usr/ccs/lib/libl.a
-LIBM?= ${DESTDIR}/usr/ccs/lib/libm.a
-LIBMP?=
-LIBPC?=
-LIBPCAP?=
-LIBPLOT?=
-LIBRESOLV?=
-LIBRPCSVC?= ${DESTDIR}/usr/lib/librpcsvc.a
-LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a
-LIBTERMCAP?= ${DESTDIR}/usr/ccs/lib/libtermcap.a
-LIBUTIL?=
-LIBWRAP?=
-LIBY?= ${DESTDIR}/usr/ccs/lib/liby.a
-LIBZ?=
-
-LINT?= lint
-LINTFLAGS?= -pF
-
-LORDER?= lorder
-
-NM?= nm
-
-PC?= pc # XXX: UDK probably does not have pc
-PFLAGS?=
-COMPILE.p?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
-LINK.p?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
-
-SIZE?= size
-
-TSORT?= tsort
+FFLAGS ?= -O
+RFLAGS ?=
+COMPILE.f ?= ${FC} ${FFLAGS} -c
+LINK.f ?= ${FC} ${FFLAGS} ${LDFLAGS}
+COMPILE.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
+LINK.F ?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.r ?= ${FC} ${FFLAGS} ${RFLAGS} -c
+LINK.r ?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+
+INSTALL ?= /usr/ucb/install # BSD install
+
+LEX ?= lex
+LFLAGS ?=
+LEX.l ?= ${LEX} ${LFLAGS}
+
+LD ?= ld
+LDFLAGS ?=
+
+LIBC ?= ${DESTDIR}/usr/ccs/lib/libc.a
+LIBCOMPAT ?=
+LIBCRYPT ?= ${DESTDIR}/usr/lib/libcrypt.a
+LIBCURSES ?= ${DESTDIR}/usr/ccs/lib/libcurses.a
+LIBDBM ?=
+LIBDES ?=
+LIBEDIT ?=
+LIBGCC ?=
+LIBKDB ?=
+LIBKRB ?=
+LIBKVM ?=
+LIBL ?= ${DESTDIR}/usr/ccs/lib/libl.a
+LIBM ?= ${DESTDIR}/usr/ccs/lib/libm.a
+LIBMP ?=
+LIBPC ?=
+LIBPCAP ?=
+LIBPLOT ?=
+LIBRESOLV ?=
+LIBRPCSVC ?= ${DESTDIR}/usr/lib/librpcsvc.a
+LIBSKEY ?= ${DESTDIR}/usr/lib/libskey.a
+LIBTERMCAP ?= ${DESTDIR}/usr/ccs/lib/libtermcap.a
+LIBUTIL ?=
+LIBWRAP ?=
+LIBY ?= ${DESTDIR}/usr/ccs/lib/liby.a
+LIBZ ?=
+
+LINT ?= lint
+LINTFLAGS ?= -pF
+
+LORDER ?= lorder
+
+NM ?= nm
+
+PC ?= pc # XXX: UDK probably does not have pc
+PFLAGS ?=
+COMPILE.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
+LINK.p ?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+SIZE ?= size
+
+TSORT ?= tsort
.if exists(/usr/local/bin/bison)
-YACC?= bison -y
+YACC ?= bison -y
.else
-YACC?= yacc
+YACC ?= yacc
.endif
-YFLAGS?= -d
-YACC.y?= ${YACC} ${YFLAGS}
+YFLAGS ?= -d
+YACC.y ?= ${YACC} ${YFLAGS}
# C
.c:
diff --git a/str.c b/str.c
index d3d7994a0868..bc0108a84d2c 100644
--- a/str.c
+++ b/str.c
@@ -1,4 +1,4 @@
-/* $NetBSD: str.c,v 1.42 2020/05/06 02:30:10 christos Exp $ */
+/* $NetBSD: str.c,v 1.48 2020/06/15 14:46:28 rillig Exp $ */
/*-
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: str.c,v 1.42 2020/05/06 02:30:10 christos Exp $";
+static char rcsid[] = "$NetBSD: str.c,v 1.48 2020/06/15 14:46:28 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)str.c 5.8 (Berkeley) 6/1/90";
#else
-__RCSID("$NetBSD: str.c,v 1.42 2020/05/06 02:30:10 christos Exp $");
+__RCSID("$NetBSD: str.c,v 1.48 2020/06/15 14:46:28 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -119,7 +119,7 @@ str_concat(const char *s1, const char *s2, int flags)
/* copy second string plus EOS into place */
memcpy(result + len1, s2, len2 + 1);
- return(result);
+ return result;
}
/*-
@@ -304,7 +304,7 @@ Str_FindSubstring(const char *string, const char *substring)
* substring.
*/
- for (b = substring; *string != 0; string += 1) {
+ for (b = substring; *string != 0; string++) {
if (*string != *b)
continue;
a = string;
@@ -344,9 +344,9 @@ Str_Match(const char *string, const char *pattern)
* pattern but not at the end of the string, we failed.
*/
if (*pattern == 0)
- return(!*string);
+ return !*string;
if (*string == 0 && *pattern != '*')
- return(0);
+ return 0;
/*
* Check for a "*" as the next pattern character. It matches
* any substring. We handle this by calling ourselves
@@ -354,15 +354,17 @@ Str_Match(const char *string, const char *pattern)
* match or we reach the end of the string.
*/
if (*pattern == '*') {
- pattern += 1;
+ pattern++;
+ while (*pattern == '*')
+ pattern++;
if (*pattern == 0)
- return(1);
+ return 1;
while (*string != 0) {
if (Str_Match(string, pattern))
- return(1);
+ return 1;
++string;
}
- return(0);
+ return 0;
}
/*
* Check for a "?" as the next pattern character. It matches
@@ -388,14 +390,14 @@ Str_Match(const char *string, const char *pattern)
if ((*pattern == ']') || (*pattern == 0)) {
if (nomatch)
break;
- return(0);
+ return 0;
}
if (*pattern == *string)
break;
if (pattern[1] == '-') {
c2 = pattern[2];
if (c2 == 0)
- return(nomatch);
+ return nomatch;
if ((*pattern <= *string) &&
(c2 >= *string))
break;
@@ -415,20 +417,20 @@ Str_Match(const char *string, const char *pattern)
goto thisCharOK;
}
/*
- * If the next pattern character is '/', just strip off the
- * '/' so we do exact matching on the character that follows.
+ * If the next pattern character is a backslash, just strip it
+ * off so we do exact matching on the character that follows.
*/
if (*pattern == '\\') {
++pattern;
if (*pattern == 0)
- return(0);
+ return 0;
}
/*
* There's no special character. Just make sure that the
* next characters of each string match.
*/
if (*pattern != *string)
- return(0);
+ return 0;
thisCharOK: ++pattern;
++string;
}
diff --git a/unit-tests/Makefile b/unit-tests/Makefile
index 5cf0212ce596..5c429c9648b9 100644
--- a/unit-tests/Makefile
+++ b/unit-tests/Makefile
@@ -1,6 +1,6 @@
-# $Id: Makefile,v 1.54 2020/05/17 17:26:14 sjg Exp $
+# $Id: Makefile,v 1.55 2020/06/29 14:47:56 sjg Exp $
#
-# $NetBSD: Makefile,v 1.58 2020/05/17 12:36:26 rillig Exp $
+# $NetBSD: Makefile,v 1.59 2020/06/28 09:42:40 rillig Exp $
#
# Unit tests for make(1)
# The main targets are:
@@ -27,6 +27,7 @@ UNIT_TESTS:= ${.PARSEDIR}
TESTNAMES= \
comment \
cond-late \
+ cond-short \
cond1 \
cond2 \
dollar \
diff --git a/unit-tests/cond-short.exp b/unit-tests/cond-short.exp
new file mode 100644
index 000000000000..d8e3861d0c61
--- /dev/null
+++ b/unit-tests/cond-short.exp
@@ -0,0 +1,7 @@
+expected and
+expected and exists
+expected and empty
+expected or
+expected or exists
+expected or empty
+exit status 0
diff --git a/unit-tests/cond-short.mk b/unit-tests/cond-short.mk
new file mode 100644
index 000000000000..45bd45bfe3ba
--- /dev/null
+++ b/unit-tests/cond-short.mk
@@ -0,0 +1,62 @@
+# $NetBSD: cond-short.mk,v 1.2 2020/06/28 11:06:26 rillig Exp $
+#
+# Demonstrates that in conditions, the right-hand side of an && or ||
+# is only evaluated if it can actually influence the result.
+#
+# Between 2015-10-11 and 2020-06-28, the right-hand side of an && or ||
+# operator was always evaluated, which was wrong.
+#
+
+# The && operator.
+
+.if 0 && ${echo "unexpected and" 1>&2 :L:sh}
+.endif
+
+.if 1 && ${echo "expected and" 1>&2 :L:sh}
+.endif
+
+.if 0 && exists(nonexistent${echo "unexpected and exists" 1>&2 :L:sh})
+.endif
+
+.if 1 && exists(nonexistent${echo "expected and exists" 1>&2 :L:sh})
+.endif
+
+.if 0 && empty(${echo "unexpected and empty" 1>&2 :L:sh})
+.endif
+
+.if 1 && empty(${echo "expected and empty" 1>&2 :L:sh})
+.endif
+
+# The || operator.
+
+.if 1 || ${echo "unexpected or" 1>&2 :L:sh}
+.endif
+
+.if 0 || ${echo "expected or" 1>&2 :L:sh}
+.endif
+
+.if 1 || exists(nonexistent${echo "unexpected or exists" 1>&2 :L:sh})
+.endif
+
+.if 0 || exists(nonexistent${echo "expected or exists" 1>&2 :L:sh})
+.endif
+
+.if 1 || empty(${echo "unexpected or empty" 1>&2 :L:sh})
+.endif
+
+.if 0 || empty(${echo "expected or empty" 1>&2 :L:sh})
+.endif
+
+# Unreachable nested conditions are skipped completely as well.
+
+.if 0
+. if ${echo "unexpected nested and" 1>&2 :L:sh}
+. endif
+.endif
+
+.if 1
+.elif ${echo "unexpected nested or" 1>&2 :L:sh}
+.endif
+
+all:
+ @:;:
diff --git a/unit-tests/modmatch.mk b/unit-tests/modmatch.mk
index 45199287acdb..c631bbd3440f 100644
--- a/unit-tests/modmatch.mk
+++ b/unit-tests/modmatch.mk
@@ -15,7 +15,7 @@ res = no
res = OK
.endif
-all: show-libs check-cclass
+all: show-libs check-cclass slow
show-libs:
@for x in $X; do ${.MAKE} -f ${MAKEFILE} show LIB=$$x; done
@@ -32,3 +32,8 @@ check-cclass:
@echo Upper=${LIST:M[A-Z]*}
@echo Lower=${LIST:M[^A-Z]*}
@echo nose=${LIST:M[^s]*[ex]}
+
+# Before 2020-06-13, this expression took quite a long time in Str_Match,
+# calling itself 601080390 times for 16 asterisks.
+slow: .PHONY
+ @:;: ${:U****************:M****************b:Q}
diff --git a/unit-tests/modorder.exp b/unit-tests/modorder.exp
index 411742738d63..8e0aad2e2027 100644
--- a/unit-tests/modorder.exp
+++ b/unit-tests/modorder.exp
@@ -1,5 +1,6 @@
LIST = one two three four five six seven eight nine ten
LIST:O = eight five four nine one seven six ten three two
+LIST:Or = two three ten six seven one nine four five eight
LIST:Ox = Ok
LIST:O:Ox = Ok
LISTX = Ok
diff --git a/unit-tests/modorder.mk b/unit-tests/modorder.mk
index 0f809391712f..89e64b43c57c 100644
--- a/unit-tests/modorder.mk
+++ b/unit-tests/modorder.mk
@@ -1,4 +1,4 @@
-# $NetBSD: modorder.mk,v 1.2 2020/01/07 22:42:14 rillig Exp $
+# $NetBSD: modorder.mk,v 1.3 2020/06/09 01:48:17 sjg Exp $
LIST= one two three four five six seven eight nine ten
LISTX= ${LIST:Ox}
@@ -10,6 +10,7 @@ TEST_RESULT= && echo Ok || echo Failed
all:
@echo "LIST = ${LIST}"
@echo "LIST:O = ${LIST:O}"
+ @echo "LIST:Or = ${LIST:Or}"
# Note that 1 in every 10! trials two independently generated
# randomized orderings will be the same. The test framework doesn't
# support checking probabilistic output, so we accept that each of the