git: dc1b8c9a846e - main - Merge bmake-20230208
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 10 Feb 2023 01:24:30 UTC
The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=dc1b8c9a846e78a87789fe1473350c3260722148 commit dc1b8c9a846e78a87789fe1473350c3260722148 Merge: cd3193f640e2 f4d51098686d Author: Simon J. Gerraty <sjg@FreeBSD.org> AuthorDate: 2023-02-10 01:21:33 +0000 Commit: Simon J. Gerraty <sjg@FreeBSD.org> CommitDate: 2023-02-10 01:23:23 +0000 Merge bmake-20230208 Merge commit 'f4d51098686d961fc03dc5aa327619d0af3c9dcd' contrib/bmake/ChangeLog | 17 +++++++ contrib/bmake/Makefile | 10 ++--- contrib/bmake/VERSION | 2 +- contrib/bmake/install-sh | 59 ++++++++++++++++-------- contrib/bmake/mk/ChangeLog | 11 +++++ contrib/bmake/mk/autoconf.mk | 4 +- contrib/bmake/mk/install-mk | 13 ++++-- contrib/bmake/mk/whats.mk | 4 +- contrib/bmake/unit-tests/varmod-remember.mk | 69 +++++++++++++++++++++++------ contrib/bmake/var.c | 6 +-- usr.bin/bmake/Makefile | 2 +- usr.bin/bmake/Makefile.config | 2 +- 12 files changed, 151 insertions(+), 48 deletions(-) diff --cc contrib/bmake/Makefile index ad78883ff890,000000000000..4ad9ac92b266 mode 100644,000000..100644 --- a/contrib/bmake/Makefile +++ b/contrib/bmake/Makefile @@@ -1,238 -1,0 +1,238 @@@ - # $Id: Makefile,v 1.122 2022/10/08 02:53:30 sjg Exp $ ++# $Id: Makefile,v 1.123 2023/01/28 02:49:20 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} == "" && ${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} ++ 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 775 -d ${DESTDIR}${SHARE_MK} - sh ${MKSRC}/install-mk -v -m 644 ${DESTDIR}${SHARE_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 usr.bin/bmake/Makefile index 722de897acbb,000000000000..f94c7d3d2914 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.122 2022/10/08 02:53:30 sjg Exp $ ++# $Id: Makefile,v 1.123 2023/01/28 02:49:20 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 fab0991419ff,000000000000..a0310f91a5f8 mode 100644,000000..100644 --- a/usr.bin/bmake/Makefile.config +++ b/usr.bin/bmake/Makefile.config @@@ -1,28 -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?=20230126 ++_MAKE_VERSION?=20230208 + +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}