git: 4fde40d9b540 - main - Merge/update to bmake-20230126
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 28 Jan 2023 00:33:56 UTC
The branch main has been updated by sjg:
URL: https://cgit.FreeBSD.org/src/commit/?id=4fde40d9b540ea1a544cb4378a14f2f6da85ca6d
commit 4fde40d9b540ea1a544cb4378a14f2f6da85ca6d
Merge: 52f9a2823c64 2e36ab236364
Author: Simon J. Gerraty <sjg@FreeBSD.org>
AuthorDate: 2023-01-28 00:33:01 +0000
Commit: Simon J. Gerraty <sjg@FreeBSD.org>
CommitDate: 2023-01-28 00:33:01 +0000
Merge/update to bmake-20230126
contrib/bmake/ChangeLog | 129 +
contrib/bmake/FILES | 8 +-
contrib/bmake/Makefile | 4 +-
contrib/bmake/Makefile.config.in | 1 +
contrib/bmake/VERSION | 2 +-
contrib/bmake/arch.c | 18 +-
contrib/bmake/bmake.1 | 1692 ++++---
contrib/bmake/bmake.cat1 | 1787 +++----
contrib/bmake/compat.c | 15 +-
contrib/bmake/cond.c | 51 +-
contrib/bmake/config.h.in | 113 +-
contrib/bmake/configure | 5323 +++++++++++---------
contrib/bmake/configure.in | 37 +-
contrib/bmake/dir.c | 19 +-
contrib/bmake/dir.h | 3 +-
contrib/bmake/find_lib.sh | 7 +
contrib/bmake/for.c | 11 +-
contrib/bmake/job.c | 39 +-
contrib/bmake/machine.sh | 81 +-
contrib/bmake/main.c | 43 +-
contrib/bmake/make.1 | 1692 ++++---
contrib/bmake/make.c | 30 +-
contrib/bmake/make.h | 17 +-
contrib/bmake/meta.c | 34 +-
contrib/bmake/mk/ChangeLog | 32 +
contrib/bmake/mk/compiler.mk | 4 +-
contrib/bmake/mk/dirdeps-options.mk | 9 +-
contrib/bmake/mk/dirdeps.mk | 4 +-
contrib/bmake/mk/gendirdeps.mk | 4 +-
contrib/bmake/mk/install-mk | 14 +-
contrib/bmake/mk/meta.autodep.mk | 4 +-
contrib/bmake/mk/meta.stage.mk | 4 +-
contrib/bmake/mk/meta2deps.py | 17 +-
contrib/bmake/mk/meta2deps.sh | 26 +-
contrib/bmake/mk/sys.clean-env.mk | 6 +-
contrib/bmake/mk/sys.mk | 5 +-
contrib/bmake/mk/sys.vars.mk | 52 +-
contrib/bmake/mk/sys/Linux.mk | 6 +-
contrib/bmake/mkdeps.sh | 9 +-
contrib/bmake/os.sh | 20 +-
contrib/bmake/parse.c | 130 +-
contrib/bmake/sigcompat.c | 4 +-
contrib/bmake/str.c | 8 +-
contrib/bmake/str.h | 14 +-
contrib/bmake/strlcpy.c | 5 +-
contrib/bmake/targ.c | 28 +-
contrib/bmake/unit-tests/Makefile | 41 +-
contrib/bmake/unit-tests/Makefile.config.in | 3 +-
contrib/bmake/unit-tests/cmd-errors-jobs.exp | 10 +-
contrib/bmake/unit-tests/cmd-errors-jobs.mk | 12 +-
contrib/bmake/unit-tests/cmd-errors.exp | 10 +-
contrib/bmake/unit-tests/cmd-errors.mk | 12 +-
contrib/bmake/unit-tests/cond-cmp-numeric.exp | 6 +-
contrib/bmake/unit-tests/cond-cmp-numeric.mk | 4 +-
contrib/bmake/unit-tests/cond-cmp-string.exp | 8 +-
contrib/bmake/unit-tests/cond-cmp-unary.mk | 22 +-
contrib/bmake/unit-tests/cond-op-parentheses.exp | 8 +-
contrib/bmake/unit-tests/cond-op-parentheses.mk | 7 +-
contrib/bmake/unit-tests/cond-token-plain.exp | 8 +-
contrib/bmake/unit-tests/cond-token-plain.mk | 6 +-
contrib/bmake/unit-tests/deptgt.exp | 4 +-
contrib/bmake/unit-tests/deptgt.mk | 4 +-
contrib/bmake/unit-tests/dir.mk | 6 +-
contrib/bmake/unit-tests/directive-for-break.exp | 4 +
contrib/bmake/unit-tests/directive-for-break.mk | 60 +
contrib/bmake/unit-tests/directive-for.mk | 18 +-
contrib/bmake/unit-tests/export.mk | 4 +-
contrib/bmake/unit-tests/hanoi-include.mk | 18 +-
contrib/bmake/unit-tests/include-main.exp | 16 +-
contrib/bmake/unit-tests/include-main.mk | 4 +-
.../unit-tests/{include-sub.mk => include-sub.inc} | 4 +-
contrib/bmake/unit-tests/include-subsub.inc | 9 +
contrib/bmake/unit-tests/include-subsub.mk | 9 -
contrib/bmake/unit-tests/job-output-null.exp | 6 +-
contrib/bmake/unit-tests/job-output-null.mk | 36 +-
contrib/bmake/unit-tests/make-exported.mk | 4 +-
contrib/bmake/unit-tests/opt-env.exp | 6 +-
contrib/bmake/unit-tests/opt-query.exp | 24 +-
contrib/bmake/unit-tests/opt-query.mk | 69 +-
contrib/bmake/unit-tests/parse-var.exp | 6 +-
contrib/bmake/unit-tests/parse-var.mk | 132 +-
contrib/bmake/unit-tests/sh-leading-at.exp | 1 +
contrib/bmake/unit-tests/sh-leading-at.mk | 6 +-
contrib/bmake/unit-tests/sh-leading-hyphen.exp | 10 +
contrib/bmake/unit-tests/sh-leading-hyphen.mk | 19 +-
contrib/bmake/unit-tests/sh-leading-plus.exp | 2 +
contrib/bmake/unit-tests/sh-leading-plus.mk | 6 +-
contrib/bmake/unit-tests/var-op-expand.exp | 8 +-
contrib/bmake/unit-tests/var-op-expand.mk | 13 +-
contrib/bmake/unit-tests/var-readonly.exp | 1 +
contrib/bmake/unit-tests/var-readonly.mk | 20 +
.../bmake/unit-tests/var-scope-local-legacy.exp | 5 +
contrib/bmake/unit-tests/var-scope-local-legacy.mk | 19 +-
contrib/bmake/unit-tests/varmod-defined.mk | 14 +-
contrib/bmake/unit-tests/varmod-ifelse.exp | 6 +-
contrib/bmake/unit-tests/varmod-ifelse.mk | 4 +-
contrib/bmake/unit-tests/varmod-loop.exp | 6 +
contrib/bmake/unit-tests/varmod-loop.mk | 47 +-
contrib/bmake/unit-tests/varmod-match.mk | 12 +-
contrib/bmake/unit-tests/varmod-order-numeric.mk | 8 +-
contrib/bmake/unit-tests/varmod-to-lower.mk | 15 +-
contrib/bmake/unit-tests/varmod-undefined.mk | 4 +-
contrib/bmake/unit-tests/varmod.exp | 10 +-
contrib/bmake/unit-tests/varmod.mk | 56 +-
contrib/bmake/unit-tests/varname-dot-newline.exp | 3 +-
contrib/bmake/unit-tests/varname-dot-newline.mk | 32 +-
contrib/bmake/unit-tests/varparse-errors.exp | 14 +
contrib/bmake/unit-tests/varparse-errors.mk | 21 +-
contrib/bmake/var.c | 132 +-
usr.bin/bmake/Makefile | 2 +-
usr.bin/bmake/Makefile.config | 3 +-
usr.bin/bmake/config.h | 117 +-
usr.bin/bmake/unit-tests/Makefile | 41 +-
usr.bin/bmake/unit-tests/Makefile.config | 3 +-
114 files changed, 7387 insertions(+), 5434 deletions(-)
diff --cc contrib/bmake/Makefile
index 201e4869dc3f,000000000000..ad78883ff890
mode 100644,000000..100644
--- a/contrib/bmake/Makefile
+++ b/contrib/bmake/Makefile
@@@ -1,238 -1,0 +1,238 @@@
- # $Id: Makefile,v 1.120 2022/07/26 23:02:54 sjg Exp $
++# $Id: Makefile,v 1.122 2022/10/08 02:53:30 sjg Exp $
+
+PROG= bmake
+
+SRCS= \
+ arch.c \
+ buf.c \
+ compat.c \
+ cond.c \
+ dir.c \
+ for.c \
+ hash.c \
+ job.c \
+ lst.c \
+ main.c \
+ make.c \
+ make_malloc.c \
+ meta.c \
+ metachar.c \
+ parse.c \
+ str.c \
+ suff.c \
+ targ.c \
+ trace.c \
+ util.c \
+ var.c
+
+.-include "VERSION"
+.-include "Makefile.inc"
+
+# this file gets generated by configure
+.-include "Makefile.config"
+
+.if !empty(LIBOBJS)
+SRCS+= ${LIBOBJS:T:.o=.c}
+.endif
+
+# just in case
+prefix?= /usr
+srcdir?= ${.CURDIR}
+
+DEFAULT_SYS_PATH?= ${prefix}/share/mk
+
+CPPFLAGS+= -DUSE_META
+CFLAGS+= ${CPPFLAGS}
+CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\"
+CFLAGS+= -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE
+CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}}
+COPTS.main.c+= "-DMAKE_VERSION=\"${_MAKE_VERSION}\""
+
+.for x in FORCE_MACHINE FORCE_MACHINE_ARCH
+.ifdef $x
+COPTS.main.c+= "-D$x=\"${$x}\""
+.endif
+.endfor
+
+# meta mode can be useful even without filemon
+# should be set by now
+USE_FILEMON ?= no
+.if ${USE_FILEMON:tl} != "no"
+.PATH: ${srcdir}/filemon
+SRCS+= filemon_${USE_FILEMON}.c
+COPTS.meta.c+= -DUSE_FILEMON -DUSE_FILEMON_${USE_FILEMON:tu}
+COPTS.job.c+= ${COPTS.meta.c}
+
+.if ${USE_FILEMON} == "dev"
+FILEMON_H ?= /usr/include/dev/filemon/filemon.h
+.if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h"
+COPTS.filemon_dev.c += -DHAVE_FILEMON_H -I${FILEMON_H:H}
+.endif
+.endif # USE_FILEMON == dev
+
+.endif # USE_FILEMON
+
+.PATH: ${srcdir}
+
+.if make(obj) || make(clean)
+SUBDIR+= unit-tests
+.endif
+
+# start-delete1 for bsd.after-import.mk
+# we skip a lot of this when building as part of FreeBSD etc.
+
+# list of OS's which are derrived from BSD4.4
+BSD44_LIST= NetBSD FreeBSD OpenBSD DragonFly MirBSD Bitrig
+# we are...
+OS := ${.MAKE.OS:U${uname -s:L:sh}}
+# are we 4.4BSD ?
+isBSD44:=${BSD44_LIST:M${OS}}
+
- .if ${isBSD44} == ""
++.if ${isBSD44} == "" && ${OS:NDarwin:NLinux} != ""
+MANTARGET= cat
+INSTALL?=${srcdir}/install-sh
+.if ${MACHINE} == "sun386"
+# even I don't have one of these anymore :-)
+CFLAGS+= -DPORTAR
+.elif ${OS} != "SunOS"
+# assume the worst
+SRCS+= sigcompat.c
+CFLAGS+= -DSIGNAL_FLAGS=SA_RESTART
+.endif
+.else
+MANTARGET?= man
+.endif
+
+# turn this on by default - ignored if we are root
+WITH_INSTALL_AS_USER=
+
+# suppress with -DWITHOUT_*
+OPTIONS_DEFAULT_YES+= \
+ AUTOCONF_MK \
+ INSTALL_MK \
+ PROG_LINK
+
+OPTIONS_DEFAULT_NO+= \
+ PROG_VERSION
+
+# process options now
+.include <own.mk>
+
+.if ${MK_PROG_VERSION} == "yes"
+PROG_NAME= ${PROG}-${_MAKE_VERSION}
+.if ${MK_PROG_LINK} == "yes"
+SYMLINKS+= ${PROG_NAME} ${BINDIR}/${PROG}
+.endif
+.endif
+
+EXTRACT_MAN=no
+# end-delete1
+
+MAN= ${PROG}.1
+MAN1= ${MAN}
+
+.if ${PROG} != "make"
+CLEANFILES+= my.history
+.if make(${MAN}) || !exists(${srcdir}/${MAN})
+my.history:
+ @(echo ".Nm"; \
+ echo "is derived from NetBSD"; \
+ echo ".Xr make 1 ."; \
+ echo "It uses autoconf to facilitate portability to other platforms."; \
+ echo ".Pp") > $@
+
+.NOPATH: ${MAN}
+${MAN}: make.1 my.history
+ @echo making $@
+ @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 > $@
+
+all beforeinstall: ${MAN}
+_mfromdir=.
+.endif
+.endif
+
+MANTARGET?= cat
+MANDEST?= ${MANDIR}/${MANTARGET}1
+
+.if ${MANTARGET} == "cat"
+_mfromdir=${srcdir}
+.endif
+
+.include <prog.mk>
+
+CPPFLAGS+= -DMAKE_NATIVE -DHAVE_CONFIG_H
+COPTS.var.c += -Wno-cast-qual
+COPTS.job.c += -Wno-format-nonliteral
+COPTS.parse.c += -Wno-format-nonliteral
+COPTS.var.c += -Wno-format-nonliteral
+
+# Force these
+SHAREDIR= ${SHAREDIR.bmake:U${prefix}/share}
+BINDIR= ${BINDIR.bmake:U${prefix}/bin}
+MANDIR= ${MANDIR.bmake:U${SHAREDIR}/man}
+
+.if !exists(.depend)
+${OBJS}: config.h
+.endif
+
+# start-delete2 for bsd.after-import.mk
+
+# make sure that MAKE_VERSION gets updated.
+main.o: ${srcdir}/VERSION
+
+.if ${MK_AUTOCONF_MK} == "yes"
+CONFIGURE_DEPS += ${.CURDIR}/VERSION
+# we do not need or want the generated makefile
+CONFIGURE_ARGS += --without-makefile
+AUTOCONF_GENERATED_MAKEFILE = Makefile.config
+.include <autoconf.mk>
+.endif
+SHARE_MK ?= ${SHAREDIR}/mk
+MKSRC = ${srcdir}/mk
+INSTALL ?= ${srcdir}/install-sh
+
+.if ${MK_INSTALL_MK} == "yes"
+install: install-mk
+.endif
+
+beforeinstall:
+ test -d ${DESTDIR}${BINDIR} || ${INSTALL} -m 775 -d ${DESTDIR}${BINDIR}
+ test -d ${DESTDIR}${MANDEST} || ${INSTALL} -m 775 -d ${DESTDIR}${MANDEST}
+
+install-mk:
+.if exists(${MKSRC}/install-mk)
+ test -d ${DESTDIR}${SHARE_MK} || ${INSTALL} -m 775 -d ${DESTDIR}${SHARE_MK}
+ sh ${MKSRC}/install-mk -v -m 644 ${DESTDIR}${SHARE_MK}
+.else
+ @echo need to unpack mk.tar.gz under ${srcdir} or set MKSRC; false
+.endif
+# end-delete2
+
+# A simple unit-test driver to help catch regressions
+TEST_MAKE ?= ${.OBJDIR}/${PROG:T}
+accept test: .NOMETA
+ cd ${.CURDIR}/unit-tests && \
+ MAKEFLAGS= ${TEST_MAKE} -r -m / ${.TARGET} ${TESTS:DTESTS=${TESTS:Q}}
+
+
+.if make(test) && ${MK_AUTO_OBJ} == "yes"
+# The test target above visits unit-tests with -r -m /
+# which prevents MK_AUTO_OBJ doing its job
+# so do it here
+.if defined(MAKEOBJDIRPREFIX) || ${MAKEOBJDIR:U:M*/*} != ""
+_utobj = ${.OBJDIR}/unit-tests
+.else
+_utobj = ${.CURDIR}/unit-tests/${MAKEOBJDIR:Uobj}
+.endif
+utobj: .NOMETA
+ @test -d ${_utobj} && exit 0; \
+ echo "[Creating ${_utobj}...]"; \
+ umask ${OBJDIR_UMASK:U002}; \
+ mkdir -p ${_utobj}
+test: utobj
+.endif
diff --cc contrib/bmake/make.1
index 9accbaae9f61,73b86e91e002..5a28d2f83ca3
--- a/contrib/bmake/make.1
+++ b/contrib/bmake/make.1
@@@ -837,27 -891,16 +891,27 @@@ The name tha
.Nm
was executed with
.Pq Va argv[0] .
- For compatibility
- .Nm
- also sets
- .Va .MAKE
- with the same value.
+ .It Va .MAKE
+ The same as
+ .Va MAKE ,
+ for compatibility.
The preferred variable to use is the environment variable
.Ev MAKE
- because it is more compatible with other versions of
- .Nm
+ because it is more compatible with other make variants
and cannot be confused with the special target with the same name.
+.It Va .MAKE.ALWAYS_PASS_JOB_QUEUE
+Tells
+.Nm
+whether to pass the descriptors of the job token queue
+even if the target is not tagged with
+.Ic .MAKE
+The default is
+.Ql Pa yes
+for backwards compatability with
+.Fx 9.0
+and earlier.
+ .\" '.MAKE.cmd_filtered' is intentionally undocumented,
+ .\" as it is an internal implementation detail.
.It Va .MAKE.DEPENDFILE
Names the makefile (default
.Sq Pa .depend )
diff --cc contrib/bmake/os.sh
index 1fc66ecc6a63,6bf52420c90f..6bf52420c90f
mode 100755,100644..100644
--- a/contrib/bmake/os.sh
+++ b/contrib/bmake/os.sh
diff --cc contrib/bmake/unit-tests/directive-for-break.exp
index 000000000000,b036ebfeb661..b036ebfeb661
mode 000000,100644..100644
--- a/contrib/bmake/unit-tests/directive-for-break.exp
+++ b/contrib/bmake/unit-tests/directive-for-break.exp
diff --cc contrib/bmake/unit-tests/directive-for-break.mk
index 000000000000,a86acfa8bde0..a86acfa8bde0
mode 000000,100644..100644
--- a/contrib/bmake/unit-tests/directive-for-break.mk
+++ b/contrib/bmake/unit-tests/directive-for-break.mk
diff --cc contrib/bmake/unit-tests/include-subsub.inc
index 000000000000,79a6a3770090..79a6a3770090
mode 000000,100644..100644
--- a/contrib/bmake/unit-tests/include-subsub.inc
+++ b/contrib/bmake/unit-tests/include-subsub.inc
diff --cc contrib/bmake/unit-tests/var-readonly.exp
index 000000000000,39a9383953dd..39a9383953dd
mode 000000,100644..100644
--- a/contrib/bmake/unit-tests/var-readonly.exp
+++ b/contrib/bmake/unit-tests/var-readonly.exp
diff --cc contrib/bmake/unit-tests/var-readonly.mk
index 000000000000,43799e4adb5c..43799e4adb5c
mode 000000,100644..100644
--- a/contrib/bmake/unit-tests/var-readonly.mk
+++ b/contrib/bmake/unit-tests/var-readonly.mk
diff --cc usr.bin/bmake/Makefile
index c8d2dbd63b2b,000000000000..722de897acbb
mode 100644,000000..100644
--- a/usr.bin/bmake/Makefile
+++ b/usr.bin/bmake/Makefile
@@@ -1,181 -1,0 +1,181 @@@
+# This is a generated file, do NOT edit!
+# See contrib/bmake/bsd.after-import.mk
+#
+# $FreeBSD$
+
+SRCTOP?= ${.CURDIR:H:H}
+
+# look here first for config.h
+CFLAGS+= -I${.CURDIR}
+
+# for after-import
+CLEANDIRS+= FreeBSD
+CLEANFILES+= bootstrap
+
- # $Id: Makefile,v 1.120 2022/07/26 23:02:54 sjg Exp $
++# $Id: Makefile,v 1.122 2022/10/08 02:53:30 sjg Exp $
+
+PROG?= ${.CURDIR:T}
+
+SRCS= \
+ arch.c \
+ buf.c \
+ compat.c \
+ cond.c \
+ dir.c \
+ for.c \
+ hash.c \
+ job.c \
+ lst.c \
+ main.c \
+ make.c \
+ make_malloc.c \
+ meta.c \
+ metachar.c \
+ parse.c \
+ str.c \
+ suff.c \
+ targ.c \
+ trace.c \
+ util.c \
+ var.c
+
+.sinclude "Makefile.inc"
+
+# this file gets generated by configure
+.sinclude "Makefile.config"
+
+.if !empty(LIBOBJS)
+SRCS+= ${LIBOBJS:T:.o=.c}
+.endif
+
+# just in case
+prefix?= /usr
+srcdir?= ${.CURDIR}
+
+DEFAULT_SYS_PATH?= ${prefix}/share/mk
+
+CPPFLAGS+= -DUSE_META
+CFLAGS+= ${CPPFLAGS}
+CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\"
+CFLAGS+= -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE
+CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}}
+COPTS.main.c+= "-DMAKE_VERSION=\"${_MAKE_VERSION}\""
+
+.for x in FORCE_MACHINE FORCE_MACHINE_ARCH
+.ifdef $x
+COPTS.main.c+= "-D$x=\"${$x}\""
+.endif
+.endfor
+
+# meta mode can be useful even without filemon
+# should be set by now
+USE_FILEMON ?= no
+.if ${USE_FILEMON:tl} != "no"
+.PATH: ${srcdir}/filemon
+SRCS+= filemon_${USE_FILEMON}.c
+COPTS.meta.c+= -DUSE_FILEMON -DUSE_FILEMON_${USE_FILEMON:tu}
+COPTS.job.c+= ${COPTS.meta.c}
+
+.if ${USE_FILEMON} == "dev"
+FILEMON_H ?= /usr/include/dev/filemon/filemon.h
+.if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h"
+COPTS.filemon_dev.c += -DHAVE_FILEMON_H -I${FILEMON_H:H}
+.endif
+.endif # USE_FILEMON == dev
+
+.endif # USE_FILEMON
+
+.PATH: ${srcdir}
+
+.if make(obj) || make(clean)
+SUBDIR+= unit-tests
+.endif
+
+
+MAN= ${PROG}.1
+MAN1= ${MAN}
+
+.if ${PROG} != "make"
+CLEANFILES+= my.history
+.if make(${MAN}) || !exists(${srcdir}/${MAN})
+my.history:
+ @(echo ".Nm"; \
+ echo "is derived from NetBSD"; \
+ echo ".Xr make 1 ."; \
+ echo "It uses autoconf to facilitate portability to other platforms."; \
+ echo ".Pp") > $@
+
+.NOPATH: ${MAN}
+${MAN}: make.1 my.history
+ @echo making $@
+ @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 > $@
+
+all beforeinstall: ${MAN}
+_mfromdir=.
+.endif
+.endif
+
+MANTARGET?= cat
+MANDEST?= ${MANDIR}/${MANTARGET}1
+
+.if ${MANTARGET} == "cat"
+_mfromdir=${srcdir}
+.endif
+
+.include <bsd.prog.mk>
+
+CPPFLAGS+= -DMAKE_NATIVE -DHAVE_CONFIG_H
+COPTS.var.c += -Wno-cast-qual
+COPTS.job.c += -Wno-format-nonliteral
+COPTS.parse.c += -Wno-format-nonliteral
+COPTS.var.c += -Wno-format-nonliteral
+
+# Force these
+SHAREDIR= ${SHAREDIR.bmake:U${prefix}/share}
+BINDIR= ${BINDIR.bmake:U${prefix}/bin}
+MANDIR= ${MANDIR.bmake:U${SHAREDIR}/man}
+
+.if !exists(.depend)
+${OBJS}: config.h
+.endif
+
+
+# A simple unit-test driver to help catch regressions
+TEST_MAKE ?= ${.OBJDIR}/${PROG:T}
+accept test: .NOMETA
+ cd ${.CURDIR}/unit-tests && \
+ MAKEFLAGS= ${TEST_MAKE} -r -m / ${.TARGET} ${TESTS:DTESTS=${TESTS:Q}}
+
+
+.if make(test) && ${MK_AUTO_OBJ} == "yes"
+# The test target above visits unit-tests with -r -m /
+# which prevents MK_AUTO_OBJ doing its job
+# so do it here
+.if defined(MAKEOBJDIRPREFIX) || ${MAKEOBJDIR:U:M*/*} != ""
+_utobj = ${.OBJDIR}/unit-tests
+.else
+_utobj = ${.CURDIR}/unit-tests/${MAKEOBJDIR:Uobj}
+.endif
+utobj: .NOMETA
+ @test -d ${_utobj} && exit 0; \
+ echo "[Creating ${_utobj}...]"; \
+ umask ${OBJDIR_UMASK:U002}; \
+ mkdir -p ${_utobj}
+test: utobj
+.endif
+
+# override some simple things
+BINDIR= /usr/bin
+MANDIR= /usr/share/man/man
+
+# make sure we get this
+CFLAGS+= ${COPTS.${.IMPSRC:T}}
+
+after-import: ${SRCTOP}/contrib/bmake/bsd.after-import.mk
+ cd ${.CURDIR} && ${.MAKE} -f ${SRCTOP}/contrib/bmake/bsd.after-import.mk
+
diff --cc usr.bin/bmake/Makefile.config
index f92abbc61dbf,000000000000..fab0991419ff
mode 100644,000000..100644
--- a/usr.bin/bmake/Makefile.config
+++ b/usr.bin/bmake/Makefile.config
@@@ -1,27 -1,0 +1,28 @@@
+# This is a generated file, do NOT edit!
+# See contrib/bmake/bsd.after-import.mk
+#
+# $FreeBSD$
+
+SRCTOP?= ${.CURDIR:H:H}
+
+# things set by configure
+
- _MAKE_VERSION?=20220726
++_MAKE_VERSION?=20230126
+
+prefix?= /usr
+srcdir= ${SRCTOP}/contrib/bmake
+CC?= cc
+DEFAULT_SYS_PATH?= .../share/mk:/usr/share/mk
+
++EGREP = egrep
+CPPFLAGS+=
+CFLAGS+= ${CPPFLAGS} -DHAVE_CONFIG_H
+LDFLAGS+=
+LIBOBJS+= ${LIBOBJDIR}stresep$U.o
+LDADD+=
+USE_META?= yes
+USE_FILEMON?= dev
+FILEMON_H?= /usr/include/dev/filemon/filemon.h
+BMAKE_PATH_MAX?= 1024
+# used if MAXPATHLEN not defined
+CPPFLAGS+= -DBMAKE_PATH_MAX=${BMAKE_PATH_MAX}
diff --cc usr.bin/bmake/config.h
index 6c053cf96cfd,000000000000..baaa1f38ea54
mode 100644,000000..100644
--- a/usr.bin/bmake/config.h
+++ b/usr.bin/bmake/config.h
@@@ -1,395 -1,0 +1,446 @@@
+/* $FreeBSD$ */
+/* config.h. Generated from config.h.in by configure. */
+/* config.h.in. Generated from configure.in by autoheader. */
+
+/* Define if building universal (internal helper macro) */
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
+
+/* Path of default shell */
+/* #undef DEFSHELL_CUSTOM */
+
+/* Shell spec to use by default */
+/* #undef DEFSHELL_INDEX */
+
+/* Path of default shell */
+/* #undef DEFSHELL_PATH */
+
+/* Define to 1 if you have the <ar.h> header file. */
+#define HAVE_AR_H 1
+
+/* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you
+ don't. */
+#define HAVE_DECL_SYS_SIGLIST 1
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+#define HAVE_DIRENT_H 1
+
+/* Define to 1 if you have the `dirname' function. */
+#define HAVE_DIRNAME 1
+
+/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
+/* #undef HAVE_DOPRNT */
+
+/* Define to 1 if you have the `err' function. */
+#define HAVE_ERR 1
+
+/* Define to 1 if you have the `errx' function. */
+#define HAVE_ERRX 1
+
+/* Define to 1 if you have the <err.h> header file. */
+#define HAVE_ERR_H 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the `fork' function. */
+#define HAVE_FORK 1
+
+/* Define to 1 if you have the `getcwd' function. */
+#define HAVE_GETCWD 1
+
+/* Define to 1 if you have the `getenv' function. */
+#define HAVE_GETENV 1
+
+/* Define to 1 if you have the `getopt' function. */
+#define HAVE_GETOPT 1
+
+/* Define to 1 if you have the `getwd' function. */
+#define HAVE_GETWD 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `killpg' function. */
+#define HAVE_KILLPG 1
+
+/* Define to 1 if you have the <libgen.h> header file. */
+#define HAVE_LIBGEN_H 1
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if the system has the type `long long int'. */
+#define HAVE_LONG_LONG_INT 1
+
- /* Define to 1 if you have the <memory.h> header file. */
- #define HAVE_MEMORY_H 1
++/* Define to 1 if you have the <minix/config.h> header file. */
++/* #undef HAVE_MINIX_CONFIG_H */
+
+/* Define to 1 if you have the `mmap' function. */
+#define HAVE_MMAP 1
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+/* #undef HAVE_NDIR_H */
+
+/* Define to 1 if you have the <paths.h> header file. */
+#define HAVE_PATHS_H 1
+
+/* Define to 1 if you have the <poll.h> header file. */
+#define HAVE_POLL_H 1
+
+/* Define to 1 if you have the `putenv' function. */
+#define HAVE_PUTENV 1
+
+/* Define to 1 if you have the <ranlib.h> header file. */
+#define HAVE_RANLIB_H 1
+
+/* Define to 1 if you have the `realpath' function. */
+#define HAVE_REALPATH 1
+
+/* Define to 1 if you have the `select' function. */
+#define HAVE_SELECT 1
+
+/* Define to 1 if you have the `setenv' function. */
+#define HAVE_SETENV 1
+
+/* Define to 1 if you have the `setpgid' function. */
+#define HAVE_SETPGID 1
+
+/* Define to 1 if you have the `setrlimit' function. */
+#define HAVE_SETRLIMIT 1
+
+/* Define to 1 if you have the `setsid' function. */
+#define HAVE_SETSID 1
+
+/* Define to 1 if you have the `sigaction' function. */
+#define HAVE_SIGACTION 1
+
+/* Define to 1 if you have the `sigaddset' function. */
+#define HAVE_SIGADDSET 1
+
+/* Define to 1 if you have the `sigpending' function. */
+#define HAVE_SIGPENDING 1
+
+/* Define to 1 if you have the `sigprocmask' function. */
+#define HAVE_SIGPROCMASK 1
+
+/* Define to 1 if you have the `sigsetmask' function. */
+#define HAVE_SIGSETMASK 1
+
+/* Define to 1 if you have the `sigsuspend' function. */
+#define HAVE_SIGSUSPEND 1
+
+/* Define to 1 if you have the `sigvec' function. */
+#define HAVE_SIGVEC 1
+
+/* Define to 1 if the system has the type `sig_atomic_t'. */
+#define HAVE_SIG_ATOMIC_T 1
+
+/* Define to 1 if you have the `snprintf' function. */
+#define HAVE_SNPRINTF 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
++/* Define to 1 if you have the <stdio.h> header file. */
++#define HAVE_STDIO_H 1
++
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strerror' function. */
+#define HAVE_STRERROR 1
+
+/* Define to 1 if you have the `stresep' function. */
+/* #undef HAVE_STRESEP */
+
+/* Define to 1 if you have the `strftime' function. */
+#define HAVE_STRFTIME 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcpy' function. */
+#define HAVE_STRLCPY 1
+
+/* Define to 1 if you have the `strsep' function. */
+#define HAVE_STRSEP 1
+
+/* Define to 1 if you have the `strtod' function. */
+#define HAVE_STRTOD 1
+
+/* Define to 1 if you have the `strtol' function. */
+#define HAVE_STRTOL 1
+
+/* Define to 1 if you have the `strtoll' function. */
+#define HAVE_STRTOLL 1
+
+/* Define to 1 if you have the `strtoul' function. */
+#define HAVE_STRTOUL 1
+
- /* Define to 1 if `st_rdev' is a member of `struct stat'. */
- #define HAVE_STRUCT_STAT_ST_RDEV 1
-
- /* Define to 1 if your `struct stat' has `st_rdev'. Deprecated, use
- `HAVE_STRUCT_STAT_ST_RDEV' instead. */
- #define HAVE_ST_RDEV 1
-
+/* Define to 1 if you have the `sysctl' function. */
+#define HAVE_SYSCTL 1
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_SYS_DIR_H */
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#define HAVE_SYS_MMAN_H 1
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_SYS_NDIR_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#define HAVE_SYS_SELECT_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/sysctl.h> header file. */
+#define HAVE_SYS_SYSCTL_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#define HAVE_SYS_UIO_H 1
+
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+#define HAVE_SYS_WAIT_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `unsetenv' function. */
+#define HAVE_UNSETENV 1
+
+/* Define to 1 if the system has the type `unsigned long long int'. */
+#define HAVE_UNSIGNED_LONG_LONG_INT 1
+
+/* Define to 1 if you have the <utime.h> header file. */
+#define HAVE_UTIME_H 1
+
+/* Define to 1 if you have the `vfork' function. */
+#define HAVE_VFORK 1
+
+/* Define to 1 if you have the <vfork.h> header file. */
+/* #undef HAVE_VFORK_H */
+
+/* Define to 1 if you have the `vprintf' function. */
+#define HAVE_VPRINTF 1
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#define HAVE_VSNPRINTF 1
+
+/* Define to 1 if you have the `wait3' function. */
+#define HAVE_WAIT3 1
+
+/* Define to 1 if you have the `wait4' function. */
+#define HAVE_WAIT4 1
+
+/* Define to 1 if you have the `waitpid' function. */
+#define HAVE_WAITPID 1
+
+/* Define to 1 if you have the `warn' function. */
+#define HAVE_WARN 1
+
+/* Define to 1 if you have the `warnx' function. */
+#define HAVE_WARNX 1
+
++/* Define to 1 if you have the <wchar.h> header file. */
++#define HAVE_WCHAR_H 1
++
+/* Define to 1 if `fork' works. */
+#define HAVE_WORKING_FORK 1
+
+/* Define to 1 if `vfork' works. */
+#define HAVE_WORKING_VFORK 1
+
+/* define if your compiler has __attribute__ */
+#define HAVE___ATTRIBUTE__ 1
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "sjg@NetBSD.org"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "bmake"
+
+/* Define to the full name and version of this package. */
- #define PACKAGE_STRING "bmake 20211020"
++#define PACKAGE_STRING "bmake 20220909"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "bmake"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
- #define PACKAGE_VERSION "20211020"
-
- /* Define as the return type of signal handlers (`int' or `void'). */
- #define RETSIGTYPE void
++#define PACKAGE_VERSION "20220909"
+
+/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
+/* #undef STAT_MACROS_BROKEN */
+
- /* Define to 1 if you have the ANSI C header files. */
++/* Define to 1 if all of the C90 standard headers exist (not just the ones
++ required in a freestanding environment). This macro is provided for
++ backward compatibility; new code need not use it. */
*** 1052 LINES SKIPPED ***