Re: git: 6a7405f5a6b6 - main - Merge bmake-20250125
Date: Fri, 31 Jan 2025 00:31:49 UTC
In message <202501302355.50UNtHPf022794@gitrepo.freebsd.org>, "Simon J.
Gerraty
" writes:
> The branch main has been updated by sjg:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=6a7405f5a6b639682cacf01e35d56141
> 1ff556aa
>
> commit 6a7405f5a6b639682cacf01e35d561411ff556aa
> Merge: 4a1b0a9e2b9f 5ad769f660f3
> Author: Simon J. Gerraty <sjg@FreeBSD.org>
> AuthorDate: 2025-01-30 23:40:08 +0000
> Commit: Simon J. Gerraty <sjg@FreeBSD.org>
> CommitDate: 2025-01-30 23:51:52 +0000
>
> Merge bmake-20250125
>
> Merge commit '5ad769f660f3d00853bc739f82d9bc62f6a682cb'
>
> contrib/bmake/ChangeLog | 139 ++++++++++++
> contrib/bmake/FILES | 2 +
> contrib/bmake/Makefile | 139 +++++++-----
> contrib/bmake/VERSION | 2 +-
> contrib/bmake/arch.c | 9 +-
> contrib/bmake/bmake.1 | 47 +++--
> contrib/bmake/bmake.cat1 | 34 +--
> contrib/bmake/bsd.after-import.mk | 5 +-
> contrib/bmake/compat.c | 13 +-
> contrib/bmake/cond.c | 29 ++-
> contrib/bmake/job.c | 84 ++------
> contrib/bmake/job.h | 4 +-
> contrib/bmake/main.c | 44 ++--
> contrib/bmake/make.1 | 35 +++-
> contrib/bmake/make.h | 21 +-
> contrib/bmake/mk/ChangeLog | 117 +++++++++++
> contrib/bmake/mk/FILES | 3 +
> contrib/bmake/mk/README | 10 +-
> contrib/bmake/mk/cython.mk | 43 ++--
> contrib/bmake/mk/dirdeps-targets.mk | 5 +-
> contrib/bmake/mk/dirdeps.mk | 20 +-
> contrib/bmake/mk/gendirdeps.mk | 4 +-
> contrib/bmake/mk/genfiles.mk | 26 +++
> contrib/bmake/mk/init.mk | 11 +-
> contrib/bmake/mk/install-mk | 4 +-
> contrib/bmake/mk/lib.mk | 14 +-
> contrib/bmake/mk/links.mk | 34 +--
> contrib/bmake/mk/meta.sys.mk | 13 +-
> contrib/bmake/mk/meta2deps.py | 16 +-
> contrib/bmake/mk/options.mk | 8 +-
> contrib/bmake/mk/own.mk | 7 +-
> contrib/bmake/mk/prog.mk | 12 +-
> contrib/bmake/mk/rust.mk | 203 ++++++++++++++++++
> contrib/bmake/mk/setopts.sh | 175 ++++++++++++++++
> contrib/bmake/mk/subdir.mk | 10 +-
> contrib/bmake/mk/sys.mk | 3 +-
> contrib/bmake/mk/sys.vars.mk | 7 +-
> contrib/bmake/os.sh | 8 +-
> contrib/bmake/parse.c | 49 +----
> contrib/bmake/suff.c | 6 +-
> contrib/bmake/unit-tests/Makefile | 23 +-
> contrib/bmake/unit-tests/archive.exp | 12 ++
> contrib/bmake/unit-tests/archive.mk | 20 +-
> contrib/bmake/unit-tests/cmd-errors-jobs.exp | 76 ++++++-
> contrib/bmake/unit-tests/cmd-errors-jobs.mk | 123 ++++++++---
> contrib/bmake/unit-tests/cmd-errors-lint.exp | 14 +-
> contrib/bmake/unit-tests/cmd-errors-lint.mk | 17 +-
> contrib/bmake/unit-tests/cmd-errors.exp | 14 +-
> contrib/bmake/unit-tests/cmd-errors.mk | 17 +-
> contrib/bmake/unit-tests/cmd-interrupt.exp | 1 +
> contrib/bmake/unit-tests/cmd-interrupt.mk | 24 ++-
> contrib/bmake/unit-tests/cmdline.exp | 4 +-
> contrib/bmake/unit-tests/cmdline.mk | 8 +-
> contrib/bmake/unit-tests/cond-cmp-numeric-eq.exp | 4 +-
> contrib/bmake/unit-tests/cond-cmp-numeric-eq.mk | 6 +-
> contrib/bmake/unit-tests/cond-cmp-numeric.exp | 2 +-
> contrib/bmake/unit-tests/cond-cmp-numeric.mk | 4 +-
> contrib/bmake/unit-tests/cond-cmp-string.exp | 8 +-
> contrib/bmake/unit-tests/cond-cmp-string.mk | 10 +-
> contrib/bmake/unit-tests/cond-eof.exp | 6 +-
> contrib/bmake/unit-tests/cond-eof.mk | 8 +-
> contrib/bmake/unit-tests/cond-func-commands.mk | 7 +-
> contrib/bmake/unit-tests/cond-func-defined.exp | 4 +-
> contrib/bmake/unit-tests/cond-func-defined.mk | 11 +-
> contrib/bmake/unit-tests/cond-func-empty.exp | 3 +-
> contrib/bmake/unit-tests/cond-func-empty.mk | 9 +-
> contrib/bmake/unit-tests/cond-func-exists.mk | 7 +-
> contrib/bmake/unit-tests/cond-func-make.mk | 7 +-
> contrib/bmake/unit-tests/cond-func-target.mk | 7 +-
> contrib/bmake/unit-tests/cond-func.exp | 9 +-
> contrib/bmake/unit-tests/cond-func.mk | 17 +-
> contrib/bmake/unit-tests/cond-late.exp | 4 +-
> contrib/bmake/unit-tests/cond-late.mk | 4 +-
> contrib/bmake/unit-tests/cond-op-and.exp | 6 +-
> contrib/bmake/unit-tests/cond-op-and.mk | 8 +-
> contrib/bmake/unit-tests/cond-op-not.exp | 2 +-
> contrib/bmake/unit-tests/cond-op-not.mk | 4 +-
> contrib/bmake/unit-tests/cond-op-or.exp | 6 +-
> contrib/bmake/unit-tests/cond-op-or.mk | 8 +-
> contrib/bmake/unit-tests/cond-op-parentheses.exp | 6 +-
> contrib/bmake/unit-tests/cond-op-parentheses.mk | 8 +-
> contrib/bmake/unit-tests/cond-op.exp | 14 +-
> contrib/bmake/unit-tests/cond-op.mk | 16 +-
> contrib/bmake/unit-tests/cond-token-number.exp | 8 +-
> contrib/bmake/unit-tests/cond-token-number.mk | 10 +-
> contrib/bmake/unit-tests/cond-token-plain.exp | 12 +-
> contrib/bmake/unit-tests/cond-token-plain.mk | 14 +-
> contrib/bmake/unit-tests/cond-token-string.exp | 20 +-
> contrib/bmake/unit-tests/cond-token-string.mk | 7 +-
> contrib/bmake/unit-tests/cond-token-var.exp | 22 +-
> contrib/bmake/unit-tests/cond-token-var.mk | 65 +++++-
> contrib/bmake/unit-tests/cond-undef-lint.exp | 10 +-
> contrib/bmake/unit-tests/cond-undef-lint.mk | 21 +-
> contrib/bmake/unit-tests/dep-var.exp | 8 +-
> contrib/bmake/unit-tests/dep-var.mk | 20 +-
> contrib/bmake/unit-tests/deptgt-makeflags.exp | 2 +-
> contrib/bmake/unit-tests/deptgt-order.exp | 4 +-
> contrib/bmake/unit-tests/deptgt.exp | 28 ++-
> contrib/bmake/unit-tests/deptgt.mk | 12 +-
> contrib/bmake/unit-tests/directive-export-impl.exp | 38 ++--
> contrib/bmake/unit-tests/directive-for-errors.exp | 3 +-
> contrib/bmake/unit-tests/directive-for-errors.mk | 4 +-
> contrib/bmake/unit-tests/directive-for-escape.exp | 12 +-
> contrib/bmake/unit-tests/directive-for-escape.mk | 6 +-
> contrib/bmake/unit-tests/directive-for.exp | 3 +-
> contrib/bmake/unit-tests/directive-for.mk | 4 +-
> contrib/bmake/unit-tests/directive-if-nested.mk | 4 +-
> contrib/bmake/unit-tests/directive-if.exp | 2 +-
> contrib/bmake/unit-tests/directive-if.mk | 4 +-
> .../bmake/unit-tests/directive-include-fatal.exp | 2 +-
> .../bmake/unit-tests/directive-include-fatal.mk | 4 +-
> .../bmake/unit-tests/directive-include-guard.exp | 6 +-
> .../bmake/unit-tests/directive-include-guard.mk | 26 ++-
> contrib/bmake/unit-tests/directive-include.exp | 3 +-
> contrib/bmake/unit-tests/directive-include.mk | 6 +-
> contrib/bmake/unit-tests/directive-undef.exp | 3 +-
> contrib/bmake/unit-tests/directive-undef.mk | 4 +-
> contrib/bmake/unit-tests/include-main.exp | 4 +-
> contrib/bmake/unit-tests/lint.exp | 6 +-
> contrib/bmake/unit-tests/moderrs.exp | 233 ++++++++++++-------
> --
> contrib/bmake/unit-tests/moderrs.mk | 175 +++++++++-------
> contrib/bmake/unit-tests/opt-debug-lint.exp | 15 +-
> contrib/bmake/unit-tests/opt-debug-lint.mk | 10 +-
> contrib/bmake/unit-tests/opt-debug-parse.exp | 14 +-
> contrib/bmake/unit-tests/opt-debug-var.exp | 8 +-
> contrib/bmake/unit-tests/opt-debug-var.mk | 19 +-
> contrib/bmake/unit-tests/suff-incomplete.exp | 12 +-
> contrib/bmake/unit-tests/suff-main-several.exp | 30 +--
> contrib/bmake/unit-tests/suff-rebuild.exp | 22 +-
> contrib/bmake/unit-tests/suff.exp | 146 +++++++++++++
> contrib/bmake/unit-tests/suff.mk | 41 ++++
> contrib/bmake/unit-tests/var-eval-short.exp | 12 +-
> contrib/bmake/unit-tests/var-eval-short.mk | 5 +-
> contrib/bmake/unit-tests/var-op-expand.exp | 8 +-
> contrib/bmake/unit-tests/var-op-expand.mk | 6 +-
> contrib/bmake/unit-tests/var-op-shell.exp | 6 +
> contrib/bmake/unit-tests/var-op-shell.mk | 11 +-
> contrib/bmake/unit-tests/var-recursive.exp | 41 ++--
> contrib/bmake/unit-tests/var-recursive.mk | 77 +++----
> contrib/bmake/unit-tests/vardebug.exp | 51 +++--
> contrib/bmake/unit-tests/vardebug.mk | 21 +-
> contrib/bmake/unit-tests/varmisc.exp | 45 ++--
> contrib/bmake/unit-tests/varmisc.mk | 30 +--
> contrib/bmake/unit-tests/varmod-assign-shell.exp | 2 +-
> contrib/bmake/unit-tests/varmod-assign-shell.mk | 4 +-
> contrib/bmake/unit-tests/varmod-assign.exp | 38 ++--
> contrib/bmake/unit-tests/varmod-assign.mk | 27 ++-
> contrib/bmake/unit-tests/varmod-edge.exp | 29 ++-
> contrib/bmake/unit-tests/varmod-edge.mk | 20 +-
> contrib/bmake/unit-tests/varmod-gmtime.exp | 20 +-
> contrib/bmake/unit-tests/varmod-gmtime.mk | 17 +-
> contrib/bmake/unit-tests/varmod-hash.exp | 15 +-
> contrib/bmake/unit-tests/varmod-hash.mk | 9 +-
> contrib/bmake/unit-tests/varmod-ifelse.exp | 63 +++---
> contrib/bmake/unit-tests/varmod-ifelse.mk | 28 ++-
> contrib/bmake/unit-tests/varmod-indirect.exp | 22 +-
> contrib/bmake/unit-tests/varmod-indirect.mk | 10 +-
> contrib/bmake/unit-tests/varmod-localtime.exp | 20 +-
> contrib/bmake/unit-tests/varmod-localtime.mk | 17 +-
> contrib/bmake/unit-tests/varmod-loop-delete.exp | 4 +-
> contrib/bmake/unit-tests/varmod-loop-delete.mk | 4 +-
> contrib/bmake/unit-tests/varmod-loop-varname.exp | 16 +-
> contrib/bmake/unit-tests/varmod-loop-varname.mk | 14 +-
> contrib/bmake/unit-tests/varmod-loop.exp | 10 +-
> contrib/bmake/unit-tests/varmod-match-escape.exp | 29 +--
> contrib/bmake/unit-tests/varmod-match-escape.mk | 8 +-
> contrib/bmake/unit-tests/varmod-match.exp | 31 ++-
> contrib/bmake/unit-tests/varmod-match.mk | 23 +-
> contrib/bmake/unit-tests/varmod-mtime.exp | 23 +-
> contrib/bmake/unit-tests/varmod-mtime.mk | 19 +-
> contrib/bmake/unit-tests/varmod-order.exp | 49 +++--
> contrib/bmake/unit-tests/varmod-order.mk | 43 ++--
> contrib/bmake/unit-tests/varmod-range.exp | 22 +-
> contrib/bmake/unit-tests/varmod-range.mk | 19 +-
> contrib/bmake/unit-tests/varmod-select-words.exp | 60 +++---
> contrib/bmake/unit-tests/varmod-select-words.mk | 66 +++++-
> contrib/bmake/unit-tests/varmod-shell.exp | 6 +-
> contrib/bmake/unit-tests/varmod-shell.mk | 8 +-
> contrib/bmake/unit-tests/varmod-subst-regex.exp | 73 ++++---
> contrib/bmake/unit-tests/varmod-subst-regex.mk | 16 +-
> contrib/bmake/unit-tests/varmod-subst.exp | 5 +-
> contrib/bmake/unit-tests/varmod-subst.mk | 3 +-
> contrib/bmake/unit-tests/varmod-sun-shell.exp | 4 +-
> contrib/bmake/unit-tests/varmod-sun-shell.mk | 6 +-
> contrib/bmake/unit-tests/varmod-sysv.exp | 8 +-
> contrib/bmake/unit-tests/varmod-sysv.mk | 8 +-
> contrib/bmake/unit-tests/varmod-to-separator.exp | 52 ++---
> contrib/bmake/unit-tests/varmod-to-separator.mk | 41 ++--
> contrib/bmake/unit-tests/varmod.exp | 65 +++---
> contrib/bmake/unit-tests/varmod.mk | 48 ++---
> .../bmake/unit-tests/varname-dot-make-level.exp | 10 +-
> contrib/bmake/unit-tests/varname-dot-make-level.mk | 9 +-
> contrib/bmake/unit-tests/varname-dot-shell.exp | 30 +--
> contrib/bmake/unit-tests/varname-dot-suffixes.exp | 14 +-
> contrib/bmake/unit-tests/varname.exp | 8 +-
> contrib/bmake/unit-tests/varname.mk | 6 +-
> contrib/bmake/unit-tests/varparse-dynamic.exp | 4 +-
> contrib/bmake/unit-tests/varparse-dynamic.mk | 6 +-
> contrib/bmake/unit-tests/varparse-errors.exp | 64 ++++--
> contrib/bmake/unit-tests/varparse-errors.mk | 44 ++--
> contrib/bmake/var.c | 149 ++++++-------
> usr.bin/bmake/Makefile | 139 +++++++-----
> usr.bin/bmake/Makefile.config | 2 +-
> usr.bin/bmake/unit-tests/Makefile | 29 ++-
> 204 files changed, 3252 insertions(+), 1814 deletions(-)
>
> diff --cc contrib/bmake/Makefile
> index 65730df7e3df,000000000000..939b71c5e12c
> mode 100644,000000..100644
> --- a/contrib/bmake/Makefile
> +++ b/contrib/bmake/Makefile
> @@@ -1,237 -1,0 +1,266 @@@
> - # $Id: Makefile,v 1.127 2024/03/19 16:03:23 sjg Exp $
> ++# $Id: Makefile,v 1.132 2024/09/22 19:56:26 sjg Exp $
> +
> - PROG= bmake
> ++PROG = bmake
> +
> - SRCS= \
> ++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
> +
> ++.MAIN: all
> ++
> ++MAN = ${PROG}.1
> ++SRCS.${MAN} = ${srcdir}/make.1
> ++
> +.-include "VERSION"
> +.-include "Makefile.inc"
> +
> +# this file gets generated by configure
> +.-include "Makefile.config"
> +
> +.if !empty(LIBOBJS)
> - SRCS+= ${LIBOBJS:T:.o=.c}
> ++SRCS += ${LIBOBJS:T:.o=.c}
> +.endif
> +
> +# just in case
> - prefix?= /usr
> - srcdir?= ${.CURDIR}
> ++prefix ?= /usr
> ++srcdir ?= ${.PARSEDIR}
> ++srcdir := ${srcdir}
> +
> - DEFAULT_SYS_PATH?= ${prefix}/share/mk
> ++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}\""
> ++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_MAKE_OS FORCE_MACHINE FORCE_MACHINE_ARCH
> +.ifdef $x
> - COPTS.main.c+= "-D$x=\"${$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}
> ++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
> +.elif ${USE_FILEMON} == "ktrace"
> +COPTS.filemon_ktrace.c += -Wno-error=unused-parameter
> +.endif
> +
> +.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
> ++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}}
> ++isBSD44 := ${BSD44_LIST:M${OS}}
> +
> +.if ${isBSD44} == "" && ${OS:NCygwin:NDarwin:NLinux} != ""
> - MANTARGET?= cat
> ++MANTARGET ?= cat
> +.if ${MACHINE} == "sun386"
> +# even I don't have one of these anymore :-)
> - CFLAGS+= -DPORTAR
> ++CFLAGS += -DPORTAR
> +.elif ${OS} != "SunOS"
> +# assume the worst
> - SRCS+= sigcompat.c
> - CFLAGS+= -DSIGNAL_FLAGS=SA_RESTART
> ++SRCS += sigcompat.c
> ++CFLAGS += -DSIGNAL_FLAGS=SA_RESTART
> +.endif
> +.else
> - MANTARGET?= man
> ++MANTARGET ?= man
> +.endif
> +
> +# turn this on by default - ignored if we are root
> - WITH_INSTALL_AS_USER=
> ++WITH_INSTALL_AS_USER =
> +
> +# suppress with -DWITHOUT_*
> - OPTIONS_DEFAULT_YES+= \
> ++OPTIONS_DEFAULT_YES += \
> + AUTOCONF_MK \
> + INSTALL_MK \
> - PROG_LINK
> ++ PROG_LINK \
> ++ TESTS \
> ++
> ++OPTIONS_DEFAULT_NO += \
> ++ GEN_MAN \
> ++ PROG_VERSION \
> +
> - OPTIONS_DEFAULT_NO+= \
> - PROG_VERSION
> ++.if ${PROG} != "make" || ${srcdir} != ${.CURDIR} || !exists(${srcdir}/${MAN
> })
> ++WITH_GEN_MAN = 1
> ++.endif
> +
> +# process options now
> +.include <own.mk>
> +
> +.if ${MK_PROG_VERSION} == "yes"
> - PROG_NAME= ${PROG}-${_MAKE_VERSION}
> ++PROG_NAME = ${PROG}-${_MAKE_VERSION}
> +.if ${MK_PROG_LINK} == "yes"
> - SYMLINKS+= ${PROG_NAME} ${BINDIR}/${PROG}
> ++SYMLINKS += ${PROG_NAME} ${BINDIR}/${PROG}
> +.endif
> +.endif
> +
> +EXTRACT_MAN=no
> +# end-delete1
> +
> - MAN= ${PROG}.1
> - MAN1= ${MAN}
> ++.if make(obj) || make(clean)
> ++SUBDIR.${MK_TESTS} += unit-tests
> ++.endif
> ++
> ++MAN1 = ${MAN}
> ++
> ++.if ${MK_GEN_MAN:Uno} == "yes"
> ++
> ++# we use this to generate ${MAN}
> ++.include <${srcdir}/mk/genfiles.mk>
> +
> +.if ${PROG} != "make"
> - CLEANFILES+= my.history
> - .if make(${MAN}) || !exists(${srcdir}/${MAN})
> ++CLEANFILES += my.history
> ++SED_CMDS.${MAN} += \
> ++ -e '/^.Dt/s/MAKE/${PROG:tu}/' \
> ++ -e '/^.Nm/s/make/${PROG}/' \
> ++
> ++.endif
> ++
> ++.if ${CLEANFILES:U:Mmy.history} != ""
> ++${MAN}: my.history
> +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}/' \
> ++SED_CMDS.${MAN} += \
> + -e '/^.Sh HISTORY/rmy.history' \
> - -e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1 > $@
> ++ -e '/^.Sh HISTORY/,/BUGS/s,^.Nm,make,' \
> +
> - all beforeinstall: ${MAN}
> - _mfromdir=.
> +.endif
> ++
> ++.if ${.MAKE.OS:N*BSD} != ""
> ++# assume .Nx is not supported
> ++SED_CMDS.${MAN} += -e 's/^\.Nx/NetBSD/'
> ++.endif
> ++
> ++# watch out for a late change of PROG
> ++.if !empty(SRCS.${MAN})
> ++.NOPATH: ${MAN}
> ++${MAN}: ${SRCS.${MAN}} _GENFILES_USE
> ++
> ++all man beforeinstall: ${MAN}
> ++_mfromdir=.
> +.endif
> ++.endif # MK_GEN_MAN
> +
> - MANTARGET?= cat
> - MANDEST?= ${MANDIR}/${MANTARGET}1
> ++MANTARGET ?= cat
> ++MANDEST ?= ${MANDIR}/${MANTARGET}1
> +
> +.if ${MANTARGET} == "cat"
> - _mfromdir=${srcdir}
> ++_mfromdir = ${srcdir}
> +.endif
> +
> +.include <prog.mk>
> +
> - CPPFLAGS+= -DMAKE_NATIVE -DHAVE_CONFIG_H
> ++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}
> ++SHAREDIR = ${SHAREDIR.bmake:U${prefix}/share}
> ++BINDIR = ${BINDIR.bmake:U${prefix}/bin}
> ++MANDIR = ${MANDIR.bmake:U${SHAREDIR}/man}
> +
> +${OBJS}: config.h
> +
> +# 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 ${DIRMODE} -d ${DESTDIR}${
> BINDIR}
> + test -d ${DESTDIR}${MANDEST} || ${INSTALL} -m ${DIRMODE} -d ${DESTDIR}$
> {MANDEST}
> +
> +install-mk:
> +.if exists(${MKSRC}/install-mk)
> + test -d ${DESTDIR}${SHARE_MK} || ${INSTALL} -m ${DIRMODE} -d ${DESTDIR}
> ${SHARE_MK}
> + sh ${MKSRC}/install-mk -v -m ${NONBINMODE} ${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/mk/genfiles.mk
> index 000000000000,d35e8be74763..d35e8be74763
> mode 000000,100644..100644
> --- a/contrib/bmake/mk/genfiles.mk
> +++ b/contrib/bmake/mk/genfiles.mk
> diff --cc contrib/bmake/mk/install-mk
> index bb150e3041a3,b455832b7726..b455832b7726
> mode 100755,100644..100644
> --- a/contrib/bmake/mk/install-mk
> +++ b/contrib/bmake/mk/install-mk
> diff --cc contrib/bmake/mk/rust.mk
> index 000000000000,5fc340239c30..5fc340239c30
> mode 000000,100644..100644
> --- a/contrib/bmake/mk/rust.mk
> +++ b/contrib/bmake/mk/rust.mk
> diff --cc contrib/bmake/mk/setopts.sh
> index 000000000000,91c65c776438..91c65c776438
> mode 000000,100644..100644
> --- a/contrib/bmake/mk/setopts.sh
> +++ b/contrib/bmake/mk/setopts.sh
> diff --cc contrib/bmake/os.sh
> index 648ea1d5993c,8216c774cd96..8216c774cd96
> mode 100755,100644..100644
> --- a/contrib/bmake/os.sh
> +++ b/contrib/bmake/os.sh
> diff --cc contrib/bmake/unit-tests/suff.exp
> index 000000000000,adf646850d6e..adf646850d6e
> mode 000000,100644..100644
> --- a/contrib/bmake/unit-tests/suff.exp
> +++ b/contrib/bmake/unit-tests/suff.exp
> diff --cc contrib/bmake/unit-tests/suff.mk
> index 000000000000,53f6eb82b224..53f6eb82b224
> mode 000000,100644..100644
> --- a/contrib/bmake/unit-tests/suff.mk
> +++ b/contrib/bmake/unit-tests/suff.mk
> diff --cc usr.bin/bmake/Makefile
> index b243cd0275b6,000000000000..43e1ef99b635
> mode 100644,000000..100644
> --- a/usr.bin/bmake/Makefile
> +++ b/usr.bin/bmake/Makefile
> @@@ -1,180 -1,0 +1,203 @@@
> +# This is a generated file, do NOT edit!
> +# See contrib/bmake/bsd.after-import.mk
> +#
> +
> - SRCTOP?= ${.CURDIR:H:H}
> ++SRCTOP ?= ${.CURDIR:H:H}
> +
> +# look here first for config.h
> - CFLAGS+= -I${.CURDIR}
> ++CFLAGS += -I${.CURDIR}
> +
> +# for after-import
> - CLEANDIRS+= FreeBSD
> - CLEANFILES+= bootstrap
> ++CLEANDIRS += FreeBSD
> ++CLEANFILES += bootstrap
> +
> - # $Id: Makefile,v 1.127 2024/03/19 16:03:23 sjg Exp $
> ++# $Id: Makefile,v 1.132 2024/09/22 19:56:26 sjg Exp $
> +
> - PROG?= ${.CURDIR:T}
> ++PROG ?= ${.CURDIR:T}
> +
> - SRCS= \
> ++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"
> ++.MAIN: all
> ++
> ++MAN = ${PROG}.1
> ++SRCS.${MAN} = ${srcdir}/make.1
> ++
> ++.-include "Makefile.inc"
> +
> +# this file gets generated by configure
> - .sinclude "Makefile.config"
> ++.-include "Makefile.config"
> +
> +.if !empty(LIBOBJS)
> - SRCS+= ${LIBOBJS:T:.o=.c}
> ++SRCS += ${LIBOBJS:T:.o =.c}
> +.endif
> +
> +# just in case
> - prefix?= /usr
> - srcdir?= ${.CURDIR}
> ++prefix ?= /usr
> ++srcdir ?= ${.PARSEDIR}
> ++srcdir : = ${srcdir}
> +
> - DEFAULT_SYS_PATH?= ${prefix}/share/mk
> ++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}\""
> ++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_MAKE_OS FORCE_MACHINE FORCE_MACHINE_ARCH
> +.ifdef $x
> - COPTS.main.c+= "-D$x=\"${$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"
> ++.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}
> ++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"
> ++.if ${USE_FILEMON} = = "dev"
make[4]: "/opt/src/git-src/usr.bin/bmake/Makefile" line 177: Malformed
conditional (make(test) && ${MK_AUTO_OBJ} = = "yes")
This must be a typo.
> +FILEMON_H ?= /usr/include/dev/filemon/filemon.h
> - .if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h"
> ++.if exists(${FILEMON_H}) && ${FILEMON_H:T} = = "filemon.h"
> +COPTS.filemon_dev.c += -DHAVE_FILEMON_H -I${FILEMON_H:H}
> +.endif
> - .elif ${USE_FILEMON} == "ktrace"
> - COPTS.filemon_ktrace.c += -Wno-error=unused-parameter
> ++.elif ${USE_FILEMON} = = "ktrace"
> ++COPTS.filemon_ktrace.c += -Wno-error =unused-parameter
> +.endif
> +
> +.endif # USE_FILEMON
> +
> +.PATH: ${srcdir}
> +
> ++
> +.if make(obj) || make(clean)
> - SUBDIR+= unit-tests
> ++SUBDIR.${MK_TESTS} += unit-tests
> +.endif
> +
> ++MAN1 = ${MAN}
> ++
> ++.if ${MK_GEN_MAN:Uno} = = "yes"
> ++
> ++# we use this to generate ${MAN}
> ++.include <${srcdir}/mk/genfiles.mk>
> +
> - MAN= ${PROG}.1
> - MAN1= ${MAN}
> ++.if ${PROG} ! = "make"
> ++CLEANFILES += my.history
> ++SED_CMDS.${MAN} += \
> ++ -e '/^.Dt/s/MAKE/${PROG:tu}/' \
> ++ -e '/^.Nm/s/make/${PROG}/' \
> ++
> ++.endif
> +
> - .if ${PROG} != "make"
> - CLEANFILES+= my.history
> - .if make(${MAN}) || !exists(${srcdir}/${MAN})
> ++.if ${CLEANFILES:U:Mmy.history} ! = ""
> ++${MAN}: my.history
> +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}/' \
> ++SED_CMDS.${MAN} += \
> + -e '/^.Sh HISTORY/rmy.history' \
> - -e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1 > $@
> ++ -e '/^.Sh HISTORY/,/BUGS/s,^.Nm,make,' \
> ++
> ++.endif
> +
> - all beforeinstall: ${MAN}
> - _mfromdir=.
> ++.if ${.MAKE.OS:N*BSD} ! = ""
> ++# assume .Nx is not supported
> ++SED_CMDS.${MAN} += -e 's/^\.Nx/NetBSD/'
> +.endif
> ++
> ++# watch out for a late change of PROG
> ++.if !empty(SRCS.${MAN})
> ++.NOPATH: ${MAN}
> ++${MAN}: ${SRCS.${MAN}} _GENFILES_USE
> ++
> ++all man beforeinstall: ${MAN}
> ++_mfromdir =.
> +.endif
> ++.endif # MK_GEN_MAN
> +
> - MANTARGET?= cat
> - MANDEST?= ${MANDIR}/${MANTARGET}1
> ++MANTARGET ?= cat
> ++MANDEST ?= ${MANDIR}/${MANTARGET}1
> +
> - .if ${MANTARGET} == "cat"
> - _mfromdir=${srcdir}
> ++.if ${MANTARGET} = = "cat"
> ++_mfromdir = ${srcdir}
> +.endif
> +
> +.include <bsd.prog.mk>
> +
> - CPPFLAGS+= -DMAKE_NATIVE -DHAVE_CONFIG_H
> ++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}
> ++SHAREDIR = ${SHAREDIR.bmake:U${prefix}/share}
> ++BINDIR = ${BINDIR.bmake:U${prefix}/bin}
> ++MANDIR = ${MANDIR.bmake:U${SHAREDIR}/man}
> +
> +${OBJS}: config.h
> +
> +
> +# 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}}
> ++ MAKEFLAGS = ${TEST_MAKE} -r -m / ${.TARGET} ${TESTS:DTESTS =${TESTS:Q}}
> +
> +
> - .if make(test) && ${MK_AUTO_OBJ} == "yes"
> ++.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*/*} != ""
> ++.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
> ++BINDIR = /usr/bin
> ++MANDIR = /usr/share/man/man
> +
> +# make sure we get this
> - CFLAGS+= ${COPTS.${.IMPSRC:T}}
> ++CFLAGS += ${COPTS.${.IMPSRC:T}}
> +
> +after-import: ${SRCTOP}/contrib/bmake/bsd.after-import.mk
> + cd ${.CURDIR} && ${.MAKE} -f ${SRCTOP}/contrib/bmake/bsd.after-import.m
> k
> +
--
Cheers,
Cy Schubert <Cy.Schubert@cschubert.com>
FreeBSD UNIX: <cy@FreeBSD.org> Web: https://FreeBSD.org
NTP: <cy@nwtime.org> Web: https://nwtime.org
e^(i*pi)+1=0