pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/devel/bmake



Module Name:    pkgsrc
Committed By:   nia
Date:           Sun May 24 11:09:45 UTC 2020

Modified Files:
        pkgsrc/devel/bmake: Makefile
        pkgsrc/devel/bmake/files: ChangeLog FILES Makefile Makefile.config.in
            README VERSION aclocal.m4 arch.c bmake.1 bmake.cat1 boot-strap
            bsd.after-import.mk buf.c buf.h compat.c cond.c config.h.in
            configure configure.in dir.c dir.h dirname.c for.c getopt.c hash.c
            hash.h install-sh job.c job.h lst.h machine.sh main.c
            make-bootstrap.sh.in make-conf.h make.c make.h make_malloc.c
            make_malloc.h makefile.in meta.c meta.h metachar.c metachar.h
            mkdeps.sh nonints.h os.sh parse.c pathnames.h ranlib.h realpath.c
            setenv.c sigcompat.c sprite.h str.c stresep.c strlcpy.c strlist.c
            strlist.h suff.c targ.c trace.c trace.h util.c var.c wait.h
        pkgsrc/devel/bmake/files/PSD.doc: Makefile tutorial.ms
        pkgsrc/devel/bmake/files/filemon: filemon.h filemon_dev.c
            filemon_ktrace.c
        pkgsrc/devel/bmake/files/lst.lib: lstAppend.c lstAtEnd.c lstAtFront.c
            lstClose.c lstConcat.c lstDatum.c lstDeQueue.c lstDestroy.c
            lstDupl.c lstEnQueue.c lstFind.c lstFindFrom.c lstFirst.c
            lstForEach.c lstForEachFrom.c lstInit.c lstInsert.c lstInt.h
            lstIsAtEnd.c lstIsEmpty.c lstLast.c lstMember.c lstNext.c lstOpen.c
            lstPrev.c lstRemove.c lstReplace.c lstSucc.c
        pkgsrc/devel/bmake/files/missing/sys: cdefs.h
        pkgsrc/devel/bmake/files/mk: README auto.dep.mk auto.obj.mk autoconf.mk
            autodep.mk compiler.mk cython.mk dep.mk dirdeps-options.mk
            dirdeps-targets.mk dirdeps.mk doc.mk dpadd.mk files.mk final.mk
            gendirdeps.mk host-target.mk host.libnames.mk inc.mk init.mk
            install-mk install-new.mk java.mk ldorder.mk lib.mk libnames.mk
            libs.mk links.mk man.mk manifest.mk meta.autodep.mk meta.stage.mk
            meta.subdir.mk meta.sys.mk meta2deps.py meta2deps.sh mk-files.txt
            mkopt.sh nls.mk obj.mk options.mk own.mk prlist.mk prog.mk progs.mk
            rst2htm.mk scripts.mk srctop.mk stage-install.sh subdir.mk
            sys.clean-env.mk sys.debug.mk sys.dependfile.mk sys.mk sys.vars.mk
            target-flags.mk warnings.mk whats.mk yacc.mk
        pkgsrc/devel/bmake/files/mk/sys: AIX.mk Darwin.mk Generic.mk HP-UX.mk
            IRIX.mk Linux.mk NetBSD.mk OSF1.mk OpenBSD.mk SunOS.mk UnixWare.mk
        pkgsrc/devel/bmake/files/unit-tests: Makefile Makefile.config.in
            cond-late.mk cond1.mk cond2.mk dollar.mk doterror.mk dotwait.mk
            error.mk escape.mk export-all.mk export-env.mk export.mk forloop.mk
            forsubst.mk impsrc.mk include-main.mk include-sub.mk
            include-subsub.mk misc.mk moderrs.mk modmisc.mk modorder.mk
            modword.mk order.mk phony-end.mk posix.mk posix1.mk qequals.mk
            suffixes.mk sysv.mk unexport-env.mk unexport.mk varcmd.mk
            varmisc.mk varmod-edge.mk varquote.mk varshell.mk

Log Message:
bmake: Update to 20200517

2020-05-17  Simon J Gerraty  <sjg%beast.crufty.net@localhost>

        * VERSION (_MAKE_VERSION): 20200517
        Merge with NetBSD make, pick up
        o modified dollar tests to avoid shell dependencies
        o new tests for .INCLUDEFROM

2020-05-16  Simon J Gerraty  <sjg%beast.crufty.net@localhost>

        * unit-tests/dollar.mk: tweak  '1 dollar literal' test
        to not depend so much on shell behavior

2020-05-10  Simon J Gerraty  <sjg%beast.crufty.net@localhost>

        * VERSION (_MAKE_VERSION): 20200510
        Merge with NetBSD make, pick up
        o unit test for dollar handling

2020-05-06  Simon J Gerraty  <sjg%beast.crufty.net@localhost>

        * VERSION (_MAKE_VERSION): 20200506
        Merge with NetBSD make, pick up
        o str.c: empty string does not match % pattern
          plus unit-test changes

2020-05-04  Simon J Gerraty  <sjg%beast.crufty.net@localhost>

        * VERSION (_MAKE_VERSION): 20200504
        May the 4th be with you
        Merge with NetBSD make, pick up
        o var.c: import handling of old sysV style modifier using '%'
        o str.c: refactor brk_string
        o unit-tests: add test case for lazy conditions

2020-04-18  Simon J Gerraty  <sjg%beast.crufty.net@localhost>

        * VERSION (_MAKE_VERSION): 20200418

        * configure.in: use_makefile=no for cygwin et al.
        case insensitive filesystems just don't work if both
        makefile and Makefile exist.
        NOTE: bmake does not support cygwin and likely never will,
        but if brave souls want to try it - help them out.

2020-04-02  Simon J Gerraty  <sjg%beast.crufty.net@localhost>

        * VERSION (_MAKE_VERSION): 20200402
        Merge with NetBSD make, pick up
        o meta.c: meta_oodate, CHECK_VALID_META is too aggressive for CMD
          a blank command is perfectly valid.

2020-03-30  Simon J Gerraty  <sjg%beast.crufty.net@localhost>

        * VERSION (_MAKE_VERSION): 20200330
        Merge with NetBSD make, pick up
        o make.h: extern debug_file

2020-03-18  Simon J Gerraty  <sjg%beast.crufty.net@localhost>

        * VERSION (_MAKE_VERSION): 20200318
        Merge with NetBSD make, pick up
        o meta.c: meta_oodate, check for corrupted meta file
          earlier and more often.

2020-02-20  Simon J Gerraty  <sjg%beast.crufty.net@localhost>

        * VERSION (_MAKE_VERSION): 20200220

2020-02-19  Simon J Gerraty  <sjg%beast.crufty.net@localhost>

        * boot-strap: unset MAKEFLAGS

2020-02-12  Simon J Gerraty  <sjg%beast.crufty.net@localhost>

        * VERSION (_MAKE_VERSION): 20200212
        * meta.c: meta_compat_parent check for USE_FILEMON
          patch from Soeren Tempel

2020-02-05  Simon J Gerraty  <sjg%beast.crufty.net@localhost>

        * VERSION: 20200205
        Merge with NetBSD make, pick up
        o meta.c: fix compat mode, need to call meta_job_output()
        o job.c: extra fds for meta mode not needed if using filemon_dev

2020-01-22  Simon J Gerraty  <sjg%beast.crufty.net@localhost>

        * VERSION: 20200122
        Merge with NetBSD make, pick up
        o meta.c: avoid passing NULL to filemon_*() when meta_needed()
          returns FALSE.

2020-01-21  Simon J Gerraty  <sjg%beast.crufty.net@localhost>

        * VERSION: 20200121
        Merge with NetBSD make, pick up
        o filemon/filemon_{dev,ktrace}.c: allow selection of
          filemon implementation.  filemon_dev.c uses the kernel module
          while filemon_ktrace.c leverages the fktrace api available in
          NetBSD.  filemon_ktrace.c can hopefully form the basis for
          adding support for other tracing mechanisms such as strace on
          Linux.
        o meta.c: when target is out-of-date per normal make rules
          record value of .OODATE in meta file.

2019-09-26  Simon J Gerraty  <sjg%beast.crufty.net@localhost>

        * VERSION: 20190926
          Merge with NetBSD make, pick up
          o parse.c: don't pass NULL to realpath(3)
            some versions cannot handle it.

2019-04-09  Simon J Gerraty  <sjg%beast.crufty.net@localhost>

        * VERSION: 20190409
          Merge with NetBSD make, pick up
          o parse.c: ParseDoDependency: free paths rather than assert

2018-12-22  Simon J Gerraty  <sjg%beast.crufty.net@localhost>

        * VERSION: 20181222

        * configure.in: add --without-makefile to avoid generating
          makefile and make-bootstrap.sh

        * include Makefile.inc if it exists

        * Use Makefile and Makefile.config.in in unit-tests
          so we can use just: make obj && make && make test
          when bmake is already available.
          We add --without-makefile to CONFIGURE_ARGS in this case.

        * tweak bsd.after-import.mk (captures Makefile.config etc
          after import to FreeBSD for example) to cope with all the above.

2018-12-21  Simon J Gerraty  <sjg%beast.crufty.net@localhost>

        * VERSION: 20181221
          Merge with NetBSD make, pick up
          o parse.c: ParseVErrorInternal use .PARSEDIR
            and apply if relative, and then use .PARSEFILE
            for consistent result.

2018-12-20  Simon J Gerraty  <sjg%beast.crufty.net@localhost>

        * VERSION: 20181220
          Merge with NetBSD make, pick up
          o parse.c: ParseVErrorInternal use .CURDIR if .PARSEDIR
            is relative
          o var.c: avoid SEGFAULT in .unexport-env
            when MAKELEVEL is not set

2018-12-16  Simon J Gerraty  <sjg%beast.crufty.net@localhost>

        * VERSION: 20181216
          Merge with NetBSD make, pick up
          o fix for unit-tests/varquote.mk on Debian

2018-09-21  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * VERSION: 20180919
          Merge with NetBSD make, pick up
          o var.c: add :q
          o dir.c: cleanup caching of stats

2018-09-21  Simon J Gerraty  <sjg%beast.crufty.net@localhost>

        * Makefile.config.in: use += where it makes sense.

2018-05-12  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * VERSION: 20180512
          Merge with NetBSD make, pick up
          o job.c: skip polling job token pipe

2018-04-05  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * VERSION: 20180405
          Merge with NetBSD make, pick up
          o parse.c: be more cautious about detecting depenency line
            rather than sysV style include.

2018-02-22  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * VERSION: 20180222
          Merge with NetBSD make, pick up
          o parse.c: avoid calling sysconf for every call to loadfile

2018-02-18  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * VERSION: 20180218
          Merge with NetBSD make, pick up
          o var.c: Var_Set handle NULL value anytime.

2018-02-12  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * VERSION: 20180212
          Merge with NetBSD make, pick up
          o parse.c: do not treat .info as warning with -W

2017-12-07  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * VERSION: 20171207
          Merge with NetBSD make, pick up
          o var.c: Var_Append use Var_Set if var not previously set
            so that VAR_CMD is handled correctly.
            Add a suitable unit-test.

2017-11-26  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * VERSION (_MAKE_VERSION): 20171126

        * aclocal.m4: use AC_LINK_IFELSE for AC_C___ATTRIBUTE__
          since AC_TRY_COMPILE puts input inside main()
          which upsets modern compilers.

2017-11-18  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * VERSION: 20171118
          Merge with NetBSD make, pick up
          o var.c: do not append to variable set on command line
            add unit-test to catch this.

2017-10-28  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * VERSION: 20171028
          Merge with NetBSD make, pick up
          o main.c: ignore empty MAKEOBJDIR

        * Makefile.config.in:
          make @prefix@ @machine*@ and @default_sys_path@ defaults.

2017-10-05  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * VERSION: 20171005

        * unit-tests/dotwait.mk: redirect stderr through pipe for more
          consistent result on some platforms.

2017-08-13  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * machine.sh: entry for AIX

2017-08-12  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * VERSION (_MAKE_VERSION): Move the setting of _MAKE_VERSION
          to a file that can be included by configure as well as make.
          This allows configure to set set _MAKE_VERSION in make-bootstrap.sh

2017-08-10  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20170810
          Merge with NetBSD make, pick up
          o meta.c: if target is in subdir we only need subdir name in
            meta_name.

2017-07-20  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20170720
          Merge with NetBSD make, pick up
          o compat.c: pass SIGINT etc onto child and wait for it to exit
            before we self-terminate.

2017-07-11  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20170711
          forgot to update after merge on 20170708 ;-)
          o main.c: refactor to reduce size of main function.
            add -v option to always fully expand values.
          o meta.c: ensure command output in meta file has ending newline
            even when filemon not being used.
            When matching ${.MAKE.META.IGNORE_PATTERNS} do not use
            pathname via ':L' since any ':' in pathname breaks that.
            Instead set a '${.p.}' to pathname in the target context and
            use that.

2017-05-10  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20170510
          Merge with NetBSD make, pick up
          o main.c: Main_SetObjdir: ensure buf2 is in scope

2017-05-08  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20170505
          see mk/ChangeLog

2017-05-05  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * parse.c: not everyone has stdint.h

2017-05-01  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20170501
          see mk/ChangeLog

2017-04-21  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20170421
          Merge with NetBSD make, pick up
          o str.c: Str_Match: fix closure tests for [^] and add unit-test.

2017-04-20  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20170420
          Merge with NetBSD make, pick up
          o main.c: only use -C arg "as is" if it contains no
            relative component.

2017-04-18  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20170418
          Merge with NetBSD make, pick up
          o main.c: fix Main_SetObjdir() for relative paths (eg obj).

2017-04-17  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20170417
          Merge with NetBSD make, pick up
          o fixes a number of coverity complaints
            - check return value of fseek, fcntl
            - plug memory leak in Dir_FindFile, Var_LoopExpand,
              JobPrintCommand, ParseTraditionalInclude
            - use bmake_malloc() where NULL is not tollerated
            - use MAKE_ATTR_UNUSED rather that kludges like
              return(unused ? 0 : 0)
            - use purge_cached_realpaths() rather than abuse cached_realpath()

2017-04-13  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20170413
          Merge with NetBSD make, pick up
          o main.c: when setting .OBJDIR ignore '$' in paths.

        * job.c: use MALLOC_OPTIONS to set malloc_options.

2017-04-11  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20170411
          Merge with NetBSD make, pick up
          o str.c: Str_Match: allow [^a-z] to behave as expected.

2017-03-26  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20170326
          Merge with NetBSD make, pick up
          o main.c: purge relative paths from realpath cache when .OBJDIR
            is changed.

2017-03-11  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20170311
          Merge with NetBSD make, pick up
          o main.c: only use -C arg "as is" if it starts with '/'.

2017-03-01  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20170301
          Merge with NetBSD make, pick up
          o main.c: use -C arg "as is" rather than getcwd()
            if they identify the same directory.
          o parse.c: ensure loadfile buffer is \n terminated in non-mmap case

2017-02-01  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20170201
          Merge with NetBSD make, pick up
          o var.c: allow :_=var and avoid use of special context.

2017-01-30  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20170130
          Merge with NetBSD make, pick up
          o var.c: add :range and :_
          o main.c: partially initialize Dir_* before MainParseArgs()
            can be called.
            If -V, skip Main_ExportMAKEFLAGS()

2017-01-14  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20170114
          Merge with NetBSD make, pick up
          o var.c: allow specifying the utc value used by :{gm,local}time

2016-12-12  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20161212
          Merge with NetBSD make, pick up
          o main.c: look for obj.${MACHINE}-${MACHINE_ARCH} too.

2016-12-09  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20161209
          Merge with NetBSD make, pick up
          o main.c: cleanup setting of .OBJDIR
          o parse.c: avoid coredump from (var)=val

2016-11-26  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20161126
          Merge with NetBSD make, pick up
          o make.c: Make_OODate: report src node name if path not set

2016-09-26  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20160926
          Merge with NetBSD make, pick up
          o support for .DELETE_ON_ERROR: (remove targets that fail)

2016-09-26  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile MAN: tweak .Dt to match ${PROG}

2016-08-18  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20160818
          its a neater number; pick up whitespace fixes to man page.

2016-08-17  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20160817
          Merge with NetBSD make, pick up
          o meta.c: move handling of .MAKE.META.IGNORE_* to meta_ignore()
            so we can call it before adding entries to missingFiles.
            Thus we do not track files we have been told to ignore.

2016-08-15  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20160815
          Merge with NetBSD make, pick up
          o meta_oodate: apply .MAKE.META.IGNORE_FILTER (if defined) to
            pathnames, and skip if the expansion is empty.
            Useful for dirdeps.mk when checking DIRDEPS_CACHE.

2016-08-12  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20160812
          Merge with NetBSD make, pick up
          o meta.c: remove all missingFiles entries that match a deleted
            dir.
          o main.c: set .ERROR_CMD if possible.

2016-06-06  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20160606
          Merge with NetBSD make, pick up
          o dir.c: extend mtimes cache to others via cached_stat()

2016-06-04  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20160604
          Merge with NetBSD make, pick up
          o meta.c: missing filemon data is only relevant if we read a
            meta file.
            Also do not return oodate for a missing metafile if gn->path
            points to .CURDIR

2016-06-02  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20160602
          Merge with NetBSD make, pick up
          o cached_realpath(): avoid hitting filesystem more than necessary.
          o meta.c: refactor need_meta decision, add knobs for
            missing meta file and filemon data wrt out-of-datedness.

2016-05-28  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20160528

        * boot-strap, make-bootstrap.sh.in: Makefile now uses _MAKE_VERSION

2016-05-12  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20160512
          Merge with NetBSD make, pick up
          o meta.c: ignore paths that match .MAKE.META.IGNORE_PATTERNS
            this is useful for gcov builds.
          o propagate errors from filemon(4).

2016-05-09  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20160509
          Merge with NetBSD make, pick up
          o remove use of non-standard types u_int etc.
          o meta.c: apply realpath() before matching against metaIgnorePaths

2016-04-04  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20160404
          Merge with NetBSD make, pick up
          o allow makefile to set .MAKE.JOBS

        * Makefile (PROG_NAME): use ${_MAKE_VERSION}

2016-03-15  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): 20160315
          Merge with NetBSD make, pick up
          o fix handling of archive members

2016-03-13  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (_MAKE_VERSION): rename variable to avoid interference
          with checks for ${MAKE_VERSION}

2016-03-10  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (MAKE_VERSION): 20160310
          Merge with NetBSD make, pick up
          o meta.c: treat missing Read file same as Write, incase we Delete it.

2016-03-07  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (MAKE_VERSION): 20160307
          Merge with NetBSD make, pick up
          o var.c: fix :ts\nnn to be octal by default.
          o meta.c: meta_finish() to cleanup memory.

2016-02-26  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (MAKE_VERSION): 20160226
          Merge with NetBSD make, pick up
          o meta.c: allow meta file for makeDepend if makefiles want it.

2016-02-19  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * var.c: default .MAKE.SAVE_DOLLARS to FALSE
          for backwards compatability.

        * Makefile (MAKE_VERSION): 20160220
          Merge with NetBSD make, pick up
          o var.c: add knob to control handling of '$$' in :=

2016-02-18  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (MAKE_VERSION): 20160218
          Merge with NetBSD make, pick up
          o var.c: add .export-literal allows us to fix sys.clean-env.mk
            post the changes to Var_Subst.
            Var_Subst now takes flags, and does not consume '$$' in :=

2016-02-17  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (MAKE_VERSION): 20160217
          Merge with NetBSD make, pick up
          o var.c: preserve '$$' in :=
          o parse.c: add .dinclude for handling included
            makefile like .depend

2015-12-20  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (MAKE_VERSION): 20151220
          Merge with NetBSD make, pick up
          o suff.c: re-initialize suffNull when clearing suffixes.

2015-12-01  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (MAKE_VERSION): 20151201
          Merge with NetBSD make, pick up
          o cond.c: CondCvtArg: avoid access beyond end of empty buffer.
          o meta.c: meta_oodate: use lstat(2) for checking link target
            in case it is a symlink.
          o var.c: avoid calling brk_string and Var_Export1 with empty
            strings.

2015-11-26  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (MAKE_VERSION): 20151126
          Merge with NetBSD make, pick up
          o parse.c: ParseTrackInput don't access beyond
            end of old value.

2015-10-22  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (MAKE_VERSION): 20151022

        * Add support for BSD/OS which lacks inttypes.h
          and really needs sys/param.h for sys/sysctl.h
          also 'type' is not a shell builtin.

        * var.c: eliminate uint32_t and need for inttypes.h

        * main.c: PrintOnError flush stdout before run .ERROR

        * parse.c: cope with _SC_PAGESIZE not being defined.

2015-10-20  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (MAKE_VERSION): 20151020
          Merge with NetBSD make, pick up
          o var.c: fix uninitialized var

2015-10-12  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * var.c: the conditional expressions used with ':?' can be
        expensive, if already discarding do not evaluate or expand
        anything.

2015-10-10  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (MAKE_VERSION): 20151010
          Merge with NetBSD make, pick up
          o Add Boolean wantit flag to Var_Subst and Var_Parse
            when FALSE we know we are discarding the result and can
            skip operations like Cmd_Exec.

2015-10-09  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (MAKE_VERSION): 20151009
          Merge with NetBSD make, pick up
          o var.c: don't check for NULL before free()
          o meta.c: meta_oodate, do not hard code ignore of makeDependfile

2015-09-10  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (MAKE_VERSION): 20150910
          Merge with NetBSD make, pick up
          o main.c: with -w print Enter/Leaving messages for objdir too
            if necessary.
          o centralize shell metachar handling

        * FILES: add metachar.[ch]

2015-06-06  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>

        * Makefile (MAKE_VERSION): 20150606
          Merge with NetBSD make, pick up
          o make.1: document .OBJDIR target


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 pkgsrc/devel/bmake/Makefile
cvs rdiff -u -r1.12 -r1.13 pkgsrc/devel/bmake/files/ChangeLog \
    pkgsrc/devel/bmake/files/boot-strap
cvs rdiff -u -r1.8 -r1.9 pkgsrc/devel/bmake/files/FILES \
    pkgsrc/devel/bmake/files/cond.c pkgsrc/devel/bmake/files/job.h \
    pkgsrc/devel/bmake/files/nonints.h
cvs rdiff -u -r1.3 -r1.4 pkgsrc/devel/bmake/files/Makefile \
    pkgsrc/devel/bmake/files/README \
    pkgsrc/devel/bmake/files/bsd.after-import.mk \
    pkgsrc/devel/bmake/files/getopt.c pkgsrc/devel/bmake/files/install-sh \
    pkgsrc/devel/bmake/files/make-conf.h pkgsrc/devel/bmake/files/meta.c \
    pkgsrc/devel/bmake/files/mkdeps.sh pkgsrc/devel/bmake/files/setenv.c \
    pkgsrc/devel/bmake/files/wait.h
cvs rdiff -u -r1.2 -r1.3 pkgsrc/devel/bmake/files/Makefile.config.in \
    pkgsrc/devel/bmake/files/dirname.c pkgsrc/devel/bmake/files/make_malloc.c \
    pkgsrc/devel/bmake/files/make_malloc.h \
    pkgsrc/devel/bmake/files/makefile.in pkgsrc/devel/bmake/files/meta.h \
    pkgsrc/devel/bmake/files/realpath.c pkgsrc/devel/bmake/files/stresep.c \
    pkgsrc/devel/bmake/files/strlcpy.c pkgsrc/devel/bmake/files/strlist.c \
    pkgsrc/devel/bmake/files/strlist.h
cvs rdiff -u -r1.1 -r1.2 pkgsrc/devel/bmake/files/VERSION
cvs rdiff -u -r1.4 -r1.5 pkgsrc/devel/bmake/files/aclocal.m4 \
    pkgsrc/devel/bmake/files/buf.h pkgsrc/devel/bmake/files/hash.h \
    pkgsrc/devel/bmake/files/lst.h pkgsrc/devel/bmake/files/ranlib.h \
    pkgsrc/devel/bmake/files/sprite.h
cvs rdiff -u -r1.7 -r1.8 pkgsrc/devel/bmake/files/arch.c \
    pkgsrc/devel/bmake/files/for.c
cvs rdiff -u -r1.10 -r1.11 pkgsrc/devel/bmake/files/bmake.1 \
    pkgsrc/devel/bmake/files/bmake.cat1 pkgsrc/devel/bmake/files/compat.c \
    pkgsrc/devel/bmake/files/parse.c pkgsrc/devel/bmake/files/var.c
cvs rdiff -u -r1.5 -r1.6 pkgsrc/devel/bmake/files/buf.c \
    pkgsrc/devel/bmake/files/dir.h pkgsrc/devel/bmake/files/hash.c \
    pkgsrc/devel/bmake/files/pathnames.h pkgsrc/devel/bmake/files/str.c \
    pkgsrc/devel/bmake/files/suff.c pkgsrc/devel/bmake/files/trace.h
cvs rdiff -u -r1.9 -r1.10 pkgsrc/devel/bmake/files/config.h.in \
    pkgsrc/devel/bmake/files/make.h
cvs rdiff -u -r1.16 -r1.17 pkgsrc/devel/bmake/files/configure
cvs rdiff -u -r1.14 -r1.15 pkgsrc/devel/bmake/files/configure.in \
    pkgsrc/devel/bmake/files/main.c pkgsrc/devel/bmake/files/util.c
cvs rdiff -u -r1.6 -r1.7 pkgsrc/devel/bmake/files/dir.c \
    pkgsrc/devel/bmake/files/make-bootstrap.sh.in \
    pkgsrc/devel/bmake/files/make.c pkgsrc/devel/bmake/files/sigcompat.c \
    pkgsrc/devel/bmake/files/targ.c pkgsrc/devel/bmake/files/trace.c
cvs rdiff -u -r1.18 -r1.19 pkgsrc/devel/bmake/files/job.c
cvs rdiff -u -r1.11 -r1.12 pkgsrc/devel/bmake/files/machine.sh \
    pkgsrc/devel/bmake/files/os.sh
cvs rdiff -u -r1.1.1.1 -r1.2 pkgsrc/devel/bmake/files/metachar.c \
    pkgsrc/devel/bmake/files/metachar.h
cvs rdiff -u -r1.3 -r1.4 pkgsrc/devel/bmake/files/PSD.doc/Makefile
cvs rdiff -u -r1.4 -r1.5 pkgsrc/devel/bmake/files/PSD.doc/tutorial.ms
cvs rdiff -u -r1.1.1.1 -r1.2 pkgsrc/devel/bmake/files/filemon/filemon.h \
    pkgsrc/devel/bmake/files/filemon/filemon_dev.c \
    pkgsrc/devel/bmake/files/filemon/filemon_ktrace.c
cvs rdiff -u -r1.4 -r1.5 pkgsrc/devel/bmake/files/lst.lib/lstAppend.c \
    pkgsrc/devel/bmake/files/lst.lib/lstAtEnd.c \
    pkgsrc/devel/bmake/files/lst.lib/lstAtFront.c \
    pkgsrc/devel/bmake/files/lst.lib/lstConcat.c \
    pkgsrc/devel/bmake/files/lst.lib/lstDatum.c \
    pkgsrc/devel/bmake/files/lst.lib/lstDeQueue.c \
    pkgsrc/devel/bmake/files/lst.lib/lstDestroy.c \
    pkgsrc/devel/bmake/files/lst.lib/lstDupl.c \
    pkgsrc/devel/bmake/files/lst.lib/lstEnQueue.c \
    pkgsrc/devel/bmake/files/lst.lib/lstFind.c \
    pkgsrc/devel/bmake/files/lst.lib/lstFindFrom.c \
    pkgsrc/devel/bmake/files/lst.lib/lstFirst.c \
    pkgsrc/devel/bmake/files/lst.lib/lstForEach.c \
    pkgsrc/devel/bmake/files/lst.lib/lstForEachFrom.c \
    pkgsrc/devel/bmake/files/lst.lib/lstInit.c \
    pkgsrc/devel/bmake/files/lst.lib/lstInsert.c \
    pkgsrc/devel/bmake/files/lst.lib/lstIsEmpty.c \
    pkgsrc/devel/bmake/files/lst.lib/lstLast.c \
    pkgsrc/devel/bmake/files/lst.lib/lstMember.c \
    pkgsrc/devel/bmake/files/lst.lib/lstNext.c \
    pkgsrc/devel/bmake/files/lst.lib/lstOpen.c \
    pkgsrc/devel/bmake/files/lst.lib/lstRemove.c \
    pkgsrc/devel/bmake/files/lst.lib/lstReplace.c \
    pkgsrc/devel/bmake/files/lst.lib/lstSucc.c
cvs rdiff -u -r1.3 -r1.4 pkgsrc/devel/bmake/files/lst.lib/lstClose.c \
    pkgsrc/devel/bmake/files/lst.lib/lstIsAtEnd.c
cvs rdiff -u -r1.7 -r1.8 pkgsrc/devel/bmake/files/lst.lib/lstInt.h
cvs rdiff -u -r1.2 -r1.3 pkgsrc/devel/bmake/files/lst.lib/lstPrev.c
cvs rdiff -u -r1.5 -r1.6 pkgsrc/devel/bmake/files/missing/sys/cdefs.h
cvs rdiff -u -r1.1.1.1 -r1.2 pkgsrc/devel/bmake/files/mk/README \
    pkgsrc/devel/bmake/files/mk/auto.dep.mk \
    pkgsrc/devel/bmake/files/mk/auto.obj.mk \
    pkgsrc/devel/bmake/files/mk/autoconf.mk \
    pkgsrc/devel/bmake/files/mk/autodep.mk \
    pkgsrc/devel/bmake/files/mk/compiler.mk \
    pkgsrc/devel/bmake/files/mk/cython.mk pkgsrc/devel/bmake/files/mk/dep.mk \
    pkgsrc/devel/bmake/files/mk/dirdeps-options.mk \
    pkgsrc/devel/bmake/files/mk/dirdeps-targets.mk \
    pkgsrc/devel/bmake/files/mk/dirdeps.mk pkgsrc/devel/bmake/files/mk/doc.mk \
    pkgsrc/devel/bmake/files/mk/dpadd.mk pkgsrc/devel/bmake/files/mk/files.mk \
    pkgsrc/devel/bmake/files/mk/final.mk \
    pkgsrc/devel/bmake/files/mk/gendirdeps.mk \
    pkgsrc/devel/bmake/files/mk/host-target.mk \
    pkgsrc/devel/bmake/files/mk/host.libnames.mk \
    pkgsrc/devel/bmake/files/mk/inc.mk pkgsrc/devel/bmake/files/mk/init.mk \
    pkgsrc/devel/bmake/files/mk/install-mk \
    pkgsrc/devel/bmake/files/mk/install-new.mk \
    pkgsrc/devel/bmake/files/mk/java.mk \
    pkgsrc/devel/bmake/files/mk/ldorder.mk pkgsrc/devel/bmake/files/mk/lib.mk \
    pkgsrc/devel/bmake/files/mk/libnames.mk \
    pkgsrc/devel/bmake/files/mk/libs.mk pkgsrc/devel/bmake/files/mk/links.mk \
    pkgsrc/devel/bmake/files/mk/man.mk \
    pkgsrc/devel/bmake/files/mk/manifest.mk \
    pkgsrc/devel/bmake/files/mk/meta.autodep.mk \
    pkgsrc/devel/bmake/files/mk/meta.stage.mk \
    pkgsrc/devel/bmake/files/mk/meta.subdir.mk \
    pkgsrc/devel/bmake/files/mk/meta.sys.mk \
    pkgsrc/devel/bmake/files/mk/meta2deps.py \
    pkgsrc/devel/bmake/files/mk/meta2deps.sh \
    pkgsrc/devel/bmake/files/mk/mk-files.txt \
    pkgsrc/devel/bmake/files/mk/mkopt.sh pkgsrc/devel/bmake/files/mk/nls.mk \
    pkgsrc/devel/bmake/files/mk/obj.mk pkgsrc/devel/bmake/files/mk/options.mk \
    pkgsrc/devel/bmake/files/mk/own.mk pkgsrc/devel/bmake/files/mk/prlist.mk \
    pkgsrc/devel/bmake/files/mk/prog.mk pkgsrc/devel/bmake/files/mk/progs.mk \
    pkgsrc/devel/bmake/files/mk/rst2htm.mk \
    pkgsrc/devel/bmake/files/mk/scripts.mk \
    pkgsrc/devel/bmake/files/mk/srctop.mk \
    pkgsrc/devel/bmake/files/mk/stage-install.sh \
    pkgsrc/devel/bmake/files/mk/subdir.mk \
    pkgsrc/devel/bmake/files/mk/sys.clean-env.mk \
    pkgsrc/devel/bmake/files/mk/sys.debug.mk \
    pkgsrc/devel/bmake/files/mk/sys.dependfile.mk \
    pkgsrc/devel/bmake/files/mk/sys.mk \
    pkgsrc/devel/bmake/files/mk/sys.vars.mk \
    pkgsrc/devel/bmake/files/mk/target-flags.mk \
    pkgsrc/devel/bmake/files/mk/warnings.mk \
    pkgsrc/devel/bmake/files/mk/whats.mk pkgsrc/devel/bmake/files/mk/yacc.mk
cvs rdiff -u -r1.1.1.1 -r1.2 pkgsrc/devel/bmake/files/mk/sys/AIX.mk \
    pkgsrc/devel/bmake/files/mk/sys/Darwin.mk \
    pkgsrc/devel/bmake/files/mk/sys/Generic.mk \
    pkgsrc/devel/bmake/files/mk/sys/HP-UX.mk \
    pkgsrc/devel/bmake/files/mk/sys/IRIX.mk \
    pkgsrc/devel/bmake/files/mk/sys/Linux.mk \
    pkgsrc/devel/bmake/files/mk/sys/NetBSD.mk \
    pkgsrc/devel/bmake/files/mk/sys/OSF1.mk \
    pkgsrc/devel/bmake/files/mk/sys/OpenBSD.mk \
    pkgsrc/devel/bmake/files/mk/sys/SunOS.mk \
    pkgsrc/devel/bmake/files/mk/sys/UnixWare.mk
cvs rdiff -u -r1.1.1.1 -r1.2 pkgsrc/devel/bmake/files/unit-tests/Makefile \
    pkgsrc/devel/bmake/files/unit-tests/Makefile.config.in \
    pkgsrc/devel/bmake/files/unit-tests/cond-late.mk \
    pkgsrc/devel/bmake/files/unit-tests/dollar.mk \
    pkgsrc/devel/bmake/files/unit-tests/include-main.mk \
    pkgsrc/devel/bmake/files/unit-tests/include-sub.mk \
    pkgsrc/devel/bmake/files/unit-tests/include-subsub.mk \
    pkgsrc/devel/bmake/files/unit-tests/varmod-edge.mk \
    pkgsrc/devel/bmake/files/unit-tests/varquote.mk
cvs rdiff -u -r1.2 -r1.3 pkgsrc/devel/bmake/files/unit-tests/cond1.mk \
    pkgsrc/devel/bmake/files/unit-tests/cond2.mk \
    pkgsrc/devel/bmake/files/unit-tests/doterror.mk \
    pkgsrc/devel/bmake/files/unit-tests/dotwait.mk \
    pkgsrc/devel/bmake/files/unit-tests/error.mk \
    pkgsrc/devel/bmake/files/unit-tests/escape.mk \
    pkgsrc/devel/bmake/files/unit-tests/export-all.mk \
    pkgsrc/devel/bmake/files/unit-tests/export-env.mk \
    pkgsrc/devel/bmake/files/unit-tests/export.mk \
    pkgsrc/devel/bmake/files/unit-tests/forloop.mk \
    pkgsrc/devel/bmake/files/unit-tests/forsubst.mk \
    pkgsrc/devel/bmake/files/unit-tests/impsrc.mk \
    pkgsrc/devel/bmake/files/unit-tests/misc.mk \
    pkgsrc/devel/bmake/files/unit-tests/moderrs.mk \
    pkgsrc/devel/bmake/files/unit-tests/modmisc.mk \
    pkgsrc/devel/bmake/files/unit-tests/modorder.mk \
    pkgsrc/devel/bmake/files/unit-tests/modword.mk \
    pkgsrc/devel/bmake/files/unit-tests/order.mk \
    pkgsrc/devel/bmake/files/unit-tests/phony-end.mk \
    pkgsrc/devel/bmake/files/unit-tests/posix.mk \
    pkgsrc/devel/bmake/files/unit-tests/posix1.mk \
    pkgsrc/devel/bmake/files/unit-tests/qequals.mk \
    pkgsrc/devel/bmake/files/unit-tests/suffixes.mk \
    pkgsrc/devel/bmake/files/unit-tests/sysv.mk \
    pkgsrc/devel/bmake/files/unit-tests/unexport-env.mk \
    pkgsrc/devel/bmake/files/unit-tests/unexport.mk \
    pkgsrc/devel/bmake/files/unit-tests/varcmd.mk \
    pkgsrc/devel/bmake/files/unit-tests/varmisc.mk \
    pkgsrc/devel/bmake/files/unit-tests/varshell.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/devel/bmake/Makefile
diff -u pkgsrc/devel/bmake/Makefile:1.73 pkgsrc/devel/bmake/Makefile:1.74
--- pkgsrc/devel/bmake/Makefile:1.73    Thu Feb 25 12:12:47 2016
+++ pkgsrc/devel/bmake/Makefile Sun May 24 11:09:43 2020
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.73 2016/02/25 12:12:47 jperkin Exp $
+# $NetBSD: Makefile,v 1.74 2020/05/24 11:09:43 nia Exp $
 
-DISTNAME=      bmake-20150505
+DISTNAME=      bmake-20200517
 CATEGORIES=    devel
 MASTER_SITES=  # empty
 DISTFILES=     # empty

Index: pkgsrc/devel/bmake/files/ChangeLog
diff -u pkgsrc/devel/bmake/files/ChangeLog:1.12 pkgsrc/devel/bmake/files/ChangeLog:1.13
--- pkgsrc/devel/bmake/files/ChangeLog:1.12     Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/ChangeLog  Sun May 24 11:09:43 2020
@@ -1,3 +1,633 @@
+2020-05-17  Simon J Gerraty  <sjg%beast.crufty.net@localhost>
+
+       * VERSION (_MAKE_VERSION): 20200517
+       Merge with NetBSD make, pick up
+       o modified dollar tests to avoid shell dependencies
+       o new tests for .INCLUDEFROM
+
+2020-05-16  Simon J Gerraty  <sjg%beast.crufty.net@localhost>
+
+       * unit-tests/dollar.mk: tweak  '1 dollar literal' test
+       to not depend so much on shell behavior
+
+2020-05-10  Simon J Gerraty  <sjg%beast.crufty.net@localhost>
+
+       * VERSION (_MAKE_VERSION): 20200510
+       Merge with NetBSD make, pick up
+       o unit test for dollar handling
+
+2020-05-06  Simon J Gerraty  <sjg%beast.crufty.net@localhost>
+
+       * VERSION (_MAKE_VERSION): 20200506
+       Merge with NetBSD make, pick up
+       o str.c: empty string does not match % pattern
+         plus unit-test changes
+
+2020-05-04  Simon J Gerraty  <sjg%beast.crufty.net@localhost>
+
+       * VERSION (_MAKE_VERSION): 20200504
+       May the 4th be with you
+       Merge with NetBSD make, pick up
+       o var.c: import handling of old sysV style modifier using '%'
+       o str.c: refactor brk_string
+       o unit-tests: add test case for lazy conditions
+
+2020-04-18  Simon J Gerraty  <sjg%beast.crufty.net@localhost>
+
+       * VERSION (_MAKE_VERSION): 20200418
+
+       * configure.in: use_makefile=no for cygwin et al.
+       case insensitive filesystems just don't work if both
+       makefile and Makefile exist.
+       NOTE: bmake does not support cygwin and likely never will,
+       but if brave souls want to try it - help them out.
+
+2020-04-02  Simon J Gerraty  <sjg%beast.crufty.net@localhost>
+
+       * VERSION (_MAKE_VERSION): 20200402
+       Merge with NetBSD make, pick up
+       o meta.c: meta_oodate, CHECK_VALID_META is too aggressive for CMD
+         a blank command is perfectly valid.
+
+2020-03-30  Simon J Gerraty  <sjg%beast.crufty.net@localhost>
+
+       * VERSION (_MAKE_VERSION): 20200330
+       Merge with NetBSD make, pick up
+       o make.h: extern debug_file
+
+2020-03-18  Simon J Gerraty  <sjg%beast.crufty.net@localhost>
+
+       * VERSION (_MAKE_VERSION): 20200318
+       Merge with NetBSD make, pick up
+       o meta.c: meta_oodate, check for corrupted meta file
+         earlier and more often.
+
+2020-02-20  Simon J Gerraty  <sjg%beast.crufty.net@localhost>
+
+       * VERSION (_MAKE_VERSION): 20200220
+
+2020-02-19  Simon J Gerraty  <sjg%beast.crufty.net@localhost>
+
+       * boot-strap: unset MAKEFLAGS
+
+2020-02-12  Simon J Gerraty  <sjg%beast.crufty.net@localhost>
+
+       * VERSION (_MAKE_VERSION): 20200212
+       * meta.c: meta_compat_parent check for USE_FILEMON
+         patch from Soeren Tempel
+
+2020-02-05  Simon J Gerraty  <sjg%beast.crufty.net@localhost>
+
+       * VERSION: 20200205
+       Merge with NetBSD make, pick up
+       o meta.c: fix compat mode, need to call meta_job_output()
+       o job.c: extra fds for meta mode not needed if using filemon_dev
+
+2020-01-22  Simon J Gerraty  <sjg%beast.crufty.net@localhost>
+
+       * VERSION: 20200122
+       Merge with NetBSD make, pick up
+       o meta.c: avoid passing NULL to filemon_*() when meta_needed()
+         returns FALSE.
+
+2020-01-21  Simon J Gerraty  <sjg%beast.crufty.net@localhost>
+
+       * VERSION: 20200121
+       Merge with NetBSD make, pick up
+       o filemon/filemon_{dev,ktrace}.c: allow selection of
+         filemon implementation.  filemon_dev.c uses the kernel module
+         while filemon_ktrace.c leverages the fktrace api available in
+         NetBSD.  filemon_ktrace.c can hopefully form the basis for
+         adding support for other tracing mechanisms such as strace on
+         Linux.
+       o meta.c: when target is out-of-date per normal make rules
+         record value of .OODATE in meta file.
+
+2019-09-26  Simon J Gerraty  <sjg%beast.crufty.net@localhost>
+
+       * VERSION: 20190926
+         Merge with NetBSD make, pick up
+         o parse.c: don't pass NULL to realpath(3)
+           some versions cannot handle it.
+
+2019-04-09  Simon J Gerraty  <sjg%beast.crufty.net@localhost>
+
+       * VERSION: 20190409
+         Merge with NetBSD make, pick up
+         o parse.c: ParseDoDependency: free paths rather than assert
+
+2018-12-22  Simon J Gerraty  <sjg%beast.crufty.net@localhost>
+
+       * VERSION: 20181222
+
+       * configure.in: add --without-makefile to avoid generating
+         makefile and make-bootstrap.sh
+
+       * include Makefile.inc if it exists
+
+       * Use Makefile and Makefile.config.in in unit-tests
+         so we can use just: make obj && make && make test
+         when bmake is already available.
+         We add --without-makefile to CONFIGURE_ARGS in this case.
+
+       * tweak bsd.after-import.mk (captures Makefile.config etc
+         after import to FreeBSD for example) to cope with all the above. 
+
+2018-12-21  Simon J Gerraty  <sjg%beast.crufty.net@localhost>
+
+       * VERSION: 20181221
+         Merge with NetBSD make, pick up
+         o parse.c: ParseVErrorInternal use .PARSEDIR
+           and apply if relative, and then use .PARSEFILE
+           for consistent result.
+
+2018-12-20  Simon J Gerraty  <sjg%beast.crufty.net@localhost>
+
+       * VERSION: 20181220
+         Merge with NetBSD make, pick up
+         o parse.c: ParseVErrorInternal use .CURDIR if .PARSEDIR
+           is relative
+         o var.c: avoid SEGFAULT in .unexport-env
+           when MAKELEVEL is not set
+
+2018-12-16  Simon J Gerraty  <sjg%beast.crufty.net@localhost>
+
+       * VERSION: 20181216
+         Merge with NetBSD make, pick up
+         o fix for unit-tests/varquote.mk on Debian
+
+2018-09-21  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * VERSION: 20180919
+         Merge with NetBSD make, pick up
+         o var.c: add :q
+         o dir.c: cleanup caching of stats
+
+2018-09-21  Simon J Gerraty  <sjg%beast.crufty.net@localhost>
+
+       * Makefile.config.in: use += where it makes sense.
+
+2018-05-12  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * VERSION: 20180512
+         Merge with NetBSD make, pick up
+         o job.c: skip polling job token pipe
+
+2018-04-05  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * VERSION: 20180405
+         Merge with NetBSD make, pick up
+         o parse.c: be more cautious about detecting depenency line
+           rather than sysV style include.
+
+2018-02-22  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * VERSION: 20180222
+         Merge with NetBSD make, pick up
+         o parse.c: avoid calling sysconf for every call to loadfile
+
+2018-02-18  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * VERSION: 20180218
+         Merge with NetBSD make, pick up
+         o var.c: Var_Set handle NULL value anytime.
+
+2018-02-12  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * VERSION: 20180212
+         Merge with NetBSD make, pick up
+         o parse.c: do not treat .info as warning with -W
+
+2017-12-07  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * VERSION: 20171207
+         Merge with NetBSD make, pick up
+         o var.c: Var_Append use Var_Set if var not previously set
+           so that VAR_CMD is handled correctly.
+           Add a suitable unit-test.
+
+2017-11-26  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * VERSION (_MAKE_VERSION): 20171126
+
+       * aclocal.m4: use AC_LINK_IFELSE for AC_C___ATTRIBUTE__
+         since AC_TRY_COMPILE puts input inside main()
+         which upsets modern compilers.
+
+2017-11-18  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * VERSION: 20171118
+         Merge with NetBSD make, pick up
+         o var.c: do not append to variable set on command line
+           add unit-test to catch this.
+
+2017-10-28  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * VERSION: 20171028
+         Merge with NetBSD make, pick up
+         o main.c: ignore empty MAKEOBJDIR
+
+       * Makefile.config.in:
+         make @prefix@ @machine*@ and @default_sys_path@ defaults.
+
+2017-10-05  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * VERSION: 20171005
+
+       * unit-tests/dotwait.mk: redirect stderr through pipe for more
+         consistent result on some platforms.
+
+2017-08-13  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * machine.sh: entry for AIX
+
+2017-08-12  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * VERSION (_MAKE_VERSION): Move the setting of _MAKE_VERSION
+         to a file that can be included by configure as well as make.
+         This allows configure to set set _MAKE_VERSION in make-bootstrap.sh
+
+2017-08-10  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20170810
+         Merge with NetBSD make, pick up
+         o meta.c: if target is in subdir we only need subdir name in
+           meta_name.
+
+2017-07-20  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20170720
+         Merge with NetBSD make, pick up
+         o compat.c: pass SIGINT etc onto child and wait for it to exit
+           before we self-terminate.
+
+2017-07-11  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20170711
+         forgot to update after merge on 20170708 ;-)
+         o main.c: refactor to reduce size of main function.
+           add -v option to always fully expand values.
+         o meta.c: ensure command output in meta file has ending newline
+           even when filemon not being used.
+           When matching ${.MAKE.META.IGNORE_PATTERNS} do not use
+           pathname via ':L' since any ':' in pathname breaks that.
+           Instead set a '${.p.}' to pathname in the target context and
+           use that.
+
+2017-05-10  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20170510
+         Merge with NetBSD make, pick up
+         o main.c: Main_SetObjdir: ensure buf2 is in scope
+
+2017-05-08  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20170505
+         see mk/ChangeLog
+
+2017-05-05  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * parse.c: not everyone has stdint.h
+
+2017-05-01  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20170501
+         see mk/ChangeLog
+
+2017-04-21  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20170421
+         Merge with NetBSD make, pick up
+         o str.c: Str_Match: fix closure tests for [^] and add unit-test.
+
+2017-04-20  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20170420
+         Merge with NetBSD make, pick up
+         o main.c: only use -C arg "as is" if it contains no 
+           relative component.
+
+2017-04-18  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20170418
+         Merge with NetBSD make, pick up
+         o main.c: fix Main_SetObjdir() for relative paths (eg obj).
+
+2017-04-17  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20170417
+         Merge with NetBSD make, pick up
+         o fixes a number of coverity complaints
+           - check return value of fseek, fcntl
+           - plug memory leak in Dir_FindFile, Var_LoopExpand,
+             JobPrintCommand, ParseTraditionalInclude
+           - use bmake_malloc() where NULL is not tollerated
+           - use MAKE_ATTR_UNUSED rather that kludges like 
+             return(unused ? 0 : 0)
+           - use purge_cached_realpaths() rather than abuse cached_realpath()
+
+2017-04-13  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20170413
+         Merge with NetBSD make, pick up
+         o main.c: when setting .OBJDIR ignore '$' in paths.
+
+       * job.c: use MALLOC_OPTIONS to set malloc_options.
+
+2017-04-11  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20170411
+         Merge with NetBSD make, pick up
+         o str.c: Str_Match: allow [^a-z] to behave as expected.
+
+2017-03-26  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20170326
+         Merge with NetBSD make, pick up
+         o main.c: purge relative paths from realpath cache when .OBJDIR
+           is changed.
+
+2017-03-11  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20170311
+         Merge with NetBSD make, pick up
+          o main.c: only use -C arg "as is" if it starts with '/'.
+
+2017-03-01  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20170301
+         Merge with NetBSD make, pick up
+         o main.c: use -C arg "as is" rather than getcwd()
+           if they identify the same directory.
+         o parse.c: ensure loadfile buffer is \n terminated in non-mmap case
+
+2017-02-01  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20170201
+         Merge with NetBSD make, pick up
+         o var.c: allow :_=var and avoid use of special context.
+
+2017-01-30  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20170130
+         Merge with NetBSD make, pick up
+         o var.c: add :range and :_
+         o main.c: partially initialize Dir_* before MainParseArgs()
+           can be called.
+           If -V, skip Main_ExportMAKEFLAGS()
+
+2017-01-14  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20170114
+         Merge with NetBSD make, pick up
+         o var.c: allow specifying the utc value used by :{gm,local}time
+
+2016-12-12  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20161212
+         Merge with NetBSD make, pick up
+          o main.c: look for obj.${MACHINE}-${MACHINE_ARCH} too.
+
+2016-12-09  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20161209
+         Merge with NetBSD make, pick up
+         o main.c: cleanup setting of .OBJDIR
+         o parse.c: avoid coredump from (var)=val
+
+2016-11-26  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20161126
+         Merge with NetBSD make, pick up
+         o make.c: Make_OODate: report src node name if path not set
+
+2016-09-26  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20160926
+         Merge with NetBSD make, pick up
+         o support for .DELETE_ON_ERROR: (remove targets that fail)
+       
+2016-09-26  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile MAN: tweak .Dt to match ${PROG}
+
+2016-08-18  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20160818
+         its a neater number; pick up whitespace fixes to man page.
+
+2016-08-17  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20160817
+         Merge with NetBSD make, pick up
+         o meta.c: move handling of .MAKE.META.IGNORE_* to meta_ignore()
+           so we can call it before adding entries to missingFiles.
+           Thus we do not track files we have been told to ignore.
+
+2016-08-15  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20160815
+         Merge with NetBSD make, pick up
+         o meta_oodate: apply .MAKE.META.IGNORE_FILTER (if defined) to
+           pathnames, and skip if the expansion is empty.
+           Useful for dirdeps.mk when checking DIRDEPS_CACHE.
+
+2016-08-12  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20160812
+         Merge with NetBSD make, pick up
+         o meta.c: remove all missingFiles entries that match a deleted
+           dir.
+         o main.c: set .ERROR_CMD if possible.
+         
+2016-06-06  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20160606
+         Merge with NetBSD make, pick up
+         o dir.c: extend mtimes cache to others via cached_stat()
+
+2016-06-04  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20160604
+         Merge with NetBSD make, pick up
+         o meta.c: missing filemon data is only relevant if we read a
+           meta file.
+           Also do not return oodate for a missing metafile if gn->path
+           points to .CURDIR
+       
+2016-06-02  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20160602
+         Merge with NetBSD make, pick up
+         o cached_realpath(): avoid hitting filesystem more than necessary.
+         o meta.c: refactor need_meta decision, add knobs for 
+           missing meta file and filemon data wrt out-of-datedness.
+
+2016-05-28  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20160528
+
+       * boot-strap, make-bootstrap.sh.in: Makefile now uses _MAKE_VERSION 
+
+2016-05-12  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20160512
+         Merge with NetBSD make, pick up
+         o meta.c: ignore paths that match .MAKE.META.IGNORE_PATTERNS
+           this is useful for gcov builds.
+         o propagate errors from filemon(4).
+       
+2016-05-09  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20160509
+         Merge with NetBSD make, pick up
+         o remove use of non-standard types u_int etc.
+         o meta.c: apply realpath() before matching against metaIgnorePaths
+
+2016-04-04  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20160404
+         Merge with NetBSD make, pick up
+         o allow makefile to set .MAKE.JOBS
+
+       * Makefile (PROG_NAME): use ${_MAKE_VERSION}
+
+2016-03-15  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): 20160315
+         Merge with NetBSD make, pick up
+         o fix handling of archive members
+
+2016-03-13  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (_MAKE_VERSION): rename variable to avoid interference
+         with checks for ${MAKE_VERSION}
+
+2016-03-10  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (MAKE_VERSION): 20160310
+         Merge with NetBSD make, pick up
+         o meta.c: treat missing Read file same as Write, incase we Delete it.
+
+2016-03-07  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (MAKE_VERSION): 20160307
+         Merge with NetBSD make, pick up
+         o var.c: fix :ts\nnn to be octal by default.
+         o meta.c: meta_finish() to cleanup memory.
+
+2016-02-26  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (MAKE_VERSION): 20160226
+         Merge with NetBSD make, pick up
+         o meta.c: allow meta file for makeDepend if makefiles want it.
+
+2016-02-19  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * var.c: default .MAKE.SAVE_DOLLARS to FALSE
+         for backwards compatability.
+
+       * Makefile (MAKE_VERSION): 20160220
+         Merge with NetBSD make, pick up
+         o var.c: add knob to control handling of '$$' in :=
+
+2016-02-18  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (MAKE_VERSION): 20160218
+         Merge with NetBSD make, pick up
+         o var.c: add .export-literal allows us to fix sys.clean-env.mk
+           post the changes to Var_Subst.
+           Var_Subst now takes flags, and does not consume '$$' in :=
+
+2016-02-17  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (MAKE_VERSION): 20160217
+         Merge with NetBSD make, pick up
+         o var.c: preserve '$$' in :=
+         o parse.c: add .dinclude for handling included 
+           makefile like .depend
+
+2015-12-20  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (MAKE_VERSION): 20151220
+         Merge with NetBSD make, pick up
+         o suff.c: re-initialize suffNull when clearing suffixes.
+
+2015-12-01  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (MAKE_VERSION): 20151201
+         Merge with NetBSD make, pick up
+         o cond.c: CondCvtArg: avoid access beyond end of empty buffer.
+         o meta.c: meta_oodate: use lstat(2) for checking link target
+           in case it is a symlink.
+         o var.c: avoid calling brk_string and Var_Export1 with empty
+           strings.
+       
+2015-11-26  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (MAKE_VERSION): 20151126
+         Merge with NetBSD make, pick up
+         o parse.c: ParseTrackInput don't access beyond 
+           end of old value.
+       
+2015-10-22  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (MAKE_VERSION): 20151022
+
+       * Add support for BSD/OS which lacks inttypes.h
+         and really needs sys/param.h for sys/sysctl.h
+         also 'type' is not a shell builtin.
+
+       * var.c: eliminate uint32_t and need for inttypes.h
+       
+       * main.c: PrintOnError flush stdout before run .ERROR
+
+       * parse.c: cope with _SC_PAGESIZE not being defined.
+
+       
+2015-10-20  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (MAKE_VERSION): 20151020
+         Merge with NetBSD make, pick up
+         o var.c: fix uninitialized var 
+
+2015-10-12  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * var.c: the conditional expressions used with ':?' can be
+       expensive, if already discarding do not evaluate or expand
+       anything. 
+
+2015-10-10  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (MAKE_VERSION): 20151010
+         Merge with NetBSD make, pick up
+         o Add Boolean wantit flag to Var_Subst and Var_Parse
+           when FALSE we know we are discarding the result and can
+           skip operations like Cmd_Exec.
+
+2015-10-09  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (MAKE_VERSION): 20151009
+         Merge with NetBSD make, pick up
+         o var.c: don't check for NULL before free()
+         o meta.c: meta_oodate, do not hard code ignore of makeDependfile
+
+2015-09-10  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (MAKE_VERSION): 20150910
+         Merge with NetBSD make, pick up
+         o main.c: with -w print Enter/Leaving messages for objdir too
+           if necessary.
+         o centralize shell metachar handling
+       
+       * FILES: add metachar.[ch]
+
+2015-06-06  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
+
+       * Makefile (MAKE_VERSION): 20150606
+         Merge with NetBSD make, pick up
+         o make.1: document .OBJDIR target
+
 2015-05-05  Simon J. Gerraty  <sjg%bad.crufty.net@localhost>
 
        * Makefile (MAKE_VERSION): 20150505
Index: pkgsrc/devel/bmake/files/boot-strap
diff -u pkgsrc/devel/bmake/files/boot-strap:1.12 pkgsrc/devel/bmake/files/boot-strap:1.13
--- pkgsrc/devel/bmake/files/boot-strap:1.12    Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/boot-strap Sun May 24 11:09:43 2020
@@ -89,6 +89,10 @@
 #              disable use of filemon(9) which is currently only
 #              available for NetBSD and FreeBSD.
 #
+#      --with-filemon=ktrace
+#              on NetBSD or others with fktrace(2), use ktrace
+#              version of filemon.
+#
 #      --with-filemon="path/to/filemon.h"
 #              enables use of filemon(9) by meta mode.
 #              
@@ -111,7 +115,7 @@
 #      Simon J. Gerraty <sjg%crufty.net@localhost>
 
 # RCSid:
-#      $Id: boot-strap,v 1.12 2015/05/19 22:01:19 joerg Exp $
+#      $Id: boot-strap,v 1.13 2020/05/24 11:09:43 nia Exp $
 #
 #      @(#) Copyright (c) 2001 Simon J. Gerraty
 #
@@ -161,6 +165,8 @@ cmd_args="$@"
 
 # clear some things from the environment that we care about
 unset MAKEOBJDIR MAKEOBJDIRPREFIX
+# or that might be incompatible
+unset MAKE MAKEFLAGS
 
 # --install[-host-target] will set this
 INSTALL_PREFIX=
@@ -395,8 +401,15 @@ Bmake() {
     )
 }
 
+# there is actually a shell where type is not a builtin
+# if type is missing, which(1) had better exists!
+if (type cat) > /dev/null 2>&1; then
+which() {
+        type "$@" | sed 's,[()],,g;s,^[^/][^/]*,,;q'
+}
+fi
 # make sure test below uses the same diff that configure did
-TOOL_DIFF=`type diff | sed 's,[()],,g;s,^[^/][^/]*,,;q'`
+TOOL_DIFF=`which diff`
 export TOOL_DIFF
 
 op_configure() {
@@ -444,7 +457,7 @@ op_all() {
                op_install
        else
                op_test
-               MAKE_VERSION=`sed -n '/^MAKE_VERSION/ { s,.*=  *,,;p; }' $srcdir/Makefile`
+               MAKE_VERSION=`sed -n '/^_MAKE_VERSION/ { s,.*=  *,,;p; }' $srcdir/Makefile`
                echo You can install by running:
                echo
                echo $0 $cmd_args op=install

Index: pkgsrc/devel/bmake/files/FILES
diff -u pkgsrc/devel/bmake/files/FILES:1.8 pkgsrc/devel/bmake/files/FILES:1.9
--- pkgsrc/devel/bmake/files/FILES:1.8  Tue Aug 15 15:54:06 2017
+++ pkgsrc/devel/bmake/files/FILES      Sun May 24 11:09:43 2020
@@ -22,6 +22,9 @@ configure.in
 dir.c
 dir.h
 dirname.c
+filemon/filemon.h
+filemon/filemon_dev.c
+filemon/filemon_ktrace.c
 find_lib.sh
 for.c
 getopt.c
@@ -72,6 +75,8 @@ make_malloc.h
 makefile.in
 meta.c
 meta.h
+metachar.c
+metachar.h
 missing/sys/cdefs.h
 mkdeps.sh
 nonints.h
@@ -92,13 +97,18 @@ suff.c
 targ.c
 trace.c
 trace.h
-unit-tests/Makefile.in
+unit-tests/Makefile
+unit-tests/Makefile.config.in
 unit-tests/comment.exp
 unit-tests/comment.mk
 unit-tests/cond1.exp
 unit-tests/cond1.mk
 unit-tests/cond2.exp
 unit-tests/cond2.mk
+unit-tests/cond-late.mk
+unit-tests/cond-late.exp
+unit-tests/dollar.exp
+unit-tests/dollar.mk
 unit-tests/doterror.exp
 unit-tests/doterror.mk
 unit-tests/dotwait.exp
@@ -121,6 +131,10 @@ unit-tests/hash.exp
 unit-tests/hash.mk
 unit-tests/impsrc.exp
 unit-tests/impsrc.mk
+unit-tests/include-main.exp
+unit-tests/include-main.mk
+unit-tests/include-sub.mk
+unit-tests/include-subsub.mk
 unit-tests/misc.exp
 unit-tests/misc.mk
 unit-tests/moderrs.exp
@@ -161,6 +175,10 @@ unit-tests/varcmd.exp
 unit-tests/varcmd.mk
 unit-tests/varmisc.exp
 unit-tests/varmisc.mk
+unit-tests/varmod-edge.exp
+unit-tests/varmod-edge.mk
+unit-tests/varquote.exp
+unit-tests/varquote.mk
 unit-tests/varshell.exp
 unit-tests/varshell.mk
 util.c
Index: pkgsrc/devel/bmake/files/cond.c
diff -u pkgsrc/devel/bmake/files/cond.c:1.8 pkgsrc/devel/bmake/files/cond.c:1.9
--- pkgsrc/devel/bmake/files/cond.c:1.8 Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/cond.c     Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.8 2015/05/19 22:01:19 joerg Exp $   */
+/*     $NetBSD: cond.c,v 1.9 2020/05/24 11:09:43 nia 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.8 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: cond.c,v 1.9 2020/05/24 11:09:43 nia 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.8 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: cond.c,v 1.9 2020/05/24 11:09:43 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -91,6 +91,7 @@ __RCSID("$NetBSD: cond.c,v 1.8 2015/05/1
  *
  */
 
+#include    <assert.h>
 #include    <ctype.h>
 #include    <errno.h>    /* For strtoul() error checking */
 
@@ -289,10 +290,10 @@ CondGetArg(char **linePtr, char **argPtr
            int         len;
            void        *freeIt;
 
-           cp2 = Var_Parse(cp, VAR_CMD, TRUE, &len, &freeIt);
+           cp2 = Var_Parse(cp, VAR_CMD, VARF_UNDEFERR|VARF_WANTRES,
+                           &len, &freeIt);
            Buf_AddBytes(&buf, strlen(cp2), cp2);
-           if (freeIt)
-               free(freeIt);
+           free(freeIt);
            cp += len;
            continue;
        }
@@ -346,8 +347,8 @@ CondDoDefined(int argLen MAKE_ATTR_UNUSE
     } else {
        result = FALSE;
     }
-    if (p1)
-       free(p1);
+
+    free(p1);
     return (result);
 }
 
@@ -490,6 +491,10 @@ CondCvtArg(char *str, double *value)
     double d_val;
 
     errno = 0;
+    if (!*str) {
+       *value = (double)0;
+       return TRUE;
+    }
     l_val = strtoul(str, &eptr, str[1] == 'x' ? 16 : 10);
     ech = *eptr;
     if (ech == 0 && errno != ERANGE) {
@@ -570,8 +575,9 @@ CondGetString(Boolean doEval, Boolean *q
            break;
        case '$':
            /* if we are in quotes, then an undefined variable is ok */
-           str = Var_Parse(condExpr, VAR_CMD, (qt ? 0 : doEval),
-                           &len, freeIt);
+           str = Var_Parse(condExpr, VAR_CMD,
+                           ((!qt && doEval) ? VARF_UNDEFERR : 0) |
+                           VARF_WANTRES, &len, freeIt);
            if (str == var_Error) {
                if (*freeIt) {
                    free(*freeIt);
@@ -801,10 +807,8 @@ do_string_compare:
     }
 
 done:
-    if (lhsFree)
-       free(lhsFree);
-    if (rhsFree)
-       free(rhsFree);
+    free(lhsFree);
+    free(rhsFree);
     return t;
 }
 
@@ -823,7 +827,7 @@ get_mpt_arg(char **linePtr, char **argPt
     /* We do all the work here and return the result as the length */
     *argPtr = NULL;
 
-    val = Var_Parse(cp - 1, VAR_CMD, FALSE, &length, &freeIt);
+    val = Var_Parse(cp - 1, VAR_CMD, VARF_WANTRES, &length, &freeIt);
     /*
      * Advance *linePtr to beyond the closing ). Note that
      * we subtract one because 'length' is calculated from 'cp - 1'.
@@ -844,8 +848,7 @@ get_mpt_arg(char **linePtr, char **argPt
      * true/false here.
      */
     length = *val ? 2 : 1;
-    if (freeIt)
-       free(freeIt);
+    free(freeIt);
     return length;
 }
 
@@ -896,8 +899,7 @@ compare_function(Boolean doEval)
        }
        /* Evaluate the argument using the required function. */
        t = !doEval || fn_def->fn_proc(arglen, arg);
-       if (arg)
-           free(arg);
+       free(arg);
        condExpr = cp;
        return t;
     }
@@ -929,8 +931,7 @@ compare_function(Boolean doEval)
      * be empty - even if it contained a variable expansion.
      */
     t = !doEval || if_info->defProc(arglen, arg) != if_info->doNot;
-    if (arg)
-       free(arg);
+    free(arg);
     return t;
 }
 
@@ -1174,8 +1175,9 @@ Cond_EvalExpression(const struct If *inf
                break;
        dflt_info = info;
     }
+    assert(info != NULL);
 
-    if_info = info != NULL ? info : ifs + 4;
+    if_info = info;
     condExpr = line;
     condPushBack = TOK_NONE;
 
Index: pkgsrc/devel/bmake/files/job.h
diff -u pkgsrc/devel/bmake/files/job.h:1.8 pkgsrc/devel/bmake/files/job.h:1.9
--- pkgsrc/devel/bmake/files/job.h:1.8  Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/job.h      Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.h,v 1.8 2015/05/19 22:01:19 joerg Exp $    */
+/*     $NetBSD: job.h,v 1.9 2020/05/24 11:09:43 nia Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
Index: pkgsrc/devel/bmake/files/nonints.h
diff -u pkgsrc/devel/bmake/files/nonints.h:1.8 pkgsrc/devel/bmake/files/nonints.h:1.9
--- pkgsrc/devel/bmake/files/nonints.h:1.8      Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/nonints.h  Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: nonints.h,v 1.8 2015/05/19 22:01:19 joerg Exp $        */
+/*     $NetBSD: nonints.h,v 1.9 2020/05/24 11:09:43 nia Exp $  */
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,6 @@ void JobReapChild(pid_t, WAIT_T, Boolean
 /* main.c */
 void Main_ParseArgLine(const char *);
 void MakeMode(const char *);
-int main(int, char **);
 char *Cmd_Exec(const char *, const char **);
 void Error(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2);
 void Fatal(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD;
@@ -120,7 +119,9 @@ void Finish(int) MAKE_ATTR_DEAD;
 int eunlink(const char *);
 void execError(const char *, const char *);
 char *getTmpdir(void);
+Boolean s2Boolean(const char *, Boolean);
 Boolean getBoolean(const char *, Boolean);
+char *cached_realpath(const char *, char *);
 
 /* parse.c */
 void Parse_Error(int, const char *, ...) MAKE_ATTR_PRINTFLIKE(2, 3);
@@ -139,8 +140,13 @@ char *str_concat(const char *, const cha
 char **brk_string(const char *, int *, Boolean, char **);
 char *Str_FindSubstring(const char *, const char *);
 int Str_Match(const char *, const char *);
-char *Str_SYSVMatch(const char *, const char *, int *len);
-void Str_SYSVSubst(Buffer *, char *, char *, int);
+char *Str_SYSVMatch(const char *, const char *, size_t *, Boolean *);
+void Str_SYSVSubst(Buffer *, char *, char *, size_t, Boolean);
+
+#ifndef HAVE_STRLCPY
+/* strlcpy.c */
+size_t strlcpy(char *, const char *, size_t);
+#endif
 
 /* suff.c */
 void Suff_ClearSuffixes(void);
@@ -184,8 +190,8 @@ void Var_Set(const char *, const char *,
 void Var_Append(const char *, const char *, GNode *);
 Boolean Var_Exists(const char *, GNode *);
 char *Var_Value(const char *, GNode *, char **);
-char *Var_Parse(const char *, GNode *, Boolean, int *, void **);
-char *Var_Subst(const char *, const char *, GNode *, Boolean);
+char *Var_Parse(const char *, GNode *, int, int *, void **);
+char *Var_Subst(const char *, const char *, GNode *, int);
 char *Var_GetTail(const char *);
 char *Var_GetHead(const char *);
 void Var_Init(void);

Index: pkgsrc/devel/bmake/files/Makefile
diff -u pkgsrc/devel/bmake/files/Makefile:1.3 pkgsrc/devel/bmake/files/Makefile:1.4
--- pkgsrc/devel/bmake/files/Makefile:1.3       Tue Aug 15 15:54:06 2017
+++ pkgsrc/devel/bmake/files/Makefile   Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-#      $Id: Makefile,v 1.3 2017/08/15 15:54:06 brook Exp $
+#      $Id: Makefile,v 1.4 2020/05/24 11:09:43 nia Exp $
 
 PROG=  bmake
 
@@ -15,6 +15,7 @@ SRCS= \
        make.c \
        make_malloc.c \
        meta.c \
+       metachar.c \
        parse.c \
        str.c \
        strlist.c \
@@ -55,6 +56,7 @@ SRCS+= \
        lstSucc.c
 
 .-include "VERSION"
+.-include "Makefile.inc"
 
 # this file gets generated by configure
 .-include "Makefile.config"
@@ -74,13 +76,25 @@ 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}\""
+COPTS.main.c+= "-DMAKE_VERSION=\"${_MAKE_VERSION}\""
 
-# meta mode can be useful even without filemon 
+# meta mode can be useful even without filemon
+# should be set by now
+USE_FILEMON ?= no
+.if ${USE_FILEMON:tl} != "no"
+.PATH: ${.CURDIR}/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.meta.c += -DHAVE_FILEMON_H -I${FILEMON_H:H}
+COPTS.filemon_dev.c += -DHAVE_FILEMON_H -I${FILEMON_H:H}
 .endif
+.endif                         # USE_FILEMON == dev
+
+.endif                         # USE_FILEMON
 
 .PATH: ${srcdir}
 .PATH: ${srcdir}/lst.lib
@@ -129,9 +143,9 @@ OPTIONS_DEFAULT_NO+= \
 .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}-${MAKE_VERSION} ${BINDIR}/${PROG}
+SYMLINKS+= ${PROG_NAME} ${BINDIR}/${PROG}
 .endif
 .endif
 
@@ -154,7 +168,10 @@ my.history: ${MAKEFILE}
 .NOPATH: ${MAN}
 ${MAN}:        make.1 my.history
        @echo making $@
-       @sed -e 's/^.Nx/NetBSD/' -e '/^.Nm/s/make/${PROG}/' \
+       @sed \
+       -e '/^.Dt/s/MAKE/${PROG:tu}/' \
+       -e 's/^.Nx/NetBSD/' \
+       -e '/^.Nm/s/make/${PROG}/' \
        -e '/^.Sh HISTORY/rmy.history' \
        -e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1 > $@
 
@@ -187,11 +204,15 @@ MANDIR= ${MANDIR.bmake:U${SHAREDIR}/man}
 ${OBJS}: config.h
 .endif
 
+# start-delete2 for bsd.after-import.mk
+
 # make sure that MAKE_VERSION gets updated.
-main.o: ${SRCS} ${MAKEFILE}
+main.o: ${SRCS} ${.CURDIR}/VERSION
 
-# start-delete2 for bsd.after-import.mk
 .if ${MK_AUTOCONF_MK} == "yes"
+CONFIGURE_DEPS += ${.CURDIR}/VERSION
+# we do not need or want the generated makefile
+CONFIGURE_ARGS += --without-makefile
 .include <autoconf.mk>
 .endif
 SHARE_MK?=${SHAREDIR}/mk
Index: pkgsrc/devel/bmake/files/README
diff -u pkgsrc/devel/bmake/files/README:1.3 pkgsrc/devel/bmake/files/README:1.4
--- pkgsrc/devel/bmake/files/README:1.3 Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/README     Sun May 24 11:09:43 2020
@@ -1,47 +1,52 @@
                               bmake
+                              *****
 
-This directory contains a port of the BSD make tool (from NetBSD)
-I have run it on SunOS,Solaris,HP-UX,AIX,IRIX,FreeBSD and Linux.
+This directory contains a port of the BSD make tool (from NetBSD).
+Since 1993 I have run it on AIX, BSDi, Darwin, FreeBSD, HP-UX, IRIX,
+Linux, Minix, OSF, Solaris, SunOS and even UTS.
+Others have run it on many more systems.
 
-Version 3 was re-worked from scratch to better facilitate
-importing newer make(1) versions from NetBSD.  The original code base
-was NetBSD-1.0, so version 3 was built by doing a fresh import of the
-NetBSD-1.0 usr.bin/make, adding the autoconf and other portability
-patches to sync it with bmake v2, and then NetBSD's make 
-of Feb 20, 2000 was imported and conflicts dealt with.
-NetBSD's make was again imported on June 6 and December 15, 2000.
+Currently each release is tested on NetBSD, FreeBSD, Solaris and Linux.
 
-In 2003 bmake switched to a date based version (first was 20030714)
+Since 2003 bmake switched to a date based version (first was 20030714)
 which generally represents the date it was last merged with NetBSD's
 make.  Since then, NetBSD's make is imported within a week of any
 interesting changes, so that bmake tracks it very closely.
 
-Building:
+Building
+========
 
-The preferred way to bootstrap bmake is:
+The preferred way to bootstrap bmake is::
 
-./bmake/boot-strap
+       ./bmake/boot-strap
 
 there are a number of args - most of which get passed to configure,
 eg.
+::
 
-./bmake/boot-strap --prefix=/opt
+       ./bmake/boot-strap --prefix=/opt
 
 see the boot-strap script for details.
 
+For folk that hate to read anything, since 20121212 you can also use
+the GNU standard process of::
+
+       ./configure; make; make install
+
 To make much use of bmake you will need the bsd.*.mk macros or my
-portable *.mk macros.  See 
+portable *.mk macros which are included with bmake since 20121212
+and separately available from
 http://www.crufty.net/ftp/pub/sjg/mk.tar.gz
 which will be links to the latest versions.
 
-On a non-BSD system, you would want to unpack mk[-YYYYmmdd].tar.gz in
-the same directory as bmake (so ./mk and ./bmake exist), and
-./bmake/boot-strap will do the rest.
+Porting
+=======
+
+If you encounter a system that bmake does not build or work on *out of
+the box*, I welcome patches.
+If you can provide access to a suitable machine - even better.
 
-If you want to do it all by hand then read boot-strap first to get the
-idea.
+More info can be found at http://www.crufty.net/help/sjg/bmake.htm
 
-Even if you have an earlier version of bmake installed, use boot-strap
-to ensure that all goes well.
+--sjg <sjg%crufty.net@localhost>
 
---sjg
Index: pkgsrc/devel/bmake/files/bsd.after-import.mk
diff -u pkgsrc/devel/bmake/files/bsd.after-import.mk:1.3 pkgsrc/devel/bmake/files/bsd.after-import.mk:1.4
--- pkgsrc/devel/bmake/files/bsd.after-import.mk:1.3    Tue Aug 15 15:54:06 2017
+++ pkgsrc/devel/bmake/files/bsd.after-import.mk        Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-# $Id: bsd.after-import.mk,v 1.3 2017/08/15 15:54:06 brook Exp $
+# $Id: bsd.after-import.mk,v 1.4 2020/05/24 11:09:43 nia Exp $
 
 # This makefile is for use when integrating bmake into a BSD build
 # system.  Use this makefile after importing bmake.
@@ -63,7 +63,7 @@ MAKEFILE_SED =        sed -e '/^MACHINE/d' \
        -e 's,${SRCTOP},$${SRCTOP},g'
 
 # These are the simple files we want to capture
-configured_files= config.h Makefile.config unit-tests/Makefile
+configured_files= config.h Makefile.config unit-tests/Makefile.config
 
 after-import: bootstrap ${MAKEFILE}
 .for f in ${configured_files:M*.[ch]}
@@ -87,7 +87,6 @@ _makefile:    bootstrap ${MAKEFILE}
        @(echo '# This is a generated file, do NOT edit!'; \
        echo '# See ${_this:S,${SRCTOP}/,,}'; \
        echo '#'; echo '# $$${HOST_OS}$$'; \
-       echo; echo '.sinclude "Makefile.inc"'; \
        echo; echo 'SRCTOP?= $${.CURDIR:${.CURDIR:S,${SRCTOP}/,,:C,[^/]+,H,g:S,/,:,g}}'; \
        echo; echo '# look here first for config.h'; \
        echo 'CFLAGS+= -I$${.CURDIR}'; echo; \
Index: pkgsrc/devel/bmake/files/getopt.c
diff -u pkgsrc/devel/bmake/files/getopt.c:1.3 pkgsrc/devel/bmake/files/getopt.c:1.4
--- pkgsrc/devel/bmake/files/getopt.c:1.3       Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/getopt.c   Sun May 24 11:09:43 2020
@@ -1,3 +1,5 @@
+/*     $NetBSD: getopt.c,v 1.4 2020/05/24 11:09:43 nia Exp $   */
+
 /*
  * Copyright (c) 1987, 1993, 1994
  *     The Regents of the University of California.  All rights reserved.
@@ -10,11 +12,7 @@
  * 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. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
@@ -35,11 +33,7 @@
 # include "config.h"
 #endif
 #if !defined(HAVE_GETOPT) || defined(WANT_GETOPT_LONG) || defined(BROKEN_GETOPT)
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/* static char sccsid[] = "from: @(#)getopt.c  8.2 (Berkeley) 4/2/94"; */
-static char *rcsid = "$Id: getopt.c,v 1.3 2015/05/19 22:01:19 joerg Exp $";
-#endif /* LIBC_SCCS and not lint */
+#include <sys/cdefs.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -61,13 +55,10 @@ char        *optarg;                /* argument associated wi
  *     Parse argc/argv argument vector.
  */
 int
-getopt(nargc, nargv, ostr)
-       int nargc;
-       char * const *nargv;
-       const char *ostr;
+getopt(int nargc, char * const nargv[], const char *ostr)
 {
        extern char *__progname;
-       static char *place = EMSG;              /* option letter processing */
+       static const char *place = EMSG;        /* option letter processing */
        char *oli;                              /* option letter list index */
 
 #ifndef BSD4_4
@@ -79,43 +70,63 @@ getopt(nargc, nargv, ostr)
        }
 #endif
        
-       if (optreset || !*place) {              /* update scanning pointer */
+       if (optreset || *place == 0) {          /* update scanning pointer */
                optreset = 0;
-               if (optind >= nargc || *(place = nargv[optind]) != '-') {
+               place = nargv[optind];
+               if (optind >= nargc || *place++ != '-') {
+                       /* Argument is absent or is not an option */
                        place = EMSG;
                        return (-1);
                }
-               if (place[1] && *++place == '-' /* found "--" */
-                   && !place[1]) {             /* and not "--foo" */
+               optopt = *place++;
+               if (optopt == '-' && *place == 0) {
+                       /* "--" => end of options */
                        ++optind;
                        place = EMSG;
                        return (-1);
                }
-       }                                       /* option letter okay? */
-       if ((optopt = (int)*place++) == (int)':' ||
-           !(oli = strchr(ostr, optopt))) {
-               /*
-                * if the user didn't specify '-' as an option,
-                * assume it means -1.
-                */
-               if (optopt == (int)'-')
-                       return (-1);
-               if (!*place)
+               if (optopt == 0) {
+                       /* Solitary '-', treat as a '-' option
+                          if the program (eg su) is looking for it. */
+                       place = EMSG;
+                       if (strchr(ostr, '-') == NULL)
+                               return -1;
+                       optopt = '-';
+               }
+       } else
+               optopt = *place++;
+
+       /* See if option letter is one the caller wanted... */
+       if (optopt == ':' || (oli = strchr(ostr, optopt)) == NULL) {
+               if (*place == 0)
                        ++optind;
                if (opterr && *ostr != ':')
                        (void)fprintf(stderr,
-                           "%s: illegal option -- %c\n", __progname, optopt);
+                           "%s: unknown option -- %c\n", __progname, optopt);
                return (BADCH);
        }
-       if (*++oli != ':') {                    /* don't need argument */
+
+       /* Does this option need an argument? */
+       if (oli[1] != ':') {
+               /* don't need argument */
                optarg = NULL;
-               if (!*place)
+               if (*place == 0)
                        ++optind;
-       }
-       else {                                  /* need an argument */
-               if (*place)                     /* no white space */
-                       optarg = place;
-               else if (nargc <= ++optind) {   /* no arg */
+       } else {
+               /* Option-argument is either the rest of this argument or the
+                  entire next argument. */
+               if (*place)
+                       optarg = __UNCONST(place);
+               else if (oli[2] == ':')
+                       /*
+                        * GNU Extension, for optional arguments if the rest of
+                        * the argument is empty, we return NULL
+                        */
+                       optarg = NULL;
+               else if (nargc > ++optind)
+                       optarg = nargv[optind];
+               else {
+                       /* option-argument absent */
                        place = EMSG;
                        if (*ostr == ':')
                                return (BADARG);
@@ -125,12 +136,10 @@ getopt(nargc, nargv, ostr)
                                    __progname, optopt);
                        return (BADCH);
                }
-               else                            /* white space */
-                       optarg = nargv[optind];
                place = EMSG;
                ++optind;
        }
-       return (optopt);                        /* dump back option letter */
+       return (optopt);                        /* return option letter */
 }
 #endif
 #ifdef MAIN
Index: pkgsrc/devel/bmake/files/install-sh
diff -u pkgsrc/devel/bmake/files/install-sh:1.3 pkgsrc/devel/bmake/files/install-sh:1.4
--- pkgsrc/devel/bmake/files/install-sh:1.3     Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/install-sh Sun May 24 11:09:43 2020
@@ -53,7 +53,7 @@
 #
 
 # RCSid:
-#      $Id: install-sh,v 1.3 2015/05/19 22:01:19 joerg Exp $
+#      $Id: install-sh,v 1.4 2020/05/24 11:09:43 nia Exp $
 #
 #      @(#) Copyright (c) 1993 Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/make-conf.h
diff -u pkgsrc/devel/bmake/files/make-conf.h:1.3 pkgsrc/devel/bmake/files/make-conf.h:1.4
--- pkgsrc/devel/bmake/files/make-conf.h:1.3    Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/make-conf.h        Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: make-conf.h,v 1.3 2015/05/19 22:01:19 joerg Exp $      */
+/*     $NetBSD: make-conf.h,v 1.4 2020/05/24 11:09:43 nia Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
Index: pkgsrc/devel/bmake/files/meta.c
diff -u pkgsrc/devel/bmake/files/meta.c:1.3 pkgsrc/devel/bmake/files/meta.c:1.4
--- pkgsrc/devel/bmake/files/meta.c:1.3 Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/meta.c     Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*      $NetBSD: meta.c,v 1.3 2015/05/19 22:01:19 joerg Exp $ */
+/*      $NetBSD: meta.c,v 1.4 2020/05/24 11:09:43 nia Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -6,7 +6,7 @@
  * --sjg
  */
 /*
- * Copyright (c) 2009-2010, Juniper Networks, Inc.
+ * Copyright (c) 2009-2016, Juniper Networks, Inc.
  * Portions Copyright (c) 2009, John Birrell.
  * 
  * Redistribution and use in source and binary forms, with or without
@@ -36,9 +36,11 @@
 # include "config.h"
 #endif
 #include <sys/stat.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
+#ifdef HAVE_LIBGEN_H
 #include <libgen.h>
+#elif !defined(HAVE_DIRNAME)
+char * dirname(char *);
+#endif
 #include <errno.h>
 #if !defined(HAVE_CONFIG_H) || defined(HAVE_ERR_H)
 #include <err.h>
@@ -47,27 +49,36 @@
 #include "make.h"
 #include "job.h"
 
-#ifdef HAVE_FILEMON_H
-# include <filemon.h>
-#endif
-#if !defined(USE_FILEMON) && defined(FILEMON_SET_FD)
-# define USE_FILEMON
+#ifdef USE_FILEMON
+#include "filemon/filemon.h"
 #endif
 
 static BuildMon Mybm;                  /* for compat */
 static Lst metaBailiwick;              /* our scope of control */
+static char *metaBailiwickStr;         /* string storage for the list */
 static Lst metaIgnorePaths;            /* paths we deliberately ignore */
+static char *metaIgnorePathsStr;       /* string storage for the list */
 
 #ifndef MAKE_META_IGNORE_PATHS
 #define MAKE_META_IGNORE_PATHS ".MAKE.META.IGNORE_PATHS"
 #endif
+#ifndef MAKE_META_IGNORE_PATTERNS
+#define MAKE_META_IGNORE_PATTERNS ".MAKE.META.IGNORE_PATTERNS"
+#endif
+#ifndef MAKE_META_IGNORE_FILTER
+#define MAKE_META_IGNORE_FILTER ".MAKE.META.IGNORE_FILTER"
+#endif
 
 Boolean useMeta = FALSE;
 static Boolean useFilemon = FALSE;
 static Boolean writeMeta = FALSE;
+static Boolean metaMissing = FALSE;    /* oodate if missing */
+static Boolean filemonMissing = FALSE; /* oodate if missing */
 static Boolean metaEnv = FALSE;                /* don't save env unless asked */
 static Boolean metaVerbose = FALSE;
 static Boolean metaIgnoreCMDs = FALSE; /* ignore CMDs in .meta files */
+static Boolean metaIgnorePatterns = FALSE; /* do we need to do pattern matches */
+static Boolean metaIgnoreFilter = FALSE;   /* do we have more complex filtering? */
 static Boolean metaCurdirOk = FALSE;   /* write .meta in .CURDIR Ok? */
 static Boolean metaSilent = FALSE;     /* if we have a .meta be SILENT */
 
@@ -106,30 +117,24 @@ extern char    **environ;
  * the benefits are more limited.
  */
 #ifdef USE_FILEMON
-# ifndef _PATH_FILEMON
-#   define _PATH_FILEMON "/dev/filemon"
-# endif
 
 /*
  * Open the filemon device.
  */
 static void
-filemon_open(BuildMon *pbm)
+meta_open_filemon(BuildMon *pbm)
 {
-    int retry;
-    
-    pbm->mon_fd = pbm->filemon_fd = -1;
-    if (!useFilemon)
-       return;
+    int dupfd;
 
-    for (retry = 5; retry >= 0; retry--) {
-       if ((pbm->filemon_fd = open(_PATH_FILEMON, O_RDWR)) >= 0)
-           break;
-    }
+    pbm->mon_fd = -1;
+    pbm->filemon = NULL;
+    if (!useFilemon || !pbm->mfp)
+       return;
 
-    if (pbm->filemon_fd < 0) {
+    pbm->filemon = filemon_open();
+    if (pbm->filemon == NULL) {
        useFilemon = FALSE;
-       warn("Could not open %s", _PATH_FILEMON);
+       warn("Could not open filemon %s", filemon_path());
        return;
     }
 
@@ -140,40 +145,48 @@ filemon_open(BuildMon *pbm)
      * We only care about the descriptor.
      */
     pbm->mon_fd = mkTempFile("filemon.XXXXXX", NULL);
-    if (ioctl(pbm->filemon_fd, FILEMON_SET_FD, &pbm->mon_fd) < 0) {
+    if ((dupfd = dup(pbm->mon_fd)) == -1) {
+       err(1, "Could not dup filemon output!");
+    }
+    (void)fcntl(dupfd, F_SETFD, FD_CLOEXEC);
+    if (filemon_setfd(pbm->filemon, dupfd) == -1) {
        err(1, "Could not set filemon file descriptor!");
     }
     /* we don't need these once we exec */
-    (void)fcntl(pbm->mon_fd, F_SETFD, 1);
-    (void)fcntl(pbm->filemon_fd, F_SETFD, 1);
+    (void)fcntl(pbm->mon_fd, F_SETFD, FD_CLOEXEC);
 }
 
 /*
  * Read the build monitor output file and write records to the target's
  * metadata file.
  */
-static void
+static int
 filemon_read(FILE *mfp, int fd)
 {
     char buf[BUFSIZ];
     int n;
+    int error;
 
     /* Check if we're not writing to a meta data file.*/
     if (mfp == NULL) {
        if (fd >= 0)
            close(fd);                  /* not interested */
-       return;
+       return 0;
     }
     /* rewind */
     (void)lseek(fd, (off_t)0, SEEK_SET);
 
+    error = 0;
     fprintf(mfp, "\n-- filemon acquired metadata --\n");
 
     while ((n = read(fd, buf, sizeof(buf))) > 0) {
-       fwrite(buf, 1, n, mfp);
+       if ((int)fwrite(buf, 1, n, mfp) < n)
+           error = EIO;
     }
     fflush(mfp);
-    close(fd);
+    if (close(fd) < 0)
+       error = errno;
+    return error;
 }
 #endif
 
@@ -221,26 +234,17 @@ eat_dots(char *buf, size_t bufsz, int do
 }
 
 static char *
-meta_name(struct GNode *gn, char *mname, size_t mnamelen,
+meta_name(char *mname, size_t mnamelen,
          const char *dname,
-         const char *tname)
+         const char *tname,
+         const char *cwd)
 {
     char buf[MAXPATHLEN];
-    char cwd[MAXPATHLEN];
     char *rp;
     char *cp;
     char *tp;
-    char *p[4];                                /* >= number of possible uses */
-    int i;
-
-    i = 0;
-    if (!dname)
-       dname = Var_Value(".OBJDIR", gn, &p[i++]);
-    if (!tname)
-       tname = Var_Value(TARGET, gn, &p[i++]);
-
-    if (realpath(dname, cwd))
-       dname = cwd;
+    char *dtp;
+    size_t ldname;
 
     /*
      * Weed out relative paths from the target file name.
@@ -250,7 +254,7 @@ meta_name(struct GNode *gn, char *mname,
      * basename as given to us.
      */
     if ((cp = strrchr(tname, '/'))) {
-       if (realpath(tname, buf)) {
+       if (cached_realpath(tname, buf)) {
            if ((rp = strrchr(buf, '/'))) {
                rp++;
                cp++;
@@ -277,10 +281,15 @@ meta_name(struct GNode *gn, char *mname,
     }
     /* on some systems dirname may modify its arg */
     tp = bmake_strdup(tname);
-    if (strcmp(dname, dirname(tp)) == 0)
+    dtp = dirname(tp);
+    if (strcmp(dname, dtp) == 0)
        snprintf(mname, mnamelen, "%s.meta", tname);
     else {
-       snprintf(mname, mnamelen, "%s/%s.meta", dname, tname);
+       ldname = strlen(dname);
+       if (strncmp(dname, dtp, ldname) == 0 && dtp[ldname] == '/')
+           snprintf(mname, mnamelen, "%s/%s.meta", dname, &tname[ldname+1]);
+       else
+           snprintf(mname, mnamelen, "%s/%s.meta", dname, tname);
 
        /*
         * Replace path separators in the file name after the
@@ -295,10 +304,6 @@ meta_name(struct GNode *gn, char *mname,
        }
     }
     free(tp);
-    for (i--; i >= 0; i--) {
-       if (p[i])
-           free(p[i]);
-    }
     return (mname);
 }
 
@@ -324,7 +329,7 @@ is_submake(void *cmdp, void *gnp)
     }
     cp = strchr(cmd, '$');
     if ((cp)) {
-       mp = Var_Subst(NULL, cmd, gn, FALSE);
+       mp = Var_Subst(NULL, cmd, gn, VARF_WANTRES);
        cmd = mp;
     }
     cp2 = strstr(cmd, p_make);
@@ -349,8 +354,7 @@ is_submake(void *cmdp, void *gnp)
            }
        }
     }
-    if (mp)
-       free(mp);
+    free(mp);
     return (rc);
 }
 
@@ -367,11 +371,10 @@ printCMD(void *cmdp, void *mfpp)
     char *cp = NULL;
 
     if (strchr(cmd, '$')) {
-       cmd = cp = Var_Subst(NULL, cmd, mfp->gn, FALSE);
+       cmd = cp = Var_Subst(NULL, cmd, mfp->gn, VARF_WANTRES);
     }
     fprintf(mfp->fp, "CMD %s\n", cmd);
-    if (cp)
-       free(cp);
+    free(cp);
     return 0;
 }
 
@@ -380,29 +383,26 @@ printCMD(void *cmdp, void *mfpp)
  */
 #define SKIP_META_TYPE(_type) do { \
     if ((gn->type & __CONCAT(OP_, _type))) {   \
-       if (DEBUG(META)) { \
+       if (verbose) { \
            fprintf(debug_file, "Skipping meta for %s: .%s\n", \
                    gn->name, __STRING(_type));                \
        } \
-       return (NULL); \
+       return FALSE; \
     } \
 } while (0)
 
-static FILE *
-meta_create(BuildMon *pbm, GNode *gn)
+
+/*
+ * Do we need/want a .meta file ?
+ */
+static Boolean
+meta_needed(GNode *gn, const char *dname,
+            char *objdir, int verbose)
 {
-    meta_file_t mf;
-    char buf[MAXPATHLEN];
-    char objdir[MAXPATHLEN];
-    char **ptr;
-    const char *dname;
-    const char *tname;
-    char *fname;
-    const char *cp;
-    char *p[4];                                /* >= possible uses */
-    int i;
     struct stat fs;
 
+    if (verbose)
+       verbose = DEBUG(META);
     
     /* This may be a phony node which we don't want meta data for... */
     /* Skip .meta for .BEGIN, .END, .ERROR etc as well. */
@@ -415,54 +415,76 @@ meta_create(BuildMon *pbm, GNode *gn)
        SKIP_META_TYPE(MAKE);
     }
 
-    mf.fp = NULL;
-    
-    i = 0;
-    
-    dname = Var_Value(".OBJDIR", gn, &p[i++]);
-    tname = Var_Value(TARGET, gn, &p[i++]);
-    
-    /* The object directory may not exist. Check it.. */
-    if (stat(dname, &fs) != 0) {
-       if (DEBUG(META))
-           fprintf(debug_file, "Skipping meta for %s: no .OBJDIR\n",
-                   gn->name);
-       goto out;
-    }
     /* Check if there are no commands to execute. */
     if (Lst_IsEmpty(gn->commands)) {
-       if (DEBUG(META))
+       if (verbose)
            fprintf(debug_file, "Skipping meta for %s: no commands\n",
                    gn->name);
-       goto out;
+       return FALSE;
+    }
+    if ((gn->type & (OP_META|OP_SUBMAKE)) == OP_SUBMAKE) {
+       /* OP_SUBMAKE is a bit too aggressive */
+       if (Lst_ForEach(gn->commands, is_submake, gn)) {
+           if (DEBUG(META))
+               fprintf(debug_file, "Skipping meta for %s: .SUBMAKE\n",
+                       gn->name);
+           return FALSE;
+       }
+    }
+
+    /* The object directory may not exist. Check it.. */
+    if (cached_stat(dname, &fs) != 0) {
+       if (verbose)
+           fprintf(debug_file, "Skipping meta for %s: no .OBJDIR\n",
+                   gn->name);
+       return FALSE;
     }
 
     /* make sure these are canonical */
-    if (realpath(dname, objdir))
+    if (cached_realpath(dname, objdir))
        dname = objdir;
 
     /* If we aren't in the object directory, don't create a meta file. */
     if (!metaCurdirOk && strcmp(curdir, dname) == 0) {
-       if (DEBUG(META))
+       if (verbose)
            fprintf(debug_file, "Skipping meta for %s: .OBJDIR == .CURDIR\n",
                    gn->name);
-       goto out;
-    }
-    if (!(gn->type & OP_META)) {
-       /* We do not generate .meta files for sub-makes */
-       if (Lst_ForEach(gn->commands, is_submake, gn)) {
-           if (DEBUG(META))
-               fprintf(debug_file, "Skipping meta for %s: .MAKE\n",
-                       gn->name);
-           goto out;
-       }
+       return FALSE;
     }
+    return TRUE;
+}
+
+    
+static FILE *
+meta_create(BuildMon *pbm, GNode *gn)
+{
+    meta_file_t mf;
+    char buf[MAXPATHLEN];
+    char objdir[MAXPATHLEN];
+    char **ptr;
+    const char *dname;
+    const char *tname;
+    char *fname;
+    const char *cp;
+    char *p[5];                                /* >= possible uses */
+    int i;
+
+    mf.fp = NULL;
+    i = 0;
+
+    dname = Var_Value(".OBJDIR", gn, &p[i++]);
+    tname = Var_Value(TARGET, gn, &p[i++]);
+
+    /* if this succeeds objdir is realpath of dname */
+    if (!meta_needed(gn, dname, objdir, TRUE))
+       goto out;
+    dname = objdir;
 
     if (metaVerbose) {
        char *mp;
 
        /* Describe the target we are building */
-       mp = Var_Subst(NULL, "${" MAKE_META_PREFIX "}", gn, 0);
+       mp = Var_Subst(NULL, "${" MAKE_META_PREFIX "}", gn, VARF_WANTRES);
        if (*mp)
            fprintf(stdout, "%s\n", mp);
        free(mp);
@@ -476,15 +498,12 @@ meta_create(BuildMon *pbm, GNode *gn)
 
     fflush(stdout);
 
-    if (strcmp(cp, makeDependfile) == 0)
-       goto out;
-
     if (!writeMeta)
        /* Don't create meta data. */
        goto out;
 
-    fname = meta_name(gn, pbm->meta_fname, sizeof(pbm->meta_fname),
-                     dname, tname);
+    fname = meta_name(pbm->meta_fname, sizeof(pbm->meta_fname),
+                     dname, tname, objdir);
 
 #ifdef DEBUG_META_MODE
     if (DEBUG(META))
@@ -502,7 +521,10 @@ meta_create(BuildMon *pbm, GNode *gn)
 
     fprintf(mf.fp, "CWD %s\n", getcwd(buf, sizeof(buf)));
     fprintf(mf.fp, "TARGET %s\n", tname);
-
+    cp = Var_Value(".OODATE", gn, &p[i++]);
+    if (cp && *cp) {
+           fprintf(mf.fp, "OODATE %s\n", cp);
+    }
     if (metaEnv) {
        for (ptr = environ; *ptr != NULL; ptr++)
            fprintf(mf.fp, "ENV %s\n", *ptr);
@@ -520,8 +542,7 @@ meta_create(BuildMon *pbm, GNode *gn)
     }
  out:
     for (i--; i >= 0; i--) {
-       if (p[i])
-           free(p[i]);
+       free(p[i]);
     }
 
     return (mf.fp);
@@ -549,11 +570,15 @@ meta_init(void)
 {
 #ifdef USE_FILEMON
        /* this allows makefiles to test if we have filemon support */
-       Var_Set(".MAKE.PATH_FILEMON", _PATH_FILEMON, VAR_GLOBAL, 0);
+       Var_Set(".MAKE.PATH_FILEMON", filemon_path(), VAR_GLOBAL, 0);
 #endif
 }
 
 
+#define get_mode_bf(bf, token) \
+    if ((cp = strstr(make_mode, token))) \
+       bf = boolValue(&cp[sizeof(token) - 1])
+
 /*
  * Initialization we need after reading makefiles.
  */
@@ -576,17 +601,13 @@ meta_mode_init(const char *make_mode)
            writeMeta = FALSE;
        if (strstr(make_mode, "nofilemon"))
            useFilemon = FALSE;
-       if ((cp = strstr(make_mode, "curdirok="))) {
-           metaCurdirOk = boolValue(&cp[9]);
-       }
-       if ((cp = strstr(make_mode, "silent="))) {
-           metaSilent = boolValue(&cp[7]);
-       }
        if (strstr(make_mode, "ignore-cmd"))
            metaIgnoreCMDs = TRUE;
-       /* for backwards compatability */
-       Var_Set(".MAKE.META_CREATED", "${.MAKE.META.CREATED}", VAR_GLOBAL, 0);
-       Var_Set(".MAKE.META_FILES", "${.MAKE.META.FILES}", VAR_GLOBAL, 0);
+       if (useFilemon)
+           get_mode_bf(filemonMissing, "missing-filemon=");
+       get_mode_bf(metaCurdirOk, "curdirok=");
+       get_mode_bf(metaMissing, "missing-meta=");
+       get_mode_bf(metaSilent, "silent=");
     }
     if (metaVerbose && !Var_Exists(MAKE_META_PREFIX, VAR_GLOBAL)) {
        /*
@@ -605,9 +626,10 @@ meta_mode_init(const char *make_mode)
      * We consider ourselves master of all within ${.MAKE.META.BAILIWICK}
      */
     metaBailiwick = Lst_Init(FALSE);
-    cp = Var_Subst(NULL, "${.MAKE.META.BAILIWICK:O:u:tA}", VAR_GLOBAL, 0);
-    if (cp) {
-       str2Lst_Append(metaBailiwick, cp, NULL);
+    metaBailiwickStr = Var_Subst(NULL, "${.MAKE.META.BAILIWICK:O:u:tA}",
+       VAR_GLOBAL, VARF_WANTRES);
+    if (metaBailiwickStr) {
+       str2Lst_Append(metaBailiwick, metaBailiwickStr, NULL);
     }
     /*
      * We ignore any paths that start with ${.MAKE.META.IGNORE_PATHS}
@@ -615,10 +637,25 @@ meta_mode_init(const char *make_mode)
     metaIgnorePaths = Lst_Init(FALSE);
     Var_Append(MAKE_META_IGNORE_PATHS,
               "/dev /etc /proc /tmp /var/run /var/tmp ${TMPDIR}", VAR_GLOBAL);
-    cp = Var_Subst(NULL,
-                  "${" MAKE_META_IGNORE_PATHS ":O:u:tA}", VAR_GLOBAL, 0);
-    if (cp) {
-       str2Lst_Append(metaIgnorePaths, cp, NULL);
+    metaIgnorePathsStr = Var_Subst(NULL,
+                  "${" MAKE_META_IGNORE_PATHS ":O:u:tA}", VAR_GLOBAL,
+                  VARF_WANTRES);
+    if (metaIgnorePathsStr) {
+       str2Lst_Append(metaIgnorePaths, metaIgnorePathsStr, NULL);
+    }
+
+    /*
+     * We ignore any paths that match ${.MAKE.META.IGNORE_PATTERNS}
+     */
+    cp = NULL;
+    if (Var_Value(MAKE_META_IGNORE_PATTERNS, VAR_GLOBAL, &cp)) {
+       metaIgnorePatterns = TRUE;
+       free(cp);
+    }
+    cp = NULL;
+    if (Var_Value(MAKE_META_IGNORE_FILTER, VAR_GLOBAL, &cp)) {
+       metaIgnoreFilter = TRUE;
+       free(cp);
     }
 }
 
@@ -643,9 +680,10 @@ meta_job_start(Job *job, GNode *gn)
 #endif
 #ifdef USE_FILEMON
     if (pbm->mfp != NULL && useFilemon) {
-       filemon_open(pbm);
+       meta_open_filemon(pbm);
     } else {
-       pbm->mon_fd = pbm->filemon_fd = -1;
+       pbm->mon_fd = -1;
+       pbm->filemon = NULL;
     }
 #endif
 }
@@ -667,11 +705,11 @@ meta_job_child(Job *job)
     }
     if (pbm->mfp != NULL) {
        close(fileno(pbm->mfp));
-       if (useFilemon) {
+       if (useFilemon && pbm->filemon) {
            pid_t pid;
 
            pid = getpid();
-           if (ioctl(pbm->filemon_fd, FILEMON_SET_PID, &pid) < 0) {
+           if (filemon_setpid_child(pbm->filemon, pid) == -1) {
                err(1, "Could not set filemon pid!");
            }
        }
@@ -680,6 +718,59 @@ meta_job_child(Job *job)
 }
 
 void
+meta_job_parent(Job *job, pid_t pid)
+{
+#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV)
+    BuildMon *pbm;
+
+    if (job != NULL) {
+       pbm = &job->bm;
+    } else {
+       pbm = &Mybm;
+    }
+    if (useFilemon && pbm->filemon) {
+       filemon_setpid_parent(pbm->filemon, pid);
+    }
+#endif
+}
+
+int
+meta_job_fd(Job *job)
+{
+#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV)
+    BuildMon *pbm;
+
+    if (job != NULL) {
+       pbm = &job->bm;
+    } else {
+       pbm = &Mybm;
+    }
+    if (useFilemon && pbm->filemon) {
+       return filemon_readfd(pbm->filemon);
+    }
+#endif
+    return -1;
+}
+
+int
+meta_job_event(Job *job)
+{
+#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV)
+    BuildMon *pbm;
+
+    if (job != NULL) {
+       pbm = &job->bm;
+    } else {
+       pbm = &Mybm;
+    }
+    if (useFilemon && pbm->filemon) {
+       return filemon_process(pbm->filemon);
+    }
+#endif
+    return 0;
+}
+
+void
 meta_job_error(Job *job, GNode *gn, int flags, int status)
 {
     char cwd[MAXPATHLEN];
@@ -687,13 +778,13 @@ meta_job_error(Job *job, GNode *gn, int 
 
     if (job != NULL) {
        pbm = &job->bm;
-    } else {
        if (!gn)
            gn = job->node;
+    } else {
        pbm = &Mybm;
     }
     if (pbm->mfp != NULL) {
-       fprintf(pbm->mfp, "*** Error code %d%s\n",
+       fprintf(pbm->mfp, "\n*** Error code %d%s\n",
                status,
                (flags & JOB_IGNERR) ?
                "(ignored)" : "");
@@ -703,7 +794,7 @@ meta_job_error(Job *job, GNode *gn, int 
     }
     getcwd(cwd, sizeof(cwd));
     Var_Set(".ERROR_CWD", cwd, VAR_GLOBAL, 0);
-    if (pbm && pbm->meta_fname[0]) {
+    if (pbm->meta_fname[0]) {
        Var_Set(".ERROR_META_FILE", pbm->meta_fname, VAR_GLOBAL, 0);
     }
     meta_job_finish(job);
@@ -727,7 +818,8 @@ meta_job_output(Job *job, char *cp, cons
            if (!meta_prefix) {
                char *cp2;
 
-               meta_prefix = Var_Subst(NULL, "${" MAKE_META_PREFIX "}", VAR_GLOBAL, 0);
+               meta_prefix = Var_Subst(NULL, "${" MAKE_META_PREFIX "}",
+                                       VAR_GLOBAL, VARF_WANTRES);
                if ((cp2 = strchr(meta_prefix, '$')))
                    meta_prefix_len = cp2 - meta_prefix;
                else
@@ -743,27 +835,41 @@ meta_job_output(Job *job, char *cp, cons
     }
 }
 
-void
+int
 meta_cmd_finish(void *pbmp)
 {
-#ifdef USE_FILEMON
+    int error = 0;
     BuildMon *pbm = pbmp;
+#ifdef USE_FILEMON
+    int x;
+#endif
 
     if (!pbm)
        pbm = &Mybm;
 
-    if (pbm->filemon_fd >= 0) {
-       close(pbm->filemon_fd);
-       filemon_read(pbm->mfp, pbm->mon_fd);
-       pbm->filemon_fd = pbm->mon_fd = -1;
-    }
+#ifdef USE_FILEMON
+    if (pbm->filemon) {
+       while (filemon_process(pbm->filemon) > 0)
+           continue;
+       if (filemon_close(pbm->filemon) == -1)
+           error = errno;
+       x = filemon_read(pbm->mfp, pbm->mon_fd);
+       if (error == 0 && x != 0)
+           error = x;
+       pbm->mon_fd = -1;
+       pbm->filemon = NULL;
+    } else
 #endif
+       fprintf(pbm->mfp, "\n");        /* ensure end with newline */
+    return error;
 }
 
-void
+int
 meta_job_finish(Job *job)
 {
     BuildMon *pbm;
+    int error = 0;
+    int x;
 
     if (job != NULL) {
        pbm = &job->bm;
@@ -771,11 +877,23 @@ meta_job_finish(Job *job)
        pbm = &Mybm;
     }
     if (pbm->mfp != NULL) {
-       meta_cmd_finish(pbm);
-       fclose(pbm->mfp);
+       error = meta_cmd_finish(pbm);
+       x = fclose(pbm->mfp);
+       if (error == 0 && x != 0)
+           error = errno;
        pbm->mfp = NULL;
        pbm->meta_fname[0] = '\0';
     }
+    return error;
+}
+
+void
+meta_finish(void)
+{
+    Lst_Destroy(metaBailiwick, NULL);
+    free(metaBailiwickStr);
+    Lst_Destroy(metaIgnorePaths, NULL);
+    free(metaIgnorePathsStr);
 }
 
 /*
@@ -806,6 +924,8 @@ fgetLine(char **bufp, size_t *szp, int o
            newsz = ROUNDUP((fs.st_size / 2), BUFSIZ);
            if (newsz <= bufsz)
                newsz = ROUNDUP(fs.st_size, BUFSIZ);
+           if (newsz <= bufsz)
+               return x;               /* truncated */
            if (DEBUG(META)) 
                fprintf(debug_file, "growing buffer %u -> %u\n",
                        (unsigned)bufsz, (unsigned)newsz);
@@ -823,6 +943,7 @@ fgetLine(char **bufp, size_t *szp, int o
     return 0;
 }
 
+/* Lst_ForEach wants 1 to stop search */
 static int
 prefix_match(void *p, void *q)
 {
@@ -833,6 +954,32 @@ prefix_match(void *p, void *q)
     return (0 == strncmp(path, prefix, n));
 }
 
+/*
+ * looking for exact or prefix/ match to
+ * Lst_Find wants 0 to stop search
+ */
+static int
+path_match(const void *p, const void *q)
+{
+    const char *prefix = q;
+    const char *path = p;
+    size_t n = strlen(prefix);
+    int rc;
+
+    if ((rc = strncmp(path, prefix, n)) == 0) {
+       switch (path[n]) {
+       case '\0':
+       case '/':
+           break;
+       default:
+           rc = 1;
+           break;
+       }
+    }
+    return rc;
+}
+
+/* Lst_Find wants 0 to stop search */
 static int
 string_match(const void *p, const void *q)
 {
@@ -843,6 +990,67 @@ string_match(const void *p, const void *
 }
 
 
+static int
+meta_ignore(GNode *gn, const char *p)
+{
+    char fname[MAXPATHLEN];
+
+    if (p == NULL)
+       return TRUE;
+
+    if (*p == '/') {
+       cached_realpath(p, fname); /* clean it up */
+       if (Lst_ForEach(metaIgnorePaths, prefix_match, fname)) {
+#ifdef DEBUG_META_MODE
+           if (DEBUG(META))
+               fprintf(debug_file, "meta_oodate: ignoring path: %s\n",
+                       p);
+#endif
+           return TRUE;
+       }
+    }
+
+    if (metaIgnorePatterns) {
+       char *pm;
+
+       Var_Set(".p.", p, gn, 0);
+       pm = Var_Subst(NULL,
+                      "${" MAKE_META_IGNORE_PATTERNS ":@m@${.p.:M$m}@}",
+                      gn, VARF_WANTRES);
+       if (*pm) {
+#ifdef DEBUG_META_MODE
+           if (DEBUG(META))
+               fprintf(debug_file, "meta_oodate: ignoring pattern: %s\n",
+                       p);
+#endif
+           free(pm);
+           return TRUE;
+       }
+       free(pm);
+    }
+
+    if (metaIgnoreFilter) {
+       char *fm;
+
+       /* skip if filter result is empty */
+       snprintf(fname, sizeof(fname),
+                "${%s:L:${%s:ts:}}",
+                p, MAKE_META_IGNORE_FILTER);
+       fm = Var_Subst(NULL, fname, gn, VARF_WANTRES);
+       if (*fm == '\0') {
+#ifdef DEBUG_META_MODE
+           if (DEBUG(META))
+               fprintf(debug_file, "meta_oodate: ignoring filtered: %s\n",
+                       p);
+#endif
+           free(fm);
+           return TRUE;
+       }
+       free(fm);
+    }
+    return FALSE;
+}
+
 /*
  * When running with 'meta' functionality, a target can be out-of-date
  * if any of the references in its meta data file is more recent.
@@ -882,6 +1090,8 @@ meta_oodate(GNode *gn, Boolean oodate)
     char fname1[MAXPATHLEN];
     char fname2[MAXPATHLEN];
     char fname3[MAXPATHLEN];
+    const char *dname;
+    const char *tname;
     char *p;
     char *cp;
     char *link_src;
@@ -891,10 +1101,23 @@ meta_oodate(GNode *gn, Boolean oodate)
     FILE *fp;
     Boolean needOODATE = FALSE;
     Lst missingFiles;
-    
+    char *pa[4];                       /* >= possible uses */
+    int i;
+    int have_filemon = FALSE;
+
     if (oodate)
        return oodate;          /* we're done */
 
+    i = 0;
+
+    dname = Var_Value(".OBJDIR", gn, &pa[i++]);
+    tname = Var_Value(TARGET, gn, &pa[i++]);
+
+    /* if this succeeds fname3 is realpath of dname */
+    if (!meta_needed(gn, dname, fname3, FALSE))
+       goto oodate_out;
+    dname = fname3;
+
     missingFiles = Lst_Init(FALSE);
 
     /*
@@ -905,7 +1128,7 @@ meta_oodate(GNode *gn, Boolean oodate)
      */
     Make_DoAllVar(gn);
 
-    meta_name(gn, fname, sizeof(fname), NULL, NULL);
+    meta_name(fname, sizeof(fname), dname, tname, dname);
 
 #ifdef DEBUG_META_MODE
     if (DEBUG(META))
@@ -918,7 +1141,6 @@ meta_oodate(GNode *gn, Boolean oodate)
        int lineno = 0;
        int lastpid = 0;
        int pid;
-       int f = 0;
        int x;
        LstNode ln;
        struct stat fs;
@@ -957,13 +1179,13 @@ meta_oodate(GNode *gn, Boolean oodate)
            link_src = NULL;
            move_target = NULL;
            /* Find the start of the build monitor section. */
-           if (!f) {
+           if (!have_filemon) {
                if (strncmp(buf, "-- filemon", 10) == 0) {
-                   f = 1;
+                   have_filemon = TRUE;
                    continue;
                }
                if (strncmp(buf, "# buildmon", 10) == 0) {
-                   f = 1;
+                   have_filemon = TRUE;
                    continue;
                }
            }               
@@ -975,7 +1197,7 @@ meta_oodate(GNode *gn, Boolean oodate)
                fprintf(debug_file, "%s: %d: %s\n", fname, lineno, buf);
 #endif
            strsep(&p, " ");
-           if (f) {
+           if (have_filemon) {
                /*
                 * We are in the 'filemon' output section.
                 * Each record from filemon follows the general form:
@@ -1028,14 +1250,12 @@ meta_oodate(GNode *gn, Boolean oodate)
                        ldir = Var_Value(ldir_vname, VAR_GLOBAL, &tp);
                        if (ldir) {
                            strlcpy(latestdir, ldir, sizeof(latestdir));
-                           if (tp)
-                               free(tp);
+                           free(tp);
                        }
                        ldir = Var_Value(lcwd_vname, VAR_GLOBAL, &tp);
                        if (ldir) {
                            strlcpy(lcwd, ldir, sizeof(lcwd));
-                           if (tp)
-                               free(tp);
+                           free(tp);
                        }
                    }
                    /* Skip past the pid. */
@@ -1112,12 +1332,19 @@ meta_oodate(GNode *gn, Boolean oodate)
                    /* FALLTHROUGH */
                case 'D':               /* unlink */
                    if (*p == '/' && !Lst_IsEmpty(missingFiles)) {
-                       /* remove p from the missingFiles list if present */
-                       if ((ln = Lst_Find(missingFiles, p, string_match)) != NULL) {
-                           char *tp = Lst_Datum(ln);
-                           Lst_Remove(missingFiles, ln);
-                           free(tp);
-                           ln = NULL;  /* we're done with it */
+                       /* remove any missingFiles entries that match p */
+                       if ((ln = Lst_Find(missingFiles, p,
+                                          path_match)) != NULL) {
+                           LstNode nln;
+                           char *tp;
+
+                           do {
+                               nln = Lst_FindFrom(missingFiles, Lst_Succ(ln),
+                                                  p, path_match);
+                               tp = Lst_Datum(ln);
+                               Lst_Remove(missingFiles, ln);
+                               free(tp);
+                           } while ((ln = nln) != NULL);
                        }
                    }
                    if (buf[0] == 'M') {
@@ -1180,8 +1407,12 @@ meta_oodate(GNode *gn, Boolean oodate)
                    if ((strstr("tmp", p)))
                        break;
 
-                   if (stat(p, &fs) < 0) {
-                       Lst_AtEnd(missingFiles, bmake_strdup(p));
+                   if ((link_src != NULL && cached_lstat(p, &fs) < 0) ||
+                       (link_src == NULL && cached_stat(p, &fs) < 0)) {
+                       if (!meta_ignore(gn, p)) {
+                           if (Lst_Find(missingFiles, p, string_match) == NULL)
+                               Lst_AtEnd(missingFiles, bmake_strdup(p));
+                       }
                    }
                    break;
                check_link_src:
@@ -1199,26 +1430,9 @@ meta_oodate(GNode *gn, Boolean oodate)
                     * be part of the dependencies because
                     * they are _expected_ to change.
                     */
-                   if (*p == '/' &&
-                       Lst_ForEach(metaIgnorePaths, prefix_match, p)) {
-#ifdef DEBUG_META_MODE
-                       if (DEBUG(META))
-                           fprintf(debug_file, "meta_oodate: ignoring: %s\n",
-                                   p);
-#endif
+                   if (meta_ignore(gn, p))
                        break;
-                   }
-
-                   if ((cp = strrchr(p, '/'))) {
-                       cp++;
-                       /*
-                        * We don't normally expect to see this,
-                        * but we do expect it to change.
-                        */
-                       if (strcmp(cp, makeDependfile) == 0)
-                           break;
-                   }
-
+                   
                    /*
                     * The rest of the record is the file name.
                     * Check if it's not an absolute path.
@@ -1257,7 +1471,7 @@ meta_oodate(GNode *gn, Boolean oodate)
                            if (DEBUG(META))
                                fprintf(debug_file, "%s: %d: looking for: %s\n", fname, lineno, *sdp);
 #endif
-                           if (stat(*sdp, &fs) == 0) {
+                           if (cached_stat(*sdp, &fs) == 0) {
                                found = 1;
                                p = *sdp;
                            }
@@ -1274,7 +1488,7 @@ meta_oodate(GNode *gn, Boolean oodate)
                                oodate = TRUE;
                            } else if (S_ISDIR(fs.st_mode)) {
                                /* Update the latest directory. */
-                               realpath(p, latestdir);
+                               cached_realpath(p, latestdir);
                            }
                        } else if (errno == ENOENT && *p == '/' &&
                                   strncmp(p, cwd, cwdlen) != 0) {
@@ -1282,9 +1496,8 @@ meta_oodate(GNode *gn, Boolean oodate)
                             * A referenced file outside of CWD is missing.
                             * We cannot catch every eventuality here...
                             */
-                           if (DEBUG(META))
-                               fprintf(debug_file, "%s: %d: file '%s' may have moved?...\n", fname, lineno, p);
-                           oodate = TRUE;
+                           if (Lst_Find(missingFiles, p, string_match) == NULL)
+                                   Lst_AtEnd(missingFiles, bmake_strdup(p));
                        }
                    }
                    if (buf[0] == 'E') {
@@ -1322,7 +1535,7 @@ meta_oodate(GNode *gn, Boolean oodate)
                        if (DEBUG(META))
                            fprintf(debug_file, "%s: %d: cannot compare command using .OODATE\n", fname, lineno);
                    }
-                   cmd = Var_Subst(NULL, cmd, gn, TRUE);
+                   cmd = Var_Subst(NULL, cmd, gn, VARF_WANTRES|VARF_UNDEFERR);
 
                    if ((cp = strchr(cmd, '\n'))) {
                        int n;
@@ -1349,7 +1562,8 @@ meta_oodate(GNode *gn, Boolean oodate)
                        if (buf[x - 1] == '\n')
                            buf[x - 1] = '\0';
                    }
-                   if (!hasOODATE &&
+                   if (p &&
+                       !hasOODATE &&
                        !(gn->type & OP_NOMETA_CMP) &&
                        strcmp(p, cmd) != 0) {
                        if (DEBUG(META))
@@ -1370,6 +1584,7 @@ meta_oodate(GNode *gn, Boolean oodate)
                        fprintf(debug_file, "%s: %d: there are extra build commands now that weren't in the meta data file\n", fname, lineno);
                    oodate = TRUE;
                }
+               CHECK_VALID_META(p);
                if (strcmp(p, cwd) != 0) {
                    if (DEBUG(META))
                        fprintf(debug_file, "%s: %d: the current working directory has changed from '%s' to '%s'\n", fname, lineno, p, curdir);
@@ -1384,15 +1599,33 @@ meta_oodate(GNode *gn, Boolean oodate)
                fprintf(debug_file, "%s: missing files: %s...\n",
                        fname, (char *)Lst_Datum(Lst_First(missingFiles)));
            oodate = TRUE;
-           Lst_Destroy(missingFiles, (FreeProc *)free);
        }
-    } else {
-       if ((gn->type & OP_META)) {
+       if (!oodate && !have_filemon && filemonMissing) {
            if (DEBUG(META))
-               fprintf(debug_file, "%s: required but missing\n", fname);
+               fprintf(debug_file, "%s: missing filemon data\n", fname);
            oodate = TRUE;
        }
+    } else {
+       if (writeMeta && metaMissing) {
+           cp = NULL;
+
+           /* if target is in .CURDIR we do not need a meta file */
+           if (gn->path && (cp = strrchr(gn->path, '/')) && cp > gn->path) {
+               if (strncmp(curdir, gn->path, (cp - gn->path)) != 0) {
+                   cp = NULL;          /* not in .CURDIR */
+               }
+           }
+           if (!cp) {
+               if (DEBUG(META))
+                   fprintf(debug_file, "%s: required but missing\n", fname);
+               oodate = TRUE;
+               needOODATE = TRUE;      /* assume the worst */
+           }
+       }
     }
+
+    Lst_Destroy(missingFiles, (FreeProc *)free);
+
     if (oodate && needOODATE) {
        /*
         * Target uses .OODATE which is empty; or we wouldn't be here.
@@ -1401,8 +1634,12 @@ meta_oodate(GNode *gn, Boolean oodate)
         */
        Var_Delete(OODATE, gn);
        Var_Set(OODATE, Var_Value(ALLSRC, gn, &cp), gn, 0);
-       if (cp)
-           free(cp);
+       free(cp);
+    }
+
+ oodate_out:
+    for (i--; i >= 0; i--) {
+       free(pa[i]);
     }
     return oodate;
 }
@@ -1421,16 +1658,17 @@ meta_compat_start(void)
     BuildMon *pbm = &Mybm;
     
     if (pbm->mfp != NULL && useFilemon) {
-       filemon_open(pbm);
+       meta_open_filemon(pbm);
     } else {
-       pbm->mon_fd = pbm->filemon_fd = -1;
+       pbm->mon_fd = -1;
+       pbm->filemon = NULL;
     }
 #endif
     if (pipe(childPipe) < 0)
        Punt("Cannot create pipe: %s", strerror(errno));
     /* Set close-on-exec flag for both */
-    (void)fcntl(childPipe[0], F_SETFD, 1);
-    (void)fcntl(childPipe[1], F_SETFD, 1);
+    (void)fcntl(childPipe[0], F_SETFD, FD_CLOEXEC);
+    (void)fcntl(childPipe[1], F_SETFD, FD_CLOEXEC);
 }
 
 void
@@ -1445,18 +1683,61 @@ meta_compat_child(void)
 }
 
 void
-meta_compat_parent(void)
+meta_compat_parent(pid_t child)
 {
-    FILE *fp;
-    char buf[BUFSIZ];
-    
+    int outfd, metafd, maxfd, nfds;
+    char buf[BUFSIZ+1];
+    fd_set readfds;
+
+    meta_job_parent(NULL, child);
     close(childPipe[1]);                       /* child side */
-    fp = fdopen(childPipe[0], "r");
-    while (fgets(buf, sizeof(buf), fp)) {
-       meta_job_output(NULL, buf, "");
-       printf("%s", buf);
+    outfd = childPipe[0];
+#ifdef USE_FILEMON
+    metafd = Mybm.filemon ? filemon_readfd(Mybm.filemon) : -1;
+#else
+    metafd = -1;
+#endif
+    maxfd = -1;
+    if (outfd > maxfd)
+           maxfd = outfd;
+    if (metafd > maxfd)
+           maxfd = metafd;
+
+    while (outfd != -1 || metafd != -1) {
+       FD_ZERO(&readfds);
+       if (outfd != -1) {
+           FD_SET(outfd, &readfds);
+       }
+       if (metafd != -1) {
+           FD_SET(metafd, &readfds);
+       }
+       nfds = select(maxfd + 1, &readfds, NULL, NULL, NULL);
+       if (nfds == -1) {
+           if (errno == EINTR)
+               continue;
+           err(1, "select");
+       }
+
+       if (outfd != -1 && FD_ISSET(outfd, &readfds)) do {
+           /* XXX this is not line-buffered */
+           ssize_t nread = read(outfd, buf, sizeof(buf) - 1);
+           if (nread == -1)
+               err(1, "read");
+           if (nread == 0) {
+               close(outfd);
+               outfd = -1;
+               break;
+           }
+           fwrite(buf, 1, (size_t)nread, stdout);
+           fflush(stdout);
+           buf[nread] = '\0';
+           meta_job_output(NULL, buf, "");
+       } while (0);
+       if (metafd != -1 && FD_ISSET(metafd, &readfds)) {
+           if (meta_job_event(NULL) <= 0)
+               metafd = -1;
+       }
     }
-    fclose(fp);
 }
 
 #endif /* USE_META */
Index: pkgsrc/devel/bmake/files/mkdeps.sh
diff -u pkgsrc/devel/bmake/files/mkdeps.sh:1.3 pkgsrc/devel/bmake/files/mkdeps.sh:1.4
--- pkgsrc/devel/bmake/files/mkdeps.sh:1.3      Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/mkdeps.sh  Sun May 24 11:09:43 2020
@@ -40,7 +40,7 @@
 #
 
 # RCSid:
-#      $Id: mkdeps.sh,v 1.3 2015/05/19 22:01:19 joerg Exp $
+#      $Id: mkdeps.sh,v 1.4 2020/05/24 11:09:43 nia Exp $
 #
 #      @(#) Copyright (c) 1993 Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/setenv.c
diff -u pkgsrc/devel/bmake/files/setenv.c:1.3 pkgsrc/devel/bmake/files/setenv.c:1.4
--- pkgsrc/devel/bmake/files/setenv.c:1.3       Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/setenv.c   Sun May 24 11:09:43 2020
@@ -38,7 +38,7 @@
 
 #if defined(LIBC_SCCS) && !defined(lint)
 /*static char *sccsid = "from: @(#)setenv.c    5.6 (Berkeley) 6/4/91";*/
-static char *rcsid = "$Id: setenv.c,v 1.3 2015/05/19 22:01:19 joerg Exp $";
+static char *rcsid = "$Id: setenv.c,v 1.4 2020/05/24 11:09:43 nia Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 #include <stddef.h>
Index: pkgsrc/devel/bmake/files/wait.h
diff -u pkgsrc/devel/bmake/files/wait.h:1.3 pkgsrc/devel/bmake/files/wait.h:1.4
--- pkgsrc/devel/bmake/files/wait.h:1.3 Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/wait.h     Sun May 24 11:09:43 2020
@@ -6,7 +6,7 @@
  */
 /*
  * RCSid:
- *     $Id: wait.h,v 1.3 2015/05/19 22:01:19 joerg Exp $
+ *     $Id: wait.h,v 1.4 2020/05/24 11:09:43 nia Exp $
  *
  *      @(#)Copyright (c) 1994, Simon J. Gerraty.
  *      

Index: pkgsrc/devel/bmake/files/Makefile.config.in
diff -u pkgsrc/devel/bmake/files/Makefile.config.in:1.2 pkgsrc/devel/bmake/files/Makefile.config.in:1.3
--- pkgsrc/devel/bmake/files/Makefile.config.in:1.2     Tue Aug 15 15:54:06 2017
+++ pkgsrc/devel/bmake/files/Makefile.config.in Sun May 24 11:09:43 2020
@@ -1,22 +1,22 @@
 # things set by configure
 
-_MAKE_VERSION=@_MAKE_VERSION@
+_MAKE_VERSION?=@_MAKE_VERSION@
 
-prefix= @prefix@
+prefix?= @prefix@
 srcdir= @srcdir@
 CC?= @CC@
-MACHINE= @machine@
-MACHINE_ARCH= @machine_arch@
-DEFAULT_SYS_PATH= @default_sys_path@
+MACHINE?= @machine@
+MACHINE_ARCH?= @machine_arch@
+DEFAULT_SYS_PATH?= @default_sys_path@
 
 CPPFLAGS+= @CPPFLAGS@
 CFLAGS+= ${CPPFLAGS} @DEFS@
-LDFLAGS= @LDFLAGS@
-LIBOBJS= @LIBOBJS@
-LDADD= @LIBS@
-USE_META= @use_meta@
-FILEMON_H= @filemon_h@
+LDFLAGS+= @LDFLAGS@
+LIBOBJS+= @LIBOBJS@
+LDADD+= @LIBS@
+USE_META?= @use_meta@
+USE_FILEMON?= @use_filemon@
+FILEMON_H?= @filemon_h@
 BMAKE_PATH_MAX?= @bmake_path_max@
 # used if MAXPATHLEN not defined
 CPPFLAGS+= -DBMAKE_PATH_MAX=${BMAKE_PATH_MAX}
-
Index: pkgsrc/devel/bmake/files/dirname.c
diff -u pkgsrc/devel/bmake/files/dirname.c:1.2 pkgsrc/devel/bmake/files/dirname.c:1.3
--- pkgsrc/devel/bmake/files/dirname.c:1.2      Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/dirname.c  Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: dirname.c,v 1.2 2015/05/19 22:01:19 joerg Exp $        */
+/*     $NetBSD: dirname.c,v 1.3 2020/05/24 11:09:43 nia Exp $  */
 
 /*-
  * Copyright (c) 1997, 2002 The NetBSD Foundation, Inc.
@@ -35,7 +35,15 @@
 #ifndef HAVE_DIRNAME
 
 #include <sys/cdefs.h>
-
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: dirname.c,v 1.3 2020/05/24 11:09:43 nia Exp $");
+#endif /* !LIBC_SCCS && !lint */
+
+#include "namespace.h"
+#include <sys/param.h>
+#ifdef HAVE_LIBGEN_H
+#include <libgen.h>
+#endif
 #ifdef HAVE_LIMITS_H
 #include <limits.h>
 #endif
@@ -45,51 +53,74 @@
 #ifndef PATH_MAX
 # define PATH_MAX 1024
 #endif
+#ifndef MIN
+# define MIN(a, b) ((a < b) ? a : b)
+#endif
 
-char *
-dirname(char *path)
+
+static size_t
+xdirname_r(const char *path, char *buf, size_t buflen)
 {
-       static char result[PATH_MAX];
-       const char *lastp;
+       const char *endp;
        size_t len;
 
        /*
         * If `path' is a null pointer or points to an empty string,
         * return a pointer to the string ".".
         */
-       if ((path == NULL) || (*path == '\0'))
-               goto singledot;
-
+       if (path == NULL || *path == '\0') {
+               path = ".";
+               len = 1;
+               goto out;
+       }
 
        /* Strip trailing slashes, if any. */
-       lastp = path + strlen(path) - 1;
-       while (lastp != path && *lastp == '/')
-               lastp--;
-
-       /* Terminate path at the last occurence of '/'. */
-       do {
-               if (*lastp == '/') {
-                       /* Strip trailing slashes, if any. */
-                       while (lastp != path && *lastp == '/')
-                               lastp--;
-
-                       /* ...and copy the result into the result buffer. */
-                       len = (lastp - path) + 1 /* last char */;
-                       if (len > (PATH_MAX - 1))
-                               len = PATH_MAX - 1;
-
-                       memcpy(result, path, len);
-                       result[len] = '\0';
-
-                       return (result);
-               }
-       } while (--lastp >= path);
-
-       /* No /'s found, return a pointer to the string ".". */
-singledot:
-       result[0] = '.';
-       result[1] = '\0';
+       endp = path + strlen(path) - 1;
+       while (endp != path && *endp == '/')
+               endp--;
+
+       /* Find the start of the dir */
+       while (endp > path && *endp != '/')
+               endp--;
+
+       if (endp == path) {
+               path = *endp == '/' ? "/" : ".";
+               len = 1;
+               goto out;
+       }
+
+       do
+               endp--;
+       while (endp > path && *endp == '/');
+
+       len = endp - path + 1;
+out:
+       if (buf != NULL && buflen != 0) {
+               buflen = MIN(len, buflen - 1);
+               if (buf != path)
+                       memcpy(buf, path, buflen);
+               buf[buflen] = '\0';
+       }
+       return len;
+}
 
-       return (result);
+char *
+dirname(char *path)
+{
+       static char result[PATH_MAX];
+       (void)xdirname_r(path, result, sizeof(result));
+       return result;
 }
+
+#ifdef MAIN
+#include <stdlib.h>
+#include <stdio.h>
+
+int
+main(int argc, char *argv[])
+{
+       printf("%s\n", dirname(argv[1]));
+       exit(0);
+}
+#endif
 #endif
Index: pkgsrc/devel/bmake/files/make_malloc.c
diff -u pkgsrc/devel/bmake/files/make_malloc.c:1.2 pkgsrc/devel/bmake/files/make_malloc.c:1.3
--- pkgsrc/devel/bmake/files/make_malloc.c:1.2  Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/make_malloc.c      Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: make_malloc.c,v 1.2 2015/05/19 22:01:19 joerg Exp $    */
+/*     $NetBSD: make_malloc.c,v 1.3 2020/05/24 11:09:43 nia Exp $      */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #ifdef MAKE_NATIVE
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: make_malloc.c,v 1.2 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: make_malloc.c,v 1.3 2020/05/24 11:09:43 nia Exp $");
 #endif
 
 #include <stdio.h>
@@ -39,13 +39,13 @@ __RCSID("$NetBSD: make_malloc.c,v 1.2 20
 #include "make.h"
 
 #ifndef USE_EMALLOC
-static void enomem(void) MAKE_ATTR_DEAD;
+static MAKE_ATTR_DEAD void enomem(void);
 
 /*
  * enomem --
  *     die when out of memory.
  */
-static void
+static MAKE_ATTR_DEAD void
 enomem(void)
 {
        (void)fprintf(stderr, "%s: %s.\n", progname, strerror(ENOMEM));
Index: pkgsrc/devel/bmake/files/make_malloc.h
diff -u pkgsrc/devel/bmake/files/make_malloc.h:1.2 pkgsrc/devel/bmake/files/make_malloc.h:1.3
--- pkgsrc/devel/bmake/files/make_malloc.h:1.2  Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/make_malloc.h      Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: make_malloc.h,v 1.2 2015/05/19 22:01:19 joerg Exp $    */
+/*     $NetBSD: make_malloc.h,v 1.3 2020/05/24 11:09:43 nia Exp $      */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
Index: pkgsrc/devel/bmake/files/makefile.in
diff -u pkgsrc/devel/bmake/files/makefile.in:1.2 pkgsrc/devel/bmake/files/makefile.in:1.3
--- pkgsrc/devel/bmake/files/makefile.in:1.2    Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/makefile.in        Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-# $Id: makefile.in,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: makefile.in,v 1.3 2020/05/24 11:09:43 nia Exp $
 
 # a simple makefile for those who don't like anything beyond:
 # ./configure; make; make install
Index: pkgsrc/devel/bmake/files/meta.h
diff -u pkgsrc/devel/bmake/files/meta.h:1.2 pkgsrc/devel/bmake/files/meta.h:1.3
--- pkgsrc/devel/bmake/files/meta.h:1.2 Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/meta.h     Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*      $NetBSD: meta.h,v 1.2 2015/05/19 22:01:19 joerg Exp $ */
+/*      $NetBSD: meta.h,v 1.3 2020/05/24 11:09:43 nia Exp $ */
 
 /*
  * Things needed for 'meta' mode.
@@ -33,7 +33,7 @@
 
 typedef struct BuildMon {
     char       meta_fname[MAXPATHLEN];
-    int                filemon_fd;
+    struct filemon *filemon;
     int                mon_fd;
     FILE       *mfp;
 } BuildMon;
@@ -42,14 +42,18 @@ extern Boolean useMeta;
 
 struct Job;                            /* not defined yet */
 void meta_init(void);
+void meta_finish(void);
 void meta_mode_init(const char *);
 void meta_job_start(struct Job *, GNode *);
 void meta_job_child(struct Job *);
+void meta_job_parent(struct Job *, pid_t);
+int  meta_job_fd(struct Job *);
+int  meta_job_event(struct Job *);
 void meta_job_error(struct Job *, GNode *, int, int);
 void meta_job_output(struct Job *, char *, const char *);
-void meta_cmd_finish(void *);
-void meta_job_finish(struct Job *);
+int  meta_cmd_finish(void *);
+int  meta_job_finish(struct Job *);
 Boolean meta_oodate(GNode *, Boolean);
 void meta_compat_start(void);
 void meta_compat_child(void);
-void meta_compat_parent(void);
+void meta_compat_parent(pid_t);
Index: pkgsrc/devel/bmake/files/realpath.c
diff -u pkgsrc/devel/bmake/files/realpath.c:1.2 pkgsrc/devel/bmake/files/realpath.c:1.3
--- pkgsrc/devel/bmake/files/realpath.c:1.2     Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/realpath.c Sun May 24 11:09:43 2020
@@ -1,5 +1,5 @@
-/* $Id: realpath.c,v 1.2 2015/05/19 22:01:19 joerg Exp $ */
-/* from: $NetBSD: realpath.c,v 1.2 2015/05/19 22:01:19 joerg Exp $     */
+/* $Id: realpath.c,v 1.3 2020/05/24 11:09:43 nia Exp $ */
+/* from: $NetBSD: realpath.c,v 1.3 2020/05/24 11:09:43 nia Exp $       */
 
 /*
  * Copyright (c) 1989, 1991, 1993, 1995
Index: pkgsrc/devel/bmake/files/stresep.c
diff -u pkgsrc/devel/bmake/files/stresep.c:1.2 pkgsrc/devel/bmake/files/stresep.c:1.3
--- pkgsrc/devel/bmake/files/stresep.c:1.2      Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/stresep.c  Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: stresep.c,v 1.2 2015/05/19 22:01:19 joerg Exp $        */
+/*     $NetBSD: stresep.c,v 1.3 2020/05/24 11:09:43 nia Exp $  */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -59,6 +59,7 @@ stresep(char **stringp, const char *deli
        char *s;
        const char *spanp;
        int c, sc;
+       size_t l;
        char *tok;
 
        if (stringp == NULL || delim == NULL)
@@ -66,23 +67,26 @@ stresep(char **stringp, const char *deli
 
        if ((s = *stringp) == NULL)
                return NULL;
+       l = strlen(s) + 1;
        for (tok = s;;) {
                c = *s++;
+               l--;
                while (esc != '\0' && c == esc) {
-                       (void)strcpy(s - 1, s);
+                       memmove(s - 1, s, l);
                        c = *s++;
+                       l--;
                }
                spanp = delim;
                do {
                        if ((sc = *spanp++) == c) {
-                               if (c == 0)
+                               if (c == '\0')
                                        s = NULL;
                                else
-                                       s[-1] = 0;
+                                       s[-1] = '\0';
                                *stringp = s;
                                return tok;
                        }
-               } while (sc != 0);
+               } while (sc != '\0');
        }
 }
 #endif
Index: pkgsrc/devel/bmake/files/strlcpy.c
diff -u pkgsrc/devel/bmake/files/strlcpy.c:1.2 pkgsrc/devel/bmake/files/strlcpy.c:1.3
--- pkgsrc/devel/bmake/files/strlcpy.c:1.2      Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/strlcpy.c  Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: strlcpy.c,v 1.2 2015/05/19 22:01:19 joerg Exp $        */
+/*     $NetBSD: strlcpy.c,v 1.3 2020/05/24 11:09:43 nia Exp $  */
 /*     $OpenBSD: strlcpy.c,v 1.7 2003/04/12 21:56:39 millert Exp $     */
 
 /*
Index: pkgsrc/devel/bmake/files/strlist.c
diff -u pkgsrc/devel/bmake/files/strlist.c:1.2 pkgsrc/devel/bmake/files/strlist.c:1.3
--- pkgsrc/devel/bmake/files/strlist.c:1.2      Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/strlist.c  Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: strlist.c,v 1.2 2015/05/19 22:01:19 joerg Exp $        */
+/*     $NetBSD: strlist.c,v 1.3 2020/05/24 11:09:43 nia Exp $  */
 
 /*-
  * Copyright (c) 2008 - 2009 The NetBSD Foundation, Inc.
@@ -33,11 +33,11 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: strlist.c,v 1.2 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: strlist.c,v 1.3 2020/05/24 11:09:43 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: strlist.c,v 1.2 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: strlist.c,v 1.3 2020/05/24 11:09:43 nia Exp $");
 #endif /* not lint */
 #endif
 
Index: pkgsrc/devel/bmake/files/strlist.h
diff -u pkgsrc/devel/bmake/files/strlist.h:1.2 pkgsrc/devel/bmake/files/strlist.h:1.3
--- pkgsrc/devel/bmake/files/strlist.h:1.2      Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/strlist.h  Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: strlist.h,v 1.2 2015/05/19 22:01:19 joerg Exp $        */
+/*     $NetBSD: strlist.h,v 1.3 2020/05/24 11:09:43 nia Exp $  */
 
 /*-
  * Copyright (c) 2008 - 2009 The NetBSD Foundation, Inc.

Index: pkgsrc/devel/bmake/files/VERSION
diff -u pkgsrc/devel/bmake/files/VERSION:1.1 pkgsrc/devel/bmake/files/VERSION:1.2
--- pkgsrc/devel/bmake/files/VERSION:1.1        Tue Aug 15 15:54:06 2017
+++ pkgsrc/devel/bmake/files/VERSION    Sun May 24 11:09:43 2020
@@ -1,2 +1,2 @@
 # keep this compatible with sh and make
-_MAKE_VERSION=20150505
+_MAKE_VERSION=20200517

Index: pkgsrc/devel/bmake/files/aclocal.m4
diff -u pkgsrc/devel/bmake/files/aclocal.m4:1.4 pkgsrc/devel/bmake/files/aclocal.m4:1.5
--- pkgsrc/devel/bmake/files/aclocal.m4:1.4     Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/aclocal.m4 Sun May 24 11:09:43 2020
@@ -1,5 +1,5 @@
 dnl RCSid:
-dnl    $Id: aclocal.m4,v 1.4 2015/05/19 22:01:19 joerg Exp $
+dnl    $Id: aclocal.m4,v 1.5 2020/05/24 11:09:43 nia Exp $
 dnl
 
 dnl 
@@ -55,10 +55,9 @@ dnl
 AC_DEFUN(AC_C___ATTRIBUTE__, [
 AC_MSG_CHECKING(for __attribute__)
 AC_CACHE_VAL(ac_cv___attribute__, [
-AC_TRY_COMPILE([
+AC_LINK_IFELSE([
 #include <stdlib.h>
-],
-[
+
 static void foo(void) __attribute__ ((noreturn));
 
 static void
@@ -66,6 +65,12 @@ foo(void)
 {
   exit(1);
 }
+
+int
+main(int argc, char **argv)
+{
+       foo();
+}
 ],
 ac_cv___attribute__=yes,
 ac_cv___attribute__=no)])
Index: pkgsrc/devel/bmake/files/buf.h
diff -u pkgsrc/devel/bmake/files/buf.h:1.4 pkgsrc/devel/bmake/files/buf.h:1.5
--- pkgsrc/devel/bmake/files/buf.h:1.4  Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/buf.h      Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: buf.h,v 1.4 2015/05/19 22:01:19 joerg Exp $    */
+/*     $NetBSD: buf.h,v 1.5 2020/05/24 11:09:43 nia Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -77,8 +77,8 @@
  *     Header for users of the buf library.
  */
 
-#ifndef _BUF_H
-#define _BUF_H
+#ifndef MAKE_BUF_H
+#define MAKE_BUF_H
 
 typedef char Byte;
 
@@ -116,4 +116,4 @@ void Buf_Init(Buffer *, int);
 Byte *Buf_Destroy(Buffer *, Boolean);
 Byte *Buf_DestroyCompact(Buffer *);
 
-#endif /* _BUF_H */
+#endif /* MAKE_BUF_H */
Index: pkgsrc/devel/bmake/files/hash.h
diff -u pkgsrc/devel/bmake/files/hash.h:1.4 pkgsrc/devel/bmake/files/hash.h:1.5
--- pkgsrc/devel/bmake/files/hash.h:1.4 Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/hash.h     Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: hash.h,v 1.4 2015/05/19 22:01:19 joerg Exp $   */
+/*     $NetBSD: hash.h,v 1.5 2020/05/24 11:09:43 nia Exp $     */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -78,8 +78,8 @@
  *     which maintains hash tables.
  */
 
-#ifndef        _HASH
-#define        _HASH
+#ifndef        _HASH_H
+#define        _HASH_H
 
 /*
  * The following defines one entry in the hash table.
@@ -89,10 +89,7 @@ typedef struct Hash_Entry {
     struct Hash_Entry *next;           /* Used to link together all the
                                         * entries associated with the same
                                         * bucket. */
-    union {
-       void          *clientPtr;       /* Arbitrary pointer */
-       time_t        clientTime;       /* Arbitrary Time */
-    } clientInfo;
+    void             *clientPtr;       /* Arbitrary pointer */
     unsigned         namehash;         /* hash value of key */
     char             name[1];          /* key string */
 } Hash_Entry;
@@ -125,8 +122,7 @@ typedef struct Hash_Search {
  *     Hash_Entry *h;
  */
 
-#define Hash_GetValue(h) ((h)->clientInfo.clientPtr)
-#define Hash_GetTimeValue(h) ((h)->clientInfo.clientTime)
+#define Hash_GetValue(h) ((h)->clientPtr)
 
 /*
  * Hash_SetValue(h, val);
@@ -134,8 +130,7 @@ typedef struct Hash_Search {
  *     char *val;
  */
 
-#define Hash_SetValue(h, val) ((h)->clientInfo.clientPtr = (val))
-#define Hash_SetTimeValue(h, val) ((h)->clientInfo.clientTime = (val))
+#define Hash_SetValue(h, val) ((h)->clientPtr = (val))
 
 /*
  * Hash_Size(n) returns the number of words in an object of n bytes
@@ -151,4 +146,4 @@ void Hash_DeleteEntry(Hash_Table *, Hash
 Hash_Entry *Hash_EnumFirst(Hash_Table *, Hash_Search *);
 Hash_Entry *Hash_EnumNext(Hash_Search *);
 
-#endif /* _HASH */
+#endif /* _HASH_H */
Index: pkgsrc/devel/bmake/files/lst.h
diff -u pkgsrc/devel/bmake/files/lst.h:1.4 pkgsrc/devel/bmake/files/lst.h:1.5
--- pkgsrc/devel/bmake/files/lst.h:1.4  Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.h      Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lst.h,v 1.4 2015/05/19 22:01:19 joerg Exp $    */
+/*     $NetBSD: lst.h,v 1.5 2020/05/24 11:09:43 nia Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
Index: pkgsrc/devel/bmake/files/ranlib.h
diff -u pkgsrc/devel/bmake/files/ranlib.h:1.4 pkgsrc/devel/bmake/files/ranlib.h:1.5
--- pkgsrc/devel/bmake/files/ranlib.h:1.4       Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/ranlib.h   Sun May 24 11:09:43 2020
@@ -1,5 +1,5 @@
 /*     @(#)ranlib.h 1.6 88/08/19 SMI; from UCB 4.1 83/05/03    */
-/*     $Id: ranlib.h,v 1.4 2015/05/19 22:01:19 joerg Exp $     */
+/*     $Id: ranlib.h,v 1.5 2020/05/24 11:09:43 nia Exp $       */
 
 /*
  * Structure of the __.SYMDEF table of contents for an archive.
Index: pkgsrc/devel/bmake/files/sprite.h
diff -u pkgsrc/devel/bmake/files/sprite.h:1.4 pkgsrc/devel/bmake/files/sprite.h:1.5
--- pkgsrc/devel/bmake/files/sprite.h:1.4       Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/sprite.h   Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: sprite.h,v 1.4 2015/05/19 22:01:19 joerg Exp $ */
+/*     $NetBSD: sprite.h,v 1.5 2020/05/24 11:09:43 nia Exp $   */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -78,8 +78,8 @@
  * Common constants and type declarations for Sprite.
  */
 
-#ifndef _SPRITE
-#define _SPRITE
+#ifndef MAKE_SPRITE_H
+#define MAKE_SPRITE_H
 
 
 /*
@@ -113,4 +113,4 @@ typedef int  ReturnStatus;
 #define        SUCCESS                 0x00000000
 #define        FAILURE                 0x00000001
 
-#endif /* _SPRITE */
+#endif /* MAKE_SPRITE_H */

Index: pkgsrc/devel/bmake/files/arch.c
diff -u pkgsrc/devel/bmake/files/arch.c:1.7 pkgsrc/devel/bmake/files/arch.c:1.8
--- pkgsrc/devel/bmake/files/arch.c:1.7 Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/arch.c     Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: arch.c,v 1.7 2015/05/19 22:01:19 joerg Exp $   */
+/*     $NetBSD: arch.c,v 1.8 2020/05/24 11:09:43 nia Exp $     */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: arch.c,v 1.7 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: arch.c,v 1.8 2020/05/24 11:09:43 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)arch.c     8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: arch.c,v 1.7 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: arch.c,v 1.8 2020/05/24 11:09:43 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -136,7 +136,6 @@ __RCSID("$NetBSD: arch.c,v 1.7 2015/05/1
 #include    <sys/stat.h>
 #include    <sys/time.h>
 #include    <sys/param.h>
-#include    <ctype.h>
 #ifdef HAVE_AR_H
 #include    <ar.h>
 #else
@@ -156,7 +155,6 @@ struct ar_hdr {
 #if defined(HAVE_RANLIB_H) && !(defined(__ELF__) || defined(NO_RANLIB))
 #include    <ranlib.h>
 #endif
-#include    <fcntl.h>
 #include    <stdio.h>
 #include    <stdlib.h>
 #ifdef HAVE_UTIME_H
@@ -254,8 +252,7 @@ ArchFree(void *ap)
        free(Hash_GetValue(entry));
 
     free(a->name);
-    if (a->fnametab)
-       free(a->fnametab);
+    free(a->fnametab);
     Hash_DeleteTable(&a->members);
     free(a);
 }
@@ -310,9 +307,10 @@ Arch_ParseArchive(char **linePtr, Lst no
            void        *freeIt;
            char        *result;
 
-           result = Var_Parse(cp, ctxt, TRUE, &length, &freeIt);
-           if (freeIt)
-               free(freeIt);
+           result = Var_Parse(cp, ctxt, VARF_UNDEFERR|VARF_WANTRES,
+                              &length, &freeIt);
+           free(freeIt);
+
            if (result == var_Error) {
                return(FAILURE);
            } else {
@@ -325,7 +323,7 @@ Arch_ParseArchive(char **linePtr, Lst no
 
     *cp++ = '\0';
     if (subLibName) {
-       libName = Var_Subst(NULL, libName, ctxt, TRUE);
+       libName = Var_Subst(NULL, libName, ctxt, VARF_UNDEFERR|VARF_WANTRES);
     }
 
 
@@ -351,9 +349,10 @@ Arch_ParseArchive(char **linePtr, Lst no
                void    *freeIt;
                char    *result;
 
-               result = Var_Parse(cp, ctxt, TRUE, &length, &freeIt);
-               if (freeIt)
-                   free(freeIt);
+               result = Var_Parse(cp, ctxt, VARF_UNDEFERR|VARF_WANTRES,
+                                  &length, &freeIt);
+               free(freeIt);
+
                if (result == var_Error) {
                    return(FAILURE);
                } else {
@@ -404,7 +403,8 @@ Arch_ParseArchive(char **linePtr, Lst no
            char    *oldMemName = memName;
            size_t   sz;
 
-           memName = Var_Subst(NULL, memName, ctxt, TRUE);
+           memName = Var_Subst(NULL, memName, ctxt,
+                               VARF_UNDEFERR|VARF_WANTRES);
 
            /*
             * Now form an archive spec and recurse to deal with nested
@@ -682,7 +682,7 @@ ArchStatMember(char *archive, char *memb
            arh.AR_SIZE[sizeof(arh.AR_SIZE)-1] = '\0';
            size = (int)strtol(arh.AR_SIZE, NULL, 10);
 
-           (void)strncpy(memName, arh.AR_NAME, sizeof(arh.AR_NAME));
+           memcpy(memName, arh.AR_NAME, sizeof(arh.AR_NAME));
            for (cp = &memName[AR_MAX_NAME_LEN]; *cp == ' '; cp--) {
                continue;
            }
@@ -726,7 +726,8 @@ ArchStatMember(char *archive, char *memb
                if (fread(memName, elen, 1, arch) != 1)
                        goto badarch;
                memName[elen] = '\0';
-               fseek(arch, -elen, SEEK_CUR);
+               if (fseek(arch, -elen, SEEK_CUR) != 0)
+                       goto badarch;
                if (DEBUG(ARCH) || DEBUG(MAKE)) {
                    fprintf(debug_file, "ArchStat: Extended format entry for %s\n", memName);
                }
@@ -737,7 +738,8 @@ ArchStatMember(char *archive, char *memb
            Hash_SetValue(he, bmake_malloc(sizeof(struct ar_hdr)));
            memcpy(Hash_GetValue(he), &arh, sizeof(struct ar_hdr));
        }
-       fseek(arch, (size + 1) & ~1, SEEK_CUR);
+       if (fseek(arch, (size + 1) & ~1, SEEK_CUR) != 0)
+           goto badarch;
     }
 
     fclose(arch);
@@ -759,8 +761,7 @@ ArchStatMember(char *archive, char *memb
 badarch:
     fclose(arch);
     Hash_DeleteTable(&ar->members);
-    if (ar->fnametab)
-       free(ar->fnametab);
+    free(ar->fnametab);
     free(ar);
     return NULL;
 }
@@ -833,7 +834,7 @@ ArchSVR4Entry(Arch *ar, char *name, size
            }
        if (DEBUG(ARCH)) {
            fprintf(debug_file, "Found svr4 archive name table with %lu entries\n",
-                   (u_long)entry);
+                   (unsigned long)entry);
        }
        return 0;
     }
@@ -851,7 +852,7 @@ ArchSVR4Entry(Arch *ar, char *name, size
     if (entry >= ar->fnamesize) {
        if (DEBUG(ARCH)) {
            fprintf(debug_file, "SVR4 entry offset %s is greater than %lu\n",
-                  name, (u_long)ar->fnamesize);
+                  name, (unsigned long)ar->fnamesize);
        }
        return 2;
     }
@@ -957,7 +958,10 @@ ArchFindMember(char *archive, char *memb
                 * the file at the actual member, rather than its header, but
                 * not here...
                 */
-               fseek(arch, -sizeof(struct ar_hdr), SEEK_CUR);
+               if (fseek(arch, -sizeof(struct ar_hdr), SEEK_CUR) != 0) {
+                   fclose(arch);
+                   return NULL;
+               }
                return (arch);
            }
        } else
@@ -987,10 +991,17 @@ ArchFindMember(char *archive, char *memb
                }
                if (strncmp(ename, member, len) == 0) {
                        /* Found as extended name */
-                       fseek(arch, -sizeof(struct ar_hdr) - elen, SEEK_CUR);
+                       if (fseek(arch, -sizeof(struct ar_hdr) - elen,
+                               SEEK_CUR) != 0) {
+                           fclose(arch);
+                           return NULL;
+                       }
                        return (arch);
                }
-               fseek(arch, -elen, SEEK_CUR);
+               if (fseek(arch, -elen, SEEK_CUR) != 0) {
+                   fclose(arch);
+                   return NULL;
+               }
                goto skip;
        } else
 #endif
@@ -1003,9 +1014,12 @@ skip:
             * extract the size of the file from the 'size' field of the
             * header and round it up during the seek.
             */
-           arhPtr->ar_size[sizeof(arhPtr->AR_SIZE)-1] = '\0';
+           arhPtr->AR_SIZE[sizeof(arhPtr->AR_SIZE)-1] = '\0';
            size = (int)strtol(arhPtr->AR_SIZE, NULL, 10);
-           fseek(arch, (size + 1) & ~1, SEEK_CUR);
+           if (fseek(arch, (size + 1) & ~1, SEEK_CUR) != 0) {
+               fclose(arch);
+               return NULL;
+           }
        }
     }
 
@@ -1045,10 +1059,10 @@ Arch_Touch(GNode *gn)
     arch = ArchFindMember(Var_Value(ARCHIVE, gn, &p1),
                          Var_Value(MEMBER, gn, &p2),
                          &arh, "r+");
-    if (p1)
-       free(p1);
-    if (p2)
-       free(p2);
+
+    free(p1);
+    free(p2);
+
     snprintf(arh.AR_DATE, sizeof(arh.AR_DATE), "%-12ld", (long) now);
 
     if (arch != NULL) {
@@ -1127,10 +1141,9 @@ Arch_MTime(GNode *gn)
     arhPtr = ArchStatMember(Var_Value(ARCHIVE, gn, &p1),
                             Var_Value(MEMBER, gn, &p2),
                             TRUE);
-    if (p1)
-       free(p1);
-    if (p2)
-       free(p2);
+
+    free(p1);
+    free(p2);
 
     if (arhPtr != NULL) {
        modTime = (time_t)strtol(arhPtr->AR_DATE, NULL, 10);
Index: pkgsrc/devel/bmake/files/for.c
diff -u pkgsrc/devel/bmake/files/for.c:1.7 pkgsrc/devel/bmake/files/for.c:1.8
--- pkgsrc/devel/bmake/files/for.c:1.7  Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/for.c      Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: for.c,v 1.7 2015/05/19 22:01:19 joerg Exp $    */
+/*     $NetBSD: for.c,v 1.8 2020/05/24 11:09:43 nia Exp $      */
 
 /*
  * Copyright (c) 1992, The Regents of the University of California.
@@ -30,14 +30,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: for.c,v 1.7 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: for.c,v 1.8 2020/05/24 11:09:43 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)for.c      8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: for.c,v 1.7 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: for.c,v 1.8 2020/05/24 11:09:43 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -216,7 +216,7 @@ For_Eval(char *line)
      * We can't do the escapes here - because we don't know whether
      * we are substuting into ${...} or $(...).
      */
-    sub = Var_Subst(NULL, ptr, VAR_GLOBAL, FALSE);
+    sub = Var_Subst(NULL, ptr, VAR_GLOBAL, VARF_WANTRES);
 
     /*
      * Split into words allowing for quoted strings.
@@ -427,7 +427,7 @@ For_Iterate(void *v_arg, size_t *ret_len
     for (cp = cmd_cp; (cp = strchr(cp, '$')) != NULL;) {
        char ech;
        ch = *++cp;
-       if ((ch == '(' && (ech = ')')) || (ch == '{' && (ech = '}'))) {
+       if ((ch == '(' && (ech = ')', 1)) || (ch == '{' && (ech = '}', 1))) {
            cp++;
            /* Check variable name against the .for loop variables */
            STRLIST_FOREACH(var, &arg->vars, i) {

Index: pkgsrc/devel/bmake/files/bmake.1
diff -u pkgsrc/devel/bmake/files/bmake.1:1.10 pkgsrc/devel/bmake/files/bmake.1:1.11
--- pkgsrc/devel/bmake/files/bmake.1:1.10       Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/bmake.1    Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-.\"    $NetBSD: bmake.1,v 1.10 2015/05/19 22:01:19 joerg Exp $
+.\"    $NetBSD: bmake.1,v 1.11 2020/05/24 11:09:43 nia Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"    from: @(#)make.1        8.4 (Berkeley) 3/19/94
 .\"
-.Dd April 9, 2015
+.Dd April 27, 2020
 .Dt BMAKE 1
 .Os
 .Sh NAME
@@ -48,6 +48,7 @@
 .Op Fl m Ar directory
 .Op Fl T Ar file
 .Op Fl V Ar variable
+.Op Fl v Ar variable
 .Op Ar variable=value
 .Op Ar target ...
 .Sh DESCRIPTION
@@ -206,7 +207,9 @@ Print debugging information about target
 .It Ar V
 Force the
 .Fl V
-option to print raw values of variables.
+option to print raw values of variables, overriding the default behavior
+set via
+.Va .MAKE.EXPAND_VARIABLES .
 .It Ar v
 Print debugging information about variable assignment.
 .It Ar x
@@ -269,7 +272,7 @@ that do not depend on the target whose c
 .It Fl m Ar directory
 Specify a directory in which to search for sys.mk and makefiles included
 via the
-.Ao Ar file Ac Ns -style
+.Li \&< Ns Ar file Ns Li \&> Ns -style
 include statement.
 The
 .Fl m
@@ -277,7 +280,7 @@ option can be used multiple times to for
 This path will override the default system include path: /usr/share/mk.
 Furthermore the system include path will be appended to the search path used
 for
-.Qo Ar file Qc Ns -style
+.Li \*q Ns Ar file Ns Li \*q Ns -style
 include statements (see the
 .Fl I
 option).
@@ -293,7 +296,7 @@ then
 will search for the specified file or directory named in the remaining part
 of the argument string.
 The search starts with the current directory of
-the Makefile and then works upward towards the root of the filesystem.
+the Makefile and then works upward towards the root of the file system.
 If the search is successful, then the resulting directory replaces the
 .Qq \&.../
 specification in the
@@ -334,20 +337,39 @@ for each job started and completed.
 Rather than re-building a target as specified in the makefile, create it
 or update its modification time to make it appear up-to-date.
 .It Fl V Ar variable
-Print
-.Nm Ns 's
-idea of the value of
-.Ar variable ,
-in the global context.
+Print the value of
+.Ar variable .
 Do not build any targets.
 Multiple instances of this option may be specified;
 the variables will be printed one per line,
 with a blank line for each null or undefined variable.
+The value printed is extracted from the global context after all
+makefiles have been read.
+By default, the raw variable contents (which may
+include additional unexpanded variable references) are shown.
 If
 .Ar variable
 contains a
 .Ql \&$
-then the value will be expanded before printing.
+then the value will be recursively expanded to its complete resultant
+text before printing.
+The expanded value will also be printed if
+.Va .MAKE.EXPAND_VARIABLES
+is set to true and
+the
+.Fl dV
+option has not been used to override it.
+Note that loop-local and target-local variables, as well as values
+taken temporarily by global variables during makefile processing, are
+not accessible via this option.
+The
+.Fl dv
+debug mode can be used to see these at the cost of generating
+substantial extraneous output.
+.It Fl v Ar variable
+Like
+.Fl V
+but the variable is always expanded to its complete value.
 .It Fl W
 Treat any warnings during makefile parsing as errors.
 .It Fl w
@@ -657,7 +679,7 @@ The seven local variables are as follows
 .Bl -tag -width ".ARCHIVE" -offset indent
 .It Va .ALLSRC
 The list of all sources for this target; also known as
-.Ql Va \&\*[Gt] .
+.Ql Va \&> .
 .It Va .ARCHIVE
 The name of the archive file; also known as
 .Ql Va \&! .
@@ -666,7 +688,7 @@ In suffix-transformation rules, the name
 target is to be transformed (the
 .Dq implied
 source); also known as
-.Ql Va \&\*[Lt] .
+.Ql Va \&< .
 It is not defined in explicit rules.
 .It Va .MEMBER
 The name of the archive member; also known as
@@ -685,12 +707,15 @@ or it will not be recognized.
 .It Va .TARGET
 The name of the target; also known as
 .Ql Va @ .
+For compatibility with other makes this is an alias for
+.Ic .ARCHIVE
+in archive member rules.
 .El
 .Pp
 The shorter forms
-.Ql ( Va \*[Gt] ,
+.Ql ( Va > ,
 .Ql Va \&! ,
-.Ql Va \*[Lt] ,
+.Ql Va < ,
 .Ql Va % ,
 .Ql Va \&? ,
 .Ql Va * ,
@@ -773,6 +798,10 @@ from which generated dependencies are re
 A boolean that controls the default behavior of the
 .Fl V
 option.
+If true, variable values printed with
+.Fl V
+are fully expanded; if false, the raw variable contents (which may
+include additional unexpanded variable references) are shown.
 .It Va .MAKE.EXPORTED
 The list of variables exported by
 .Nm .
@@ -843,7 +872,7 @@ Can affect the mode that
 .Nm
 runs in.
 It can contain a number of keywords:
-.Bl -hang -width ignore-cmd
+.Bl -hang -width missing-filemon=bf.
 .It Pa compat
 Like
 .Fl B ,
@@ -867,8 +896,19 @@ will not create .meta files in
 This can be overridden by setting
 .Va bf
 to a value which represents True.
+.It Pa missing-meta= Ar bf
+If
+.Va bf
+is True, then a missing .meta file makes the target out-of-date.
+.It Pa missing-filemon= Ar bf
+If
+.Va bf
+is True, then missing filemon data makes the target out-of-date.
+.It Pa nofilemon
+Do not use
+.Xr filemon 4 .
 .It Pa env
-For debugging, it can be useful to inlcude the environment
+For debugging, it can be useful to include the environment
 in the .meta file.
 .It Pa verbose
 If in "meta" mode, print a clue about the target being built.
@@ -910,6 +950,12 @@ Provides a list of path prefixes that sh
 because the contents are expected to change over time.
 The default list includes:
 .Ql Pa /dev /etc /proc /tmp /var/run /var/tmp
+.It Va .MAKE.META.IGNORE_PATTERNS
+Provides a list of patterns to match against pathnames.
+Ignore any that match.
+.It Va .MAKE.META.IGNORE_FILTER
+Provides a list of variable modifiers to apply to each pathname.
+Ignore if the expansion is an empty string.
 .It Va .MAKE.META.PREFIX
 Defines the message printed for each meta file updated in "meta verbose" mode.
 The default value is:
@@ -918,7 +964,7 @@ The default value is:
 This variable is used to record the names of variables assigned to
 on the command line, so that they may be exported as part of
 .Ql Ev MAKEFLAGS .
-This behaviour can be disabled by assigning an empty value to
+This behavior can be disabled by assigning an empty value to
 .Ql Va .MAKEOVERRIDES
 within a makefile.
 Extra variables can be exported from a makefile
@@ -941,10 +987,35 @@ The process-id of
 .It Va .MAKE.PPID
 The parent process-id of
 .Nm .
+.It Va .MAKE.SAVE_DOLLARS
+value should be a boolean that controls whether
+.Ql $$
+are preserved when doing
+.Ql :=
+assignments.
+The default is false, for backwards compatibility.
+Set to true for compatability with other makes.
+If set to false,
+.Ql $$
+becomes
+.Ql $
+per normal evaluation rules.
 .It Va MAKE_PRINT_VAR_ON_ERROR
 When
 .Nm
-stops due to an error, it prints its name and the value of
+stops due to an error, it sets
+.Ql Va .ERROR_TARGET
+to the name of the target that failed,
+.Ql Va .ERROR_CMD
+to the commands of the failed target,
+and in "meta" mode, it also sets
+.Ql Va .ERROR_CWD
+to the
+.Xr getcwd 3 ,
+and
+.Ql Va .ERROR_META_FILE
+to the path of the meta file (if any) describing the failed target.
+It then prints its name and the value of
 .Ql Va .CURDIR
 as well as the value of any variables named in
 .Ql Va MAKE_PRINT_VAR_ON_ERROR .
@@ -993,14 +1064,15 @@ This is especially useful with
 .Ql Ev MAKEOBJDIR .
 .Pp
 .Ql Va .OBJDIR
-may be modified in the makefile as a global variable.
+may be modified in the makefile via the special target
+.Ql Ic .OBJDIR .
 In all cases,
 .Nm
 will
 .Xr chdir 2
-to
+to the specified directory if it exists, and set
 .Ql Va .OBJDIR
-and set
+and
 .Ql Ev PWD
 to that directory before executing any targets.
 .
@@ -1043,7 +1115,7 @@ sets
 to the value of
 .Ql Ev PWD
 instead.
-This behaviour is disabled if
+This behavior is disabled if
 .Ql Ev MAKEOBJDIRPREFIX
 is set or
 .Ql Ev MAKEOBJDIR
@@ -1113,7 +1185,7 @@ The wildcard characters may be escaped w
 As a consequence of the way values are split into words, matched,
 and then joined, a construct like
 .Dl ${VAR:M*}
-will normalise the inter-word spacing, removing all leading and
+will normalize the inter-word spacing, removing all leading and
 trailing space, and converting multiple consecutive spaces
 to single spaces.
 .
@@ -1133,7 +1205,7 @@ Randomize words in variable.
 The results will be different each time you are referring to the
 modified variable; use the assignment with expansion
 .Pq Ql Cm \&:=
-to prevent such behaviour.
+to prevent such behavior.
 For example,
 .Bd -literal -offset indent
 LIST=                  uno due tre quattro
@@ -1155,22 +1227,39 @@ due uno quattro tre
 .Ed
 .It Cm \&:Q
 Quotes every shell meta-character in the variable, so that it can be passed
+safely to the shell.
+.It Cm \&:q
+Quotes every shell meta-character in the variable, and also doubles
+.Sq $
+characters so that it can be passed
 safely through recursive invocations of
 .Nm .
+This is equivalent to:
+.Sq \&:S/\e\&$/&&/g:Q .
 .It Cm \&:R
 Replaces each word in the variable with everything but its suffix.
-.It Cm \&:gmtime
+.It Cm \&:range[=count]
+The value is an integer sequence representing the words of the original
+value, or the supplied
+.Va count .
+.It Cm \&:gmtime[=utc]
 The value is a format string for
 .Xr strftime 3 ,
-using the current
+using
 .Xr gmtime 3 .
+If a
+.Va utc
+value is not provided or is 0, the current time is used.
 .It Cm \&:hash
-Compute a 32bit hash of the value and encode it as hex digits.
-.It Cm \&:localtime
+Compute a 32-bit hash of the value and encode it as hex digits.
+.It Cm \&:localtime[=utc]
 The value is a format string for
 .Xr strftime 3 ,
-using the current
+using
 .Xr localtime 3 .
+If a
+.Va utc
+value is not provided or is 0, the current time is used.
 .It Cm \&:tA
 Attempt to convert variable to an absolute path using
 .Xr realpath 3 ,
@@ -1231,7 +1320,7 @@ it is anchored at the end of each word.
 Inside
 .Ar new_string ,
 an ampersand
-.Pq Ql \*[Am]
+.Pq Ql &
 is replaced by
 .Ar old_string
 (without any
@@ -1340,6 +1429,29 @@ is the substring of
 .Ar old_string
 to be replaced in
 .Ar new_string .
+If only
+.Ar old_string
+contains the pattern matching character
+.Ar % ,
+and 
+.Ar old_string
+matches, then the result is the
+.Ar new_string .
+If only the
+.Ar new_string
+contains the pattern matching character
+.Ar % ,
+then it is not treated specially and it is printed as a literal
+.Ar %
+on match.
+If there is more than one pattern matching character
+.Ar ( % )
+in either the
+.Ar new_string
+or
+.Ar old_string ,
+only the first instance is treated specially (as the pattern character);
+all subsequent instances are treated as regular characters
 .Pp
 Variable expansion occurs in the normal fashion inside both
 .Ar old_string
@@ -1370,6 +1482,27 @@ For example.
 .Pp
 However a single character variable is often more readable:
 .Dl ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@}
+.It Cm \&:_[=var]
+Save the current variable value in
+.Ql $_
+or the named
+.Va var
+for later reference.
+Example usage:
+.Bd -literal -offset indent
+M_cmpv.units = 1 1000 1000000
+M_cmpv = S,., ,g:_:range:@i@+ $${_:[-$$i]} \&\\
+\\* $${M_cmpv.units:[$$i]}@:S,^,expr 0 ,1:sh
+
+.Dv .if ${VERSION:${M_cmpv}} < ${3.1.12:L:${M_cmpv}}
+
+.Ed
+Here
+.Ql $_
+is used to save the result of the
+.Ql :S
+modifier which is later referenced using the index values from
+.Ql :range .
 .It Cm \&:U Ns Ar newval
 If the variable is undefined
 .Ar newval
@@ -1443,7 +1576,7 @@ value is divided into words.
 .Pp
 Ordinarily, a value is treated as a sequence of words
 delimited by white space.
-Some modifiers suppress this behaviour,
+Some modifiers suppress this behavior,
 causing a value to be treated as a single word
 (possibly containing embedded white space).
 An empty value, or a value that consists entirely of white-space,
@@ -1513,9 +1646,9 @@ dot
 .Pq Ql \&.
 character.
 Files are included with either
-.Cm \&.include Aq Ar file
+.Cm \&.include \&< Ns Ar file Ns Cm \&>
 or
-.Cm \&.include Pf \*q Ar file Ns \*q .
+.Cm \&.include \&\*q Ns Ar file Ns Cm \&\*q .
 Variables between the angle brackets or double quotes are expanded
 to form the file name.
 If angle brackets are used, the included makefile is expected to be in
@@ -1529,12 +1662,20 @@ For compatibility with other versions of
 .Nm
 .Ql include file ...
 is also accepted.
+.Pp
 If the include statement is written as
 .Cm .-include
 or as
 .Cm .sinclude
 then errors locating and/or opening include files are ignored.
 .Pp
+If the include statement is written as
+.Cm .dinclude
+not only are errors locating and/or opening include files ignored,
+but stale dependencies within the included file will be ignored
+just like
+.Va .MAKE.DEPENDFILE .
+.Pp
 Conditional expressions are also preceded by a single dot as the first
 character of a line.
 The possible conditionals are as follows:
@@ -1570,6 +1711,10 @@ This allows exporting a value to the env
 used by
 .Nm
 internally.
+.It Ic .export-literal Ar variable ...
+The same as
+.Ql .export-env ,
+except that variables in the value are not expanded.
 .It Ic .info Ar message
 The message is printed along with the name of the makefile and line number.
 .It Ic .undef Ar variable
@@ -1662,7 +1807,7 @@ may be any one of the following:
 .Bl -tag -width "Cm XX"
 .It Cm \&|\&|
 Logical OR.
-.It Cm \&\*[Am]\*[Am]
+.It Cm \&&&
 Logical
 .Tn AND ;
 of higher precedence than
@@ -1679,7 +1824,7 @@ The boolean operator
 may be used to logically negate an entire
 conditional.
 It is of higher precedence than
-.Ql Ic \&\*[Am]\*[Am] .
+.Ql Ic \&&& .
 .Pp
 The value of
 .Ar expression
@@ -1750,7 +1895,8 @@ expression is applied.
 Similarly, if the form is
 .Ql Ic .ifmake
 or
-.Ql Ic .ifnmake , the
+.Ql Ic .ifnmake ,
+the
 .Dq make
 expression is applied.
 .Pp
@@ -1953,6 +2099,14 @@ variable of a target that inherits
 .Ic .DEFAULT Ns 's
 commands is set
 to the target's own name.
+.It Ic .DELETE_ON_ERROR
+If this target is present in the makefile, it globally causes make to
+delete targets whose commands fail.
+(By default, only targets whose commands are interrupted during
+execution are deleted.
+This is the historical behavior.)
+This setting can be used to help prevent half-finished or malformed
+targets from being left around and corrupting future rebuilds.
 .It Ic .END
 Any command lines attached to this target are executed after everything
 else is done.
@@ -2001,6 +2155,15 @@ Disable parallel mode.
 Synonym for
 .Ic .NOTPARALLEL ,
 for compatibility with other pmake variants.
+.It Ic .OBJDIR
+The source is a new value for
+.Ql Va .OBJDIR .
+If it exists,
+.Nm
+will
+.Xr chdir 2
+to it and update the value of
+.Ql Va .OBJDIR .
 .It Ic .ORDER
 The named targets are made in sequence.
 This ordering does not add targets to the list of targets to be made.
@@ -2058,7 +2221,7 @@ The sources are a set of
 pairs.
 .Bl -tag -width hasErrCtls
 .It Ar name
-This is the minimal specification, used to select one of the builtin
+This is the minimal specification, used to select one of the built-in
 shell specs;
 .Ar sh ,
 .Ar ksh ,
Index: pkgsrc/devel/bmake/files/bmake.cat1
diff -u pkgsrc/devel/bmake/files/bmake.cat1:1.10 pkgsrc/devel/bmake/files/bmake.cat1:1.11
--- pkgsrc/devel/bmake/files/bmake.cat1:1.10    Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/bmake.cat1 Sun May 24 11:09:43 2020
@@ -1,73 +1,73 @@
-BMAKE(1)                    General Commands Manual                   BMAKE(1)
+BMAKE(1)                FreeBSD General Commands Manual               BMAKE(1)
 
-NNAAMMEE
-     bbmmaakkee - maintain program dependencies
+NAME
+     bmake -- maintain program dependencies
 
-SSYYNNOOPPSSIISS
-     bbmmaakkee [--BBeeiikkNNnnqqrrssttWWwwXX] [--CC _d_i_r_e_c_t_o_r_y] [--DD _v_a_r_i_a_b_l_e] [--dd _f_l_a_g_s]
-           [--ff _m_a_k_e_f_i_l_e] [--II _d_i_r_e_c_t_o_r_y] [--JJ _p_r_i_v_a_t_e] [--jj _m_a_x___j_o_b_s]
-           [--mm _d_i_r_e_c_t_o_r_y] [--TT _f_i_l_e] [--VV _v_a_r_i_a_b_l_e] [_v_a_r_i_a_b_l_e_=_v_a_l_u_e]
-           [_t_a_r_g_e_t _._._.]
-
-DDEESSCCRRIIPPTTIIOONN
-     bbmmaakkee is a program designed to simplify the maintenance of other
-     programs.  Its input is a list of specifications as to the files upon
-     which programs and other files depend.  If no --ff _m_a_k_e_f_i_l_e makefile option
-     is given, bbmmaakkee will try to open `_m_a_k_e_f_i_l_e' then `_M_a_k_e_f_i_l_e' in order to
-     find the specifications.  If the file `_._d_e_p_e_n_d' exists, it is read (see
+SYNOPSIS
+     bmake [-BeikNnqrstWwX] [-C directory] [-D variable] [-d flags]
+           [-f makefile] [-I directory] [-J private] [-j max_jobs]
+           [-m directory] [-T file] [-V variable] [-v variable]
+           [variable=value] [target ...]
+
+DESCRIPTION
+     bmake is a program designed to simplify the maintenance of other pro-
+     grams.  Its input is a list of specifications as to the files upon which
+     programs and other files depend.  If no -f makefile makefile option is
+     given, bmake will try to open `makefile' then `Makefile' in order to find
+     the specifications.  If the file `.depend' exists, it is read (see
      mkdep(1)).
 
      This manual page is intended as a reference document only.  For a more
-     thorough description of bbmmaakkee and makefiles, please refer to _P_M_a_k_e _- _A
-     _T_u_t_o_r_i_a_l_.
+     thorough description of bmake and makefiles, please refer to PMake - A
+     Tutorial.
 
-     bbmmaakkee will prepend the contents of the _M_A_K_E_F_L_A_G_S environment variable to
+     bmake will prepend the contents of the MAKEFLAGS environment variable to
      the command line arguments before parsing them.
 
      The options are as follows:
 
-     --BB      Try to be backwards compatible by executing a single shell per
+     -B      Try to be backwards compatible by executing a single shell per
              command and by executing the commands to make the sources of a
              dependency line in sequence.
 
-     --CC _d_i_r_e_c_t_o_r_y
-             Change to _d_i_r_e_c_t_o_r_y before reading the makefiles or doing
-             anything else.  If multiple --CC options are specified, each is
-             interpreted relative to the previous one: --CC _/ --CC _e_t_c is
-             equivalent to --CC _/_e_t_c.
+     -C directory
+             Change to directory before reading the makefiles or doing any-
+             thing else.  If multiple -C options are specified, each is inter-
+             preted relative to the previous one: -C / -C etc is equivalent to
+             -C /etc.
 
-     --DD _v_a_r_i_a_b_l_e
-             Define _v_a_r_i_a_b_l_e to be 1, in the global context.
+     -D variable
+             Define variable to be 1, in the global context.
 
-     --dd _[_-_]_f_l_a_g_s
-             Turn on debugging, and specify which portions of bbmmaakkee are to
+     -d [-]flags
+             Turn on debugging, and specify which portions of bmake are to
              print debugging information.  Unless the flags are preceded by
-             `-' they are added to the _M_A_K_E_F_L_A_G_S environment variable and will
+             `-' they are added to the MAKEFLAGS environment variable and will
              be processed by any child make processes.  By default, debugging
              information is printed to standard error, but this can be changed
-             using the _F debugging flag.  The debugging output is always
+             using the F debugging flag.  The debugging output is always
              unbuffered; in addition, if debugging is enabled but debugging
-             output is not directed to standard output, then the standard
-             output is line buffered.  _F_l_a_g_s is one or more of the following:
+             output is not directed to standard output, then the standard out-
+             put is line buffered.  Flags is one or more of the following:
 
-             _A       Print all possible debugging information; equivalent to
+             A       Print all possible debugging information; equivalent to
                      specifying all of the debugging flags.
 
-             _a       Print debugging information about archive searching and
+             a       Print debugging information about archive searching and
                      caching.
 
-             _C       Print debugging information about current working
-                     directory.
+             C       Print debugging information about current working direc-
+                     tory.
 
-             _c       Print debugging information about conditional evaluation.
+             c       Print debugging information about conditional evaluation.
 
-             _d       Print debugging information about directory searching and
+             d       Print debugging information about directory searching and
                      caching.
 
-             _e       Print debugging information about failed commands and
+             e       Print debugging information about failed commands and
                      targets.
 
-             _F[++]_f_i_l_e_n_a_m_e
+             F[+]filename
                      Specify where debugging output is written.  This must be
                      the last flag, because it consumes the remainder of the
                      argument.  If the character immediately after the `F'
@@ -80,161 +80,174 @@ DDEESSCCRRIIPPTTIIOONN
                      named file.  If the file name ends `.%d' then the `%d' is
                      replaced by the pid.
 
-             _f       Print debugging information about loop evaluation.
+             f       Print debugging information about loop evaluation.
 
-             _g_1      Print the input graph before making anything.
+             g1      Print the input graph before making anything.
 
-             _g_2      Print the input graph after making everything, or before
+             g2      Print the input graph after making everything, or before
                      exiting on error.
 
-             _g_3      Print the input graph before exiting on error.
+             g3      Print the input graph before exiting on error.
 
-             _j       Print debugging information about running multiple
+             j       Print debugging information about running multiple
                      shells.
 
-             _l       Print commands in Makefiles regardless of whether or not
+             l       Print commands in Makefiles regardless of whether or not
                      they are prefixed by `@' or other "quiet" flags.  Also
                      known as "loud" behavior.
 
-             _M       Print debugging information about "meta" mode decisions
+             M       Print debugging information about "meta" mode decisions
                      about targets.
 
-             _m       Print debugging information about making targets,
-                     including modification dates.
+             m       Print debugging information about making targets, includ-
+                     ing modification dates.
 
-             _n       Don't delete the temporary command scripts created when
+             n       Don't delete the temporary command scripts created when
                      running commands.  These temporary scripts are created in
-                     the directory referred to by the TMPDIR environment
-                     variable, or in _/_t_m_p if TMPDIR is unset or set to the
-                     empty string.  The temporary scripts are created by
-                     mkstemp(3), and have names of the form _m_a_k_e_X_X_X_X_X_X.  _N_O_T_E:
-                     This can create many files in TMPDIR or _/_t_m_p, so use with
-                     care.
+                     the directory referred to by the TMPDIR environment vari-
+                     able, or in /tmp if TMPDIR is unset or set to the empty
+                     string.  The temporary scripts are created by mkstemp(3),
+                     and have names of the form makeXXXXXX.  NOTE: This can
+                     create many files in TMPDIR or /tmp, so use with care.
 
-             _p       Print debugging information about makefile parsing.
+             p       Print debugging information about makefile parsing.
 
-             _s       Print debugging information about suffix-transformation
+             s       Print debugging information about suffix-transformation
                      rules.
 
-             _t       Print debugging information about target list
-                     maintenance.
+             t       Print debugging information about target list mainte-
+                     nance.
 
-             _V       Force the --VV option to print raw values of variables.
+             V       Force the -V option to print raw values of variables,
+                     overriding the default behavior set via
+                     .MAKE.EXPAND_VARIABLES.
 
-             _v       Print debugging information about variable assignment.
+             v       Print debugging information about variable assignment.
 
-             _x       Run shell commands with --xx so the actual commands are
+             x       Run shell commands with -x so the actual commands are
                      printed as they are executed.
 
-     --ee      Specify that environment variables override macro assignments
+     -e      Specify that environment variables override macro assignments
              within makefiles.
 
-     --ff _m_a_k_e_f_i_l_e
-             Specify a makefile to read instead of the default `_m_a_k_e_f_i_l_e'.  If
-             _m_a_k_e_f_i_l_e is `--', standard input is read.  Multiple makefiles may
+     -f makefile
+             Specify a makefile to read instead of the default `makefile'.  If
+             makefile is `-', standard input is read.  Multiple makefiles may
              be specified, and are read in the order specified.
 
-     --II _d_i_r_e_c_t_o_r_y
+     -I directory
              Specify a directory in which to search for makefiles and included
              makefiles.  The system makefile directory (or directories, see
-             the --mm option) is automatically included as part of this list.
+             the -m option) is automatically included as part of this list.
 
-     --ii      Ignore non-zero exit of shell commands in the makefile.
-             Equivalent to specifying `--' before each command line in the
-             makefile.
+     -i      Ignore non-zero exit of shell commands in the makefile.  Equiva-
+             lent to specifying `-' before each command line in the makefile.
 
-     --JJ _p_r_i_v_a_t_e
-             This option should _n_o_t be specified by the user.
+     -J private
+             This option should not be specified by the user.
 
-             When the _j option is in use in a recursive build, this option is
+             When the j option is in use in a recursive build, this option is
              passed by a make to child makes to allow all the make processes
              in the build to cooperate to avoid overloading the system.
 
-     --jj _m_a_x___j_o_b_s
-             Specify the maximum number of jobs that bbmmaakkee may have running at
-             any one time.  The value is saved in _._M_A_K_E_._J_O_B_S.  Turns
-             compatibility mode off, unless the _B flag is also specified.
-             When compatibility mode is off, all commands associated with a
-             target are executed in a single shell invocation as opposed to
-             the traditional one shell invocation per line.  This can break
-             traditional scripts which change directories on each command
-             invocation and then expect to start with a fresh environment on
-             the next line.  It is more efficient to correct the scripts
-             rather than turn backwards compatibility on.
+     -j max_jobs
+             Specify the maximum number of jobs that bmake may have running at
+             any one time.  The value is saved in .MAKE.JOBS.  Turns compati-
+             bility mode off, unless the B flag is also specified.  When com-
+             patibility mode is off, all commands associated with a target are
+             executed in a single shell invocation as opposed to the tradi-
+             tional one shell invocation per line.  This can break traditional
+             scripts which change directories on each command invocation and
+             then expect to start with a fresh environment on the next line.
+             It is more efficient to correct the scripts rather than turn
+             backwards compatibility on.
 
-     --kk      Continue processing after errors are encountered, but only on
+     -k      Continue processing after errors are encountered, but only on
              those targets that do not depend on the target whose creation
              caused the error.
 
-     --mm _d_i_r_e_c_t_o_r_y
+     -m directory
              Specify a directory in which to search for sys.mk and makefiles
-             included via the <_f_i_l_e>-style include statement.  The --mm option
+             included via the <file>-style include statement.  The -m option
              can be used multiple times to form a search path.  This path will
-             override the default system include path: /usr/share/mk.
-             Furthermore the system include path will be appended to the
-             search path used for "_f_i_l_e"-style include statements (see the --II
+             override the default system include path: /usr/share/mk.  Fur-
+             thermore the system include path will be appended to the search
+             path used for "file"-style include statements (see the -I
              option).
 
-             If a file or directory name in the --mm argument (or the
+             If a file or directory name in the -m argument (or the
              MAKESYSPATH environment variable) starts with the string ".../"
-             then bbmmaakkee will search for the specified file or directory named
+             then bmake will search for the specified file or directory named
              in the remaining part of the argument string.  The search starts
              with the current directory of the Makefile and then works upward
-             towards the root of the filesystem.  If the search is successful,
-             then the resulting directory replaces the ".../" specification in
-             the --mm argument.  If used, this feature allows bbmmaakkee to easily
-             search in the current source tree for customized sys.mk files
-             (e.g., by using ".../mk/sys.mk" as an argument).
-
-     --nn      Display the commands that would have been executed, but do not
-             actually execute them unless the target depends on the .MAKE
-             special source (see below).
+             towards the root of the file system.  If the search is success-
+             ful, then the resulting directory replaces the ".../" specifica-
+             tion in the -m argument.  If used, this feature allows bmake to
+             easily search in the current source tree for customized sys.mk
+             files (e.g., by using ".../mk/sys.mk" as an argument).
+
+     -n      Display the commands that would have been executed, but do not
+             actually execute them unless the target depends on the .MAKE spe-
+             cial source (see below).
 
-     --NN      Display the commands which would have been executed, but do not
+     -N      Display the commands which would have been executed, but do not
              actually execute any of them; useful for debugging top-level
              makefiles without descending into subdirectories.
 
-     --qq      Do not execute any commands, but exit 0 if the specified targets
+     -q      Do not execute any commands, but exit 0 if the specified targets
              are up-to-date and 1, otherwise.
 
-     --rr      Do not use the built-in rules specified in the system makefile.
+     -r      Do not use the built-in rules specified in the system makefile.
 
-     --ss      Do not echo any commands as they are executed.  Equivalent to
-             specifying `@@' before each command line in the makefile.
+     -s      Do not echo any commands as they are executed.  Equivalent to
+             specifying `@' before each command line in the makefile.
 
-     --TT _t_r_a_c_e_f_i_l_e
-             When used with the --jj flag, append a trace record to _t_r_a_c_e_f_i_l_e
+     -T tracefile
+             When used with the -j flag, append a trace record to tracefile
              for each job started and completed.
 
-     --tt      Rather than re-building a target as specified in the makefile,
+     -t      Rather than re-building a target as specified in the makefile,
              create it or update its modification time to make it appear up-
              to-date.
 
-     --VV _v_a_r_i_a_b_l_e
-             Print bbmmaakkee's idea of the value of _v_a_r_i_a_b_l_e, in the global
-             context.  Do not build any targets.  Multiple instances of this
-             option may be specified; the variables will be printed one per
-             line, with a blank line for each null or undefined variable.  If
-             _v_a_r_i_a_b_l_e contains a `$' then the value will be expanded before
-             printing.
-
-     --WW      Treat any warnings during makefile parsing as errors.
-
-     --ww      Print entering and leaving directory messages, pre and post
-             processing.
-
-     --XX      Don't export variables passed on the command line to the
-             environment individually.  Variables passed on the command line
-             are still exported via the _M_A_K_E_F_L_A_G_S environment variable.  This
+     -V variable
+             Print the value of variable.  Do not build any targets.  Multiple
+             instances of this option may be specified; the variables will be
+             printed one per line, with a blank line for each null or unde-
+             fined variable.  The value printed is extracted from the global
+             context after all makefiles have been read.  By default, the raw
+             variable contents (which may include additional unexpanded vari-
+             able references) are shown.  If variable contains a `$' then the
+             value will be recursively expanded to its complete resultant text
+             before printing.  The expanded value will also be printed if
+             .MAKE.EXPAND_VARIABLES is set to true and the -dV option has not
+             been used to override it.  Note that loop-local and target-local
+             variables, as well as values taken temporarily by global vari-
+             ables during makefile processing, are not accessible via this
+             option.  The -dv debug mode can be used to see these at the cost
+             of generating substantial extraneous output.
+
+     -v variable
+             Like -V but the variable is always expanded to its complete
+             value.
+
+     -W      Treat any warnings during makefile parsing as errors.
+
+     -w      Print entering and leaving directory messages, pre and post pro-
+             cessing.
+
+     -X      Don't export variables passed on the command line to the environ-
+             ment individually.  Variables passed on the command line are
+             still exported via the MAKEFLAGS environment variable.  This
              option may be useful on systems which have a small limit on the
              size of command arguments.
 
-     _v_a_r_i_a_b_l_e_=_v_a_l_u_e
-             Set the value of the variable _v_a_r_i_a_b_l_e to _v_a_l_u_e.  Normally, all
+     variable=value
+             Set the value of the variable variable to value.  Normally, all
              values passed on the command line are also exported to sub-makes
-             in the environment.  The --XX flag disables this behavior.
-             Variable assignments should follow options for POSIX
-             compatibility but no ordering is enforced.
+             in the environment.  The -X flag disables this behavior.  Vari-
+             able assignments should follow options for POSIX compatibility
+             but no ordering is enforced.
 
      There are seven different types of lines in a makefile: file dependency
      specifications, shell commands, variable assignments, include statements,
@@ -244,28 +257,28 @@ DDEESSCCRRIIPPTTIIOONN
      them with a backslash (`\').  The trailing newline character and initial
      whitespace on the following line are compressed into a single space.
 
-FFIILLEE DDEEPPEENNDDEENNCCYY SSPPEECCIIFFIICCAATTIIOONNSS
+FILE DEPENDENCY SPECIFICATIONS
      Dependency lines consist of one or more targets, an operator, and zero or
      more sources.  This creates a relationship where the targets ``depend''
      on the sources and are usually created from them.  The exact relationship
-     between the target and the source is determined by the operator that
-     separates them.  The three operators are as follows:
+     between the target and the source is determined by the operator that sep-
+     arates them.  The three operators are as follows:
 
-     ::     A target is considered out-of-date if its modification time is less
+     :     A target is considered out-of-date if its modification time is less
            than those of any of its sources.  Sources for a target accumulate
            over dependency lines when this operator is used.  The target is
-           removed if bbmmaakkee is interrupted.
+           removed if bmake is interrupted.
 
-     !!     Targets are always re-created, but not until all sources have been
-           examined and re-created as necessary.  Sources for a target
-           accumulate over dependency lines when this operator is used.  The
-           target is removed if bbmmaakkee is interrupted.
+     !     Targets are always re-created, but not until all sources have been
+           examined and re-created as necessary.  Sources for a target accumu-
+           late over dependency lines when this operator is used.  The target
+           is removed if bmake is interrupted.
 
-     ::::    If no sources are specified, the target is always re-created.
-           Otherwise, a target is considered out-of-date if any of its sources
+     ::    If no sources are specified, the target is always re-created.  Oth-
+           erwise, a target is considered out-of-date if any of its sources
            has been modified more recently than the target.  Sources for a
            target do not accumulate over dependency lines when this operator
-           is used.  The target will not be removed if bbmmaakkee is interrupted.
+           is used.  The target will not be removed if bmake is interrupted.
 
      Targets and sources may contain the shell wildcard values `?', `*', `[]',
      and `{}'.  The values `?', `*', and `[]' may only be used as part of the
@@ -274,42 +287,42 @@ FFIILLEE DDEEPPEENNDDEENNCC
      existing files.  Expansion is in directory order, not alphabetically as
      done in the shell.
 
-SSHHEELLLL CCOOMMMMAANNDDSS
-     Each target may have associated with it one or more lines of shell
-     commands, normally used to create the target.  Each of the lines in this
-     script _m_u_s_t be preceded by a tab.  (For historical reasons, spaces are
+SHELL COMMANDS
+     Each target may have associated with it one or more lines of shell com-
+     mands, normally used to create the target.  Each of the lines in this
+     script must be preceded by a tab.  (For historical reasons, spaces are
      not accepted.)  While targets can appear in many dependency lines if
      desired, by default only one of these rules may be followed by a creation
-     script.  If the `::::' operator is used, however, all rules may include
+     script.  If the `::' operator is used, however, all rules may include
      scripts and the scripts are executed in the order found.
 
      Each line is treated as a separate shell command, unless the end of line
      is escaped with a backslash (`\') in which case that line and the next
      are combined.  If the first characters of the command are any combination
-     of `@@', `++', or `--', the command is treated specially.  A `@@' causes the
-     command not to be echoed before it is executed.  A `++' causes the command
-     to be executed even when --nn is given.  This is similar to the effect of
-     the .MAKE special source, except that the effect can be limited to a
-     single line of a script.  A `--' in compatibility mode causes any non-zero
+     of `@', `+', or `-', the command is treated specially.  A `@' causes the
+     command not to be echoed before it is executed.  A `+' causes the command
+     to be executed even when -n is given.  This is similar to the effect of
+     the .MAKE special source, except that the effect can be limited to a sin-
+     gle line of a script.  A `-' in compatibility mode causes any non-zero
      exit status of the command line to be ignored.
 
-     When bbmmaakkee is run in jobs mode with --jj _m_a_x___j_o_b_s, the entire script for
+     When bmake is run in jobs mode with -j max_jobs, the entire script for
      the target is fed to a single instance of the shell.  In compatibility
-     (non-jobs) mode, each command is run in a separate process.  If the
-     command contains any shell meta characters (`#=|^(){};&<>*?[]:$`\\n') it
-     will be passed to the shell; otherwise bbmmaakkee will attempt direct
-     execution.  If a line starts with `--' and the shell has ErrCtl enabled
-     then failure of the command line will be ignored as in compatibility
-     mode.  Otherwise `--' affects the entire job; the script will stop at the
-     first command line that fails, but the target will not be deemed to have
+     (non-jobs) mode, each command is run in a separate process.  If the com-
+     mand contains any shell meta characters (`#=|^(){};&<>*?[]:$`\\n') it
+     will be passed to the shell; otherwise bmake will attempt direct execu-
+     tion.  If a line starts with `-' and the shell has ErrCtl enabled then
+     failure of the command line will be ignored as in compatibility mode.
+     Otherwise `-' affects the entire job; the script will stop at the first
+     command line that fails, but the target will not be deemed to have
      failed.
 
-     Makefiles should be written so that the mode of bbmmaakkee operation does not
+     Makefiles should be written so that the mode of bmake operation does not
      change their behavior.  For example, any command which needs to use
-     ``cd'' or ``chdir'' without potentially changing the directory for
-     subsequent commands should be put in parentheses so it executes in a
-     subshell.  To force the use of one shell, escape the line breaks so as to
-     make the whole script one command.  For example:
+     ``cd'' or ``chdir'' without potentially changing the directory for subse-
+     quent commands should be put in parentheses so it executes in a subshell.
+     To force the use of one shell, escape the line breaks so as to make the
+     whole script one command.  For example:
 
            avoid-chdir-side-effects:
                    @echo Building $@ in `pwd`
@@ -321,47 +334,47 @@ SSHHEELLLL CCOOMMMMAANNDDSS
                    (cd ${.CURDIR} && ${MAKE} $@); \
                    echo Back in `pwd`
 
-     Since bbmmaakkee will chdir(2) to `_._O_B_J_D_I_R' before executing any targets, each
+     Since bmake will chdir(2) to `.OBJDIR' before executing any targets, each
      child process starts with that as its current working directory.
 
-VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS
-     Variables in make are much like variables in the shell, and, by
-     tradition, consist of all upper-case letters.
+VARIABLE ASSIGNMENTS
+     Variables in make are much like variables in the shell, and, by tradi-
+     tion, consist of all upper-case letters.
 
-   VVaarriiaabbllee aassssiiggnnmmeenntt mmooddiiffiieerrss
+   Variable assignment modifiers
      The five operators that can be used to assign values to variables are as
      follows:
 
-     ==       Assign the value to the variable.  Any previous value is
-             overridden.
+     =       Assign the value to the variable.  Any previous value is overrid-
+             den.
 
-     ++==      Append the value to the current value of the variable.
+     +=      Append the value to the current value of the variable.
 
-     ??==      Assign the value to the variable if it is not already defined.
+     ?=      Assign the value to the variable if it is not already defined.
 
-     ::==      Assign with expansion, i.e. expand the value before assigning it
-             to the variable.  Normally, expansion is not done until the
-             variable is referenced.  _N_O_T_E: References to undefined variables
-             are _n_o_t expanded.  This can cause problems when variable
-             modifiers are used.
+     :=      Assign with expansion, i.e. expand the value before assigning it
+             to the variable.  Normally, expansion is not done until the vari-
+             able is referenced.  NOTE: References to undefined variables are
+             not expanded.  This can cause problems when variable modifiers
+             are used.
 
-     !!==      Expand the value and pass it to the shell for execution and
+     !=      Expand the value and pass it to the shell for execution and
              assign the result to the variable.  Any newlines in the result
              are replaced with spaces.
 
-     Any white-space before the assigned _v_a_l_u_e is removed; if the value is
+     Any white-space before the assigned value is removed; if the value is
      being appended, a single space is inserted between the previous contents
      of the variable and the appended value.
 
      Variables are expanded by surrounding the variable name with either curly
      braces (`{}') or parentheses (`()') and preceding it with a dollar sign
-     (`$').  If the variable name contains only a single letter, the
-     surrounding braces or parentheses are not required.  This shorter form is
-     not recommended.
+     (`$').  If the variable name contains only a single letter, the surround-
+     ing braces or parentheses are not required.  This shorter form is not
+     recommended.
 
      If the variable name contains a dollar, then the name itself is expanded
-     first.  This allows almost arbitrary variable names, however names
-     containing dollar, braces, parenthesis, or whitespace are really best
+     first.  This allows almost arbitrary variable names, however names con-
+     taining dollar, braces, parenthesis, or whitespace are really best
      avoided!
 
      If the result of expanding a variable contains a dollar sign (`$') the
@@ -376,8 +389,8 @@ VVAARRIIAABBLLEE AASSSSIIGG
           executed.
 
      3.   ``.for'' loop index variables are expanded on each loop iteration.
-          Note that other variables are not expanded inside loops so the
-          following example code:
+          Note that other variables are not expanded inside loops so the fol-
+          lowing example code:
 
 
                 .for i in 1 2 3
@@ -399,12 +412,12 @@ VVAARRIIAABBLLEE AASSSSIIGG
           ${b} contains ``${j} ${j} ${j}'' which expands to ``3 3 3'' since
           after the loop completes ${j} contains ``3''.
 
-   VVaarriiaabbllee ccllaasssseess
-     The four different classes of variables (in order of increasing
-     precedence) are:
+   Variable classes
+     The four different classes of variables (in order of increasing prece-
+     dence) are:
 
      Environment variables
-             Variables defined as part of bbmmaakkee's environment.
+             Variables defined as part of bmake's environment.
 
      Global variables
              Variables defined in the makefile or in included makefiles.
@@ -416,230 +429,269 @@ VVAARRIIAABBLLEE AASSSSIIGG
              Variables that are defined specific to a certain target.
 
      Local variables are all built in and their values vary magically from
-     target to target.  It is not currently possible to define new local
-     variables.  The seven local variables are as follows:
+     target to target.  It is not currently possible to define new local vari-
+     ables.  The seven local variables are as follows:
 
-           _._A_L_L_S_R_C   The list of all sources for this target; also known as
-                     `_>'.
+           .ALLSRC   The list of all sources for this target; also known as
+                     `>'.
 
-           _._A_R_C_H_I_V_E  The name of the archive file; also known as `_!'.
+           .ARCHIVE  The name of the archive file; also known as `!'.
 
-           _._I_M_P_S_R_C   In suffix-transformation rules, the name/path of the
+           .IMPSRC   In suffix-transformation rules, the name/path of the
                      source from which the target is to be transformed (the
-                     ``implied'' source); also known as `_<'.  It is not
+                     ``implied'' source); also known as `<'.  It is not
                      defined in explicit rules.
 
-           _._M_E_M_B_E_R   The name of the archive member; also known as `_%'.
+           .MEMBER   The name of the archive member; also known as `%'.
 
-           _._O_O_D_A_T_E   The list of sources for this target that were deemed out-
-                     of-date; also known as `_?'.
+           .OODATE   The list of sources for this target that were deemed out-
+                     of-date; also known as `?'.
 
-           _._P_R_E_F_I_X   The file prefix of the target, containing only the file
+           .PREFIX   The file prefix of the target, containing only the file
                      portion, no suffix or preceding directory components;
-                     also known as `_*'.  The suffix must be one of the known
-                     suffixes declared with ..SSUUFFFFIIXXEESS or it will not be
-                     recognized.
+                     also known as `*'.  The suffix must be one of the known
+                     suffixes declared with .SUFFIXES or it will not be recog-
+                     nized.
+
+           .TARGET   The name of the target; also known as `@'.  For compati-
+                     bility with other makes this is an alias for .ARCHIVE in
+                     archive member rules.
 
-           _._T_A_R_G_E_T   The name of the target; also known as `_@'.
-
-     The shorter forms (`_>', `_!', `_<', `_%', `_?', `_*', and `_@') are permitted
+     The shorter forms (`>', `!', `<', `%', `?', `*', and `@') are permitted
      for backward compatibility with historical makefiles and legacy POSIX
      make and are not recommended.
 
      Variants of these variables with the punctuation followed immediately by
-     `D' or `F', e.g.  `_$_(_@_D_)', are legacy forms equivalent to using the `:H'
+     `D' or `F', e.g.  `$(@D)', are legacy forms equivalent to using the `:H'
      and `:T' modifiers.  These forms are accepted for compatibility with AT&T
      System V UNIX makefiles and POSIX but are not recommended.
 
      Four of the local variables may be used in sources on dependency lines
      because they expand to the proper value for each target on the line.
-     These variables are `_._T_A_R_G_E_T', `_._P_R_E_F_I_X', `_._A_R_C_H_I_V_E', and `_._M_E_M_B_E_R'.
+     These variables are `.TARGET', `.PREFIX', `.ARCHIVE', and `.MEMBER'.
 
-   AAddddiittiioonnaall bbuuiilltt--iinn vvaarriiaabblleess
-     In addition, bbmmaakkee sets or knows about the following variables:
+   Additional built-in variables
+     In addition, bmake sets or knows about the following variables:
 
-     _$               A single dollar sign `$', i.e.  `$$' expands to a single
+     $               A single dollar sign `$', i.e.  `$$' expands to a single
                      dollar sign.
 
-     _._A_L_L_T_A_R_G_E_T_S     The list of all targets encountered in the Makefile.  If
-                     evaluated during Makefile parsing, lists only those
-                     targets encountered thus far.
+     .ALLTARGETS     The list of all targets encountered in the Makefile.  If
+                     evaluated during Makefile parsing, lists only those tar-
+                     gets encountered thus far.
 
-     _._C_U_R_D_I_R         A path to the directory where bbmmaakkee was executed.  Refer
+     .CURDIR         A path to the directory where bmake was executed.  Refer
                      to the description of `PWD' for more details.
 
-     _._I_N_C_L_U_D_E_D_F_R_O_M_D_I_R
+     .INCLUDEDFROMDIR
                      The directory of the file this Makefile was included
                      from.
 
-     _._I_N_C_L_U_D_E_D_F_R_O_M_F_I_L_E
+     .INCLUDEDFROMFILE
                      The filename of the file this Makefile was included from.
 
-     MAKE            The name that bbmmaakkee was executed with (_a_r_g_v_[_0_]).  For
-                     compatibility bbmmaakkee also sets _._M_A_K_E with the same value.
+     MAKE            The name that bmake was executed with (argv[0]).  For
+                     compatibility bmake also sets .MAKE with the same value.
                      The preferred variable to use is the environment variable
                      MAKE because it is more compatible with other versions of
-                     bbmmaakkee and cannot be confused with the special target with
+                     bmake and cannot be confused with the special target with
                      the same name.
 
-     _._M_A_K_E_._D_E_P_E_N_D_F_I_L_E
-                     Names the makefile (default `_._d_e_p_e_n_d') from which
-                     generated dependencies are read.
-
-     _._M_A_K_E_._E_X_P_A_N_D___V_A_R_I_A_B_L_E_S
-                     A boolean that controls the default behavior of the --VV
-                     option.
+     .MAKE.DEPENDFILE
+                     Names the makefile (default `.depend') from which gener-
+                     ated dependencies are read.
+
+     .MAKE.EXPAND_VARIABLES
+                     A boolean that controls the default behavior of the -V
+                     option.  If true, variable values printed with -V are
+                     fully expanded; if false, the raw variable contents
+                     (which may include additional unexpanded variable refer-
+                     ences) are shown.
 
-     _._M_A_K_E_._E_X_P_O_R_T_E_D  The list of variables exported by bbmmaakkee.
+     .MAKE.EXPORTED  The list of variables exported by bmake.
 
-     _._M_A_K_E_._J_O_B_S      The argument to the --jj option.
+     .MAKE.JOBS      The argument to the -j option.
 
-     _._M_A_K_E_._J_O_B_._P_R_E_F_I_X
-                     If bbmmaakkee is run with _j then output for each target is
+     .MAKE.JOB.PREFIX
+                     If bmake is run with j then output for each target is
                      prefixed with a token `--- target ---' the first part of
-                     which can be controlled via _._M_A_K_E_._J_O_B_._P_R_E_F_I_X.  If
-                     _._M_A_K_E_._J_O_B_._P_R_E_F_I_X is empty, no token is printed.
+                     which can be controlled via .MAKE.JOB.PREFIX.  If
+                     .MAKE.JOB.PREFIX is empty, no token is printed.
                      For example:
                      .MAKE.JOB.PREFIX=${.newline}---${.MAKE:T}[${.MAKE.PID}]
-                     would produce tokens like `---make[1234] target ---'
-                     making it easier to track the degree of parallelism being
+                     would produce tokens like `---make[1234] target ---' mak-
+                     ing it easier to track the degree of parallelism being
                      achieved.
 
      MAKEFLAGS       The environment variable `MAKEFLAGS' may contain anything
-                     that may be specified on bbmmaakkee's command line.  Anything
-                     specified on bbmmaakkee's command line is appended to the
-                     `MAKEFLAGS' variable which is then entered into the
-                     environment for all programs which bbmmaakkee executes.
+                     that may be specified on bmake's command line.  Anything
+                     specified on bmake's command line is appended to the
+                     `MAKEFLAGS' variable which is then entered into the envi-
+                     ronment for all programs which bmake executes.
 
-     _._M_A_K_E_._L_E_V_E_L     The recursion depth of bbmmaakkee.  The initial instance of
-                     bbmmaakkee will be 0, and an incremented value is put into the
+     .MAKE.LEVEL     The recursion depth of bmake.  The initial instance of
+                     bmake will be 0, and an incremented value is put into the
                      environment to be seen by the next generation.  This
                      allows tests like: .if ${.MAKE.LEVEL} == 0 to protect
                      things which should only be evaluated in the initial
-                     instance of bbmmaakkee.
+                     instance of bmake.
 
-     _._M_A_K_E_._M_A_K_E_F_I_L_E___P_R_E_F_E_R_E_N_C_E
-                     The ordered list of makefile names (default `_m_a_k_e_f_i_l_e',
-                     `_M_a_k_e_f_i_l_e') that bbmmaakkee will look for.
+     .MAKE.MAKEFILE_PREFERENCE
+                     The ordered list of makefile names (default `makefile',
+                     `Makefile') that bmake will look for.
 
-     _._M_A_K_E_._M_A_K_E_F_I_L_E_S
-                     The list of makefiles read by bbmmaakkee, which is useful for
+     .MAKE.MAKEFILES
+                     The list of makefiles read by bmake, which is useful for
                      tracking dependencies.  Each makefile is recorded only
                      once, regardless of the number of times read.
 
-     _._M_A_K_E_._M_O_D_E      Processed after reading all makefiles.  Can affect the
-                     mode that bbmmaakkee runs in.  It can contain a number of
-                     keywords:
-
-                     _c_o_m_p_a_t      Like --BB, puts bbmmaakkee into "compat" mode.
-
-                     _m_e_t_a        Puts bbmmaakkee into "meta" mode, where meta files
-                                 are created for each target to capture the
-                                 command run, the output generated and if
-                                 filemon(4) is available, the system calls
-                                 which are of interest to bbmmaakkee.  The captured
-                                 output can be very useful when diagnosing
-                                 errors.
-
-                     _c_u_r_d_i_r_O_k_= _b_f Normally bbmmaakkee will not create .meta files
-                                 in `_._C_U_R_D_I_R'.  This can be overridden by
-                                 setting _b_f to a value which represents True.
-
-                     _e_n_v         For debugging, it can be useful to inlcude
-                                 the environment in the .meta file.
-
-                     _v_e_r_b_o_s_e     If in "meta" mode, print a clue about the
-                                 target being built.  This is useful if the
-                                 build is otherwise running silently.  The
-                                 message printed the value of:
-                                 _._M_A_K_E_._M_E_T_A_._P_R_E_F_I_X.
-
-                     _i_g_n_o_r_e_-_c_m_d  Some makefiles have commands which are simply
-                                 not stable.  This keyword causes them to be
-                                 ignored for determining whether a target is
-                                 out of date in "meta" mode.  See also
-                                 ..NNOOMMEETTAA__CCMMPP.
+     .MAKE.MODE      Processed after reading all makefiles.  Can affect the
+                     mode that bmake runs in.  It can contain a number of key-
+                     words:
+
+                     compat               Like -B, puts bmake into "compat"
+                                          mode.
+
+                     meta                 Puts bmake into "meta" mode, where
+                                          meta files are created for each tar-
+                                          get to capture the command run, the
+                                          output generated and if filemon(4)
+                                          is available, the system calls which
+                                          are of interest to bmake.  The cap-
+                                          tured output can be very useful when
+                                          diagnosing errors.
+
+                     curdirOk= bf         Normally bmake will not create .meta
+                                          files in `.CURDIR'.  This can be
+                                          overridden by setting bf to a value
+                                          which represents True.
+
+                     missing-meta= bf     If bf is True, then a missing .meta
+                                          file makes the target out-of-date.
+
+                     missing-filemon= bf  If bf is True, then missing filemon
+                                          data makes the target out-of-date.
+
+                     nofilemon            Do not use filemon(4).
+
+                     env                  For debugging, it can be useful to
+                                          include the environment in the .meta
+                                          file.
+
+                     verbose              If in "meta" mode, print a clue
+                                          about the target being built.  This
+                                          is useful if the build is otherwise
+                                          running silently.  The message
+                                          printed the value of:
+                                          .MAKE.META.PREFIX.
+
+                     ignore-cmd           Some makefiles have commands which
+                                          are simply not stable.  This keyword
+                                          causes them to be ignored for deter-
+                                          mining whether a target is out of
+                                          date in "meta" mode.  See also
+                                          .NOMETA_CMP.
 
-                     _s_i_l_e_n_t_= _b_f  If _b_f is True, when a .meta file is created,
-                                 mark the target ..SSIILLEENNTT.
+                     silent= bf           If bf is True, when a .meta file is
+                                          created, mark the target .SILENT.
 
-     _._M_A_K_E_._M_E_T_A_._B_A_I_L_I_W_I_C_K
+     .MAKE.META.BAILIWICK
                      In "meta" mode, provides a list of prefixes which match
-                     the directories controlled by bbmmaakkee.  If a file that was
-                     generated outside of _._O_B_J_D_I_R but within said bailiwick is
+                     the directories controlled by bmake.  If a file that was
+                     generated outside of .OBJDIR but within said bailiwick is
                      missing, the current target is considered out-of-date.
 
-     _._M_A_K_E_._M_E_T_A_._C_R_E_A_T_E_D
+     .MAKE.META.CREATED
                      In "meta" mode, this variable contains a list of all the
                      meta files updated.  If not empty, it can be used to
-                     trigger processing of _._M_A_K_E_._M_E_T_A_._F_I_L_E_S.
+                     trigger processing of .MAKE.META.FILES.
 
-     _._M_A_K_E_._M_E_T_A_._F_I_L_E_S
+     .MAKE.META.FILES
                      In "meta" mode, this variable contains a list of all the
                      meta files used (updated or not).  This list can be used
-                     to process the meta files to extract dependency
-                     information.
+                     to process the meta files to extract dependency informa-
+                     tion.
 
-     _._M_A_K_E_._M_E_T_A_._I_G_N_O_R_E___P_A_T_H_S
+     .MAKE.META.IGNORE_PATHS
                      Provides a list of path prefixes that should be ignored;
                      because the contents are expected to change over time.
-                     The default list includes: `_/_d_e_v _/_e_t_c _/_p_r_o_c _/_t_m_p _/_v_a_r_/_r_u_n
-                     _/_v_a_r_/_t_m_p'
+                     The default list includes: `/dev /etc /proc /tmp /var/run
+                     /var/tmp'
 
-     _._M_A_K_E_._M_E_T_A_._P_R_E_F_I_X
+     .MAKE.META.IGNORE_PATTERNS
+                     Provides a list of patterns to match against pathnames.
+                     Ignore any that match.
+
+     .MAKE.META.IGNORE_FILTER
+                     Provides a list of variable modifiers to apply to each
+                     pathname.  Ignore if the expansion is an empty string.
+
+     .MAKE.META.PREFIX
                      Defines the message printed for each meta file updated in
                      "meta verbose" mode.  The default value is:
                            Building ${.TARGET:H:tA}/${.TARGET:T}
 
-     _._M_A_K_E_O_V_E_R_R_I_D_E_S  This variable is used to record the names of variables
+     .MAKEOVERRIDES  This variable is used to record the names of variables
                      assigned to on the command line, so that they may be
-                     exported as part of `MAKEFLAGS'.  This behaviour can be
-                     disabled by assigning an empty value to `_._M_A_K_E_O_V_E_R_R_I_D_E_S'
+                     exported as part of `MAKEFLAGS'.  This behavior can be
+                     disabled by assigning an empty value to `.MAKEOVERRIDES'
                      within a makefile.  Extra variables can be exported from
-                     a makefile by appending their names to `_._M_A_K_E_O_V_E_R_R_I_D_E_S'.
-                     `MAKEFLAGS' is re-exported whenever `_._M_A_K_E_O_V_E_R_R_I_D_E_S' is
+                     a makefile by appending their names to `.MAKEOVERRIDES'.
+                     `MAKEFLAGS' is re-exported whenever `.MAKEOVERRIDES' is
                      modified.
 
-     _._M_A_K_E_._P_A_T_H___F_I_L_E_M_O_N
-                     If bbmmaakkee was built with filemon(4) support, this is set
+     .MAKE.PATH_FILEMON
+                     If bmake was built with filemon(4) support, this is set
                      to the path of the device node.  This allows makefiles to
                      test for this support.
 
-     _._M_A_K_E_._P_I_D       The process-id of bbmmaakkee.
+     .MAKE.PID       The process-id of bmake.
 
-     _._M_A_K_E_._P_P_I_D      The parent process-id of bbmmaakkee.
+     .MAKE.PPID      The parent process-id of bmake.
 
-     _M_A_K_E___P_R_I_N_T___V_A_R___O_N___E_R_R_O_R
-                     When bbmmaakkee stops due to an error, it prints its name and
-                     the value of `_._C_U_R_D_I_R' as well as the value of any
-                     variables named in `_M_A_K_E___P_R_I_N_T___V_A_R___O_N___E_R_R_O_R'.
+     .MAKE.SAVE_DOLLARS
+                     value should be a boolean that controls whether `$$' are
+                     preserved when doing `:=' assignments.  The default is
+                     false, for backwards compatibility.  Set to true for com-
+                     patability with other makes.  If set to false, `$$'
+                     becomes `$' per normal evaluation rules.
+
+     MAKE_PRINT_VAR_ON_ERROR
+                     When bmake stops due to an error, it sets `.ERROR_TARGET'
+                     to the name of the target that failed, `.ERROR_CMD' to
+                     the commands of the failed target, and in "meta" mode, it
+                     also sets `.ERROR_CWD' to the getcwd(3), and
+                     `.ERROR_META_FILE' to the path of the meta file (if any)
+                     describing the failed target.  It then prints its name
+                     and the value of `.CURDIR' as well as the value of any
+                     variables named in `MAKE_PRINT_VAR_ON_ERROR'.
 
-     _._n_e_w_l_i_n_e        This variable is simply assigned a newline character as
-                     its value.  This allows expansions using the ::@@ modifier
+     .newline        This variable is simply assigned a newline character as
+                     its value.  This allows expansions using the :@ modifier
                      to put a newline between iterations of the loop rather
                      than a space.  For example, the printing of
-                     `_M_A_K_E___P_R_I_N_T___V_A_R___O_N___E_R_R_O_R' could be done as
+                     `MAKE_PRINT_VAR_ON_ERROR' could be done as
                      ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@}.
 
-     _._O_B_J_D_I_R         A path to the directory where the targets are built.  Its
-                     value is determined by trying to chdir(2) to the
-                     following directories in order and using the first match:
+     .OBJDIR         A path to the directory where the targets are built.  Its
+                     value is determined by trying to chdir(2) to the follow-
+                     ing directories in order and using the first match:
 
                      1.   ${MAKEOBJDIRPREFIX}${.CURDIR}
 
-                          (Only if `MAKEOBJDIRPREFIX' is set in the
-                          environment or on the command line.)
+                          (Only if `MAKEOBJDIRPREFIX' is set in the environ-
+                          ment or on the command line.)
 
                      2.   ${MAKEOBJDIR}
 
                           (Only if `MAKEOBJDIR' is set in the environment or
                           on the command line.)
 
-                     3.   ${.CURDIR}_/_o_b_j_.${MACHINE}
+                     3.   ${.CURDIR}/obj.${MACHINE}
 
-                     4.   ${.CURDIR}_/_o_b_j
+                     4.   ${.CURDIR}/obj
 
-                     5.   _/_u_s_r_/_o_b_j_/${.CURDIR}
+                     5.   /usr/obj/${.CURDIR}
 
                      6.   ${.CURDIR}
 
@@ -649,46 +701,46 @@ VVAARRIIAABBLLEE AASSSSIIGG
                      may be used.  This is especially useful with
                      `MAKEOBJDIR'.
 
-                     `_._O_B_J_D_I_R' may be modified in the makefile as a global
-                     variable.  In all cases, bbmmaakkee will chdir(2) to `_._O_B_J_D_I_R'
-                     and set `PWD' to that directory before executing any
-                     targets.
+                     `.OBJDIR' may be modified in the makefile via the special
+                     target `.OBJDIR'.  In all cases, bmake will chdir(2) to
+                     the specified directory if it exists, and set `.OBJDIR'
+                     and `PWD' to that directory before executing any targets.
 
-     _._P_A_R_S_E_D_I_R       A path to the directory of the current `_M_a_k_e_f_i_l_e' being
+     .PARSEDIR       A path to the directory of the current `Makefile' being
                      parsed.
 
-     _._P_A_R_S_E_F_I_L_E      The basename of the current `_M_a_k_e_f_i_l_e' being parsed.
-                     This variable and `_._P_A_R_S_E_D_I_R' are both set only while the
-                     `_M_a_k_e_f_i_l_e_s' are being parsed.  If you want to retain
+     .PARSEFILE      The basename of the current `Makefile' being parsed.
+                     This variable and `.PARSEDIR' are both set only while the
+                     `Makefiles' are being parsed.  If you want to retain
                      their current values, assign them to a variable using
-                     assignment with expansion: (`::==').
+                     assignment with expansion: (`:=').
 
-     _._P_A_T_H           A variable that represents the list of directories that
-                     bbmmaakkee will search for files.  The search list should be
-                     updated using the target `_._P_A_T_H' rather than the
-                     variable.
+     .PATH           A variable that represents the list of directories that
+                     bmake will search for files.  The search list should be
+                     updated using the target `.PATH' rather than the vari-
+                     able.
 
-     PWD             Alternate path to the current directory.  bbmmaakkee normally
-                     sets `_._C_U_R_D_I_R' to the canonical path given by getcwd(3).
+     PWD             Alternate path to the current directory.  bmake normally
+                     sets `.CURDIR' to the canonical path given by getcwd(3).
                      However, if the environment variable `PWD' is set and
-                     gives a path to the current directory, then bbmmaakkee sets
-                     `_._C_U_R_D_I_R' to the value of `PWD' instead.  This behaviour
+                     gives a path to the current directory, then bmake sets
+                     `.CURDIR' to the value of `PWD' instead.  This behavior
                      is disabled if `MAKEOBJDIRPREFIX' is set or `MAKEOBJDIR'
                      contains a variable transform.  `PWD' is set to the value
-                     of `_._O_B_J_D_I_R' for all programs which bbmmaakkee executes.
+                     of `.OBJDIR' for all programs which bmake executes.
 
      .TARGETS        The list of targets explicitly specified on the command
                      line, if any.
 
-     VPATH           Colon-separated (``:'') lists of directories that bbmmaakkee
+     VPATH           Colon-separated (``:'') lists of directories that bmake
                      will search for files.  The variable is supported for
-                     compatibility with old make programs only, use `_._P_A_T_H'
+                     compatibility with old make programs only, use `.PATH'
                      instead.
 
-   VVaarriiaabbllee mmooddiiffiieerrss
+   Variable modifiers
      Variable expansion may be modified to select or modify each word of the
-     variable (where a ``word'' is white-space delimited sequence of
-     characters).  The general format of a variable expansion is as follows:
+     variable (where a ``word'' is white-space delimited sequence of charac-
+     ters).  The general format of a variable expansion is as follows:
 
            ${variable[:modifier[:...]]}
 
@@ -707,32 +759,32 @@ VVAARRIIAABBLLEE AASSSSIIGG
 
      The supported modifiers are:
 
-     ::EE   Replaces each word in the variable with its suffix.
+     :E   Replaces each word in the variable with its suffix.
 
-     ::HH   Replaces each word in the variable with everything but the last
-          component.
+     :H   Replaces each word in the variable with everything but the last com-
+          ponent.
 
-     ::MM_p_a_t_t_e_r_n
-          Select only those words that match _p_a_t_t_e_r_n.  The standard shell
+     :Mpattern
+          Select only those words that match pattern.  The standard shell
           wildcard characters (`*', `?', and `[]') may be used.  The wildcard
           characters may be escaped with a backslash (`\').  As a consequence
           of the way values are split into words, matched, and then joined, a
           construct like
                 ${VAR:M*}
-          will normalise the inter-word spacing, removing all leading and
+          will normalize the inter-word spacing, removing all leading and
           trailing space, and converting multiple consecutive spaces to single
           spaces.
 
-     ::NN_p_a_t_t_e_r_n
-          This is identical to `::MM', but selects all words which do not match
-          _p_a_t_t_e_r_n.
+     :Npattern
+          This is identical to `:M', but selects all words which do not match
+          pattern.
 
-     ::OO   Order every word in variable alphabetically.  To sort words in
-          reverse order use the `::OO::[[--11....11]]' combination of modifiers.
+     :O   Order every word in variable alphabetically.  To sort words in
+          reverse order use the `:O:[-1..1]' combination of modifiers.
 
-     ::OOxx  Randomize words in variable.  The results will be different each
+     :Ox  Randomize words in variable.  The results will be different each
           time you are referring to the modified variable; use the assignment
-          with expansion (`::==') to prevent such behaviour.  For example,
+          with expansion (`:=') to prevent such behavior.  For example,
 
                 LIST=                   uno due tre quattro
                 RANDOM_LIST=            ${LIST:Ox}
@@ -750,88 +802,92 @@ VVAARRIIAABBLLEE AASSSSIIGG
                 due uno quattro tre
                 due uno quattro tre
 
-     ::QQ   Quotes every shell meta-character in the variable, so that it can be
-          passed safely through recursive invocations of bbmmaakkee.
+     :Q   Quotes every shell meta-character in the variable, so that it can be
+          passed safely through recursive invocations of bmake.
 
-     ::RR   Replaces each word in the variable with everything but its suffix.
+     :R   Replaces each word in the variable with everything but its suffix.
 
-     ::ggmmttiimmee
-          The value is a format string for strftime(3), using the current
-          gmtime(3).
+     :range[=count]
+          The value is an integer sequence representing the words of the orig-
+          inal value, or the supplied count.
 
-     ::hhaasshh
-          Compute a 32bit hash of the value and encode it as hex digits.
+     :gmtime[=utc]
+          The value is a format string for strftime(3), using gmtime(3).  If a
+          utc value is not provided or is 0, the current time is used.
 
-     ::llooccaallttiimmee
-          The value is a format string for strftime(3), using the current
-          localtime(3).
+     :hash
+          Compute a 32-bit hash of the value and encode it as hex digits.
 
-     ::ttAA  Attempt to convert variable to an absolute path using realpath(3),
+     :localtime[=utc]
+          The value is a format string for strftime(3), using localtime(3).
+          If a utc value is not provided or is 0, the current time is used.
+
+     :tA  Attempt to convert variable to an absolute path using realpath(3),
           if that fails, the value is unchanged.
 
-     ::ttll  Converts variable to lower-case letters.
+     :tl  Converts variable to lower-case letters.
 
-     ::ttss_c
-          Words in the variable are normally separated by a space on
-          expansion.  This modifier sets the separator to the character _c.  If
-          _c is omitted, then no separator is used.  The common escapes
-          (including octal numeric codes), work as expected.
+     :tsc
+          Words in the variable are normally separated by a space on expan-
+          sion.  This modifier sets the separator to the character c.  If c is
+          omitted, then no separator is used.  The common escapes (including
+          octal numeric codes), work as expected.
 
-     ::ttuu  Converts variable to upper-case letters.
+     :tu  Converts variable to upper-case letters.
 
-     ::ttWW  Causes the value to be treated as a single word (possibly containing
-          embedded white space).  See also `::[[**]]'.
+     :tW  Causes the value to be treated as a single word (possibly containing
+          embedded white space).  See also `:[*]'.
 
-     ::ttww  Causes the value to be treated as a sequence of words delimited by
-          white space.  See also `::[[@@]]'.
+     :tw  Causes the value to be treated as a sequence of words delimited by
+          white space.  See also `:[@]'.
 
-     ::SS/_o_l_d___s_t_r_i_n_g/_n_e_w___s_t_r_i_n_g/[11ggWW]
-          Modify the first occurrence of _o_l_d___s_t_r_i_n_g in the variable's value,
-          replacing it with _n_e_w___s_t_r_i_n_g.  If a `g' is appended to the last
+     :S/old_string/new_string/[1gW]
+          Modify the first occurrence of old_string in the variable's value,
+          replacing it with new_string.  If a `g' is appended to the last
           slash of the pattern, all occurrences in each word are replaced.  If
           a `1' is appended to the last slash of the pattern, only the first
           word is affected.  If a `W' is appended to the last slash of the
-          pattern, then the value is treated as a single word (possibly
-          containing embedded white space).  If _o_l_d___s_t_r_i_n_g begins with a caret
-          (`^'), _o_l_d___s_t_r_i_n_g is anchored at the beginning of each word.  If
-          _o_l_d___s_t_r_i_n_g ends with a dollar sign (`$'), it is anchored at the end
-          of each word.  Inside _n_e_w___s_t_r_i_n_g, an ampersand (`&') is replaced by
-          _o_l_d___s_t_r_i_n_g (without any `^' or `$').  Any character may be used as a
+          pattern, then the value is treated as a single word (possibly con-
+          taining embedded white space).  If old_string begins with a caret
+          (`^'), old_string is anchored at the beginning of each word.  If
+          old_string ends with a dollar sign (`$'), it is anchored at the end
+          of each word.  Inside new_string, an ampersand (`&') is replaced by
+          old_string (without any `^' or `$').  Any character may be used as a
           delimiter for the parts of the modifier string.  The anchoring,
           ampersand and delimiter characters may be escaped with a backslash
           (`\').
 
           Variable expansion occurs in the normal fashion inside both
-          _o_l_d___s_t_r_i_n_g and _n_e_w___s_t_r_i_n_g with the single exception that a backslash
-          is used to prevent the expansion of a dollar sign (`$'), not a
-          preceding dollar sign as is usual.
-
-     ::CC/_p_a_t_t_e_r_n/_r_e_p_l_a_c_e_m_e_n_t/[11ggWW]
-          The ::CC modifier is just like the ::SS modifier except that the old and
-          new strings, instead of being simple strings, are an extended
-          regular expression (see regex(3)) string _p_a_t_t_e_r_n and an ed(1)-style
-          string _r_e_p_l_a_c_e_m_e_n_t.  Normally, the first occurrence of the pattern
-          _p_a_t_t_e_r_n in each word of the value is substituted with _r_e_p_l_a_c_e_m_e_n_t.
+          old_string and new_string with the single exception that a backslash
+          is used to prevent the expansion of a dollar sign (`$'), not a pre-
+          ceding dollar sign as is usual.
+
+     :C/pattern/replacement/[1gW]
+          The :C modifier is just like the :S modifier except that the old and
+          new strings, instead of being simple strings, are an extended regu-
+          lar expression (see regex(3)) string pattern and an ed(1)-style
+          string replacement.  Normally, the first occurrence of the pattern
+          pattern in each word of the value is substituted with replacement.
           The `1' modifier causes the substitution to apply to at most one
           word; the `g' modifier causes the substitution to apply to as many
-          instances of the search pattern _p_a_t_t_e_r_n as occur in the word or
+          instances of the search pattern pattern as occur in the word or
           words it is found in; the `W' modifier causes the value to be
           treated as a single word (possibly containing embedded white space).
           Note that `1' and `g' are orthogonal; the former specifies whether
           multiple words are potentially affected, the latter whether multiple
           substitutions can potentially occur within each affected word.
 
-          As for the ::SS modifier, the _p_a_t_t_e_r_n and _r_e_p_l_a_c_e_m_e_n_t are subjected to
+          As for the :S modifier, the pattern and replacement are subjected to
           variable expansion before being parsed as regular expressions.
 
-     ::TT   Replaces each word in the variable with its last component.
+     :T   Replaces each word in the variable with its last component.
 
-     ::uu   Remove adjacent duplicate words (like uniq(1)).
+     :u   Remove adjacent duplicate words (like uniq(1)).
 
-     ::??_t_r_u_e___s_t_r_i_n_g::_f_a_l_s_e___s_t_r_i_n_g
-          If the variable name (not its value), when parsed as a .if
-          conditional expression, evaluates to true, return as its value the
-          _t_r_u_e___s_t_r_i_n_g, otherwise return the _f_a_l_s_e___s_t_r_i_n_g.  Since the variable
+     :?true_string:false_string
+          If the variable name (not its value), when parsed as a .if condi-
+          tional expression, evaluates to true, return as its value the
+          true_string, otherwise return the false_string.  Since the variable
           name is used as the expression, :? must be the first modifier after
           the variable name itself - which will, of course, usually contain
           variable expansions.  A common error is trying to use expressions
@@ -841,32 +897,45 @@ VVAARRIIAABBLLEE AASSSSIIGG
           match "42" you need to use something like:
                 ${"${NUMBERS:M42}" != "":?match:no}.
 
-     _:_o_l_d___s_t_r_i_n_g_=_n_e_w___s_t_r_i_n_g
+     :old_string=new_string
           This is the AT&T System V UNIX style variable substitution.  It must
-          be the last modifier specified.  If _o_l_d___s_t_r_i_n_g or _n_e_w___s_t_r_i_n_g do not
-          contain the pattern matching character _% then it is assumed that
+          be the last modifier specified.  If old_string or new_string do not
+          contain the pattern matching character % then it is assumed that
           they are anchored at the end of each word, so only suffixes or
-          entire words may be replaced.  Otherwise _% is the substring of
-          _o_l_d___s_t_r_i_n_g to be replaced in _n_e_w___s_t_r_i_n_g.
+          entire words may be replaced.  Otherwise % is the substring of
+          old_string to be replaced in new_string.
 
           Variable expansion occurs in the normal fashion inside both
-          _o_l_d___s_t_r_i_n_g and _n_e_w___s_t_r_i_n_g with the single exception that a backslash
-          is used to prevent the expansion of a dollar sign (`$'), not a
-          preceding dollar sign as is usual.
-
-     ::@@_t_e_m_p@@_s_t_r_i_n_g@@
-          This is the loop expansion mechanism from the OSF Development
-          Environment (ODE) make.  Unlike ..ffoorr loops expansion occurs at the
-          time of reference.  Assign _t_e_m_p to each word in the variable and
-          evaluate _s_t_r_i_n_g.  The ODE convention is that _t_e_m_p should start and
-          end with a period.  For example.
+          old_string and new_string with the single exception that a backslash
+          is used to prevent the expansion of a dollar sign (`$'), not a pre-
+          ceding dollar sign as is usual.
+
+     :@temp@string@
+          This is the loop expansion mechanism from the OSF Development Envi-
+          ronment (ODE) make.  Unlike .for loops expansion occurs at the time
+          of reference.  Assign temp to each word in the variable and evaluate
+          string.  The ODE convention is that temp should start and end with a
+          period.  For example.
                 ${LINKS:@.LINK.@${LN} ${TARGET} ${.LINK.}@}
 
           However a single character variable is often more readable:
                 ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@}
 
-     ::UU_n_e_w_v_a_l
-          If the variable is undefined _n_e_w_v_a_l is the value.  If the variable
+     :_[=var]
+          Save the current variable value in `$_' or the named var for later
+          reference.  Example usage:
+
+                M_cmpv.units = 1 1000 1000000
+                M_cmpv = S,., ,g:_:range:@i@+ $${_:[-$$i]} \
+                \* $${M_cmpv.units:[$$i]}@:S,^,expr 0 ,1:sh
+
+                .if ${VERSION:${M_cmpv}} < ${3.1.12:L:${M_cmpv}}
+
+          Here `$_' is used to save the result of the `:S' modifier which is
+          later referenced using the index values from `:range'.
+
+     :Unewval
+          If the variable is undefined newval is the value.  If the variable
           is defined, the existing value is returned.  This is another ODE
           make feature.  It is handy for setting per-target CFLAGS for
           instance:
@@ -874,139 +943,146 @@ VVAARRIIAABBLLEE AASSSSIIGG
           If a value is only required if the variable is undefined, use:
                 ${VAR:D:Unewval}
 
-     ::DD_n_e_w_v_a_l
-          If the variable is defined _n_e_w_v_a_l is the value.
+     :Dnewval
+          If the variable is defined newval is the value.
 
-     ::LL   The name of the variable is the value.
+     :L   The name of the variable is the value.
 
-     ::PP   The path of the node which has the same name as the variable is the
+     :P   The path of the node which has the same name as the variable is the
           value.  If no such node exists or its path is null, then the name of
           the variable is used.  In order for this modifier to work, the name
           (node) must at least have appeared on the rhs of a dependency.
 
-     ::!!_c_m_d!!
-          The output of running _c_m_d is the value.
+     :!cmd!
+          The output of running cmd is the value.
 
-     ::sshh  If the variable is non-empty it is run as a command and the output
+     :sh  If the variable is non-empty it is run as a command and the output
           becomes the new value.
 
-     ::::==_s_t_r
-          The variable is assigned the value _s_t_r after substitution.  This
+     ::=str
+          The variable is assigned the value str after substitution.  This
           modifier and its variations are useful in obscure situations such as
           wanting to set a variable when shell commands are being parsed.
           These assignment modifiers always expand to nothing, so if appearing
           in a rule line by themselves should be preceded with something to
-          keep bbmmaakkee happy.
+          keep bmake happy.
 
-          The `::::' helps avoid false matches with the AT&T System V UNIX style
-          ::== modifier and since substitution always occurs the ::::== form is
+          The `::' helps avoid false matches with the AT&T System V UNIX style
+          := modifier and since substitution always occurs the ::= form is
           vaguely appropriate.
 
-     ::::??==_s_t_r
-          As for ::::== but only if the variable does not already have a value.
+     ::?=str
+          As for ::= but only if the variable does not already have a value.
 
-     ::::++==_s_t_r
-          Append _s_t_r to the variable.
+     ::+=str
+          Append str to the variable.
 
-     ::::!!==_c_m_d
-          Assign the output of _c_m_d to the variable.
+     ::!=cmd
+          Assign the output of cmd to the variable.
 
-     ::[[_r_a_n_g_e]]
-          Selects one or more words from the value, or performs other
-          operations related to the way in which the value is divided into
-          words.
+     :[range]
+          Selects one or more words from the value, or performs other opera-
+          tions related to the way in which the value is divided into words.
 
           Ordinarily, a value is treated as a sequence of words delimited by
-          white space.  Some modifiers suppress this behaviour, causing a
-          value to be treated as a single word (possibly containing embedded
-          white space).  An empty value, or a value that consists entirely of
-          white-space, is treated as a single word.  For the purposes of the
-          `::[[]]' modifier, the words are indexed both forwards using positive
-          integers (where index 1 represents the first word), and backwards
-          using negative integers (where index -1 represents the last word).
+          white space.  Some modifiers suppress this behavior, causing a value
+          to be treated as a single word (possibly containing embedded white
+          space).  An empty value, or a value that consists entirely of white-
+          space, is treated as a single word.  For the purposes of the `:[]'
+          modifier, the words are indexed both forwards using positive inte-
+          gers (where index 1 represents the first word), and backwards using
+          negative integers (where index -1 represents the last word).
 
-          The _r_a_n_g_e is subjected to variable expansion, and the expanded
+          The range is subjected to variable expansion, and the expanded
           result is then interpreted as follows:
 
-          _i_n_d_e_x  Selects a single word from the value.
+          index  Selects a single word from the value.
 
-          _s_t_a_r_t...._e_n_d
-                 Selects all words from _s_t_a_r_t to _e_n_d, inclusive.  For example,
-                 `::[[22....--11]]' selects all words from the second word to the last
-                 word.  If _s_t_a_r_t is greater than _e_n_d, then the words are
-                 output in reverse order.  For example, `::[[--11....11]]' selects all
+          start..end
+                 Selects all words from start to end, inclusive.  For example,
+                 `:[2..-1]' selects all words from the second word to the last
+                 word.  If start is greater than end, then the words are out-
+                 put in reverse order.  For example, `:[-1..1]' selects all
                  the words from last to first.
 
-          **      Causes subsequent modifiers to treat the value as a single
+          *      Causes subsequent modifiers to treat the value as a single
                  word (possibly containing embedded white space).  Analogous
                  to the effect of "$*" in Bourne shell.
 
-          0      Means the same as `::[[**]]'.
+          0      Means the same as `:[*]'.
 
-          @@      Causes subsequent modifiers to treat the value as a sequence
+          @      Causes subsequent modifiers to treat the value as a sequence
                  of words delimited by white space.  Analogous to the effect
                  of "$@" in Bourne shell.
 
-          ##      Returns the number of words in the value.
+          #      Returns the number of words in the value.
 
-IINNCCLLUUDDEE SSTTAATTEEMMEENNTTSS,, CCOONNDDIITTIIOONNAALLSS AANNDD FFOORR LLOOOOPPSS
+INCLUDE STATEMENTS, CONDITIONALS AND FOR LOOPS
      Makefile inclusion, conditional structures and for loops  reminiscent of
-     the C programming language are provided in bbmmaakkee.  All such structures
+     the C programming language are provided in bmake.  All such structures
      are identified by a line beginning with a single dot (`.') character.
-     Files are included with either ..iinncclluuddee <_f_i_l_e> or ..iinncclluuddee "_f_i_l_e".
-     Variables between the angle brackets or double quotes are expanded to
-     form the file name.  If angle brackets are used, the included makefile is
+     Files are included with either .include <file> or .include "file".  Vari-
+     ables between the angle brackets or double quotes are expanded to form
+     the file name.  If angle brackets are used, the included makefile is
      expected to be in the system makefile directory.  If double quotes are
      used, the including makefile's directory and any directories specified
-     using the --II option are searched before the system makefile directory.
-     For compatibility with other versions of bbmmaakkee `include file ...' is also
-     accepted.  If the include statement is written as ..--iinncclluuddee or as
-     ..ssiinncclluuddee then errors locating and/or opening include files are ignored.
+     using the -I option are searched before the system makefile directory.
+     For compatibility with other versions of bmake `include file ...' is also
+     accepted.
+
+     If the include statement is written as .-include or as .sinclude then
+     errors locating and/or opening include files are ignored.
+
+     If the include statement is written as .dinclude not only are errors
+     locating and/or opening include files ignored, but stale dependencies
+     within the included file will be ignored just like .MAKE.DEPENDFILE.
 
      Conditional expressions are also preceded by a single dot as the first
      character of a line.  The possible conditionals are as follows:
 
-     ..eerrrroorr _m_e_s_s_a_g_e
+     .error message
              The message is printed along with the name of the makefile and
-             line number, then bbmmaakkee will exit.
+             line number, then bmake will exit.
 
-     ..eexxppoorrtt _v_a_r_i_a_b_l_e _._._.
+     .export variable ...
              Export the specified global variable.  If no variable list is
              provided, all globals are exported except for internal variables
-             (those that start with `.').  This is not affected by the --XX
+             (those that start with `.').  This is not affected by the -X
              flag, so should be used with caution.  For compatibility with
-             other bbmmaakkee programs `export variable=value' is also accepted.
+             other bmake programs `export variable=value' is also accepted.
 
-             Appending a variable name to _._M_A_K_E_._E_X_P_O_R_T_E_D is equivalent to
+             Appending a variable name to .MAKE.EXPORTED is equivalent to
              exporting a variable.
 
-     ..eexxppoorrtt--eennvv _v_a_r_i_a_b_l_e _._._.
+     .export-env variable ...
              The same as `.export', except that the variable is not appended
-             to _._M_A_K_E_._E_X_P_O_R_T_E_D.  This allows exporting a value to the
-             environment which is different from that used by bbmmaakkee
-             internally.
+             to .MAKE.EXPORTED.  This allows exporting a value to the environ-
+             ment which is different from that used by bmake internally.
+
+     .export-literal variable ...
+             The same as `.export-env', except that variables in the value are
+             not expanded.
 
-     ..iinnffoo _m_e_s_s_a_g_e
+     .info message
              The message is printed along with the name of the makefile and
              line number.
 
-     ..uunnddeeff _v_a_r_i_a_b_l_e
+     .undef variable
              Un-define the specified global variable.  Only global variables
              may be un-defined.
 
-     ..uunneexxppoorrtt _v_a_r_i_a_b_l_e _._._.
-             The opposite of `.export'.  The specified global _v_a_r_i_a_b_l_e will be
-             removed from _._M_A_K_E_._E_X_P_O_R_T_E_D.  If no variable list is provided,
-             all globals are unexported, and _._M_A_K_E_._E_X_P_O_R_T_E_D deleted.
-
-     ..uunneexxppoorrtt--eennvv
-             Unexport all globals previously exported and clear the
-             environment inherited from the parent.  This operation will cause
-             a memory leak of the original environment, so should be used
-             sparingly.  Testing for _._M_A_K_E_._L_E_V_E_L being 0, would make sense.
-             Also note that any variables which originated in the parent
-             environment should be explicitly preserved if desired.  For
-             example:
+     .unexport variable ...
+             The opposite of `.export'.  The specified global variable will be
+             removed from .MAKE.EXPORTED.  If no variable list is provided,
+             all globals are unexported, and .MAKE.EXPORTED deleted.
+
+     .unexport-env
+             Unexport all globals previously exported and clear the environ-
+             ment inherited from the parent.  This operation will cause a mem-
+             ory leak of the original environment, so should be used spar-
+             ingly.  Testing for .MAKE.LEVEL being 0, would make sense.  Also
+             note that any variables which originated in the parent environ-
+             ment should be explicitly preserved if desired.  For example:
 
                    .if ${.MAKE.LEVEL} == 0
                    PATH := ${PATH}
@@ -1018,148 +1094,148 @@ IINNCCLLUUDDEE SSTTAATTEEMM
              the minimal useful environment.  Actually `.MAKE.LEVEL' will also
              be pushed into the new environment.
 
-     ..wwaarrnniinngg _m_e_s_s_a_g_e
-             The message prefixed by `_w_a_r_n_i_n_g_:' is printed along with the name
+     .warning message
+             The message prefixed by `warning:' is printed along with the name
              of the makefile and line number.
 
-     ..iiff [!]_e_x_p_r_e_s_s_i_o_n [_o_p_e_r_a_t_o_r _e_x_p_r_e_s_s_i_o_n _._._.]
+     .if [!]expression [operator expression ...]
              Test the value of an expression.
 
-     ..iiffddeeff [!]_v_a_r_i_a_b_l_e [_o_p_e_r_a_t_o_r _v_a_r_i_a_b_l_e _._._.]
+     .ifdef [!]variable [operator variable ...]
              Test the value of a variable.
 
-     ..iiffnnddeeff [!]_v_a_r_i_a_b_l_e [_o_p_e_r_a_t_o_r _v_a_r_i_a_b_l_e _._._.]
+     .ifndef [!]variable [operator variable ...]
              Test the value of a variable.
 
-     ..iiffmmaakkee [!]_t_a_r_g_e_t [_o_p_e_r_a_t_o_r _t_a_r_g_e_t _._._.]
+     .ifmake [!]target [operator target ...]
              Test the target being built.
 
-     ..iiffnnmmaakkee [!] _t_a_r_g_e_t [_o_p_e_r_a_t_o_r _t_a_r_g_e_t _._._.]
+     .ifnmake [!] target [operator target ...]
              Test the target being built.
 
-     ..eellssee   Reverse the sense of the last conditional.
+     .else   Reverse the sense of the last conditional.
 
-     ..eelliiff [!] _e_x_p_r_e_s_s_i_o_n [_o_p_e_r_a_t_o_r _e_x_p_r_e_s_s_i_o_n _._._.]
-             A combination of `..eellssee' followed by `..iiff'.
+     .elif [!] expression [operator expression ...]
+             A combination of `.else' followed by `.if'.
 
-     ..eelliiffddeeff [!]_v_a_r_i_a_b_l_e [_o_p_e_r_a_t_o_r _v_a_r_i_a_b_l_e _._._.]
-             A combination of `..eellssee' followed by `..iiffddeeff'.
+     .elifdef [!]variable [operator variable ...]
+             A combination of `.else' followed by `.ifdef'.
 
-     ..eelliiffnnddeeff [!]_v_a_r_i_a_b_l_e [_o_p_e_r_a_t_o_r _v_a_r_i_a_b_l_e _._._.]
-             A combination of `..eellssee' followed by `..iiffnnddeeff'.
+     .elifndef [!]variable [operator variable ...]
+             A combination of `.else' followed by `.ifndef'.
 
-     ..eelliiffmmaakkee [!]_t_a_r_g_e_t [_o_p_e_r_a_t_o_r _t_a_r_g_e_t _._._.]
-             A combination of `..eellssee' followed by `..iiffmmaakkee'.
+     .elifmake [!]target [operator target ...]
+             A combination of `.else' followed by `.ifmake'.
 
-     ..eelliiffnnmmaakkee [!]_t_a_r_g_e_t [_o_p_e_r_a_t_o_r _t_a_r_g_e_t _._._.]
-             A combination of `..eellssee' followed by `..iiffnnmmaakkee'.
+     .elifnmake [!]target [operator target ...]
+             A combination of `.else' followed by `.ifnmake'.
 
-     ..eennddiiff  End the body of the conditional.
+     .endif  End the body of the conditional.
 
-     The _o_p_e_r_a_t_o_r may be any one of the following:
+     The operator may be any one of the following:
 
-     ||||     Logical OR.
+     ||     Logical OR.
 
-     &&&&     Logical AND; of higher precedence than ``||''.
+     &&     Logical AND; of higher precedence than ``||''.
 
-     As in C, bbmmaakkee will only evaluate a conditional as far as is necessary to
+     As in C, bmake will only evaluate a conditional as far as is necessary to
      determine its value.  Parentheses may be used to change the order of
-     evaluation.  The boolean operator `!!' may be used to logically negate an
-     entire conditional.  It is of higher precedence than `&&&&'.
+     evaluation.  The boolean operator `!' may be used to logically negate an
+     entire conditional.  It is of higher precedence than `&&'.
 
-     The value of _e_x_p_r_e_s_s_i_o_n may be any of the following:
+     The value of expression may be any of the following:
 
-     ddeeffiinneedd  Takes a variable name as an argument and evaluates to true if
+     defined  Takes a variable name as an argument and evaluates to true if
               the variable has been defined.
 
-     mmaakkee     Takes a target name as an argument and evaluates to true if the
-              target was specified as part of bbmmaakkee's command line or was
+     make     Takes a target name as an argument and evaluates to true if the
+              target was specified as part of bmake's command line or was
               declared the default target (either implicitly or explicitly,
-              see _._M_A_I_N) before the line containing the conditional.
+              see .MAIN) before the line containing the conditional.
 
-     eemmppttyy    Takes a variable, with possible modifiers, and evaluates to true
+     empty    Takes a variable, with possible modifiers, and evaluates to true
               if the expansion of the variable would result in an empty
               string.
 
-     eexxiissttss   Takes a file name as an argument and evaluates to true if the
+     exists   Takes a file name as an argument and evaluates to true if the
               file exists.  The file is searched for on the system search path
-              (see _._P_A_T_H).
+              (see .PATH).
 
-     ttaarrggeett   Takes a target name as an argument and evaluates to true if the
+     target   Takes a target name as an argument and evaluates to true if the
               target has been defined.
 
-     ccoommmmaannddss
+     commands
               Takes a target name as an argument and evaluates to true if the
               target has been defined and has commands associated with it.
 
-     _E_x_p_r_e_s_s_i_o_n may also be an arithmetic or string comparison.  Variable
+     Expression may also be an arithmetic or string comparison.  Variable
      expansion is performed on both sides of the comparison, after which the
      integral values are compared.  A value is interpreted as hexadecimal if
-     it is preceded by 0x, otherwise it is decimal; octal numbers are not
-     supported.  The standard C relational operators are all supported.  If
-     after variable expansion, either the left or right hand side of a `====' or
-     `!!==' operator is not an integral value, then string comparison is
-     performed between the expanded variables.  If no relational operator is
-     given, it is assumed that the expanded variable is being compared against
-     0 or an empty string in the case of a string comparison.
+     it is preceded by 0x, otherwise it is decimal; octal numbers are not sup-
+     ported.  The standard C relational operators are all supported.  If after
+     variable expansion, either the left or right hand side of a `==' or `!='
+     operator is not an integral value, then string comparison is performed
+     between the expanded variables.  If no relational operator is given, it
+     is assumed that the expanded variable is being compared against 0 or an
+     empty string in the case of a string comparison.
 
-     When bbmmaakkee is evaluating one of these conditional expressions, and it
+     When bmake is evaluating one of these conditional expressions, and it
      encounters a (white-space separated) word it doesn't recognize, either
      the ``make'' or ``defined'' expression is applied to it, depending on the
-     form of the conditional.  If the form is `..iiffddeeff', `..iiffnnddeeff', or `..iiff'
+     form of the conditional.  If the form is `.ifdef', `.ifndef', or `.if'
      the ``defined'' expression is applied.  Similarly, if the form is
-     `..iiffmmaakkee' or `..iiffnnmmaakkee, tthhee' ``make'' expression is applied.
+     `.ifmake' or `.ifnmake, the' ``make'' expression is applied.
 
-     If the conditional evaluates to true the parsing of the makefile
-     continues as before.  If it evaluates to false, the following lines are
-     skipped.  In both cases this continues until a `..eellssee' or `..eennddiiff' is
+     If the conditional evaluates to true the parsing of the makefile contin-
+     ues as before.  If it evaluates to false, the following lines are
+     skipped.  In both cases this continues until a `.else' or `.endif' is
      found.
 
      For loops are typically used to apply a set of rules to a list of files.
      The syntax of a for loop is:
 
-     ..ffoorr _v_a_r_i_a_b_l_e [_v_a_r_i_a_b_l_e _._._.] iinn _e_x_p_r_e_s_s_i_o_n
+     .for variable [variable ...] in expression
      <make-rules>
-     ..eennddffoorr
+     .endfor
 
-     After the for eexxpprreessssiioonn is evaluated, it is split into words.  On each
-     iteration of the loop, one word is taken and assigned to each vvaarriiaabbllee,
-     in order, and these vvaarriiaabblleess are substituted into the mmaakkee--rruulleess inside
+     After the for expression is evaluated, it is split into words.  On each
+     iteration of the loop, one word is taken and assigned to each variable,
+     in order, and these variables are substituted into the make-rules inside
      the body of the for loop.  The number of words must come out even; that
      is, if there are three iteration variables, the number of words provided
      must be a multiple of three.
 
-CCOOMMMMEENNTTSS
-     Comments begin with a hash (`#') character, anywhere but in a shell
-     command line, and continue to the end of an unescaped new line.
+COMMENTS
+     Comments begin with a hash (`#') character, anywhere but in a shell com-
+     mand line, and continue to the end of an unescaped new line.
 
-SSPPEECCIIAALL SSOOUURRCCEESS ((AATTTTRRIIBBUUTTEESS))
-     ..EEXXEECC     Target is never out of date, but always execute commands
-               anyway.
+SPECIAL SOURCES (ATTRIBUTES)
+     .EXEC     Target is never out of date, but always execute commands any-
+               way.
 
-     ..IIGGNNOORREE   Ignore any errors from the commands associated with this
-               target, exactly as if they all were preceded by a dash (`-').
+     .IGNORE   Ignore any errors from the commands associated with this tar-
+               get, exactly as if they all were preceded by a dash (`-').
 
-     ..MMAADDEE     Mark all sources of this target as being up-to-date.
+     .MADE     Mark all sources of this target as being up-to-date.
 
-     ..MMAAKKEE     Execute the commands associated with this target even if the --nn
-               or --tt options were specified.  Normally used to mark recursive
-               bbmmaakkees.
+     .MAKE     Execute the commands associated with this target even if the -n
+               or -t options were specified.  Normally used to mark recursive
+               bmakes.
 
-     ..MMEETTAA     Create a meta file for the target, even if it is flagged as
-               ..PPHHOONNYY, ..MMAAKKEE, or ..SSPPEECCIIAALL.  Usage in conjunction with ..MMAAKKEE is
+     .META     Create a meta file for the target, even if it is flagged as
+               .PHONY, .MAKE, or .SPECIAL.  Usage in conjunction with .MAKE is
                the most likely case.  In "meta" mode, the target is out-of-
                date if the meta file is missing.
 
-     ..NNOOMMEETTAA   Do not create a meta file for the target.  Meta files are also
-               not created for ..PPHHOONNYY, ..MMAAKKEE, or ..SSPPEECCIIAALL targets.
+     .NOMETA   Do not create a meta file for the target.  Meta files are also
+               not created for .PHONY, .MAKE, or .SPECIAL targets.
 
-     ..NNOOMMEETTAA__CCMMPP
+     .NOMETA_CMP
                Ignore differences in commands when deciding if target is out
                of date.  This is useful if the command contains a value which
                always changes.  If the number of commands change, though, the
                target will still be out of date.  The same effect applies to
-               any command line that uses the variable _._O_O_D_A_T_E, which can be
+               any command line that uses the variable .OODATE, which can be
                used for that purpose even when not otherwise needed or
                desired:
 
@@ -1169,53 +1245,53 @@ SSPPEECCIIAALL SSOOUURRCCEE
                              @echo this will not ${.OODATE:M.NOMETA_CMP}
                              @echo this will also be compared
 
-               The ::MM pattern suppresses any expansion of the unwanted
-               variable.
+               The :M pattern suppresses any expansion of the unwanted vari-
+               able.
 
-     ..NNOOPPAATTHH   Do not search for the target in the directories specified by
-               ..PPAATTHH.
+     .NOPATH   Do not search for the target in the directories specified by
+               .PATH.
 
-     ..NNOOTTMMAAIINN  Normally bbmmaakkee selects the first target it encounters as the
+     .NOTMAIN  Normally bmake selects the first target it encounters as the
                default target to be built if no target was specified.  This
                source prevents this target from being selected.
 
-     ..OOPPTTIIOONNAALL
-               If a target is marked with this attribute and bbmmaakkee can't
-               figure out how to create it, it will ignore this fact and
-               assume the file isn't needed or already exists.
+     .OPTIONAL
+               If a target is marked with this attribute and bmake can't fig-
+               ure out how to create it, it will ignore this fact and assume
+               the file isn't needed or already exists.
 
-     ..PPHHOONNYY    The target does not correspond to an actual file; it is always
+     .PHONY    The target does not correspond to an actual file; it is always
                considered to be out of date, and will not be created with the
-               --tt option.  Suffix-transformation rules are not applied to
-               ..PPHHOONNYY targets.
+               -t option.  Suffix-transformation rules are not applied to
+               .PHONY targets.
 
-     ..PPRREECCIIOOUUSS
-               When bbmmaakkee is interrupted, it normally removes any partially
+     .PRECIOUS
+               When bmake is interrupted, it normally removes any partially
                made targets.  This source prevents the target from being
                removed.
 
-     ..RREECCUURRSSIIVVEE
-               Synonym for ..MMAAKKEE.
+     .RECURSIVE
+               Synonym for .MAKE.
 
-     ..SSIILLEENNTT   Do not echo any of the commands associated with this target,
+     .SILENT   Do not echo any of the commands associated with this target,
                exactly as if they all were preceded by an at sign (`@').
 
-     ..UUSSEE      Turn the target into bbmmaakkee's version of a macro.  When the
-               target is used as a source for another target, the other target
+     .USE      Turn the target into bmake's version of a macro.  When the tar-
+               get is used as a source for another target, the other target
                acquires the commands, sources, and attributes (except for
-               ..UUSSEE) of the source.  If the target already has commands, the
-               ..UUSSEE target's commands are appended to them.
+               .USE) of the source.  If the target already has commands, the
+               .USE target's commands are appended to them.
 
-     ..UUSSEEBBEEFFOORREE
-               Exactly like ..UUSSEE, but prepend the ..UUSSEEBBEEFFOORREE target commands
+     .USEBEFORE
+               Exactly like .USE, but prepend the .USEBEFORE target commands
                to the target.
 
-     ..WWAAIITT     If ..WWAAIITT appears in a dependency line, the sources that precede
+     .WAIT     If .WAIT appears in a dependency line, the sources that precede
                it are made before the sources that succeed it in the line.
                Since the dependents of files are not made until the file
                itself could be made, this also stops the dependents being
-               built unless they are needed for another branch of the
-               dependency tree.  So given:
+               built unless they are needed for another branch of the depen-
+               dency tree.  So given:
 
                x: a .WAIT b
                        echo x
@@ -1227,112 +1303,123 @@ SSPPEECCIIAALL SSOOUURRCCEE
                        echo b1
 
                the output is always `a', `b1', `b', `x'.
-               The ordering imposed by ..WWAAIITT is only relevant for parallel
+               The ordering imposed by .WAIT is only relevant for parallel
                makes.
 
-SSPPEECCIIAALL TTAARRGGEETTSS
+SPECIAL TARGETS
      Special targets may not be included with other targets, i.e. they must be
      the only target specified.
 
-     ..BBEEGGIINN   Any command lines attached to this target are executed before
+     .BEGIN   Any command lines attached to this target are executed before
               anything else is done.
 
-     ..DDEEFFAAUULLTT
-              This is sort of a ..UUSSEE rule for any target (that was used only
-              as a source) that bbmmaakkee can't figure out any other way to
-              create.  Only the shell script is used.  The ..IIMMPPSSRRCC variable of
-              a target that inherits ..DDEEFFAAUULLTT's commands is set to the
-              target's own name.
+     .DEFAULT
+              This is sort of a .USE rule for any target (that was used only
+              as a source) that bmake can't figure out any other way to cre-
+              ate.  Only the shell script is used.  The .IMPSRC variable of a
+              target that inherits .DEFAULT's commands is set to the target's
+              own name.
+
+     .DELETE_ON_ERROR
+              If this target is present in the makefile, it globally causes
+              make to delete targets whose commands fail.  (By default, only
+              targets whose commands are interrupted during execution are
+              deleted.  This is the historical behavior.)  This setting can be
+              used to help prevent half-finished or malformed targets from
+              being left around and corrupting future rebuilds.
 
-     ..EENNDD     Any command lines attached to this target are executed after
+     .END     Any command lines attached to this target are executed after
               everything else is done.
 
-     ..EERRRROORR   Any command lines attached to this target are executed when
-              another target fails.  The ..EERRRROORR__TTAARRGGEETT variable is set to the
-              target that failed.  See also MMAAKKEE__PPRRIINNTT__VVAARR__OONN__EERRRROORR.
+     .ERROR   Any command lines attached to this target are executed when
+              another target fails.  The .ERROR_TARGET variable is set to the
+              target that failed.  See also MAKE_PRINT_VAR_ON_ERROR.
 
-     ..IIGGNNOORREE  Mark each of the sources with the ..IIGGNNOORREE attribute.  If no
+     .IGNORE  Mark each of the sources with the .IGNORE attribute.  If no
               sources are specified, this is the equivalent of specifying the
-              --ii option.
+              -i option.
 
-     ..IINNTTEERRRRUUPPTT
-              If bbmmaakkee is interrupted, the commands for this target will be
+     .INTERRUPT
+              If bmake is interrupted, the commands for this target will be
               executed.
 
-     ..MMAAIINN    If no target is specified when bbmmaakkee is invoked, this target
+     .MAIN    If no target is specified when bmake is invoked, this target
               will be built.
 
-     ..MMAAKKEEFFLLAAGGSS
-              This target provides a way to specify flags for bbmmaakkee when the
+     .MAKEFLAGS
+              This target provides a way to specify flags for bmake when the
               makefile is used.  The flags are as if typed to the shell,
-              though the --ff option will have no effect.
+              though the -f option will have no effect.
 
-     ..NNOOPPAATTHH  Apply the ..NNOOPPAATTHH attribute to any specified sources.
+     .NOPATH  Apply the .NOPATH attribute to any specified sources.
 
-     ..NNOOTTPPAARRAALLLLEELL
+     .NOTPARALLEL
               Disable parallel mode.
 
-     ..NNOO__PPAARRAALLLLEELL
-              Synonym for ..NNOOTTPPAARRAALLLLEELL, for compatibility with other pmake
+     .NO_PARALLEL
+              Synonym for .NOTPARALLEL, for compatibility with other pmake
               variants.
 
-     ..OORRDDEERR   The named targets are made in sequence.  This ordering does not
-              add targets to the list of targets to be made.  Since the
-              dependents of a target do not get built until the target itself
-              could be built, unless `a' is built by another part of the
-              dependency graph, the following is a dependency loop:
+     .OBJDIR  The source is a new value for `.OBJDIR'.  If it exists, bmake
+              will chdir(2) to it and update the value of `.OBJDIR'.
+
+     .ORDER   The named targets are made in sequence.  This ordering does not
+              add targets to the list of targets to be made.  Since the depen-
+              dents of a target do not get built until the target itself could
+              be built, unless `a' is built by another part of the dependency
+              graph, the following is a dependency loop:
 
               .ORDER: b a
               b: a
 
-              The ordering imposed by ..OORRDDEERR is only relevant for parallel
+              The ordering imposed by .ORDER is only relevant for parallel
               makes.
 
-     ..PPAATTHH    The sources are directories which are to be searched for files
-              not found in the current directory.  If no sources are
-              specified, any previously specified directories are deleted.  If
-              the source is the special ..DDOOTTLLAASSTT target, then the current
-              working directory is searched last.
-
-     ..PPAATTHH.._s_u_f_f_i_x
-              Like ..PPAATTHH but applies only to files with a particular suffix.
-              The suffix must have been previously declared with ..SSUUFFFFIIXXEESS.
-
-     ..PPHHOONNYY   Apply the ..PPHHOONNYY attribute to any specified sources.
-
-     ..PPRREECCIIOOUUSS
-              Apply the ..PPRREECCIIOOUUSS attribute to any specified sources.  If no
-              sources are specified, the ..PPRREECCIIOOUUSS attribute is applied to
+     .PATH    The sources are directories which are to be searched for files
+              not found in the current directory.  If no sources are speci-
+              fied, any previously specified directories are deleted.  If the
+              source is the special .DOTLAST target, then the current working
+              directory is searched last.
+
+     .PATH.suffix
+              Like .PATH but applies only to files with a particular suffix.
+              The suffix must have been previously declared with .SUFFIXES.
+
+     .PHONY   Apply the .PHONY attribute to any specified sources.
+
+     .PRECIOUS
+              Apply the .PRECIOUS attribute to any specified sources.  If no
+              sources are specified, the .PRECIOUS attribute is applied to
               every target in the file.
 
-     ..SSHHEELLLL   Sets the shell that bbmmaakkee will use to execute commands.  The
-              sources are a set of _f_i_e_l_d_=_v_a_l_u_e pairs.
+     .SHELL   Sets the shell that bmake will use to execute commands.  The
+              sources are a set of field=value pairs.
 
-              _n_a_m_e        This is the minimal specification, used to select
-                          one of the builtin shell specs; _s_h, _k_s_h, and _c_s_h.
+              name        This is the minimal specification, used to select
+                          one of the built-in shell specs; sh, ksh, and csh.
 
-              _p_a_t_h        Specifies the path to the shell.
+              path        Specifies the path to the shell.
 
-              _h_a_s_E_r_r_C_t_l   Indicates whether the shell supports exit on error.
+              hasErrCtl   Indicates whether the shell supports exit on error.
 
-              _c_h_e_c_k       The command to turn on error checking.
+              check       The command to turn on error checking.
 
-              _i_g_n_o_r_e      The command to disable error checking.
+              ignore      The command to disable error checking.
 
-              _e_c_h_o        The command to turn on echoing of commands executed.
+              echo        The command to turn on echoing of commands executed.
 
-              _q_u_i_e_t       The command to turn off echoing of commands
-                          executed.
+              quiet       The command to turn off echoing of commands exe-
+                          cuted.
 
-              _f_i_l_t_e_r      The output to filter after issuing the _q_u_i_e_t
-                          command.  It is typically identical to _q_u_i_e_t.
+              filter      The output to filter after issuing the quiet com-
+                          mand.  It is typically identical to quiet.
 
-              _e_r_r_F_l_a_g     The flag to pass the shell to enable error checking.
+              errFlag     The flag to pass the shell to enable error checking.
 
-              _e_c_h_o_F_l_a_g    The flag to pass the shell to enable command
-                          echoing.
+              echoFlag    The flag to pass the shell to enable command echo-
+                          ing.
 
-              _n_e_w_l_i_n_e     The string literal to pass the shell that results in
+              newline     The string literal to pass the shell that results in
                           a single newline character when used outside of any
                           quoting characters.
               Example:
@@ -1342,15 +1429,15 @@ SSPPEECCIIAALL TTAARRGGEETT
                       echo="set -v" quiet="set +v" filter="set +v" \
                       echoFlag=v errFlag=e newline="'\n'"
 
-     ..SSIILLEENNTT  Apply the ..SSIILLEENNTT attribute to any specified sources.  If no
-              sources are specified, the ..SSIILLEENNTT attribute is applied to every
+     .SILENT  Apply the .SILENT attribute to any specified sources.  If no
+              sources are specified, the .SILENT attribute is applied to every
               command in the file.
 
-     ..SSTTAALLEE   This target gets run when a dependency file contains stale
-              entries, having _._A_L_L_S_R_C set to the name of that dependency file.
+     .STALE   This target gets run when a dependency file contains stale
+              entries, having .ALLSRC set to the name of that dependency file.
 
-     ..SSUUFFFFIIXXEESS
-              Each source specifies a suffix to bbmmaakkee.  If no sources are
+     .SUFFIXES
+              Each source specifies a suffix to bmake.  If no sources are
               specified, any previously specified suffixes are deleted.  It
               allows the creation of suffix-transformation rules.
 
@@ -1360,29 +1447,29 @@ SSPPEECCIIAALL TTAARRGGEETT
               .c.o:
                       cc -o ${.TARGET} -c ${.IMPSRC}
 
-EENNVVIIRROONNMMEENNTT
-     bbmmaakkee uses the following environment variables, if they exist: MACHINE,
+ENVIRONMENT
+     bmake uses the following environment variables, if they exist: MACHINE,
      MACHINE_ARCH, MAKE, MAKEFLAGS, MAKEOBJDIR, MAKEOBJDIRPREFIX, MAKESYSPATH,
      PWD, and TMPDIR.
 
      MAKEOBJDIRPREFIX and MAKEOBJDIR may only be set in the environment or on
-     the command line to bbmmaakkee and not as makefile variables; see the
-     description of `_._O_B_J_D_I_R' for more details.
+     the command line to bmake and not as makefile variables; see the descrip-
+     tion of `.OBJDIR' for more details.
 
-FFIILLEESS
+FILES
      .depend        list of dependencies
      Makefile       list of dependencies
      makefile       list of dependencies
      sys.mk         system makefile
      /usr/share/mk  system makefile directory
 
-CCOOMMPPAATTIIBBIILLIITTYY
+COMPATIBILITY
      The basic make syntax is compatible between different versions of make;
      however the special variables, variable modifiers and conditionals are
      not.
 
-   OOllddeerr vveerrssiioonnss
-     An incomplete list of changes in older versions of bbmmaakkee:
+   Older versions
+     An incomplete list of changes in older versions of bmake:
 
      The way that .for loop variables are substituted changed after NetBSD 5.0
      so that they still appear to be variable expansions.  In particular this
@@ -1390,51 +1477,68 @@ CCOOMMPPAATTIIBBIILLIITTYY
      using them in .if statements.
 
      The way that parallel makes are scheduled changed in NetBSD 4.0 so that
-     .ORDER and .WAIT apply recursively to the dependent nodes.  The
-     algorithms used may change again in the future.
+     .ORDER and .WAIT apply recursively to the dependent nodes.  The algo-
+     rithms used may change again in the future.
 
-   OOtthheerr mmaakkee ddiiaalleeccttss
-     Other make dialects (GNU make, SVR4 make, POSIX make, etc.) do not
-     support most of the features of bbmmaakkee as described in this manual.  Most
+   Other make dialects
+     Other make dialects (GNU make, SVR4 make, POSIX make, etc.) do not sup-
+     port most of the features of bmake as described in this manual.  Most
      notably:
 
-           oo   The ..WWAAIITT and ..OORRDDEERR declarations and most functionality
-               pertaining to parallelization.  (GNU make supports
-               parallelization but lacks these features needed to control it
-               effectively.)
+           +o   The .WAIT and .ORDER declarations and most functionality per-
+               taining to parallelization.  (GNU make supports parallelization
+               but lacks these features needed to control it effectively.)
 
-           oo   Directives, including for loops and conditionals and most of
+           +o   Directives, including for loops and conditionals and most of
                the forms of include files.  (GNU make has its own incompatible
                and less powerful syntax for conditionals.)
 
-           oo   All built-in variables that begin with a dot.
+           +o   All built-in variables that begin with a dot.
 
-           oo   Most of the special sources and targets that begin with a dot,
-               with the notable exception of ..PPHHOONNYY, ..PPRREECCIIOOUUSS, and ..SSUUFFFFIIXXEESS.
+           +o   Most of the special sources and targets that begin with a dot,
+               with the notable exception of .PHONY, .PRECIOUS, and .SUFFIXES.
 
-           oo   Variable modifiers, except for the
+           +o   Variable modifiers, except for the
                      :old=new
                string substitution, which does not portably support globbing
                with `%' and historically only works on declared suffixes.
 
-           oo   The $$>> variable even in its short form; most makes support this
+           +o   The $> variable even in its short form; most makes support this
                functionality but its name varies.
 
-     Some features are somewhat more portable, such as assignment with ++==, ??==,
-     and !!==.  The ..PPAATTHH functionality is based on an older feature VVPPAATTHH found
+     Some features are somewhat more portable, such as assignment with +=, ?=,
+     and !=.  The .PATH functionality is based on an older feature VPATH found
      in GNU make and many versions of SVR4 make; however, historically its
      behavior is too ill-defined (and too buggy) to rely upon.
 
-     The $$@@ and $$<< variables are more or less universally portable, as is the
-     $$((MMAAKKEE)) variable.  Basic use of suffix rules (for files only in the
-     current directory, not trying to chain transformations together, etc.) is
+     The $@ and $< variables are more or less universally portable, as is the
+     $(MAKE) variable.  Basic use of suffix rules (for files only in the cur-
+     rent directory, not trying to chain transformations together, etc.) is
      also reasonably portable.
 
-SSEEEE AALLSSOO
+SEE ALSO
      mkdep(1)
 
-HHIISSTTOORRYY
-     bbmmaakkee is derived from NetBSD's make(1).  It uses autoconf to facilitate
+HISTORY
+     bmake is derived from NetBSD make(1).  It uses autoconf to facilitate
      portability to other platforms.
 
-NetBSD 7.99                      April 9, 2015                     NetBSD 7.99
+     A make command appeared in Version 7 AT&T UNIX.  This make implementation
+     is based on Adam De Boor's pmake program which was written for Sprite at
+     Berkeley.  It was designed to be a parallel distributed make running jobs
+     on different machines using a daemon called ``customs''.
+
+     Historically the target/dependency ``FRC'' has been used to FoRCe
+     rebuilding (since the target/dependency does not exist... unless someone
+     creates an ``FRC'' file).
+
+BUGS
+     The make syntax is difficult to parse without actually acting of the
+     data.  For instance finding the end of a variable use should involve
+     scanning each the modifiers using the correct terminator for each field.
+     In many places make just counts {} and () in order to find the end of a
+     variable expansion.
+
+     There is no way of escaping a space character in a filename.
+
+FreeBSD 11.1                     June 22, 2017                    FreeBSD 11.1
Index: pkgsrc/devel/bmake/files/compat.c
diff -u pkgsrc/devel/bmake/files/compat.c:1.10 pkgsrc/devel/bmake/files/compat.c:1.11
--- pkgsrc/devel/bmake/files/compat.c:1.10      Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/compat.c   Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat.c,v 1.10 2015/05/19 22:01:19 joerg Exp $        */
+/*     $NetBSD: compat.c,v 1.11 2020/05/24 11:09:43 nia Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: compat.c,v 1.10 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: compat.c,v 1.11 2020/05/24 11:09:43 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)compat.c   8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: compat.c,v 1.10 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: compat.c,v 1.11 2020/05/24 11:09:43 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -111,35 +111,33 @@ __RCSID("$NetBSD: compat.c,v 1.10 2015/0
 #include    "hash.h"
 #include    "dir.h"
 #include    "job.h"
+#include    "metachar.h"
 #include    "pathnames.h"
 
-/*
- * The following array is used to make a fast determination of which
- * characters are interpreted specially by the shell.  If a command
- * contains any of these characters, it is executed by the shell, not
- * directly by us.
- */
-
-static char        meta[256];
 
 static GNode       *curTarg = NULL;
 static GNode       *ENDNode;
 static void CompatInterrupt(int);
+static pid_t compatChild;
+static int compatSigno;
 
+/*
+ * CompatDeleteTarget -- delete a failed, interrupted, or otherwise
+ * duffed target if not inhibited by .PRECIOUS.
+ */
 static void
-Compat_Init(void)
+CompatDeleteTarget(GNode *gn)
 {
-    const char *cp;
+    if ((gn != NULL) && !Targ_Precious (gn)) {
+       char      *p1;
+       char      *file = Var_Value(TARGET, gn, &p1);
 
-    Shell_Init();              /* setup default shell */
-    
-    for (cp = "~#=|^(){};&<>*?[]:$`\\\n"; *cp != '\0'; cp++) {
-       meta[(unsigned char) *cp] = 1;
+       if (!noExecute && eunlink(file) != -1) {
+           Error("*** %s removed", file);
+       }
+
+       free(p1);
     }
-    /*
-     * The null character serves as a sentinel in the string.
-     */
-    meta[0] = 1;
 }
 
 /*-
@@ -155,6 +153,9 @@ Compat_Init(void)
  *     The target is removed and the process exits. If .INTERRUPT exists,
  *     its commands are run first WITH INTERRUPTS IGNORED..
  *
+ * XXX: is .PRECIOUS supposed to inhibit .INTERRUPT? I doubt it, but I've
+ * left the logic alone for now. - dholland 20160826
+ *
  *-----------------------------------------------------------------------
  */
 static void
@@ -162,16 +163,9 @@ CompatInterrupt(int signo)
 {
     GNode   *gn;
 
-    if ((curTarg != NULL) && !Targ_Precious (curTarg)) {
-       char      *p1;
-       char      *file = Var_Value(TARGET, curTarg, &p1);
-
-       if (!noExecute && eunlink(file) != -1) {
-           Error("*** %s removed", file);
-       }
-       if (p1)
-           free(p1);
+    CompatDeleteTarget(curTarg);
 
+    if ((curTarg != NULL) && !Targ_Precious (curTarg)) {
        /*
         * Run .INTERRUPT only if hit with interrupt signal
         */
@@ -181,12 +175,20 @@ CompatInterrupt(int signo)
                Compat_Make(gn, gn);
            }
        }
-
     }
     if (signo == SIGQUIT)
        _exit(signo);
-    bmake_signal(signo, SIG_DFL);
-    kill(myPid, signo);
+    /*
+     * If there is a child running, pass the signal on
+     * we will exist after it has exited.
+     */
+    compatSigno = signo;
+    if (compatChild > 0) {
+       KILLPG(compatChild, signo);
+    } else {
+       bmake_signal(signo, SIG_DFL);
+       kill(myPid, signo);
+    }
 }
 
 /*-
@@ -236,7 +238,7 @@ CompatRunCommand(void *cmdp, void *gnp)
     doIt = FALSE;
     
     cmdNode = Lst_Member(gn->commands, cmd);
-    cmdStart = Var_Subst(NULL, cmd, gn, FALSE);
+    cmdStart = Var_Subst(NULL, cmd, gn, VARF_WANTRES);
 
     /*
      * brk_string will return an argv with a NULL in av[0], thus causing
@@ -271,8 +273,8 @@ CompatRunCommand(void *cmdp, void *gnp)
            break;
        case '+':
            doIt = TRUE;
-           if (!meta[0])               /* we came here from jobs */
-               Compat_Init();
+           if (!shellName)             /* we came here from jobs */
+               Shell_Init();
            break;
        }
        cmd++;
@@ -300,11 +302,13 @@ CompatRunCommand(void *cmdp, void *gnp)
      * Search for meta characters in the command. If there are no meta
      * characters, there's no need to execute a shell to execute the
      * command.
+     *
+     * Additionally variable assignments and empty commands
+     * go to the shell. Therefore treat '=' and ':' like shell
+     * meta characters as documented in make(1).
      */
-    for (cp = cmd; !meta[(unsigned char)*cp]; cp++) {
-       continue;
-    }
-    useShell = (*cp != '\0');
+    
+    useShell = needshell(cmd, FALSE);
 #endif
 
     /*
@@ -377,7 +381,7 @@ again:
     /*
      * Fork and execute the single command. If the fork fails, we abort.
      */
-    cpid = vFork();
+    compatChild = cpid = vFork();
     if (cpid < 0) {
        Fatal("Could not fork");
     }
@@ -395,15 +399,15 @@ again:
        execError("exec", av[0]);
        _exit(1);
     }
-    if (mav)
-       free(mav);
-    if (bp)
-       free(bp);
+
+    free(mav);
+    free(bp);
+
     Lst_Replace(cmdNode, NULL);
 
 #ifdef USE_META
     if (useMeta) {
-       meta_compat_parent();
+       meta_compat_parent(cpid);
     }
 #endif
 
@@ -468,6 +472,11 @@ again:
                         * continue.
                         */
                        printf(" (continuing)\n");
+                   } else {
+                       printf("\n");
+                   }
+                   if (deleteOnError) {
+                           CompatDeleteTarget(gn);
                    }
                } else {
                    /*
@@ -485,7 +494,12 @@ again:
        }
     }
     free(cmdStart);
-
+    compatChild = 0;
+    if (compatSigno) {
+       bmake_signal(compatSigno, SIG_DFL);
+       kill(myPid, compatSigno);
+    }
+    
     return (status);
 }
 
@@ -512,8 +526,8 @@ Compat_Make(void *gnp, void *pgnp)
     GNode *gn = (GNode *)gnp;
     GNode *pgn = (GNode *)pgnp;
 
-    if (!meta[0])              /* we came here from jobs */
-       Compat_Init();
+    if (!shellName)            /* we came here from jobs */
+       Shell_Init();
     if (gn->made == UNMADE && (gn == pgn || (pgn->type & OP_MADE) == 0)) {
        /*
         * First mark ourselves to be made, then apply whatever transformations
@@ -537,8 +551,7 @@ Compat_Make(void *gnp, void *pgnp)
        if (Lst_Member(gn->iParents, pgn) != NULL) {
            char *p1;
            Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), pgn, 0);
-           if (p1)
-               free(p1);
+           free(p1);
        }
 
        /*
@@ -608,7 +621,8 @@ Compat_Make(void *gnp, void *pgnp)
        }
 #ifdef USE_META
        if (useMeta && !NoExecute(gn)) {
-           meta_job_finish(NULL);
+           if (meta_job_finish(NULL) != 0)
+               gn->made = ERROR;
        }
 #endif
 
@@ -628,7 +642,7 @@ Compat_Make(void *gnp, void *pgnp)
        } else if (keepgoing) {
            pgn->flags &= ~REMAKE;
        } else {
-           PrintOnError(gn, "\n\nStop.");
+           PrintOnError(gn, "\nStop.");
            exit(1);
        }
     } else if (gn->made == ERROR) {
@@ -641,8 +655,7 @@ Compat_Make(void *gnp, void *pgnp)
        if (Lst_Member(gn->iParents, pgn) != NULL) {
            char *p1;
            Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), pgn, 0);
-           if (p1)
-               free(p1);
+           free(p1);
        }
        switch(gn->made) {
            case BEINGMADE:
@@ -693,7 +706,8 @@ Compat_Run(Lst targs)
     GNode        *gn = NULL;/* Current root target */
     int                  errors;   /* Number of targets not remade due to errors */
 
-    Compat_Init();
+    if (!shellName)
+       Shell_Init();
 
     if (bmake_signal(SIGINT, SIG_IGN) != SIG_IGN) {
        bmake_signal(SIGINT, CompatInterrupt);
@@ -719,7 +733,7 @@ Compat_Run(Lst targs)
        if (gn != NULL) {
            Compat_Make(gn, gn);
             if (gn->made == ERROR) {
-                PrintOnError(gn, "\n\nStop.");
+                PrintOnError(gn, "\nStop.");
                 exit(1);
             }
        }
@@ -760,7 +774,7 @@ Compat_Run(Lst targs)
     if (errors == 0) {
        Compat_Make(ENDNode, ENDNode);
        if (gn->made == ERROR) {
-           PrintOnError(gn, "\n\nStop.");
+           PrintOnError(gn, "\nStop.");
            exit(1);
        }
     }
Index: pkgsrc/devel/bmake/files/parse.c
diff -u pkgsrc/devel/bmake/files/parse.c:1.10 pkgsrc/devel/bmake/files/parse.c:1.11
--- pkgsrc/devel/bmake/files/parse.c:1.10       Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/parse.c    Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.10 2015/05/19 22:01:19 joerg Exp $ */
+/*     $NetBSD: parse.c,v 1.11 2020/05/24 11:09:43 nia Exp $   */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.10 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.11 2020/05/24 11:09:43 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)parse.c    8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: parse.c,v 1.10 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: parse.c,v 1.11 2020/05/24 11:09:43 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -128,7 +128,6 @@ __RCSID("$NetBSD: parse.c,v 1.10 2015/05
 #include <assert.h>
 #include <ctype.h>
 #include <errno.h>
-#include <fcntl.h>
 #include <stdarg.h>
 #include <stdio.h>
 
@@ -139,6 +138,10 @@ __RCSID("$NetBSD: parse.c,v 1.10 2015/05
 #include "buf.h"
 #include "pathnames.h"
 
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
 #ifdef HAVE_MMAP
 #include <sys/mman.h>
 
@@ -161,6 +164,7 @@ typedef struct IFile {
     int             lineno;         /* current line number in file */
     int             first_lineno;   /* line number of start of text */
     int             cond_depth;     /* 'if' nesting when file opened */
+    Boolean         depending;      /* state of doing_depend on EOF */
     char            *P_str;         /* point to base of string buffer */
     char            *P_ptr;         /* point to next char of string buffer */
     char            *P_end;         /* point to the end of string buffer */
@@ -184,6 +188,7 @@ typedef struct IFile {
 typedef enum {
     Begin,         /* .BEGIN */
     Default,       /* .DEFAULT */
+    DeleteOnError,  /* .DELETE_ON_ERROR */
     End,           /* .END */
     dotError,      /* .ERROR */
     Ignore,        /* .IGNORE */
@@ -301,6 +306,7 @@ static const struct {
 } parseKeywords[] = {
 { ".BEGIN",      Begin,        0 },
 { ".DEFAULT",    Default,      0 },
+{ ".DELETE_ON_ERROR", DeleteOnError, 0 },
 { ".END",        End,          0 },
 { ".ERROR",      dotError,     0 },
 { ".EXEC",       Attribute,    OP_EXEC },
@@ -365,9 +371,6 @@ static void ParseHasCommands(void *);
 static void ParseDoInclude(char *);
 static void ParseSetParseFile(const char *);
 static void ParseSetIncludedFile(void);
-#ifdef SYSVINCLUDE
-static void ParseTraditionalInclude(char *);
-#endif
 #ifdef GMAKEEXPORT
 static void ParseGmakeExport(char *);
 #endif
@@ -484,7 +487,7 @@ loadfile(const char *path, int fd)
 {
        struct loadedfile *lf;
 #ifdef HAVE_MMAP
-       long pagesize;
+       static long pagesize = 0;
 #endif
        ssize_t result;
        size_t bufpos;
@@ -508,7 +511,10 @@ loadfile(const char *path, int fd)
 #ifdef HAVE_MMAP
        if (load_getsize(fd, &lf->len) == SUCCESS) {
                /* found a size, try mmap */
-               pagesize = sysconf(_SC_PAGESIZE);
+#ifdef _SC_PAGESIZE
+               if (pagesize == 0)
+                       pagesize = sysconf(_SC_PAGESIZE);
+#endif
                if (pagesize <= 0) {
                        pagesize = 0x1000;
                }
@@ -533,7 +539,7 @@ loadfile(const char *path, int fd)
                if (lf->buf != MAP_FAILED) {
                        /* succeeded */
                        if (lf->len == lf->maplen && lf->buf[lf->len - 1] != '\n') {
-                               char *b = malloc(lf->len + 1);
+                               char *b = bmake_malloc(lf->len + 1);
                                b[lf->len] = '\n';
                                memcpy(b, lf->buf, lf->len++);
                                munmap(lf->buf, lf->maplen);
@@ -554,9 +560,15 @@ loadfile(const char *path, int fd)
        while (1) {
                assert(bufpos <= lf->len);
                if (bufpos == lf->len) {
+                       if (lf->len > SIZE_MAX/2) {
+                               errno = EFBIG;
+                               Error("%s: file too large", path);
+                               exit(1);
+                       }
                        lf->len *= 2;
                        lf->buf = bmake_realloc(lf->buf, lf->len);
                }
+               assert(bufpos < lf->len);
                result = read(fd, lf->buf + bufpos, lf->len - bufpos);
                if (result < 0) {
                        Error("%s: read error: %s", path, strerror(errno));
@@ -572,7 +584,11 @@ loadfile(const char *path, int fd)
 
        /* truncate malloc region to actual length (maybe not useful) */
        if (lf->len > 0) {
+               /* as for mmap case, ensure trailing \n */
+               if (lf->buf[lf->len - 1] != '\n')
+                       lf->len++;
                lf->buf = bmake_realloc(lf->buf, lf->len);
+               lf->buf[lf->len - 1] = '\n';
        }
 
 #ifdef HAVE_MMAP
@@ -669,27 +685,37 @@ ParseVErrorInternal(FILE *f, const char 
     const char *fmt, va_list ap)
 {
        static Boolean fatal_warning_error_printed = FALSE;
+       char dirbuf[MAXPATHLEN+1];
 
        (void)fprintf(f, "%s: ", progname);
 
        if (cfname != NULL) {
                (void)fprintf(f, "\"");
                if (*cfname != '/' && strcmp(cfname, "(stdin)") != 0) {
-                       char *cp;
-                       const char *dir;
+                       char *cp, *cp2;
+                       const char *dir, *fname;
 
                        /*
                         * Nothing is more annoying than not knowing
-                        * which Makefile is the culprit.
+                        * which Makefile is the culprit; we try ${.PARSEDIR}
+                        * and apply realpath(3) if not absolute.
                         */
                        dir = Var_Value(".PARSEDIR", VAR_GLOBAL, &cp);
-                       if (dir == NULL || *dir == '\0' ||
-                           (*dir == '.' && dir[1] == '\0'))
-                               dir = Var_Value(".CURDIR", VAR_GLOBAL, &cp);
                        if (dir == NULL)
                                dir = ".";
-
-                       (void)fprintf(f, "%s/%s", dir, cfname);
+                       if (*dir != '/') {
+                               dir = realpath(dir, dirbuf);
+                       }
+                       fname = Var_Value(".PARSEFILE", VAR_GLOBAL, &cp2);
+                       if (fname == NULL) {
+                               if ((fname = strrchr(cfname, '/')))
+                                       fname++;
+                               else
+                                       fname = cfname;
+                       }
+                       (void)fprintf(f, "%s/%s", dir, fname);
+                       free(cp2);
+                       free(cp);
                } else
                        (void)fprintf(f, "%s", cfname);
 
@@ -700,6 +726,8 @@ ParseVErrorInternal(FILE *f, const char 
        (void)vfprintf(f, fmt, ap);
        (void)fprintf(f, "\n");
        (void)fflush(f);
+       if (type == PARSE_INFO)
+               return;
        if (type == PARSE_FATAL || parseWarnFatal)
                fatals += 1;
        if (parseWarnFatal && !fatal_warning_error_printed) {
@@ -792,7 +820,7 @@ ParseMessage(char *line)
 
     switch(*line) {
     case 'i':
-       mtype = 0;
+       mtype = PARSE_INFO;
        break;
     case 'w':
        mtype = PARSE_WARNING;
@@ -805,14 +833,14 @@ ParseMessage(char *line)
        return FALSE;
     }
 
-    while (isalpha((u_char)*line))
+    while (isalpha((unsigned char)*line))
        line++;
-    if (!isspace((u_char)*line))
+    if (!isspace((unsigned char)*line))
        return FALSE;                   /* not for us */
-    while (isspace((u_char)*line))
+    while (isspace((unsigned char)*line))
        line++;
 
-    line = Var_Subst(NULL, line, VAR_CMD, 0);
+    line = Var_Subst(NULL, line, VAR_CMD, VARF_WANTRES);
     Parse_Error(mtype, "%s", line);
     free(line);
 
@@ -1089,15 +1117,15 @@ ParseDoSrc(int tOp, const char *src)
  *-----------------------------------------------------------------------
  */
 static int
-ParseFindMain(void *gnp, void *dummy)
+ParseFindMain(void *gnp, void *dummy MAKE_ATTR_UNUSED)
 {
     GNode        *gn = (GNode *)gnp;
     if ((gn->type & OP_NOTARGET) == 0) {
        mainNode = gn;
        Targ_SetMain(gn);
-       return (dummy ? 1 : 1);
+       return 1;
     } else {
-       return (dummy ? 0 : 0);
+       return 0;
     }
 }
 
@@ -1135,10 +1163,10 @@ ParseAddDir(void *path, void *name)
  *-----------------------------------------------------------------------
  */
 static int
-ParseClearPath(void *path, void *dummy)
+ParseClearPath(void *path, void *dummy MAKE_ATTR_UNUSED)
 {
     Dir_ClearPath((Lst) path);
-    return(dummy ? 0 : 0);
+    return 0;
 }
 
 /*-
@@ -1229,9 +1257,9 @@ ParseDoDependency(char *line)
                int     length;
                void    *freeIt;
 
-               (void)Var_Parse(cp, VAR_CMD, TRUE, &length, &freeIt);
-               if (freeIt)
-                   free(freeIt);
+               (void)Var_Parse(cp, VAR_CMD, VARF_UNDEFERR|VARF_WANTRES,
+                               &length, &freeIt);
+               free(freeIt);
                cp += length-1;
            }
        }
@@ -1257,6 +1285,7 @@ ParseDoDependency(char *line)
                goto out;
            } else {
                /* Done with this word; on to the next. */
+               cp = line;
                continue;
            }
        }
@@ -1329,6 +1358,7 @@ ParseDoDependency(char *line)
                 *      .BEGIN
                 *      .END
                 *      .ERROR
+                *      .DELETE_ON_ERROR
                 *      .INTERRUPT      Are not to be considered the
                 *                      main target.
                 *      .NOTPARALLEL    Make only one target at a time.
@@ -1364,6 +1394,9 @@ ParseDoDependency(char *line)
                    (void)Lst_AtEnd(targets, gn);
                    DEFAULT = gn;
                    break;
+               case DeleteOnError:
+                   deleteOnError = TRUE;
+                   break;
                case NotParallel:
                    maxJobs = 1;
                    break;
@@ -1592,7 +1625,8 @@ ParseDoDependency(char *line)
            goto out;
        }
        *line = '\0';
-    } else if ((specType == NotParallel) || (specType == SingleShell)) {
+    } else if ((specType == NotParallel) || (specType == SingleShell) ||
+           (specType == DeleteOnError)) {
        *line = '\0';
     }
 
@@ -1653,7 +1687,7 @@ ParseDoDependency(char *line)
                    Suff_SetNull(line);
                    break;
                case ExObjdir:
-                   Main_SetObjdir(line);
+                   Main_SetObjdir("%s", line);
                    break;
                default:
                    break;
@@ -1669,10 +1703,12 @@ ParseDoDependency(char *line)
        }
        if (paths) {
            Lst_Destroy(paths, NULL);
+           paths = NULL;
        }
        if (specType == ExPath)
            Dir_SetPATH();
     } else {
+       assert(paths == NULL);
        while (*line) {
            /*
             * The targets take real sources, so we must beware of archive
@@ -1731,6 +1767,8 @@ ParseDoDependency(char *line)
     }
 
 out:
+    if (paths)
+       Lst_Destroy(paths, NULL);
     if (curTargs)
            Lst_Destroy(curTargs, NULL);
 }
@@ -1853,7 +1891,7 @@ Parse_DoVar(char *line, GNode *ctxt)
      * XXX Rather than counting () and {} we should look for $ and
      * then expand the variable.
      */
-    for (depth = 0, cp = line + 1; depth != 0 || *cp != '='; cp++) {
+    for (depth = 0, cp = line + 1; depth > 0 || *cp != '='; cp++) {
        if (*cp == '(' || *cp == '{') {
            depth++;
            continue;
@@ -1944,7 +1982,7 @@ Parse_DoVar(char *line, GNode *ctxt)
        if (!Var_Exists(line, ctxt))
            Var_Set(line, "", ctxt, 0);
 
-       cp = Var_Subst(NULL, cp, ctxt, FALSE);
+       cp = Var_Subst(NULL, cp, ctxt, VARF_WANTRES|VARF_ASSIGN);
        oldVars = oldOldVars;
        freeCp = TRUE;
 
@@ -1959,7 +1997,7 @@ Parse_DoVar(char *line, GNode *ctxt)
             * expansion on the whole thing. The resulting string will need
             * freeing when we're done, so set freeCmd to TRUE.
             */
-           cp = Var_Subst(NULL, cp, VAR_CMD, TRUE);
+           cp = Var_Subst(NULL, cp, VAR_CMD, VARF_UNDEFERR|VARF_WANTRES);
            freeCp = TRUE;
        }
 
@@ -2151,7 +2189,7 @@ Parse_AddIncludeDir(char *dir)
  */
 
 static void
-Parse_include_file(char *file, Boolean isSystem, int silent)
+Parse_include_file(char *file, Boolean isSystem, Boolean depinc, int silent)
 {
     struct loadedfile *lf;
     char          *fullname;   /* full pathname of file */
@@ -2251,6 +2289,8 @@ Parse_include_file(char *file, Boolean i
     /* Start reading from this file next */
     Parse_SetInput(fullname, 0, -1, loadedfile_nextbuf, lf);
     curFile->lf = lf;
+    if (depinc)
+       doing_depend = depinc;          /* only turn it on */
 }
 
 static void
@@ -2298,9 +2338,9 @@ ParseDoInclude(char *line)
      * Substitute for any variables in the file name before trying to
      * find the thing.
      */
-    file = Var_Subst(NULL, file, VAR_CMD, FALSE);
+    file = Var_Subst(NULL, file, VAR_CMD, VARF_WANTRES);
 
-    Parse_include_file(file, endc == '>', silent);
+    Parse_include_file(file, endc == '>', (*line == 'd'), silent);
     free(file);
 }
 
@@ -2335,10 +2375,8 @@ ParseSetIncludedFile(void)
        fprintf(debug_file, "%s: ${.INCLUDEDFROMDIR} = `%s' "
            "${.INCLUDEDFROMFILE} = `%s'\n", __func__, pd, pf);
 
-    if (fp)
-       free(fp);
-    if (dp)
-       free(dp);
+    free(fp);
+    free(dp);
 }
 /*-
  *---------------------------------------------------------------------
@@ -2390,15 +2428,19 @@ static void
 ParseTrackInput(const char *name)
 {
     char *old;
+    char *ep;
     char *fp = NULL;
     size_t name_len = strlen(name);
     
     old = Var_Value(MAKE_MAKEFILES, VAR_GLOBAL, &fp);
     if (old) {
+       ep = old + strlen(old) - name_len;
        /* does it contain name? */
        for (; old != NULL; old = strchr(old, ' ')) {
            if (*old == ' ')
                old++;
+           if (old >= ep)
+               break;                  /* cannot contain name */
            if (memcmp(old, name, name_len) == 0
                    && (old[name_len] == 0 || old[name_len] == ' '))
                goto cleanup;
@@ -2464,6 +2506,7 @@ Parse_SetInput(const char *name, int lin
     curFile->nextbuf = nextbuf;
     curFile->nextbuf_arg = arg;
     curFile->lf = NULL;
+    curFile->depending = doing_depend; /* restore this on EOF */
 
     assert(nextbuf != NULL);
 
@@ -2484,8 +2527,73 @@ Parse_SetInput(const char *name, int lin
     ParseSetParseFile(name);
 }
 
+/*-
+ *-----------------------------------------------------------------------
+ * IsInclude --
+ *     Check if the line is an include directive
+ *
+ * Results:
+ *     TRUE if it is.
+ *
+ * Side Effects:
+ *     None
+ *
+ *-----------------------------------------------------------------------
+ */
+static Boolean
+IsInclude(const char *line, Boolean sysv)
+{
+       static const char inc[] = "include";
+       static const size_t inclen = sizeof(inc) - 1;
+
+       // 'd' is not valid for sysv
+       int o = strchr(&("ds-"[sysv]), *line) != NULL;
+
+       if (strncmp(line + o, inc, inclen) != 0)
+               return FALSE;
+
+       // Space is not mandatory for BSD .include
+       return !sysv || isspace((unsigned char)line[inclen + o]);
+}
+
+
 #ifdef SYSVINCLUDE
 /*-
+ *-----------------------------------------------------------------------
+ * IsSysVInclude --
+ *     Check if the line is a SYSV include directive
+ *
+ * Results:
+ *     TRUE if it is.
+ *
+ * Side Effects:
+ *     None
+ *
+ *-----------------------------------------------------------------------
+ */
+static Boolean
+IsSysVInclude(const char *line)
+{
+       const char *p;
+
+       if (!IsInclude(line, TRUE))
+               return FALSE;
+
+       /* Avoid interpeting a dependency line as an include */
+       for (p = line; (p = strchr(p, ':')) != NULL;) {
+               if (*++p == '\0') {
+                       /* end of line -> dependency */
+                       return FALSE;
+               }
+               if (*p == ':' || isspace((unsigned char)*p)) {
+                       /* :: operator or ': ' -> dependency */
+                       return FALSE;
+               }
+       }
+       return TRUE;
+}
+
+/*-
  *---------------------------------------------------------------------
  * ParseTraditionalInclude  --
  *     Push to another file.
@@ -2524,12 +2632,12 @@ ParseTraditionalInclude(char *line)
      * Substitute for any variables in the file name before trying to
      * find the thing.
      */
-    all_files = Var_Subst(NULL, file, VAR_CMD, FALSE);
+    all_files = Var_Subst(NULL, file, VAR_CMD, VARF_WANTRES);
 
     if (*file == '\0') {
        Parse_Error(PARSE_FATAL,
                     "Filename missing from \"include\"");
-       return;
+       goto out;
     }
 
     for (file = all_files; !done; file = cp + 1) {
@@ -2542,8 +2650,9 @@ ParseTraditionalInclude(char *line)
        else
            done = 1;
 
-       Parse_include_file(file, FALSE, silent);
+       Parse_include_file(file, FALSE, FALSE, silent);
     }
+out:
     free(all_files);
 }
 #endif
@@ -2592,8 +2701,9 @@ ParseGmakeExport(char *line)
     /*
      * Expand the value before putting it in the environment.
      */
-    value = Var_Subst(NULL, value, VAR_CMD, FALSE);
+    value = Var_Subst(NULL, value, VAR_CMD, VARF_WANTRES);
     setenv(variable, value, 1);
+    free(value);
 }
 #endif
 
@@ -2620,6 +2730,7 @@ ParseEOF(void)
 
     assert(curFile->nextbuf != NULL);
 
+    doing_depend = curFile->depending; /* restore this */
     /* get next input buffer, if any */
     ptr = curFile->nextbuf(curFile->nextbuf_arg, &len);
     curFile->P_ptr = ptr;
@@ -2981,9 +3092,7 @@ Parse_File(const char *name, int fd)
                for (cp = line + 1; isspace((unsigned char)*cp); cp++) {
                    continue;
                }
-               if (strncmp(cp, "include", 7) == 0 ||
-                       ((cp[0] == 's' || cp[0] == '-') &&
-                           strncmp(&cp[1], "include", 7) == 0)) {
+               if (IsInclude(cp, FALSE)) {
                    ParseDoInclude(cp);
                    continue;
                }
@@ -3045,12 +3154,7 @@ Parse_File(const char *name, int fd)
            }
 
 #ifdef SYSVINCLUDE
-           if (((strncmp(line, "include", 7) == 0 &&
-                   isspace((unsigned char) line[7])) ||
-                       ((line[0] == 's' || line[0] == '-') &&
-                           strncmp(&line[1], "include", 7) == 0 &&
-                           isspace((unsigned char) line[8]))) &&
-                   strchr(line, ':') == NULL) {
+           if (IsSysVInclude(line)) {
                /*
                 * It's an S3/S5-style "include".
                 */
@@ -3141,7 +3245,7 @@ Parse_File(const char *name, int fd)
             * variables expanded before being parsed. Tell the variable
             * module to complain if some variable is undefined...
             */
-           line = Var_Subst(NULL, line, VAR_CMD, TRUE);
+           line = Var_Subst(NULL, line, VAR_CMD, VARF_UNDEFERR|VARF_WANTRES);
 
            /*
             * Need a non-circular list for the target nodes
Index: pkgsrc/devel/bmake/files/var.c
diff -u pkgsrc/devel/bmake/files/var.c:1.10 pkgsrc/devel/bmake/files/var.c:1.11
--- pkgsrc/devel/bmake/files/var.c:1.10 Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/var.c      Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.10 2015/05/19 22:01:19 joerg Exp $   */
+/*     $NetBSD: var.c,v 1.11 2020/05/24 11:09:43 nia Exp $     */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.10 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.11 2020/05/24 11:09:43 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c      8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.10 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: var.c,v 1.11 2020/05/24 11:09:43 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -129,7 +129,6 @@ __RCSID("$NetBSD: var.c,v 1.10 2015/05/1
 #include    <regex.h>
 #endif
 #include    <ctype.h>
-#include    <inttypes.h>
 #include    <stdlib.h>
 #include    <limits.h>
 #include    <time.h>
@@ -138,6 +137,7 @@ __RCSID("$NetBSD: var.c,v 1.10 2015/05/1
 #include    "buf.h"
 #include    "dir.h"
 #include    "job.h"
+#include    "metachar.h"
 
 extern int makelevel;
 /*
@@ -154,13 +154,23 @@ char **savedEnv = NULL;
 char   var_Error[] = "";
 
 /*
- * Similar to var_Error, but returned when the 'errnum' flag for Var_Parse is
- * set false. Why not just use a constant? Well, gcc likes to condense
- * identical string instances...
+ * Similar to var_Error, but returned when the 'VARF_UNDEFERR' flag for
+ * Var_Parse is not set. Why not just use a constant? Well, gcc likes
+ * to condense identical string instances...
  */
 static char    varNoError[] = "";
 
 /*
+ * Traditionally we consume $$ during := like any other expansion.
+ * Other make's do not.
+ * This knob allows controlling the behavior.
+ * FALSE for old behavior.
+ * TRUE for new compatible.
+ */
+#define SAVE_DOLLARS ".MAKE.SAVE_DOLLARS"
+static Boolean save_dollars = FALSE;
+
+/*
  * Internally, variables are contained in four different contexts.
  *     1) the environment. They may not be changed. If an environment
  *         variable is appended-to, the result is placed in the global
@@ -216,7 +226,11 @@ static int var_exportedVars = VAR_EXPORT
  * We pass this to Var_Export when doing the initial export
  * or after updating an exported var.
  */
-#define VAR_EXPORT_PARENT 1
+#define VAR_EXPORT_PARENT      1
+/*
+ * We pass this to Var_Export1 to tell it to leave the value alone.
+ */
+#define VAR_EXPORT_LITERAL     2
 
 /* Var*Pattern flags */
 #define VAR_SUB_GLOBAL 0x01    /* Apply substitution globally */
@@ -310,7 +324,7 @@ static Boolean VarLoopExpand(GNode *, Va
 static char *VarGetPattern(GNode *, Var_Parse_State *,
                           int, const char **, int, int *, int *,
                           VarPattern *);
-static char *VarQuote(char *);
+static char *VarQuote(char *, Boolean);
 static char *VarHash(char *);
 static char *VarModify(GNode *, Var_Parse_State *,
     const char *,
@@ -516,7 +530,7 @@ VarAdd(const char *name, const char *val
     h = Hash_CreateEntry(&ctxt->context, name, NULL);
     Hash_SetValue(h, v);
     v->name = h->name;
-    if (DEBUG(VAR)) {
+    if (DEBUG(VAR) && (ctxt->flags & INTERNAL) == 0) {
        fprintf(debug_file, "%s:%s = %s\n", ctxt->name, name, val);
     }
 }
@@ -541,7 +555,7 @@ Var_Delete(const char *name, GNode *ctxt
     char *cp;
     
     if (strchr(name, '$')) {
-       cp = Var_Subst(NULL, name, VAR_GLOBAL, 0);
+       cp = Var_Subst(NULL, name, VAR_GLOBAL, VARF_WANTRES);
     } else {
        cp = (char *)name;
     }
@@ -580,12 +594,13 @@ Var_Delete(const char *name, GNode *ctxt
  * We only manipulate flags of vars if 'parent' is set.
  */
 static int
-Var_Export1(const char *name, int parent)
+Var_Export1(const char *name, int flags)
 {
     char tmp[BUFSIZ];
     Var *v;
     char *val = NULL;
     int n;
+    int parent = (flags & VAR_EXPORT_PARENT);
 
     if (*name == '.')
        return 0;                       /* skip internals */
@@ -613,7 +628,7 @@ Var_Export1(const char *name, int parent
        return 0;                       /* nothing to do */
     }
     val = Buf_GetAll(&v->val, NULL);
-    if (strchr(val, '$')) {
+    if ((flags & VAR_EXPORT_LITERAL) == 0 && strchr(val, '$')) {
        if (parent) {
            /*
             * Flag this as something we need to re-export.
@@ -632,7 +647,7 @@ Var_Export1(const char *name, int parent
        }
        n = snprintf(tmp, sizeof(tmp), "${%s}", name);
        if (n < (int)sizeof(tmp)) {
-           val = Var_Subst(NULL, tmp, VAR_GLOBAL, 0);
+           val = Var_Subst(NULL, tmp, VAR_GLOBAL, VARF_WANTRES);
            setenv(name, val, 1);
            free(val);
        }
@@ -700,14 +715,16 @@ Var_ExportVars(void)
        int ac;
        int i;
 
-       val = Var_Subst(NULL, tmp, VAR_GLOBAL, 0);
-       av = brk_string(val, &ac, FALSE, &as);
-       for (i = 0; i < ac; i++) {
-           Var_Export1(av[i], 0);
+       val = Var_Subst(NULL, tmp, VAR_GLOBAL, VARF_WANTRES);
+       if (*val) {
+           av = brk_string(val, &ac, FALSE, &as);
+           for (i = 0; i < ac; i++) {
+               Var_Export1(av[i], 0);
+           }
+           free(as);
+           free(av);
        }
        free(val);
-       free(as);
-       free(av);
     }
 }
 
@@ -723,7 +740,7 @@ Var_Export(char *str, int isExport)
     char *val;
     char **av;
     char *as;
-    int track;
+    int flags;
     int ac;
     int i;
 
@@ -732,42 +749,47 @@ Var_Export(char *str, int isExport)
        return;
     }
 
+    flags = 0;
     if (strncmp(str, "-env", 4) == 0) {
-       track = 0;
        str += 4;
+    } else if (strncmp(str, "-literal", 8) == 0) {
+       str += 8;
+       flags |= VAR_EXPORT_LITERAL;
     } else {
-       track = VAR_EXPORT_PARENT;
+       flags |= VAR_EXPORT_PARENT;
     }
-    val = Var_Subst(NULL, str, VAR_GLOBAL, 0);
-    av = brk_string(val, &ac, FALSE, &as);
-    for (i = 0; i < ac; i++) {
-       name = av[i];
-       if (!name[1]) {
-           /*
-            * A single char.
-            * If it is one of the vars that should only appear in
-            * local context, skip it, else we can get Var_Subst
-            * into a loop.
-            */
-           switch (name[0]) {
-           case '@':
-           case '%':
-           case '*':
-           case '!':
-               continue;
+    val = Var_Subst(NULL, str, VAR_GLOBAL, VARF_WANTRES);
+    if (*val) {
+       av = brk_string(val, &ac, FALSE, &as);
+       for (i = 0; i < ac; i++) {
+           name = av[i];
+           if (!name[1]) {
+               /*
+                * A single char.
+                * If it is one of the vars that should only appear in
+                * local context, skip it, else we can get Var_Subst
+                * into a loop.
+                */
+               switch (name[0]) {
+               case '@':
+               case '%':
+               case '*':
+               case '!':
+                   continue;
+               }
            }
-       }
-       if (Var_Export1(name, track)) {
-           if (VAR_EXPORTED_ALL != var_exportedVars)
-               var_exportedVars = VAR_EXPORTED_YES;
-           if (isExport && track) {
-               Var_Append(MAKE_EXPORTED, name, VAR_GLOBAL);
+           if (Var_Export1(name, flags)) {
+               if (VAR_EXPORTED_ALL != var_exportedVars)
+                   var_exportedVars = VAR_EXPORTED_YES;
+               if (isExport && (flags & VAR_EXPORT_PARENT)) {
+                   Var_Append(MAKE_EXPORTED, name, VAR_GLOBAL);
+               }
            }
        }
+       free(as);
+       free(av);
     }
     free(val);
-    free(as);
-    free(av);
 }
 
 
@@ -813,7 +835,8 @@ Var_UnExport(char *str)
        environ = savedEnv = newenv;
        newenv[0] = NULL;
        newenv[1] = NULL;
-       setenv(MAKE_LEVEL_ENV, cp, 1);
+       if (cp && *cp)
+           setenv(MAKE_LEVEL_ENV, cp, 1);
     } else {
        for (; *str != '\n' && isspace((unsigned char) *str); str++)
            continue;
@@ -826,7 +849,7 @@ Var_UnExport(char *str)
        /* Using .MAKE.EXPORTED */
        n = snprintf(tmp, sizeof(tmp), "${" MAKE_EXPORTED ":O:u}");
        if (n < (int)sizeof(tmp)) {
-           vlist = Var_Subst(NULL, tmp, VAR_GLOBAL, 0);
+           vlist = Var_Subst(NULL, tmp, VAR_GLOBAL, VARF_WANTRES);
        }
     }
     if (vlist) {
@@ -856,7 +879,7 @@ Var_UnExport(char *str)
                n = snprintf(tmp, sizeof(tmp),
                             "${" MAKE_EXPORTED ":N%s}", v->name);
                if (n < (int)sizeof(tmp)) {
-                   cp = Var_Subst(NULL, tmp, VAR_GLOBAL, 0);
+                   cp = Var_Subst(NULL, tmp, VAR_GLOBAL, VARF_WANTRES);
                    Var_Set(MAKE_EXPORTED, cp, VAR_GLOBAL, 0);
                    free(cp);
                }
@@ -911,7 +934,7 @@ Var_Set(const char *name, const char *va
      * point in searching them all just to save a bit of memory...
      */
     if (strchr(name, '$') != NULL) {
-       expanded_name = Var_Subst(NULL, name, ctxt, 0);
+       expanded_name = Var_Subst(NULL, name, ctxt, VARF_WANTRES);
        if (expanded_name[0] == 0) {
            if (DEBUG(VAR)) {
                fprintf(debug_file, "Var_Set(\"%s\", \"%s\", ...) "
@@ -948,7 +971,8 @@ Var_Set(const char *name, const char *va
        VarAdd(name, val, ctxt);
     } else {
        Buf_Empty(&v->val);
-       Buf_AddBytes(&v->val, strlen(val), val);
+       if (val)
+           Buf_AddBytes(&v->val, strlen(val), val);
 
        if (DEBUG(VAR)) {
            fprintf(debug_file, "%s:%s = %s\n", ctxt->name, name, val);
@@ -975,14 +999,17 @@ Var_Set(const char *name, const char *va
         * Makefile settings.
         */
        if (varNoExportEnv != TRUE)
-           setenv(name, val, 1);
+           setenv(name, val ? val : "", 1);
 
        Var_Append(MAKEOVERRIDES, name, VAR_GLOBAL);
     }
-       
+    if (*name == '.') {
+       if (strcmp(name, SAVE_DOLLARS) == 0)
+           save_dollars = s2Boolean(val, save_dollars);
+    }
+
  out:
-    if (expanded_name != NULL)
-       free(expanded_name);
+    free(expanded_name);
     if (v != NULL)
        VarFreeEnv(v, TRUE);
 }
@@ -1022,7 +1049,7 @@ Var_Append(const char *name, const char 
     char *expanded_name = NULL;
 
     if (strchr(name, '$') != NULL) {
-       expanded_name = Var_Subst(NULL, name, ctxt, 0);
+       expanded_name = Var_Subst(NULL, name, ctxt, VARF_WANTRES);
        if (expanded_name[0] == 0) {
            if (DEBUG(VAR)) {
                fprintf(debug_file, "Var_Append(\"%s\", \"%s\", ...) "
@@ -1035,11 +1062,11 @@ Var_Append(const char *name, const char 
        name = expanded_name;
     }
 
-    v = VarFind(name, ctxt, (ctxt == VAR_GLOBAL) ? FIND_ENV : 0);
+    v = VarFind(name, ctxt, (ctxt == VAR_GLOBAL) ? (FIND_CMD|FIND_ENV) : 0);
 
     if (v == NULL) {
-       VarAdd(name, val, ctxt);
-    } else {
+       Var_Set(name, val, ctxt, 0);
+    } else if (ctxt == VAR_CMD || !(v->flags & VAR_FROM_CMD)) {
        Buf_AddByte(&v->val, ' ');
        Buf_AddBytes(&v->val, strlen(val), val);
 
@@ -1060,8 +1087,7 @@ Var_Append(const char *name, const char 
            Hash_SetValue(h, v);
        }
     }
-    if (expanded_name != NULL)
-       free(expanded_name);
+    free(expanded_name);
 }
 
 /*-
@@ -1088,12 +1114,10 @@ Var_Exists(const char *name, GNode *ctxt
     char          *cp;
 
     if ((cp = strchr(name, '$')) != NULL) {
-       cp = Var_Subst(NULL, name, ctxt, FALSE);
+       cp = Var_Subst(NULL, name, ctxt, VARF_WANTRES);
     }
     v = VarFind(cp ? cp : name, ctxt, FIND_CMD|FIND_GLOBAL|FIND_ENV);
-    if (cp != NULL) {
-       free(cp);
-    }
+    free(cp);
     if (v == NULL) {
        return(FALSE);
     } else {
@@ -1159,7 +1183,7 @@ Var_Value(const char *name, GNode *ctxt,
 static Boolean
 VarHead(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate,
        char *word, Boolean addSpace, Buffer *buf,
-       void *dummy)
+       void *dummy MAKE_ATTR_UNUSED)
 {
     char *slash;
 
@@ -1180,7 +1204,7 @@ VarHead(GNode *ctx MAKE_ATTR_UNUSED, Var
            Buf_AddByte(buf, vpstate->varSpace);
        Buf_AddByte(buf, '.');
     }
-    return(dummy ? TRUE : TRUE);
+    return TRUE;
 }
 
 /*-
@@ -1207,7 +1231,7 @@ VarHead(GNode *ctx MAKE_ATTR_UNUSED, Var
 static Boolean
 VarTail(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate,
        char *word, Boolean addSpace, Buffer *buf,
-       void *dummy)
+       void *dummy MAKE_ATTR_UNUSED)
 {
     char *slash;
 
@@ -1223,7 +1247,7 @@ VarTail(GNode *ctx MAKE_ATTR_UNUSED, Var
     } else {
        Buf_AddBytes(buf, strlen(word), word);
     }
-    return (dummy ? TRUE : TRUE);
+    return TRUE;
 }
 
 /*-
@@ -1249,7 +1273,7 @@ VarTail(GNode *ctx MAKE_ATTR_UNUSED, Var
 static Boolean
 VarSuffix(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate,
          char *word, Boolean addSpace, Buffer *buf,
-         void *dummy)
+         void *dummy MAKE_ATTR_UNUSED)
 {
     char *dot;
 
@@ -1263,7 +1287,7 @@ VarSuffix(GNode *ctx MAKE_ATTR_UNUSED, V
        dot[-1] = '.';
        addSpace = TRUE;
     }
-    return (dummy ? addSpace : addSpace);
+    return addSpace;
 }
 
 /*-
@@ -1290,7 +1314,7 @@ VarSuffix(GNode *ctx MAKE_ATTR_UNUSED, V
 static Boolean
 VarRoot(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate,
        char *word, Boolean addSpace, Buffer *buf,
-       void *dummy)
+       void *dummy MAKE_ATTR_UNUSED)
 {
     char *dot;
 
@@ -1306,7 +1330,7 @@ VarRoot(GNode *ctx MAKE_ATTR_UNUSED, Var
     } else {
        Buf_AddBytes(buf, strlen(word), word);
     }
-    return (dummy ? TRUE : TRUE);
+    return TRUE;
 }
 
 /*-
@@ -1377,8 +1401,9 @@ VarSYSVMatch(GNode *ctx, Var_Parse_State
             char *word, Boolean addSpace, Buffer *buf,
             void *patp)
 {
-    int len;
+    size_t len;
     char *ptr;
+    Boolean hasPercent;
     VarPattern           *pat = (VarPattern *)patp;
     char *varexp;
 
@@ -1387,9 +1412,9 @@ VarSYSVMatch(GNode *ctx, Var_Parse_State
 
     addSpace = TRUE;
 
-    if ((ptr = Str_SYSVMatch(word, pat->lhs, &len)) != NULL) {
-        varexp = Var_Subst(NULL, pat->rhs, ctx, 0);
-       Str_SYSVSubst(buf, varexp, ptr, len);
+    if ((ptr = Str_SYSVMatch(word, pat->lhs, &len, &hasPercent)) != NULL) {
+        varexp = Var_Subst(NULL, pat->rhs, ctx, VARF_WANTRES);
+       Str_SYSVSubst(buf, varexp, ptr, len, hasPercent);
        free(varexp);
     } else {
        Buf_AddBytes(buf, strlen(word), word);
@@ -1628,14 +1653,14 @@ VarSubstitute(GNode *ctx MAKE_ATTR_UNUSE
  *-----------------------------------------------------------------------
  */
 static void
-VarREError(int errnum, regex_t *pat, const char *str)
+VarREError(int reerr, regex_t *pat, const char *str)
 {
     char *errbuf;
     int errlen;
 
-    errlen = regerror(errnum, pat, 0, 0);
+    errlen = regerror(reerr, pat, 0, 0);
     errbuf = bmake_malloc(errlen);
-    regerror(errnum, pat, errbuf, errlen);
+    regerror(reerr, pat, errbuf, errlen);
     Error("%s: %s", str, errbuf);
     free(errbuf);
 }
@@ -1808,14 +1833,14 @@ VarLoopExpand(GNode *ctx MAKE_ATTR_UNUSE
 
     if (word && *word) {
         Var_Set(loop->tvar, word, loop->ctxt, VAR_NO_EXPORT);
-        s = Var_Subst(NULL, loop->str, loop->ctxt, loop->errnum);
+        s = Var_Subst(NULL, loop->str, loop->ctxt, loop->errnum | VARF_WANTRES);
         if (s != NULL && *s != '\0') {
             if (addSpace && *s != '\n')
                 Buf_AddByte(buf, ' ');
             Buf_AddBytes(buf, (slen = strlen(s)), s);
             addSpace = (slen > 0 && s[slen - 1] != '\n');
-            free(s);
         }
+       free(s);
     }
     return addSpace;
 }
@@ -1928,7 +1953,7 @@ VarRealpath(GNode *ctx MAKE_ATTR_UNUSED,
            Buf_AddByte(buf, vpstate->varSpace);
        }
        addSpace = TRUE;
-       rp = realpath(word, rbuf);
+       rp = cached_realpath(word, rbuf);
        if (rp && *rp == '/' && stat(rp, &st) == 0)
                word = rp;
        
@@ -2117,6 +2142,51 @@ VarUniq(const char *str)
     return Buf_Destroy(&buf, FALSE);
 }
 
+/*-
+ *-----------------------------------------------------------------------
+ * VarRange --
+ *     Return an integer sequence
+ *
+ * Input:
+ *     str             String whose words provide default range
+ *     ac              range length, if 0 use str words
+ *
+ * Side Effects:
+ *     None.
+ *
+ *-----------------------------------------------------------------------
+ */
+static char *
+VarRange(const char *str, int ac)
+{
+    Buffer       buf;              /* Buffer for new string */
+    char         tmp[32];          /* each element */
+    char       **av;               /* List of words to affect */
+    char        *as;               /* Word list memory */
+    int          i, n;
+
+    Buf_Init(&buf, 0);
+    if (ac > 0) {
+       as = NULL;
+       av = NULL;
+    } else {
+       av = brk_string(str, &ac, FALSE, &as);
+    }
+    for (i = 0; i < ac; i++) {
+       n = snprintf(tmp, sizeof(tmp), "%d", 1 + i);
+       if (n >= (int)sizeof(tmp))
+           break;
+       Buf_AddBytes(&buf, n, tmp);
+       if (i != ac - 1)
+           Buf_AddByte(&buf, ' ');
+    }
+
+    free(as);
+    free(av);
+
+    return Buf_Destroy(&buf, FALSE);
+}
+
 
 /*-
  *-----------------------------------------------------------------------
@@ -2142,13 +2212,14 @@ VarUniq(const char *str)
  */
 static char *
 VarGetPattern(GNode *ctxt, Var_Parse_State *vpstate MAKE_ATTR_UNUSED,
-             int errnum, const char **tstr, int delim, int *flags,
+             int flags, const char **tstr, int delim, int *vflags,
              int *length, VarPattern *pattern)
 {
     const char *cp;
     char *rstr;
     Buffer buf;
     int junk;
+    int errnum = flags & VARF_UNDEFERR;
 
     Buf_Init(&buf, 0);
     if (length == NULL)
@@ -2170,16 +2241,16 @@ VarGetPattern(GNode *ctxt, Var_Parse_Sta
            cp++;
        } else if (*cp == '$') {
            if (cp[1] == delim) {
-               if (flags == NULL)
+               if (vflags == NULL)
                    Buf_AddByte(&buf, *cp);
                else
                    /*
                     * Unescaped $ at end of pattern => anchor
                     * pattern at end.
                     */
-                   *flags |= VAR_MATCH_END;
+                   *vflags |= VAR_MATCH_END;
            } else {
-               if (flags == NULL || (*flags & VAR_NOSUBST) == 0) {
+               if (vflags == NULL || (*vflags & VAR_NOSUBST) == 0) {
                    char   *cp2;
                    int     len;
                    void   *freeIt;
@@ -2189,10 +2260,10 @@ VarGetPattern(GNode *ctxt, Var_Parse_Sta
                     * delimiter, assume it's a variable
                     * substitution and recurse.
                     */
-                   cp2 = Var_Parse(cp, ctxt, errnum, &len, &freeIt);
+                   cp2 = Var_Parse(cp, ctxt, errnum | VARF_WANTRES, &len,
+                       &freeIt);
                    Buf_AddBytes(&buf, strlen(cp2), cp2);
-                   if (freeIt)
-                       free(freeIt);
+                   free(freeIt);
                    cp += len - 1;
                } else {
                    const char *cp2 = &cp[1];
@@ -2245,7 +2316,8 @@ VarGetPattern(GNode *ctxt, Var_Parse_Sta
 /*-
  *-----------------------------------------------------------------------
  * VarQuote --
- *     Quote shell meta-characters in the string
+ *     Quote shell meta-characters and space characters in the string
+ *     if quoteDollar is set, also quote and double any '$' characters.
  *
  * Results:
  *     The quoted string
@@ -2256,33 +2328,31 @@ VarGetPattern(GNode *ctxt, Var_Parse_Sta
  *-----------------------------------------------------------------------
  */
 static char *
-VarQuote(char *str)
+VarQuote(char *str, Boolean quoteDollar)
 {
 
     Buffer       buf;
-    /* This should cover most shells :-( */
-    static const char meta[] = "\n \t'`\";&<>()|*?{}[]\\$!#^~";
     const char *newline;
-    size_t len, nlen;
+    size_t nlen;
 
     if ((newline = Shell_GetNewline()) == NULL)
            newline = "\\\n";
     nlen = strlen(newline);
 
     Buf_Init(&buf, 0);
-    while (*str != '\0') {
-       if ((len = strcspn(str, meta)) != 0) {
-           Buf_AddBytes(&buf, len, str);
-           str += len;
-       } else if (*str == '\n') {
+
+    for (; *str != '\0'; str++) {
+       if (*str == '\n') {
            Buf_AddBytes(&buf, nlen, newline);
-           ++str;
-       } else {
-           Buf_AddByte(&buf, '\\');
-           Buf_AddByte(&buf, *str);
-           ++str;
+           continue;
        }
+       if (isspace((unsigned char)*str) || ismeta((unsigned char)*str))
+           Buf_AddByte(&buf, '\\');
+       Buf_AddByte(&buf, *str);
+       if (quoteDollar && *str == '$')
+           Buf_AddBytes(&buf, 2, "\\$");
     }
+
     str = Buf_Destroy(&buf, FALSE);
     if (DEBUG(VAR))
        fprintf(debug_file, "QuoteMeta: [%s]\n", str);
@@ -2313,7 +2383,7 @@ VarHash(char *str)
     Buffer         buf;
     size_t         len, len2;
     unsigned char  *ustr = (unsigned char *)str;
-    uint32_t       h, k, c1, c2;
+    unsigned int   h, k, c1, c2;
 
     h  = 0x971e137bU;
     c1 = 0x95543787U;
@@ -2330,8 +2400,10 @@ VarHash(char *str)
            break;
        case 3:
            k |= (ustr[2] << 16);
+           /* FALLTHROUGH */
        case 2:
            k |= (ustr[1] << 8);
+           /* FALLTHROUGH */
        case 1:
            k |= ustr[0];
            len = 0;
@@ -2361,12 +2433,12 @@ VarHash(char *str)
 }
 
 static char *
-VarStrftime(const char *fmt, int zulu)
+VarStrftime(const char *fmt, int zulu, time_t utc)
 {
     char buf[BUFSIZ];
-    time_t utc;
 
-    time(&utc);
+    if (!utc)
+       time(&utc);
     if (!*fmt)
        fmt = "%c";
     strftime(buf, sizeof(buf), fmt, zulu ? gmtime(&utc) : localtime(&utc));
@@ -2463,23 +2535,28 @@ VarStrftime(const char *fmt, int zulu)
 /* we now have some modifiers with long names */
 #define STRMOD_MATCH(s, want, n) \
     (strncmp(s, want, n) == 0 && (s[n] == endc || s[n] == ':'))
+#define STRMOD_MATCHX(s, want, n) \
+    (strncmp(s, want, n) == 0 && (s[n] == endc || s[n] == ':' || s[n] == '='))
+#define CHARMOD_MATCH(c) (c == endc || c == ':')
 
 static char *
 ApplyModifiers(char *nstr, const char *tstr,
               int startc, int endc,
-              Var *v, GNode *ctxt, Boolean errnum,
+              Var *v, GNode *ctxt, int flags,
               int *lengthPtr, void **freePtr)
 {
     const char            *start;
     const char     *cp;        /* Secondary pointer into str (place marker
                                 * for tstr) */
     char          *newStr;     /* New value to return */
+    char          *ep;
     char           termc;      /* Character which terminated scan */
     int             cnt;       /* Used to count brace pairs when variable in
                                 * in parens or braces */
     char       delim;
     int                modifier;       /* that we are processing */
     Var_Parse_State parsestate; /* Flags passed to helper functions */
+    time_t     utc;            /* for VarStrftime */
 
     delim = '\0';
     parsestate.oneBigWord = FALSE;
@@ -2498,7 +2575,7 @@ ApplyModifiers(char *nstr, const char *t
            int rlen;
            int c;
 
-           rval = Var_Parse(tstr, ctxt, errnum, &rlen, &freeIt);
+           rval = Var_Parse(tstr, ctxt, flags, &rlen, &freeIt);
 
            /*
             * If we have not parsed up to endc or ':',
@@ -2508,8 +2585,7 @@ ApplyModifiers(char *nstr, const char *t
                (c = tstr[rlen]) != '\0' &&
                c != ':' &&
                c != endc) {
-               if (freeIt)
-                   free(freeIt);
+               free(freeIt);
                goto apply_mods;
            }
 
@@ -2524,18 +2600,15 @@ ApplyModifiers(char *nstr, const char *t
                int used;
 
                nstr = ApplyModifiers(nstr, rval,
-                                     0, 0,
-                                     v, ctxt, errnum, &used, freePtr);
+                                     0, 0, v, ctxt, flags, &used, freePtr);
                if (nstr == var_Error
-                   || (nstr == varNoError && errnum == 0)
+                   || (nstr == varNoError && (flags & VARF_UNDEFERR) == 0)
                    || strlen(rval) != (size_t) used) {
-                   if (freeIt)
-                       free(freeIt);
+                   free(freeIt);
                    goto out;           /* error already reported */
                }
            }
-           if (freeIt)
-               free(freeIt);
+           free(freeIt);
            if (*tstr == ':')
                tstr++;
            else if (!*tstr && endc) {
@@ -2564,6 +2637,7 @@ ApplyModifiers(char *nstr, const char *t
                    char *sv_name;
                    VarPattern  pattern;
                    int how;
+                   int vflags;
 
                    if (v->name[0] == 0)
                        goto bad_modifier;
@@ -2599,8 +2673,9 @@ ApplyModifiers(char *nstr, const char *t
                    delim = startc == PROPEN ? PRCLOSE : BRCLOSE;
                    pattern.flags = 0;
 
-                   pattern.rhs = VarGetPattern(ctxt, &parsestate, errnum,
-                                               &cp, delim, NULL,
+                   vflags = (flags & VARF_WANTRES) ? 0 : VAR_NOSUBST;
+                   pattern.rhs = VarGetPattern(ctxt, &parsestate, flags,
+                                               &cp, delim, &vflags,
                                                &pattern.rightLen,
                                                NULL);
                    if (v->flags & VAR_JUNK) {
@@ -2614,26 +2689,27 @@ ApplyModifiers(char *nstr, const char *t
                    termc = *--cp;
                    delim = '\0';
 
-                   switch (how) {
-                   case '+':
-                       Var_Append(v->name, pattern.rhs, v_ctxt);
-                       break;
-                   case '!':
-                       newStr = Cmd_Exec(pattern.rhs, &emsg);
-                       if (emsg)
-                           Error(emsg, nstr);
-                       else
-                           Var_Set(v->name, newStr,  v_ctxt, 0);
-                       if (newStr)
+                   if (flags & VARF_WANTRES) {
+                       switch (how) {
+                       case '+':
+                           Var_Append(v->name, pattern.rhs, v_ctxt);
+                           break;
+                       case '!':
+                           newStr = Cmd_Exec(pattern.rhs, &emsg);
+                           if (emsg)
+                               Error(emsg, nstr);
+                           else
+                               Var_Set(v->name, newStr,  v_ctxt, 0);
                            free(newStr);
-                       break;
-                   case '?':
-                       if ((v->flags & VAR_JUNK) == 0)
                            break;
-                       /* FALLTHROUGH */
-                   default:
-                       Var_Set(v->name, pattern.rhs, v_ctxt, 0);
-                       break;
+                       case '?':
+                           if ((v->flags & VAR_JUNK) == 0)
+                               break;
+                           /* FALLTHROUGH */
+                       default:
+                           Var_Set(v->name, pattern.rhs, v_ctxt, 0);
+                           break;
+                       }
                    }
                    free(UNCONST(pattern.rhs));
                    newStr = varNoError;
@@ -2644,39 +2720,73 @@ ApplyModifiers(char *nstr, const char *t
        case '@':
            {
                VarLoop_t       loop;
-               int flags = VAR_NOSUBST;
+               int vflags = VAR_NOSUBST;
 
                cp = ++tstr;
                delim = '@';
-               if ((loop.tvar = VarGetPattern(ctxt, &parsestate, errnum,
+               if ((loop.tvar = VarGetPattern(ctxt, &parsestate, flags,
                                               &cp, delim,
-                                              &flags, &loop.tvarLen,
+                                              &vflags, &loop.tvarLen,
                                               NULL)) == NULL)
                    goto cleanup;
 
-               if ((loop.str = VarGetPattern(ctxt, &parsestate, errnum,
+               if ((loop.str = VarGetPattern(ctxt, &parsestate, flags,
                                              &cp, delim,
-                                             &flags, &loop.strLen,
+                                             &vflags, &loop.strLen,
                                              NULL)) == NULL)
                    goto cleanup;
 
                termc = *cp;
                delim = '\0';
 
-               loop.errnum = errnum;
+               loop.errnum = flags & VARF_UNDEFERR;
                loop.ctxt = ctxt;
                newStr = VarModify(ctxt, &parsestate, nstr, VarLoopExpand,
                                   &loop);
+               Var_Delete(loop.tvar, ctxt);
                free(loop.tvar);
                free(loop.str);
                break;
            }
+       case '_':                       /* remember current value */
+           cp = tstr + 1;      /* make sure it is set */
+           if (STRMOD_MATCHX(tstr, "_", 1)) {
+               if (tstr[1] == '=') {
+                   char *np;
+                   int n;
+
+                   cp++;
+                   n = strcspn(cp, ":)}");
+                   np = bmake_strndup(cp, n+1);
+                   np[n] = '\0';
+                   cp = tstr + 2 + n;
+                   Var_Set(np, nstr, ctxt, 0);
+                   free(np);
+               } else {
+                   Var_Set("_", nstr, ctxt, 0);
+               }
+               newStr = nstr;
+               termc = *cp;
+               break;
+           }
+           goto default_case;
        case 'D':
        case 'U':
            {
                Buffer  buf;            /* Buffer for patterns */
-               int         wantit;     /* want data in buffer */
+               int     nflags;
 
+               if (flags & VARF_WANTRES) {
+                   int wantres;
+                   if (*tstr == 'U')
+                       wantres = ((v->flags & VAR_JUNK) != 0);
+                   else
+                       wantres = ((v->flags & VAR_JUNK) == 0);
+                   nflags = flags & ~VARF_WANTRES;
+                   if (wantres)
+                       nflags |= VARF_WANTRES;
+               } else
+                   nflags = flags;
                /*
                 * Pass through tstr looking for 1) escaped delimiters,
                 * '$'s and backslashes (place the escaped character in
@@ -2705,10 +2815,9 @@ ApplyModifiers(char *nstr, const char *t
                            int     len;
                            void    *freeIt;
 
-                           cp2 = Var_Parse(cp, ctxt, errnum, &len, &freeIt);
+                           cp2 = Var_Parse(cp, ctxt, nflags, &len, &freeIt);
                            Buf_AddBytes(&buf, strlen(cp2), cp2);
-                           if (freeIt)
-                               free(freeIt);
+                           free(freeIt);
                            cp += len - 1;
                        } else {
                            Buf_AddByte(&buf, *cp);
@@ -2717,13 +2826,9 @@ ApplyModifiers(char *nstr, const char *t
 
                termc = *cp;
 
-               if (*tstr == 'U')
-                   wantit = ((v->flags & VAR_JUNK) != 0);
-               else
-                   wantit = ((v->flags & VAR_JUNK) == 0);
                if ((v->flags & VAR_JUNK) != 0)
                    v->flags |= VAR_KEEP;
-               if (wantit) {
+               if (nflags & VARF_WANTRES) {
                    newStr = Buf_Destroy(&buf, FALSE);
                } else {
                    newStr = nstr;
@@ -2768,14 +2873,17 @@ ApplyModifiers(char *nstr, const char *t
                pattern.flags = 0;
 
                delim = '!';
-
+               emsg = NULL;
                cp = ++tstr;
-               if ((pattern.rhs = VarGetPattern(ctxt, &parsestate, errnum,
+               if ((pattern.rhs = VarGetPattern(ctxt, &parsestate, flags,
                                                 &cp, delim,
                                                 NULL, &pattern.rightLen,
                                                 NULL)) == NULL)
                    goto cleanup;
-               newStr = Cmd_Exec(pattern.rhs, &emsg);
+               if (flags & VARF_WANTRES)
+                   newStr = Cmd_Exec(pattern.rhs, &emsg);
+               else
+                   newStr = varNoError;
                free(UNCONST(pattern.rhs));
                if (emsg)
                    Error(emsg, nstr);
@@ -2800,7 +2908,7 @@ ApplyModifiers(char *nstr, const char *t
                cp = tstr+1; /* point to char after '[' */
                delim = ']'; /* look for closing ']' */
                estr = VarGetPattern(ctxt, &parsestate,
-                                    errnum, &cp, delim,
+                                    flags, &cp, delim,
                                     NULL, NULL, NULL);
                if (estr == NULL)
                    goto cleanup; /* report missing ']' */
@@ -2867,8 +2975,6 @@ ApplyModifiers(char *nstr, const char *t
                     * integer for :[N], or two integers
                     * separated by ".." for :[start..end].
                     */
-                   char *ep;
-
                    VarSelectWords_t seldata = { 0, 0 };
 
                    seldata.start = strtol(estr, &ep, 0);
@@ -2927,9 +3033,15 @@ ApplyModifiers(char *nstr, const char *t
            }
        case 'g':
            cp = tstr + 1;      /* make sure it is set */
-           if (STRMOD_MATCH(tstr, "gmtime", 6)) {
-               newStr = VarStrftime(nstr, 1);
-               cp = tstr + 6;
+           if (STRMOD_MATCHX(tstr, "gmtime", 6)) {
+               if (tstr[6] == '=') {
+                   utc = strtoul(&tstr[7], &ep, 10);
+                   cp = ep;
+               } else {
+                   utc = 0;
+                   cp = tstr + 6;
+               }
+               newStr = VarStrftime(nstr, 1, utc);
                termc = *cp;
            } else {
                goto default_case;
@@ -2947,9 +3059,15 @@ ApplyModifiers(char *nstr, const char *t
            break;
        case 'l':
            cp = tstr + 1;      /* make sure it is set */
-           if (STRMOD_MATCH(tstr, "localtime", 9)) {
-               newStr = VarStrftime(nstr, 0);
-               cp = tstr + 9;
+           if (STRMOD_MATCHX(tstr, "localtime", 9)) {
+               if (tstr[9] == '=') {
+                   utc = strtoul(&tstr[10], &ep, 10);
+                   cp = ep;
+               } else {
+                   utc = 0;
+                   cp = tstr + 9;
+               }
+               newStr = VarStrftime(nstr, 0, utc);
                termc = *cp;
            } else {
                goto default_case;
@@ -2977,6 +3095,9 @@ ApplyModifiers(char *nstr, const char *t
                            parsestate.varSpace = 0; /* no separator */
                            cp = tstr + 2;
                        } else if (tstr[2] == '\\') {
+                           const char *xp = &tstr[3];
+                           int base = 8; /* assume octal */
+
                            switch (tstr[3]) {
                            case 'n':
                                parsestate.varSpace = '\n';
@@ -2986,12 +3107,19 @@ ApplyModifiers(char *nstr, const char *t
                                parsestate.varSpace = '\t';
                                cp = tstr + 4;
                                break;
+                           case 'x':
+                               base = 16;
+                               xp++;
+                               goto get_numeric;
+                           case '0':
+                               base = 0;
+                               goto get_numeric;
                            default:
                                if (isdigit((unsigned char)tstr[3])) {
-                                   char *ep;
 
+                               get_numeric:
                                    parsestate.varSpace =
-                                       strtoul(&tstr[3], &ep, 0);
+                                       strtoul(xp, &ep, base);
                                    if (*ep != ':' && *ep != endc)
                                        goto bad_modifier;
                                    cp = ep;
@@ -3151,7 +3279,7 @@ ApplyModifiers(char *nstr, const char *t
                     * expand it.
                     */
                    cp2 = pattern;
-                   pattern = Var_Subst(NULL, cp2, ctxt, errnum);
+                   pattern = Var_Subst(NULL, cp2, ctxt, flags | VARF_WANTRES);
                    free(cp2);
                }
                if (DEBUG(VAR))
@@ -3187,14 +3315,14 @@ ApplyModifiers(char *nstr, const char *t
                }
 
                cp = tstr;
-               if ((pattern.lhs = VarGetPattern(ctxt, &parsestate, errnum,
+               if ((pattern.lhs = VarGetPattern(ctxt, &parsestate, flags,
                                                 &cp, delim,
                                                 &pattern.flags,
                                                 &pattern.leftLen,
                                                 NULL)) == NULL)
                    goto cleanup;
 
-               if ((pattern.rhs = VarGetPattern(ctxt, &parsestate, errnum,
+               if ((pattern.rhs = VarGetPattern(ctxt, &parsestate, flags,
                                                 &cp, delim, NULL,
                                                 &pattern.rightLen,
                                                 &pattern)) == NULL)
@@ -3237,31 +3365,47 @@ ApplyModifiers(char *nstr, const char *t
            {
                VarPattern      pattern;
                Boolean value;
-
+               int cond_rc;
+               int lhs_flags, rhs_flags;
+               
                /* find ':', and then substitute accordingly */
-
+               if (flags & VARF_WANTRES) {
+                   cond_rc = Cond_EvalExpression(NULL, v->name, &value, 0, FALSE);
+                   if (cond_rc == COND_INVALID) {
+                       lhs_flags = rhs_flags = VAR_NOSUBST;
+                   } else if (value) {
+                       lhs_flags = 0;
+                       rhs_flags = VAR_NOSUBST;
+                   } else {
+                       lhs_flags = VAR_NOSUBST;
+                       rhs_flags = 0;
+                   }
+               } else {
+                   /* we are just consuming and discarding */
+                   cond_rc = value = 0;
+                   lhs_flags = rhs_flags = VAR_NOSUBST;
+               }
                pattern.flags = 0;
 
                cp = ++tstr;
                delim = ':';
-               if ((pattern.lhs = VarGetPattern(ctxt, &parsestate, errnum,
-                                                &cp, delim, NULL,
+               if ((pattern.lhs = VarGetPattern(ctxt, &parsestate, flags,
+                                                &cp, delim, &lhs_flags,
                                                 &pattern.leftLen,
                                                 NULL)) == NULL)
                    goto cleanup;
 
                /* BROPEN or PROPEN */
                delim = endc;
-               if ((pattern.rhs = VarGetPattern(ctxt, &parsestate, errnum,
-                                                &cp, delim, NULL,
+               if ((pattern.rhs = VarGetPattern(ctxt, &parsestate, flags,
+                                                &cp, delim, &rhs_flags,
                                                 &pattern.rightLen,
                                                 NULL)) == NULL)
                    goto cleanup;
 
                termc = *--cp;
                delim = '\0';
-               if (Cond_EvalExpression(NULL, v->name, &value, 0, FALSE)
-                   == COND_INVALID) {
+               if (cond_rc == COND_INVALID) {
                    Error("Bad conditional expression `%s' in %s?%s:%s",
                          v->name, v->name, pattern.lhs, pattern.rhs);
                    goto cleanup;
@@ -3294,12 +3438,12 @@ ApplyModifiers(char *nstr, const char *t
 
                cp = tstr;
 
-               if ((re = VarGetPattern(ctxt, &parsestate, errnum, &cp, delim,
+               if ((re = VarGetPattern(ctxt, &parsestate, flags, &cp, delim,
                                        NULL, NULL, NULL)) == NULL)
                    goto cleanup;
 
                if ((pattern.replace = VarGetPattern(ctxt, &parsestate,
-                                                    errnum, &cp, delim, NULL,
+                                                    flags, &cp, delim, NULL,
                                                     NULL, NULL)) == NULL){
                    free(re);
                    goto cleanup;
@@ -3348,9 +3492,10 @@ ApplyModifiers(char *nstr, const char *t
                break;
            }
 #endif
+       case 'q':
        case 'Q':
            if (tstr[1] == endc || tstr[1] == ':') {
-               newStr = VarQuote(nstr);
+               newStr = VarQuote(nstr, modifier == 'q');
                cp = tstr + 1;
                termc = *cp;
                break;
@@ -3392,6 +3537,23 @@ ApplyModifiers(char *nstr, const char *t
                break;
            }
            goto default_case;
+       case 'r':
+           cp = tstr + 1;      /* make sure it is set */
+           if (STRMOD_MATCHX(tstr, "range", 5)) {
+               int n;
+               
+               if (tstr[5] == '=') {
+                   n = strtoul(&tstr[6], &ep, 10);
+                   cp = ep;
+               } else {
+                   n = 0;
+                   cp = tstr + 5;
+               }
+               newStr = VarRange(nstr, n);
+               termc = *cp;
+               break;
+           }
+           goto default_case;
        case 'O':
            {
                char otype;
@@ -3423,9 +3585,12 @@ ApplyModifiers(char *nstr, const char *t
        case 's':
            if (tstr[1] == 'h' && (tstr[2] == endc || tstr[2] == ':')) {
                const char *emsg;
-               newStr = Cmd_Exec(nstr, &emsg);
-               if (emsg)
-                   Error(emsg, nstr);
+               if (flags & VARF_WANTRES) {
+                   newStr = Cmd_Exec(nstr, &emsg);
+                   if (emsg)
+                       Error(emsg, nstr);
+               } else
+                   newStr = varNoError;
                cp = tstr + 2;
                termc = *cp;
                break;
@@ -3473,12 +3638,12 @@ ApplyModifiers(char *nstr, const char *t
                delim='=';
                cp = tstr;
                if ((pattern.lhs = VarGetPattern(ctxt, &parsestate,
-                                                errnum, &cp, delim, &pattern.flags,
+                                                flags, &cp, delim, &pattern.flags,
                                                 &pattern.leftLen, NULL)) == NULL)
                    goto cleanup;
                delim = endc;
                if ((pattern.rhs = VarGetPattern(ctxt, &parsestate,
-                                                errnum, &cp, delim, NULL, &pattern.rightLen,
+                                                flags, &cp, delim, NULL, &pattern.rightLen,
                                                 &pattern)) == NULL)
                    goto cleanup;
 
@@ -3546,10 +3711,8 @@ ApplyModifiers(char *nstr, const char *t
     if (delim != '\0')
        Error("Unclosed substitution for %s (%c missing)",
              v->name, delim);
-    if (*freePtr) {
-       free(*freePtr);
-       *freePtr = NULL;
-    }
+    free(*freePtr);
+    *freePtr = NULL;
     return (var_Error);
 }
 
@@ -3563,7 +3726,9 @@ ApplyModifiers(char *nstr, const char *t
  * Input:
  *     str             The string to parse
  *     ctxt            The context for the variable
- *     errnum          TRUE if undefined variables are an error
+ *     flags           VARF_UNDEFERR   if undefineds are an error
+ *                     VARF_WANTRES    if we actually want the result
+ *                     VARF_ASSIGN     if we are in a := assignment
  *     lengthPtr       OUT: The length of the specification
  *     freePtr         OUT: Non-NULL if caller should free *freePtr
  *
@@ -3582,8 +3747,8 @@ ApplyModifiers(char *nstr, const char *t
  */
 /* coverity[+alloc : arg-*4] */
 char *
-Var_Parse(const char *str, GNode *ctxt, Boolean errnum, int *lengthPtr,
-         void **freePtr)
+Var_Parse(const char *str, GNode *ctxt, int flags,
+         int *lengthPtr, void **freePtr)
 {
     const char    *tstr;       /* Pointer into str */
     Var                   *v;          /* Variable in invocation */
@@ -3641,17 +3806,17 @@ Var_Parse(const char *str, GNode *ctxt, 
                    case '@':
                        return UNCONST("$(.TARGET)");
                    case '%':
-                       return UNCONST("$(.ARCHIVE)");
+                       return UNCONST("$(.MEMBER)");
                    case '*':
                        return UNCONST("$(.PREFIX)");
                    case '!':
-                       return UNCONST("$(.MEMBER)");
+                       return UNCONST("$(.ARCHIVE)");
                }
            }
            /*
             * Error
             */
-           return (errnum ? var_Error : varNoError);
+           return (flags & VARF_UNDEFERR) ? var_Error : varNoError;
        } else {
            haveModifier = FALSE;
            tstr = &str[1];
@@ -3688,12 +3853,11 @@ Var_Parse(const char *str, GNode *ctxt, 
            if (*tstr == '$') {
                int rlen;
                void *freeIt;
-               char *rval = Var_Parse(tstr, ctxt, errnum, &rlen, &freeIt);
+               char *rval = Var_Parse(tstr, ctxt, flags,  &rlen, &freeIt);
                if (rval != NULL) {
                    Buf_AddBytes(&buf, strlen(rval), rval);
                }
-               if (freeIt)
-                   free(freeIt);
+               free(freeIt);
                tstr += rlen - 1;
            }
            else
@@ -3802,7 +3966,7 @@ Var_Parse(const char *str, GNode *ctxt, 
                    return(pstr);
                } else {
                    Buf_Destroy(&buf, TRUE);
-                   return (errnum ? var_Error : varNoError);
+                   return (flags & VARF_UNDEFERR) ? var_Error : varNoError;
                }
            } else {
                /*
@@ -3836,7 +4000,7 @@ Var_Parse(const char *str, GNode *ctxt, 
      */
     nstr = Buf_GetAll(&v->val, NULL);
     if (strchr(nstr, '$') != NULL) {
-       nstr = Var_Subst(NULL, nstr, ctxt, errnum);
+       nstr = Var_Subst(NULL, nstr, ctxt, flags);
        *freePtr = nstr;
     }
 
@@ -3849,7 +4013,7 @@ Var_Parse(const char *str, GNode *ctxt, 
        extraFree = NULL;
        if (extramodifiers != NULL) {
                nstr = ApplyModifiers(nstr, extramodifiers, '(', ')',
-                                     v, ctxt, errnum, &used, &extraFree);
+                                     v, ctxt, flags, &used, &extraFree);
        }
 
        if (haveModifier) {
@@ -3857,11 +4021,9 @@ Var_Parse(const char *str, GNode *ctxt, 
                tstr++;
 
                nstr = ApplyModifiers(nstr, tstr, startc, endc,
-                                     v, ctxt, errnum, &used, freePtr);
+                                     v, ctxt, flags, &used, freePtr);
                tstr += used;
-               if (extraFree) {
-                       free(extraFree);
-               }
+               free(extraFree);
        } else {
                *freePtr = extraFree;
        }
@@ -3900,7 +4062,7 @@ Var_Parse(const char *str, GNode *ctxt, 
                nstr = bmake_strndup(start, *lengthPtr);
                *freePtr = nstr;
            } else {
-               nstr = errnum ? var_Error : varNoError;
+               nstr = (flags & VARF_UNDEFERR) ? var_Error : varNoError;
            }
        }
        if (nstr != Buf_GetAll(&v->val, NULL))
@@ -3915,14 +4077,16 @@ Var_Parse(const char *str, GNode *ctxt, 
  *-----------------------------------------------------------------------
  * Var_Subst  --
  *     Substitute for all variables in the given string in the given context
- *     If undefErr is TRUE, Parse_Error will be called when an undefined
+ *     If flags & VARF_UNDEFERR, Parse_Error will be called when an undefined
  *     variable is encountered.
  *
  * Input:
  *     var             Named variable || NULL for all
  *     str             the string which to substitute
  *     ctxt            the context wherein to find variables
- *     undefErr        TRUE if undefineds are an error
+ *     flags           VARF_UNDEFERR   if undefineds are an error
+ *                     VARF_WANTRES    if we actually want the result
+ *                     VARF_ASSIGN     if we are in a := assignment
  *
  * Results:
  *     The resulting string.
@@ -3932,7 +4096,7 @@ Var_Parse(const char *str, GNode *ctxt, 
  *-----------------------------------------------------------------------
  */
 char *
-Var_Subst(const char *var, const char *str, GNode *ctxt, Boolean undefErr)
+Var_Subst(const char *var, const char *str, GNode *ctxt, int flags)
 {
     Buffer       buf;              /* Buffer for forming things */
     char         *val;             /* Value to substitute for a variable */
@@ -3956,6 +4120,8 @@ Var_Subst(const char *var, const char *s
             * In such a case, we skip over the escape character and store the
             * dollar sign into the buffer directly.
             */
+           if (save_dollars && (flags & VARF_ASSIGN))
+               Buf_AddByte(&buf, *str);
            str++;
            Buf_AddByte(&buf, *str);
            str++;
@@ -4030,7 +4196,7 @@ Var_Subst(const char *var, const char *s
                    continue;
            }
 
-           val = Var_Parse(str, ctxt, undefErr, &length, &freeIt);
+           val = Var_Parse(str, ctxt, flags, &length, &freeIt);
 
            /*
             * When we come down here, val should either point to the
@@ -4047,7 +4213,7 @@ Var_Subst(const char *var, const char *s
                 */
                if (oldVars) {
                    str += length;
-               } else if (undefErr || val == var_Error) {
+               } else if ((flags & VARF_UNDEFERR) || val == var_Error) {
                    /*
                     * If variable is undefined, complain and skip the
                     * variable. The complaint will stop us from doing anything
@@ -4078,10 +4244,8 @@ Var_Subst(const char *var, const char *s
                Buf_AddBytes(&buf, length, val);
                trailingBslash = length > 0 && val[length - 1] == '\\';
            }
-           if (freeIt) {
-               free(freeIt);
-               freeIt = NULL;
-           }
+           free(freeIt);
+           freeIt = NULL;
        }
     }
 

Index: pkgsrc/devel/bmake/files/buf.c
diff -u pkgsrc/devel/bmake/files/buf.c:1.5 pkgsrc/devel/bmake/files/buf.c:1.6
--- pkgsrc/devel/bmake/files/buf.c:1.5  Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/buf.c      Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: buf.c,v 1.5 2015/05/19 22:01:19 joerg Exp $    */
+/*     $NetBSD: buf.c,v 1.6 2020/05/24 11:09:43 nia Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: buf.c,v 1.5 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: buf.c,v 1.6 2020/05/24 11:09:43 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)buf.c      8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: buf.c,v 1.5 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: buf.c,v 1.6 2020/05/24 11:09:43 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/dir.h
diff -u pkgsrc/devel/bmake/files/dir.h:1.5 pkgsrc/devel/bmake/files/dir.h:1.6
--- pkgsrc/devel/bmake/files/dir.h:1.5  Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/dir.h      Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.h,v 1.5 2015/05/19 22:01:19 joerg Exp $    */
+/*     $NetBSD: dir.h,v 1.6 2020/05/24 11:09:43 nia Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -75,8 +75,8 @@
 /* dir.h --
  */
 
-#ifndef        _DIR
-#define        _DIR
+#ifndef        MAKE_DIR_H
+#define        MAKE_DIR_H
 
 typedef struct Path {
     char         *name;                /* Name of directory */
@@ -105,4 +105,4 @@ void Dir_PrintPath(Lst);
 void Dir_Destroy(void *);
 void * Dir_CopyDir(void *);
 
-#endif /* _DIR */
+#endif /* MAKE_DIR_H */
Index: pkgsrc/devel/bmake/files/hash.c
diff -u pkgsrc/devel/bmake/files/hash.c:1.5 pkgsrc/devel/bmake/files/hash.c:1.6
--- pkgsrc/devel/bmake/files/hash.c:1.5 Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/hash.c     Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: hash.c,v 1.5 2015/05/19 22:01:19 joerg Exp $   */
+/*     $NetBSD: hash.c,v 1.6 2020/05/24 11:09:43 nia Exp $     */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: hash.c,v 1.5 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: hash.c,v 1.6 2020/05/24 11:09:43 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)hash.c     8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: hash.c,v 1.5 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: hash.c,v 1.6 2020/05/24 11:09:43 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/pathnames.h
diff -u pkgsrc/devel/bmake/files/pathnames.h:1.5 pkgsrc/devel/bmake/files/pathnames.h:1.6
--- pkgsrc/devel/bmake/files/pathnames.h:1.5    Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/pathnames.h        Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: pathnames.h,v 1.5 2015/05/19 22:01:19 joerg Exp $      */
+/*     $NetBSD: pathnames.h,v 1.6 2020/05/24 11:09:43 nia Exp $        */
 
 /*
  * Copyright (c) 1990, 1993
@@ -29,7 +29,7 @@
  * SUCH DAMAGE.
  *
  *     from: @(#)pathnames.h   5.2 (Berkeley) 6/1/90
- *     $Id: pathnames.h,v 1.5 2015/05/19 22:01:19 joerg Exp $
+ *     $Id: pathnames.h,v 1.6 2020/05/24 11:09:43 nia Exp $
  */
 
 #if HAVE_CONFIG_H
Index: pkgsrc/devel/bmake/files/str.c
diff -u pkgsrc/devel/bmake/files/str.c:1.5 pkgsrc/devel/bmake/files/str.c:1.6
--- pkgsrc/devel/bmake/files/str.c:1.5  Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/str.c      Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: str.c,v 1.5 2015/05/19 22:01:19 joerg Exp $    */
+/*     $NetBSD: str.c,v 1.6 2020/05/24 11:09:43 nia Exp $      */
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: str.c,v 1.5 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: str.c,v 1.6 2020/05/24 11:09:43 nia 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.5 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: str.c,v 1.6 2020/05/24 11:09:43 nia Exp $");
 #endif
 #endif                         /* not lint */
 #endif
@@ -102,7 +102,7 @@ str_concat(const char *s1, const char *s
        len2 = strlen(s2);
 
        /* allocate length plus separator plus EOS */
-       result = bmake_malloc((u_int)(len1 + len2 + 2));
+       result = bmake_malloc((unsigned int)(len1 + len2 + 2));
 
        /* copy first string into place */
        memcpy(result, s1, len1);
@@ -133,42 +133,43 @@ str_concat(const char *s1, const char *s
  *
  * returns --
  *     Pointer to the array of pointers to the words.
- *      Memory containing the actual words in *buffer.
+ *      Memory containing the actual words in *store_words_buf.
  *             Both of these must be free'd by the caller.
- *      Number of words in *store_argc.
+ *      Number of words in *store_words_len.
  */
 char **
-brk_string(const char *str, int *store_argc, Boolean expand, char **buffer)
+brk_string(const char *str, int *store_words_len, Boolean expand,
+       char **store_words_buf)
 {
-       int argc, ch;
-       char inquote, *start, *t;
-       const char *p;
-       int len;
-       int argmax = 50, curlen = 0;
-       char **argv;
+       char inquote;
+       const char *str_p;
+       size_t str_len;
+       char **words;
+       int words_len;
+       int words_cap = 50;
+       char *words_buf, *word_start, *word_end;
 
        /* skip leading space chars. */
        for (; *str == ' ' || *str == '\t'; ++str)
                continue;
 
-       /* allocate room for a copy of the string */
-       if ((len = strlen(str) + 1) > curlen)
-               *buffer = bmake_malloc(curlen = len);
+       /* words_buf holds the words, separated by '\0'. */
+       str_len = strlen(str);
+       words_buf = bmake_malloc(strlen(str) + 1);
 
-       /*
-        * initial argmax based on len
-        */
-       argmax = MAX((len / 5), 50);
-       argv = bmake_malloc((argmax + 1) * sizeof(char *));
+       words_cap = MAX((str_len / 5), 50);
+       words = bmake_malloc((words_cap + 1) * sizeof(char *));
 
        /*
         * copy the string; at the same time, parse backslashes,
-        * quotes and build the argument list.
+        * quotes and build the word list.
         */
-       argc = 0;
+       words_len = 0;
        inquote = '\0';
-       for (p = str, start = t = *buffer;; ++p) {
-               switch(ch = *p) {
+       word_start = word_end = words_buf;
+       for (str_p = str;; ++str_p) {
+               char ch = *str_p;
+               switch(ch) {
                case '"':
                case '\'':
                        if (inquote) {
@@ -180,21 +181,21 @@ brk_string(const char *str, int *store_a
                        else {
                                inquote = (char) ch;
                                /* Don't miss "" or '' */
-                               if (start == NULL && p[1] == inquote) {
+                               if (word_start == NULL && str_p[1] == inquote) {
                                        if (!expand) {
-                                               start = t;
-                                               *t++ = ch;
+                                               word_start = word_end;
+                                               *word_end++ = ch;
                                        } else
-                                               start = t + 1;
-                                       p++;
+                                               word_start = word_end + 1;
+                                       str_p++;
                                        inquote = '\0';
                                        break;
                                }
                        }
                        if (!expand) {
-                               if (!start)
-                                       start = t;
-                               *t++ = ch;
+                               if (word_start == NULL)
+                                       word_start = word_end;
+                               *word_end++ = ch;
                        }
                        continue;
                case ' ':
@@ -202,30 +203,30 @@ brk_string(const char *str, int *store_a
                case '\n':
                        if (inquote)
                                break;
-                       if (!start)
+                       if (word_start == NULL)
                                continue;
                        /* FALLTHROUGH */
                case '\0':
                        /*
-                        * end of a token -- make sure there's enough argv
+                        * end of a token -- make sure there's enough words
                         * space and save off a pointer.
                         */
-                       if (!start)
+                       if (word_start == NULL)
                            goto done;
 
-                       *t++ = '\0';
-                       if (argc == argmax) {
-                               argmax *= 2;            /* ramp up fast */
-                               argv = (char **)bmake_realloc(argv,
-                                   (argmax + 1) * sizeof(char *));
+                       *word_end++ = '\0';
+                       if (words_len == words_cap) {
+                               words_cap *= 2;         /* ramp up fast */
+                               words = (char **)bmake_realloc(words,
+                                   (words_cap + 1) * sizeof(char *));
                        }
-                       argv[argc++] = start;
-                       start = NULL;
+                       words[words_len++] = word_start;
+                       word_start = NULL;
                        if (ch == '\n' || ch == '\0') {
                                if (expand && inquote) {
-                                       free(argv);
-                                       free(*buffer);
-                                       *buffer = NULL;
+                                       free(words);
+                                       free(words_buf);
+                                       *store_words_buf = NULL;
                                        return NULL;
                                }
                                goto done;
@@ -233,21 +234,22 @@ brk_string(const char *str, int *store_a
                        continue;
                case '\\':
                        if (!expand) {
-                               if (!start)
-                                       start = t;
-                               *t++ = '\\';
-                               if (*(p+1) == '\0') /* catch '\' at end of line */
+                               if (word_start == NULL)
+                                       word_start = word_end;
+                               *word_end++ = '\\';
+                               /* catch '\' at end of line */
+                               if (str_p[1] == '\0')
                                        continue;
-                               ch = *++p;
+                               ch = *++str_p;
                                break;
                        }
 
-                       switch (ch = *++p) {
+                       switch (ch = *++str_p) {
                        case '\0':
                        case '\n':
                                /* hmmm; fix it up as best we can */
                                ch = '\\';
-                               --p;
+                               --str_p;
                                break;
                        case 'b':
                                ch = '\b';
@@ -267,13 +269,14 @@ brk_string(const char *str, int *store_a
                        }
                        break;
                }
-               if (!start)
-                       start = t;
-               *t++ = (char) ch;
+               if (word_start == NULL)
+                       word_start = word_end;
+               *word_end++ = ch;
        }
-done:  argv[argc] = NULL;
-       *store_argc = argc;
-       return(argv);
+done:  words[words_len] = NULL;
+       *store_words_len = words_len;
+       *store_words_buf = words_buf;
+       return words;
 }
 
 /*
@@ -373,16 +376,26 @@ Str_Match(const char *string, const char
                 * by a range (two characters separated by "-").
                 */
                if (*pattern == '[') {
+                       int nomatch;
+
                        ++pattern;
+                       if (*pattern == '^') {
+                               ++pattern;
+                               nomatch = 1;
+                       } else
+                               nomatch = 0;
                        for (;;) {
-                               if ((*pattern == ']') || (*pattern == 0))
+                               if ((*pattern == ']') || (*pattern == 0)) {
+                                       if (nomatch)
+                                               break;
                                        return(0);
+                               }
                                if (*pattern == *string)
                                        break;
                                if (pattern[1] == '-') {
                                        c2 = pattern[2];
                                        if (c2 == 0)
-                                               return(0);
+                                               return(nomatch);
                                        if ((*pattern <= *string) &&
                                            (c2 >= *string))
                                                break;
@@ -393,8 +406,12 @@ Str_Match(const char *string, const char
                                }
                                ++pattern;
                        }
+                       if (nomatch && (*pattern != ']') && (*pattern != 0))
+                               return 0;
                        while ((*pattern != ']') && (*pattern != 0))
                                ++pattern;
+                       if (*pattern == 0)
+                               --pattern;
                        goto thisCharOK;
                }
                /*
@@ -438,12 +455,14 @@ thisCharOK:       ++pattern;
  *-----------------------------------------------------------------------
  */
 char *
-Str_SYSVMatch(const char *word, const char *pattern, int *len)
+Str_SYSVMatch(const char *word, const char *pattern, size_t *len,
+    Boolean *hasPercent)
 {
     const char *p = pattern;
     const char *w = word;
     const char *m;
 
+    *hasPercent = FALSE;
     if (*p == '\0') {
        /* Null pattern is the whole string */
        *len = strlen(w);
@@ -451,6 +470,11 @@ Str_SYSVMatch(const char *word, const ch
     }
 
     if ((m = strchr(p, '%')) != NULL) {
+       *hasPercent = TRUE;
+       if (*w == '\0') {
+               /* empty word does not match pattern */
+               return NULL;
+       }
        /* check that the prefix matches */
        for (; p != m && *w && *w == *p; w++, p++)
             continue;
@@ -495,19 +519,21 @@ Str_SYSVMatch(const char *word, const ch
  *-----------------------------------------------------------------------
  */
 void
-Str_SYSVSubst(Buffer *buf, char *pat, char *src, int len)
+Str_SYSVSubst(Buffer *buf, char *pat, char *src, size_t len,
+    Boolean lhsHasPercent)
 {
     char *m;
 
-    if ((m = strchr(pat, '%')) != NULL) {
+    if ((m = strchr(pat, '%')) != NULL && lhsHasPercent) {
        /* Copy the prefix */
        Buf_AddBytes(buf, m - pat, pat);
        /* skip the % */
        pat = m + 1;
     }
-
-    /* Copy the pattern */
-    Buf_AddBytes(buf, len, src);
+    if (m != NULL || !lhsHasPercent) {
+       /* Copy the pattern */
+       Buf_AddBytes(buf, len, src);
+    }
 
     /* append the rest */
     Buf_AddBytes(buf, strlen(pat), pat);
Index: pkgsrc/devel/bmake/files/suff.c
diff -u pkgsrc/devel/bmake/files/suff.c:1.5 pkgsrc/devel/bmake/files/suff.c:1.6
--- pkgsrc/devel/bmake/files/suff.c:1.5 Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/suff.c     Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: suff.c,v 1.5 2015/05/19 22:01:19 joerg Exp $   */
+/*     $NetBSD: suff.c,v 1.6 2020/05/24 11:09:43 nia Exp $     */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: suff.c,v 1.5 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: suff.c,v 1.6 2020/05/24 11:09:43 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)suff.c     8.4 (Berkeley) 3/21/94";
 #else
-__RCSID("$NetBSD: suff.c,v 1.5 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: suff.c,v 1.6 2020/05/24 11:09:43 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -135,6 +135,7 @@ __RCSID("$NetBSD: suff.c,v 1.5 2015/05/1
  *                             order to find the node.
  */
 
+#include         <assert.h>
 #include         <stdio.h>
 #include         "make.h"
 #include         "hash.h"
@@ -553,7 +554,20 @@ Suff_ClearSuffixes(void)
 #endif
     sufflist = Lst_Init(FALSE);
     sNum = 0;
-    suffNull = emptySuff;
+    if (suffNull)
+       SuffFree(suffNull);
+    emptySuff = suffNull = bmake_malloc(sizeof(Suff));
+
+    suffNull->name =               bmake_strdup("");
+    suffNull->nameLen =     0;
+    suffNull->searchPath =  Lst_Init(FALSE);
+    Dir_Concat(suffNull->searchPath, dirSearchPath);
+    suffNull->children =    Lst_Init(FALSE);
+    suffNull->parents =            Lst_Init(FALSE);
+    suffNull->ref =        Lst_Init(FALSE);
+    suffNull->sNum =               sNum++;
+    suffNull->flags =              SUFF_NULL;
+    suffNull->refCount =    1;
 }
 
 /*-
@@ -749,7 +763,7 @@ Suff_AddTransform(char *line)
  *-----------------------------------------------------------------------
  */
 int
-Suff_EndTransform(void *gnp, void *dummy)
+Suff_EndTransform(void *gnp, void *dummy MAKE_ATTR_UNUSED)
 {
     GNode *gn = (GNode *)gnp;
 
@@ -796,7 +810,7 @@ Suff_EndTransform(void *gnp, void *dummy
        fprintf(debug_file, "transformation %s complete\n", gn->name);
     }
 
-    return(dummy ? 0 : 0);
+    return 0;
 }
 
 /*-
@@ -1202,7 +1216,7 @@ SuffAddSrc(void *sp, void *lsp)
 #ifdef DEBUG_SRC
        s2->cp = Lst_Init(FALSE);
        Lst_AtEnd(targ->cp, s2);
-       fprintf(debug_file, "1 add %x %x to %x:", targ, s2, ls->l);
+       fprintf(debug_file, "1 add %p %p to %p:", targ, s2, ls->l);
        Lst_ForEach(ls->l, PrintAddr, NULL);
        fprintf(debug_file, "\n");
 #endif
@@ -1220,7 +1234,7 @@ SuffAddSrc(void *sp, void *lsp)
 #ifdef DEBUG_SRC
     s2->cp = Lst_Init(FALSE);
     Lst_AtEnd(targ->cp, s2);
-    fprintf(debug_file, "2 add %x %x to %x:", targ, s2, ls->l);
+    fprintf(debug_file, "2 add %p %p to %p:", targ, s2, ls->l);
     Lst_ForEach(ls->l, PrintAddr, NULL);
     fprintf(debug_file, "\n");
 #endif
@@ -1292,14 +1306,14 @@ SuffRemoveSrc(Lst l)
                free(s->pref);
            else {
 #ifdef DEBUG_SRC
-               LstNode ln = Lst_Member(s->parent->cp, s);
-               if (ln != NULL)
-                   Lst_Remove(s->parent->cp, ln);
+               LstNode ln2 = Lst_Member(s->parent->cp, s);
+               if (ln2 != NULL)
+                   Lst_Remove(s->parent->cp, ln2);
 #endif
                --s->parent->children;
            }
 #ifdef DEBUG_SRC
-           fprintf(debug_file, "free: [l=%x] p=%x %d\n", l, s, s->children);
+           fprintf(debug_file, "free: [l=%p] p=%p %d\n", l, s, s->children);
            Lst_Destroy(s->cp, NULL);
 #endif
            Lst_Remove(l, ln);
@@ -1310,7 +1324,7 @@ SuffRemoveSrc(Lst l)
        }
 #ifdef DEBUG_SRC
        else {
-           fprintf(debug_file, "keep: [l=%x] p=%x %d: ", l, s, s->children);
+           fprintf(debug_file, "keep: [l=%p] p=%p %d: ", l, s, s->children);
            Lst_ForEach(s->cp, PrintAddr, NULL);
            fprintf(debug_file, "\n");
        }
@@ -1359,7 +1373,7 @@ SuffFindThem(Lst srcs, Lst slst)
         */
        if (Targ_FindNode(s->file, TARG_NOCREATE) != NULL) {
 #ifdef DEBUG_SRC
-           fprintf(debug_file, "remove %x from %x\n", s, srcs);
+           fprintf(debug_file, "remove %p from %p\n", s, srcs);
 #endif
            rs = s;
            break;
@@ -1368,7 +1382,7 @@ SuffFindThem(Lst srcs, Lst slst)
        if ((ptr = Dir_FindFile(s->file, s->suff->searchPath)) != NULL) {
            rs = s;
 #ifdef DEBUG_SRC
-           fprintf(debug_file, "remove %x from %x\n", s, srcs);
+           fprintf(debug_file, "remove %p from %p\n", s, srcs);
 #endif
            free(ptr);
            break;
@@ -1484,7 +1498,7 @@ SuffFindCmds(Src *targ, Lst slst)
     targ->children += 1;
 #ifdef DEBUG_SRC
     ret->cp = Lst_Init(FALSE);
-    fprintf(debug_file, "3 add %x %x\n", targ, ret);
+    fprintf(debug_file, "3 add %p %p\n", targ, ret);
     Lst_AtEnd(targ->cp, ret);
 #endif
     Lst_AtEnd(slst, ret);
@@ -1543,7 +1557,7 @@ SuffExpandChildren(LstNode cln, GNode *p
     if (DEBUG(SUFF)) {
        fprintf(debug_file, "Expanding \"%s\"...", cgn->name);
     }
-    cp = Var_Subst(NULL, cgn->name, pgn, TRUE);
+    cp = Var_Subst(NULL, cgn->name, pgn, VARF_UNDEFERR|VARF_WANTRES);
 
     if (cp != NULL) {
        Lst         members = Lst_Init(FALSE);
@@ -1596,14 +1610,14 @@ SuffExpandChildren(LstNode cln, GNode *p
                    int         len;
                    void        *freeIt;
 
-                   junk = Var_Parse(cp, pgn, TRUE, &len, &freeIt);
+                   junk = Var_Parse(cp, pgn, VARF_UNDEFERR|VARF_WANTRES,
+                       &len, &freeIt);
                    if (junk != var_Error) {
                        cp += len - 1;
                    }
 
-                   if (freeIt)
-                       free(freeIt);
-               } else if (*cp == '\\' && *cp != '\0') {
+                   free(freeIt);
+               } else if (*cp == '\\' && cp[1] != '\0') {
                    /*
                     * Escaped something -- skip over it
                     */
@@ -1881,6 +1895,7 @@ SuffFindArchiveDeps(GNode *gn, Lst slst)
        TARGET,             /* Must be first */
        PREFIX,             /* Must be second */
     };
+    LstNode    ln, nln;    /* Next suffix node to check */
     int                i;          /* Index into copy and vals */
     Suff       *ms;        /* Suffix descriptor for member */
     char       *name;      /* Start of member's name */
@@ -1892,6 +1907,13 @@ SuffFindArchiveDeps(GNode *gn, Lst slst)
     eoarch = strchr(gn->name, '(');
     eoname = strchr(eoarch, ')');
 
+    /*
+     * Caller guarantees the format `libname(member)', via
+     * Arch_ParseArchive.
+     */
+    assert(eoarch != NULL);
+    assert(eoname != NULL);
+
     *eoname = '\0';      /* Nuke parentheses during suffix search */
     *eoarch = '\0';      /* So a suffix can be found */
 
@@ -1920,8 +1942,7 @@ SuffFindArchiveDeps(GNode *gn, Lst slst)
     for (i = (sizeof(copy)/sizeof(copy[0]))-1; i >= 0; i--) {
        char *p1;
        Var_Set(copy[i], Var_Value(copy[i], mem, &p1), gn, 0);
-       if (p1)
-           free(p1);
+       free(p1);
 
     }
 
@@ -1943,6 +1964,20 @@ SuffFindArchiveDeps(GNode *gn, Lst slst)
     Var_Set(MEMBER, name, gn, 0);
     Var_Set(ARCHIVE, gn->name, gn, 0);
 
+    /*
+     * Set $@ for compatibility with other makes
+     */
+    Var_Set(TARGET, gn->name, gn, 0);
+
+    /*
+     * Now we've got the important local variables set, expand any sources
+     * that still contain variables or wildcards in their names.
+     */
+    for (ln = Lst_First(gn->children); ln != NULL; ln = nln) {
+       nln = Lst_Succ(ln);
+       SuffExpandChildren(ln, gn);
+    }
+
     if (ms != NULL) {
        /*
         * Member has a known suffix, so look for a transformation rule from
@@ -1950,7 +1985,6 @@ SuffFindArchiveDeps(GNode *gn, Lst slst)
         * through the entire list, we just look at suffixes to which the
         * member's suffix may be transformed...
         */
-       LstNode         ln;
        SuffixCmpData   sd;             /* Search string data */
 
        /*
@@ -1990,9 +2024,10 @@ SuffFindArchiveDeps(GNode *gn, Lst slst)
 
     /*
      * Flag the member as such so we remember to look in the archive for
-     * its modification time.
+     * its modification time. The OP_JOIN | OP_MADE is needed because this
+     * target should never get made.
      */
-    mem->type |= OP_MEMBER;
+    mem->type |= OP_MEMBER | OP_JOIN | OP_MADE;
 }
 
 /*-
@@ -2524,32 +2559,18 @@ Suff_SetNull(char *name)
 void
 Suff_Init(void)
 {
-    sufflist = Lst_Init(FALSE);
 #ifdef CLEANUP
     suffClean = Lst_Init(FALSE);
 #endif
     srclist = Lst_Init(FALSE);
     transforms = Lst_Init(FALSE);
 
-    sNum = 0;
     /*
      * Create null suffix for single-suffix rules (POSIX). The thing doesn't
      * actually go on the suffix list or everyone will think that's its
      * suffix.
      */
-    emptySuff = suffNull = bmake_malloc(sizeof(Suff));
-
-    suffNull->name =               bmake_strdup("");
-    suffNull->nameLen =     0;
-    suffNull->searchPath =  Lst_Init(FALSE);
-    Dir_Concat(suffNull->searchPath, dirSearchPath);
-    suffNull->children =    Lst_Init(FALSE);
-    suffNull->parents =            Lst_Init(FALSE);
-    suffNull->ref =        Lst_Init(FALSE);
-    suffNull->sNum =               sNum++;
-    suffNull->flags =              SUFF_NULL;
-    suffNull->refCount =    1;
-
+    Suff_ClearSuffixes();
 }
 
 
@@ -2582,14 +2603,15 @@ Suff_End(void)
 
 /********************* DEBUGGING FUNCTIONS **********************/
 
-static int SuffPrintName(void *s, void *dummy)
+static int SuffPrintName(void *s, void *dummy MAKE_ATTR_UNUSED)
 {
+
     fprintf(debug_file, "%s ", ((Suff *)s)->name);
-    return (dummy ? 0 : 0);
+    return 0;
 }
 
 static int
-SuffPrintSuff(void *sp, void *dummy)
+SuffPrintSuff(void *sp, void *dummy MAKE_ATTR_UNUSED)
 {
     Suff    *s = (Suff *)sp;
     int            flags;
@@ -2627,11 +2649,11 @@ SuffPrintSuff(void *sp, void *dummy)
     fprintf(debug_file, "#\tSearch Path: ");
     Dir_PrintPath(s->searchPath);
     fputc('\n', debug_file);
-    return (dummy ? 0 : 0);
+    return 0;
 }
 
 static int
-SuffPrintTrans(void *tp, void *dummy)
+SuffPrintTrans(void *tp, void *dummy MAKE_ATTR_UNUSED)
 {
     GNode   *t = (GNode *)tp;
 
@@ -2640,7 +2662,7 @@ SuffPrintTrans(void *tp, void *dummy)
     fputc('\n', debug_file);
     Lst_ForEach(t->commands, Targ_PrintCmd, NULL);
     fputc('\n', debug_file);
-    return(dummy ? 0 : 0);
+    return 0;
 }
 
 void
Index: pkgsrc/devel/bmake/files/trace.h
diff -u pkgsrc/devel/bmake/files/trace.h:1.5 pkgsrc/devel/bmake/files/trace.h:1.6
--- pkgsrc/devel/bmake/files/trace.h:1.5        Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/trace.h    Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: trace.h,v 1.5 2015/05/19 22:01:19 joerg Exp $  */
+/*     $NetBSD: trace.h,v 1.6 2020/05/24 11:09:43 nia Exp $    */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.

Index: pkgsrc/devel/bmake/files/config.h.in
diff -u pkgsrc/devel/bmake/files/config.h.in:1.9 pkgsrc/devel/bmake/files/config.h.in:1.10
--- pkgsrc/devel/bmake/files/config.h.in:1.9    Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/config.h.in        Sun May 24 11:09:43 2020
@@ -59,6 +59,12 @@
 /* Define to 1 if you have the `killpg' function. */
 #undef HAVE_KILLPG
 
+/* Define to 1 if you have the <libgen.h> header file. */
+#undef HAVE_LIBGEN_H
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
@@ -137,7 +143,7 @@
 /* Define to 1 if you have the `strtol' function. */
 #undef HAVE_STRTOL
 
-/* Define to 1 if `struct stat' is a member of `st_rdev'. */
+/* Define to 1 if `st_rdev' is a member of `struct stat'. */
 #undef HAVE_STRUCT_STAT_ST_RDEV
 
 /* Define to 1 if your `struct stat' has `st_rdev'. Deprecated, use
@@ -158,6 +164,9 @@
    */
 #undef HAVE_SYS_NDIR_H
 
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
 /* Define to 1 if you have the <sys/select.h> header file. */
 #undef HAVE_SYS_SELECT_H
 
@@ -304,12 +313,20 @@
 /* Define to 1 if you need to in order for `stat' and other things to work. */
 #undef _POSIX_SOURCE
 
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+#undef _UINT32_T
+
 /* C99 function name */
 #undef __func__
 
 /* Define to empty if `const' does not conform to ANSI C. */
 #undef const
 
+/* Define to `int' if <sys/types.h> does not define. */
+#undef mode_t
+
 /* Define to `long int' if <sys/types.h> does not define. */
 #undef off_t
 
@@ -319,5 +336,9 @@
 /* Define to `unsigned int' if <sys/types.h> does not define. */
 #undef size_t
 
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+   such a type exists and the standard includes do not define it. */
+#undef uint32_t
+
 /* Define as `fork' if `vfork' does not work. */
 #undef vfork
Index: pkgsrc/devel/bmake/files/make.h
diff -u pkgsrc/devel/bmake/files/make.h:1.9 pkgsrc/devel/bmake/files/make.h:1.10
--- pkgsrc/devel/bmake/files/make.h:1.9 Sun Feb 11 17:34:54 2018
+++ pkgsrc/devel/bmake/files/make.h     Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.h,v 1.9 2018/02/11 17:34:54 khorben Exp $ */
+/*     $NetBSD: make.h,v 1.10 2020/05/24 11:09:43 nia Exp $    */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -88,17 +88,21 @@
 #include <sys/param.h>
 
 #include <ctype.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #ifdef HAVE_STRING_H
 #include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
+#else
 #include <strings.h>
 #endif
 #include <unistd.h>
 #include <sys/cdefs.h>
 
+#ifndef FD_CLOEXEC
+#define FD_CLOEXEC 1
+#endif
+
 #if defined(__GNUC__)
 #define        MAKE_GNUC_PREREQ(x, y)                                          \
        ((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) ||                  \
@@ -195,6 +199,7 @@ typedef struct GNode {
 #define DONE_ALLSRC    0x40    /* We do it once only */
 #define CYCLE          0x1000  /* Used by MakePrintStatus */
 #define DONECYCLE      0x2000  /* Used by MakePrintStatus */
+#define INTERNAL       0x4000  /* Internal use only */
     enum enum_made {
        UNMADE, DEFERRED, REQUESTED, BEINGMADE,
        MADE, UPTODATE, ERROR, ABORTED
@@ -341,6 +346,7 @@ typedef struct GNode {
  * once the makefile has been parsed. PARSE_WARNING means it can. Passed
  * as the first argument to Parse_Error.
  */
+#define PARSE_INFO     3
 #define PARSE_WARNING  2
 #define PARSE_FATAL    1
 
@@ -384,6 +390,7 @@ extern Boolean  beSilent;           /* True if
 extern Boolean  noExecute;     /* True if should execute nothing */
 extern Boolean  noRecursiveExecute;            /* True if should execute nothing */
 extern Boolean  allPrecious;           /* True if every target is precious */
+extern Boolean  deleteOnError; /* True if failed targets should be deleted */
 extern Boolean  keepgoing;     /* True if should continue on unaffected
                                 * portions of the graph when have an error
                                 * in one portion */
@@ -457,7 +464,7 @@ extern pid_t        myPid;
  *     There is one bit per module.  It is up to the module what debug
  *     information to print.
  */
-FILE *debug_file;              /* Output written here - default stdout */
+extern FILE *debug_file;       /* Output written here - default stdout */
 extern int debug;
 #define        DEBUG_ARCH      0x00001
 #define        DEBUG_COND      0x00002
@@ -498,9 +505,15 @@ char * Check_Cwd_Cmd(const char *);
 void Check_Cwd(const char **);
 void PrintOnError(GNode *, const char *);
 void Main_ExportMAKEFLAGS(Boolean);
-Boolean Main_SetObjdir(const char *);
+Boolean Main_SetObjdir(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2);
 int mkTempFile(const char *, char **);
 int str2Lst_Append(Lst, char *, const char *);
+int cached_lstat(const char *, void *);
+int cached_stat(const char *, void *);
+
+#define        VARF_UNDEFERR   1
+#define        VARF_WANTRES    2
+#define        VARF_ASSIGN     4
 
 #ifdef __GNUC__
 #define UNCONST(ptr)   ({              \
@@ -520,8 +533,21 @@ int str2Lst_Append(Lst, char *, const ch
 #define MAX(a, b) ((a > b) ? a : b)
 #endif
 
+/* At least GNU/Hurd systems lack hardcoded MAXPATHLEN/PATH_MAX */
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
 #ifndef MAXPATHLEN
-#define MAXPATHLEN BMAKE_PATH_MAX
+#define MAXPATHLEN     BMAKE_PATH_MAX
+#endif
+#ifndef PATH_MAX
+#define PATH_MAX       MAXPATHLEN
+#endif
+
+#if defined(SYSV)
+#define KILLPG(pid, sig)       kill(-(pid), (sig))
+#else
+#define KILLPG(pid, sig)       killpg((pid), (sig))
 #endif
 
 #endif /* _MAKE_H_ */

Index: pkgsrc/devel/bmake/files/configure
diff -u pkgsrc/devel/bmake/files/configure:1.16 pkgsrc/devel/bmake/files/configure:1.17
--- pkgsrc/devel/bmake/files/configure:1.16     Tue Aug 15 15:54:06 2017
+++ pkgsrc/devel/bmake/files/configure  Sun May 24 11:09:43 2020
@@ -1,12 +1,12 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.64 for bmake 20140214.
+# Generated by GNU Autoconf 2.69 for bmake 20200418.
 #
 # Report bugs to <sjg%NetBSD.org@localhost>.
 #
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
-# Foundation, Inc.
+#
+# 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.
@@ -89,6 +89,7 @@ fi
 IFS=" ""       $as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -133,6 +134,31 @@ export LANGUAGE
 # CDPATH.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
 if test "x$CONFIG_SHELL" = x; then
   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
@@ -166,7 +192,8 @@ if ( set x; as_fn_ret_success y && test 
 else
   exitcode=1; echo positional parameters were not saved.
 fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -211,14 +238,25 @@ IFS=$as_save_IFS
 
 
       if test "x$CONFIG_SHELL" != x; then :
-  # We cannot yet assume a decent shell, so we have to provide a
-       # neutralization value for shells without unset; and this also
-       # works around shells that cannot unset nonexistent variables.
-       BASH_ENV=/dev/null
-       ENV=/dev/null
-       (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-       export CONFIG_SHELL
-       exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
 fi
 
     if test x$as_have_required = xno; then :
@@ -317,10 +355,18 @@ $as_echo X"$as_dir" |
       test -d "$as_dir" && break
     done
     test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
 
 
 } # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
 # as_fn_append VAR VALUE
 # ----------------------
 # Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -357,19 +403,19 @@ else
 fi # as_fn_arith
 
 
-# as_fn_error ERROR [LINENO LOG_FD]
-# ---------------------------------
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with status $?, using 1 if that was 0.
+# script with STATUS, using 1 if that was 0.
 as_fn_error ()
 {
-  as_status=$?; test $as_status -eq 0 && as_status=1
-  if test "$3"; then
-    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
   fi
-  $as_echo "$as_me: error: $1" >&2
+  $as_echo "$as_me: error: $2" >&2
   as_fn_exit $as_status
 } # as_fn_error
 
@@ -442,6 +488,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
   chmod +x "$as_me.lineno" ||
     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensitive to this).
@@ -476,16 +526,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -497,28 +547,8 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-       test -d "$1/.";
-      else
-       case $1 in #(
-       -*)set "./$1";;
-       esac;
-       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-       ???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -527,10 +557,11 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-exec 7<&0 </dev/null 6>&1
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
 
 # Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
 # so uname gets run too.
 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
@@ -549,8 +580,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='bmake'
 PACKAGE_TARNAME='bmake'
-PACKAGE_VERSION='20140214'
-PACKAGE_STRING='bmake 20140214'
+PACKAGE_VERSION='20200418'
+PACKAGE_STRING='bmake 20200418'
 PACKAGE_BUGREPORT='sjg%NetBSD.org@localhost'
 PACKAGE_URL=''
 
@@ -593,6 +624,7 @@ ac_includes_default="\
 ac_subst_vars='LTLIBOBJS
 _MAKE_VERSION
 filemon_h
+use_filemon
 use_meta
 diff_u
 GCC
@@ -660,6 +692,7 @@ ac_subst_files=''
 ac_user_opts='
 enable_option_checking
 with_defshell
+with_makefile
 with_meta
 with_filemon
 with_machine
@@ -743,8 +776,9 @@ do
   fi
 
   case $ac_option in
-  *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
-  *)   ac_optarg=yes ;;
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
   esac
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
@@ -789,7 +823,7 @@ do
     ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error "invalid feature name: $ac_useropt"
+      as_fn_error $? "invalid feature name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -815,7 +849,7 @@ do
     ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error "invalid feature name: $ac_useropt"
+      as_fn_error $? "invalid feature name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1019,7 +1053,7 @@ do
     ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error "invalid package name: $ac_useropt"
+      as_fn_error $? "invalid package name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1035,7 +1069,7 @@ do
     ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error "invalid package name: $ac_useropt"
+      as_fn_error $? "invalid package name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1065,8 +1099,8 @@ do
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
     x_libraries=$ac_optarg ;;
 
-  -*) as_fn_error "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information."
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
     ;;
 
   *=*)
@@ -1074,7 +1108,7 @@ Try \`$0 --help' for more information."
     # Reject names that are not valid shell variable names.
     case $ac_envvar in #(
       '' | [0-9]* | *[!_$as_cr_alnum]* )
-      as_fn_error "invalid variable name: \`$ac_envvar'" ;;
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
     esac
     eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
@@ -1084,7 +1118,7 @@ Try \`$0 --help' for more information."
     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
     ;;
 
   esac
@@ -1092,13 +1126,13 @@ done
 
 if test -n "$ac_prev"; then
   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  as_fn_error "missing argument to $ac_option"
+  as_fn_error $? "missing argument to $ac_option"
 fi
 
 if test -n "$ac_unrecognized_opts"; then
   case $enable_option_checking in
     no) ;;
-    fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
     *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
   esac
 fi
@@ -1121,7 +1155,7 @@ do
     [\\/$]* | ?:[\\/]* )  continue;;
     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
-  as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
 done
 
 # There might be people who depend on the old broken behavior: `$host'
@@ -1135,8 +1169,6 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used." >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1151,9 +1183,9 @@ test "$silent" = yes && exec 6>/dev/null
 ac_pwd=`pwd` && test -n "$ac_pwd" &&
 ac_ls_di=`ls -di .` &&
 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  as_fn_error "working directory cannot be determined"
+  as_fn_error $? "working directory cannot be determined"
 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
-  as_fn_error "pwd does not report name of working directory"
+  as_fn_error $? "pwd does not report name of working directory"
 
 
 # Find the source files, if location was not specified.
@@ -1192,11 +1224,11 @@ else
 fi
 if test ! -r "$srcdir/$ac_unique_file"; then
   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
-  as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
 fi
 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
 ac_abs_confdir=`(
-       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
+       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
        pwd)`
 # When building in place, set srcdir=.
 if test "$ac_abs_confdir" = "$ac_pwd"; then
@@ -1222,7 +1254,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures bmake 20140214 to adapt to many kinds of systems.
+\`configure' configures bmake 20200418 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1236,7 +1268,7 @@ Configuration:
       --help=short        display options specific to this package
       --help=recursive    display the short help of all the included packages
   -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking...' messages
+  -q, --quiet, --silent   do not print \`checking ...' messages
       --cache-file=FILE   cache test results in FILE [disabled]
   -C, --config-cache      alias for \`--cache-file=config.cache'
   -n, --no-create         do not create output files
@@ -1283,7 +1315,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of bmake 20140214:";;
+     short | recursive ) echo "Configuration of bmake 20200418:";;
    esac
   cat <<\_ACEOF
 
@@ -1299,8 +1331,9 @@ Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-defshell=SHELL  use SHELL by default - must be sh compatible, use sh or ksh to pick the internal definitions
+ --without-makefile dissable use of generated makefile
  --without-meta dissable use of meta-mode
- --with-filemon=path/filemon.h indicate path to filemon.h for meta-mode
+ --with-filemon={no,dev,ktrace,path/filemon.h} indicate filemon method for meta-mode. Path to filemon.h implies dev
   --with-machine=MACHINE  explicitly set MACHINE
   --with-force-machine=MACHINE  set FORCE_MACHINE
   --with-force-machine-arch=MACHINE  set FORCE_MACHINE_ARCH
@@ -1318,7 +1351,7 @@ Some influential environment variables:
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib dir>
   LIBS        libraries to pass to the linker, e.g. -l<library>
-  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
 
@@ -1388,10 +1421,10 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-bmake configure 20140214
-generated by GNU Autoconf 2.64
+bmake configure 20200418
+generated by GNU Autoconf 2.69
 
-Copyright (C) 2009 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1435,8 +1468,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
        ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  return $ac_retval
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_compile
 
@@ -1461,7 +1494,7 @@ $as_echo "$ac_try_echo"; } >&5
     mv -f conftest.er1 conftest.err
   fi
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } >/dev/null && {
+  test $ac_status = 0; } > conftest.i && {
         test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
         test ! -s conftest.err
        }; then :
@@ -1472,8 +1505,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
     ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  return $ac_retval
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_cpp
 
@@ -1485,10 +1518,10 @@ fi
 ac_fn_c_check_header_mongrel ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  if eval \${$3+:} false; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 fi
 eval ac_res=\$$3
@@ -1524,7 +1557,7 @@ if ac_fn_c_try_cpp "$LINENO"; then :
 else
   ac_header_preproc=no
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
 $as_echo "$ac_header_preproc" >&6; }
 
@@ -1547,17 +1580,15 @@ $as_echo "$as_me: WARNING: $2: see the A
 $as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( cat <<\_ASBOX
-## ----------------------------- ##
+( $as_echo "## ----------------------------- ##
 ## Report this to sjg%NetBSD.org@localhost ##
-## ----------------------------- ##
-_ASBOX
+## ----------------------------- ##"
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=\$ac_header_compiler"
@@ -1566,7 +1597,7 @@ eval ac_res=\$$3
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_mongrel
 
@@ -1607,8 +1638,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
        ac_retval=$ac_status
 fi
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  return $ac_retval
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_run
 
@@ -1621,7 +1652,7 @@ ac_fn_c_check_header_compile ()
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1639,7 +1670,7 @@ fi
 eval ac_res=\$$3
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_compile
 
@@ -1670,7 +1701,7 @@ $as_echo "$ac_try_echo"; } >&5
         test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
         test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
+        test -x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
@@ -1684,8 +1715,8 @@ fi
   # interfere with the next link command; also delete a directory that is
   # left behind by Apple's compiler.  We do this before executing the actions.
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  return $ac_retval
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_link
 
@@ -1698,7 +1729,7 @@ ac_fn_c_check_type ()
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=no"
@@ -1739,19 +1770,76 @@ fi
 eval ac_res=\$$3
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_type
 
-# ac_fn_c_check_decl LINENO SYMBOL VAR
+# ac_fn_c_find_uintX_t LINENO BITS VAR
 # ------------------------------------
-# Tests whether SYMBOL is declared, setting cache variable VAR accordingly.
+# Finds an unsigned integer type with width BITS, setting cache variable VAR
+# accordingly.
+ac_fn_c_find_uintX_t ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
+$as_echo_n "checking for uint$2_t... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+     # Order is important - never check a type that is potentially smaller
+     # than half of the expected target width.
+     for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \
+        'unsigned long long int' 'unsigned short int' 'unsigned char'; do
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  case $ac_type in #(
+  uint$2_t) :
+    eval "$3=yes" ;; #(
+  *) :
+    eval "$3=\$ac_type" ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       if eval test \"x\$"$3"\" = x"no"; then :
+
+else
+  break
+fi
+     done
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_find_uintX_t
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
 ac_fn_c_check_decl ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5
-$as_echo_n "checking whether $2 is declared... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  as_decl_name=`echo $2|sed 's/ *(.*//'`
+  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1760,8 +1848,12 @@ $4
 int
 main ()
 {
-#ifndef $2
-  (void) $2;
+#ifndef $as_decl_name
+#ifdef __cplusplus
+  (void) $as_decl_use;
+#else
+  (void) $as_decl_name;
+#endif
 #endif
 
   ;
@@ -1778,7 +1870,7 @@ fi
 eval ac_res=\$$3
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_decl
 
@@ -1790,7 +1882,7 @@ ac_fn_c_check_func ()
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1845,7 +1937,7 @@ fi
 eval ac_res=\$$3
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_func
 
@@ -1858,7 +1950,7 @@ ac_fn_c_check_member ()
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
 $as_echo_n "checking for $2.$3... " >&6; }
-if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$4+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1902,15 +1994,15 @@ fi
 eval ac_res=\$$4
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_member
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by bmake $as_me 20140214, which was
-generated by GNU Autoconf 2.64.  Invocation command line was
+It was created by bmake $as_me 20200418, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 
@@ -2020,11 +2112,9 @@ trap 'exit_status=$?
   {
     echo
 
-    cat <<\_ASBOX
-## ---------------- ##
+    $as_echo "## ---------------- ##
 ## Cache variables. ##
-## ---------------- ##
-_ASBOX
+## ---------------- ##"
     echo
     # The following way of writing the cache mishandles newlines in values,
 (
@@ -2058,11 +2148,9 @@ $as_echo "$as_me: WARNING: cache variabl
 )
     echo
 
-    cat <<\_ASBOX
-## ----------------- ##
+    $as_echo "## ----------------- ##
 ## Output variables. ##
-## ----------------- ##
-_ASBOX
+## ----------------- ##"
     echo
     for ac_var in $ac_subst_vars
     do
@@ -2075,11 +2163,9 @@ _ASBOX
     echo
 
     if test -n "$ac_subst_files"; then
-      cat <<\_ASBOX
-## ------------------- ##
+      $as_echo "## ------------------- ##
 ## File substitutions. ##
-## ------------------- ##
-_ASBOX
+## ------------------- ##"
       echo
       for ac_var in $ac_subst_files
       do
@@ -2093,11 +2179,9 @@ _ASBOX
     fi
 
     if test -s confdefs.h; then
-      cat <<\_ASBOX
-## ----------- ##
+      $as_echo "## ----------- ##
 ## confdefs.h. ##
-## ----------- ##
-_ASBOX
+## ----------- ##"
       echo
       cat confdefs.h
       echo
@@ -2152,7 +2236,12 @@ _ACEOF
 ac_site_file1=NONE
 ac_site_file2=NONE
 if test -n "$CONFIG_SITE"; then
-  ac_site_file1=$CONFIG_SITE
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
 elif test "x$prefix" != xNONE; then
   ac_site_file1=$prefix/share/config.site
   ac_site_file2=$prefix/etc/config.site
@@ -2163,18 +2252,22 @@ fi
 for ac_site_file in "$ac_site_file1" "$ac_site_file2"
 do
   test "x$ac_site_file" = xNONE && continue
-  if test -r "$ac_site_file"; then
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
-    . "$ac_site_file"
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
   fi
 done
 
 if test -r "$cache_file"; then
-  # Some versions of bash will fail to source /dev/null (special
-  # files actually), so we avoid doing that.
-  if test -f "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special files
+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
 $as_echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
@@ -2243,7 +2336,7 @@ if $ac_cache_corrupted; then
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
   { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
 fi
 ## -------------------- ##
 ## Main body of script. ##
@@ -2265,12 +2358,13 @@ case "$srcdir" in
 esac
 
 . $srcdir/VERSION
+OS=`uname -s`
 
 
 # Check whether --with-defshell was given.
 if test "${with_defshell+set}" = set; then :
   withval=$with_defshell; case "${withval}" in
-yes)   as_fn_error "bad value ${withval} given for bmake DEFSHELL" "$LINENO" 5 ;;
+yes)   as_fn_error $? "bad value ${withval} given for bmake DEFSHELL" "$LINENO" 5 ;;
 no)    ;;
 *)     case "$with_defshell" in
        sh)  DEFSHELL_INDEX=DEFSHELL_INDEX_SH;; # it's the default anyway
@@ -2282,13 +2376,26 @@ no)    ;;
        esac
 fi
 
+case "$OS" in
+CYGWIN*|MINGW*) use_makefile=no;;
+*) use_makefile=yes;;
+esac
+
+# Check whether --with-makefile was given.
+if test "${with_makefile+set}" = set; then :
+  withval=$with_makefile; case "${withval}" in
+yes|no) use_makefile=${withval};;
+*) as_fn_error $? "bad value ${withval} given for makefile" "$LINENO" 5 ;;
+esac
+fi
+
 use_meta=yes
 
 # Check whether --with-meta was given.
 if test "${with_meta+set}" = set; then :
   withval=$with_meta; case "${withval}" in
 yes|no) use_meta=${withval};;
-*) as_fn_error "bad value ${withval} given for meta" "$LINENO" 5 ;;
+*) as_fn_error $? "bad value ${withval} given for meta" "$LINENO" 5 ;;
 esac
 fi
 
@@ -2296,30 +2403,41 @@ fi
 # Check whether --with-filemon was given.
 if test "${with_filemon+set}" = set; then :
   withval=$with_filemon;  case "/${withval}" in
-/no|*/filemon.h) filemon_h="${withval}";;
+/no) use_filemon=no;;
+/*trace) filemon_h=no use_filemon="${withval}";;
+*/filemon.h) filemon_h="${withval}";;
 */filemon*) filemon_h="${withval}/filemon.h";;
-*) as_fn_error "bad value ${withval} given for filemon" "$LINENO" 5 ;;
+*) as_fn_error $? "bad value ${withval} given for filemon" "$LINENO" 5 ;;
 esac
 else
 
-OS=`uname -s`
-for d in "/usr/include/dev/filemon" "$prefix/include/dev/filemon" "$srcdir/filemon" "$srcdir/../filemon" "$srcdir/../../sys/dev/filemon"
-do
-       for x in "/$OS" ""
-       do
-               filemon_h="$d$x/filemon.h"
-               test -s "$filemon_h" && break
-       done
-       test -s "$filemon_h" && break
-done
-test -s "${filemon_h:-/dev/null}" || filemon_h=no
+case "$OS" in
+NetBSD) filemon_h=no use_filemon=ktrace;;
+*)
+    for d in "/usr/include/dev/filemon" "$prefix/include/dev/filemon" "$srcdir/../../sys/dev/filemon"
+    do
+        for x in "/$OS" ""
+        do
+            filemon_h="$d$x/filemon.h"
+            test -s "$filemon_h" && break
+        done
+        test -s "$filemon_h" && { use_filemon=dev; break; }
+    done
+    ;;
+esac
+use_filemon=${use_filemon:-no}
+case "$use_filemon" in
+dev) ;;
+*) filemon_h=no;;
+esac
 
 fi
 
 case "$use_meta" in
 yes)
-       case "$filemon_h" in
-       *.h) echo "Using: filemon=$filemon_h" >&6;;
+       case "$use_filemon" in
+       no) ;;
+       *) echo "Using: filemon_${use_filemon}.c" >&6;;
        esac
        ;;
 esac
@@ -2333,7 +2451,7 @@ if test -n "$ac_tool_prefix"; then
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2345,7 +2463,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2373,7 +2491,7 @@ if test -z "$ac_cv_prog_CC"; then
 set dummy gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2385,7 +2503,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2426,7 +2544,7 @@ if test -z "$CC"; then
 set dummy ${ac_tool_prefix}cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2438,7 +2556,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2466,7 +2584,7 @@ if test -z "$CC"; then
 set dummy cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2479,7 +2597,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -2525,7 +2643,7 @@ if test -z "$CC"; then
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2537,7 +2655,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2569,7 +2687,7 @@ do
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2581,7 +2699,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2623,8 +2741,8 @@ fi
 
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "no acceptable C compiler found in \$PATH
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -2645,32 +2763,30 @@ $as_echo "$ac_try_echo"; } >&5
 ... rest of stderr output deleted ...
          10q' conftest.err >conftest.er1
     cat conftest.er1 >&5
-    rm -f conftest.er1 conftest.err
   fi
+  rm -f conftest.er1 conftest.err
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
 done
 
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stdio.h>
+
 int
 main ()
 {
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
 
   ;
   return 0;
 }
 _ACEOF
 ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out conftest.out"
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
 
 # The possible output files:
@@ -2732,62 +2848,28 @@ test "$ac_cv_exeext" = no && ac_cv_exeex
 else
   ac_file=''
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
 if test -z "$ac_file"; then :
-  $as_echo "$as_me: failed program was:" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ as_fn_set_status 77
-as_fn_error "C compiler cannot create executables
-See \`config.log' for more details." "$LINENO" 5; }; }
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
 ac_exeext=$ac_cv_exeext
 
-# Check that the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
-  if { ac_try='./$ac_file'
-  { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then
-    cross_compiling=no
-  else
-    if test "$cross_compiling" = maybe; then
-       cross_compiling=yes
-    else
-       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." "$LINENO" 5; }
-    fi
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
-# Check that the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
 $as_echo_n "checking for suffix of executables... " >&6; }
 if { { ac_try="$ac_link"
@@ -2817,19 +2899,78 @@ done
 else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
 fi
-rm -f conftest$ac_cv_exeext
+rm -f conftest conftest$ac_cv_exeext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
 $as_echo "$ac_cv_exeext" >&6; }
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    else
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
 $as_echo_n "checking for suffix of object files... " >&6; }
-if test "${ac_cv_objext+set}" = set; then :
+if ${ac_cv_objext+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2869,8 +3010,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
@@ -2880,7 +3021,7 @@ OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+if ${ac_cv_c_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2917,7 +3058,7 @@ ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then :
+if ${ac_cv_prog_cc_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
@@ -2995,7 +3136,7 @@ else
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then :
+if ${ac_cv_prog_cc_c89+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
@@ -3004,8 +3145,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -3103,7 +3243,7 @@ if test -n "$CPP" && test -d "$CPP"; the
   CPP=
 fi
 if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then :
+  if ${ac_cv_prog_CPP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
@@ -3133,7 +3273,7 @@ else
   # Broken: fails on valid input.
 continue
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
@@ -3149,11 +3289,11 @@ else
 ac_preproc_ok=:
 break
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.i conftest.err conftest.$ac_ext
 if $ac_preproc_ok; then :
   break
 fi
@@ -3192,7 +3332,7 @@ else
   # Broken: fails on valid input.
 continue
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
@@ -3208,18 +3348,18 @@ else
 ac_preproc_ok=:
 break
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.i conftest.err conftest.$ac_ext
 if $ac_preproc_ok; then :
 
 else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
 ac_ext=c
@@ -3231,7 +3371,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then :
+if ${ac_cv_path_GREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$GREP"; then
@@ -3245,7 +3385,7 @@ do
     for ac_prog in grep ggrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+      as_fn_executable_p "$ac_path_GREP" || continue
 # Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
@@ -3280,7 +3420,7 @@ esac
   done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_GREP"; then
-    as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
   fi
 else
   ac_cv_path_GREP=$GREP
@@ -3294,7 +3434,7 @@ $as_echo "$ac_cv_path_GREP" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
 $as_echo_n "checking for egrep... " >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then :
+if ${ac_cv_path_EGREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
@@ -3311,7 +3451,7 @@ do
     for ac_prog in egrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+      as_fn_executable_p "$ac_path_EGREP" || continue
 # Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
@@ -3346,7 +3486,7 @@ esac
   done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_EGREP"; then
-    as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
   fi
 else
   ac_cv_path_EGREP=$EGREP
@@ -3361,7 +3501,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then :
+if ${ac_cv_header_stdc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3478,8 +3618,7 @@ do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
 "
-eval as_val=\$$as_ac_Header
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -3491,7 +3630,7 @@ done
 
 
   ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
-if test "x$ac_cv_header_minix_config_h" = x""yes; then :
+if test "x$ac_cv_header_minix_config_h" = xyes; then :
   MINIX=yes
 else
   MINIX=
@@ -3513,14 +3652,14 @@ $as_echo "#define _MINIX 1" >>confdefs.h
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
-if test "${ac_cv_safe_to_define___extensions__+set}" = set; then :
+if ${ac_cv_safe_to_define___extensions__+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#        define __EXTENSIONS__ 1
-         $ac_includes_default
+#         define __EXTENSIONS__ 1
+          $ac_includes_default
 int
 main ()
 {
@@ -3560,7 +3699,7 @@ if test -n "$ac_tool_prefix"; then
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3572,7 +3711,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3600,7 +3739,7 @@ if test -z "$ac_cv_prog_CC"; then
 set dummy gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -3612,7 +3751,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3653,7 +3792,7 @@ if test -z "$CC"; then
 set dummy ${ac_tool_prefix}cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3665,7 +3804,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3693,7 +3832,7 @@ if test -z "$CC"; then
 set dummy cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3706,7 +3845,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -3752,7 +3891,7 @@ if test -z "$CC"; then
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3764,7 +3903,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3796,7 +3935,7 @@ do
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -3808,7 +3947,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3850,8 +3989,8 @@ fi
 
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "no acceptable C compiler found in \$PATH
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -3872,15 +4011,15 @@ $as_echo "$ac_try_echo"; } >&5
 ... rest of stderr output deleted ...
          10q' conftest.err >conftest.er1
     cat conftest.er1 >&5
-    rm -f conftest.er1 conftest.err
   fi
+  rm -f conftest.er1 conftest.err
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
 done
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+if ${ac_cv_c_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3917,7 +4056,7 @@ ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then :
+if ${ac_cv_prog_cc_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
@@ -3995,7 +4134,7 @@ else
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then :
+if ${ac_cv_prog_cc_c89+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
@@ -4004,8 +4143,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -4093,7 +4231,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 if test $ac_cv_c_compiler_gnu = yes; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5
 $as_echo_n "checking whether $CC needs -traditional... " >&6; }
-if test "${ac_cv_prog_gcc_traditional+set}" = set; then :
+if ${ac_cv_prog_gcc_traditional+:} false; then :
   $as_echo_n "(cached) " >&6
 else
     ac_pattern="Autoconf.*'x'"
@@ -4134,16 +4272,22 @@ fi
 
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
-  for ac_t in install-sh install.sh shtool; do
-    if test -f "$ac_dir/$ac_t"; then
-      ac_aux_dir=$ac_dir
-      ac_install_sh="$ac_aux_dir/$ac_t -c"
-      break 2
-    fi
-  done
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
 done
 if test -z "$ac_aux_dir"; then
-  as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
 fi
 
 # These three variables are undocumented and unsupported,
@@ -4172,7 +4316,7 @@ ac_configure="$SHELL $ac_aux_dir/configu
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
 $as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then :
+if ${ac_cv_path_install+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -4192,7 +4336,7 @@ case $as_dir/ in #((
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-       if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+       if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
          if test $ac_prog = install &&
            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
            # AIX install.  It has an incompatible calling convention.
@@ -4262,7 +4406,7 @@ echo "Using: BMAKE_PATH_MAX=$bmake_path_
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then :
+if ${ac_cv_header_stdc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4374,7 +4518,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5
 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; }
-if test "${ac_cv_header_sys_wait_h+set}" = set; then :
+if ${ac_cv_header_sys_wait_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4418,7 +4562,7 @@ for ac_hdr in dirent.h sys/ndir.h sys/di
   as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5
 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$as_ac_Header+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4445,8 +4589,7 @@ fi
 eval ac_res=\$$as_ac_Header
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-eval as_val=\$$as_ac_Header
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
 _ACEOF
@@ -4459,7 +4602,7 @@ done
 if test $ac_header_dirent = dirent.h; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
 $as_echo_n "checking for library containing opendir... " >&6; }
-if test "${ac_cv_search_opendir+set}" = set; then :
+if ${ac_cv_search_opendir+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
@@ -4493,11 +4636,11 @@ for ac_lib in '' dir; do
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext
-  if test "${ac_cv_search_opendir+set}" = set; then :
+  if ${ac_cv_search_opendir+:} false; then :
   break
 fi
 done
-if test "${ac_cv_search_opendir+set}" = set; then :
+if ${ac_cv_search_opendir+:} false; then :
 
 else
   ac_cv_search_opendir=no
@@ -4516,7 +4659,7 @@ fi
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
 $as_echo_n "checking for library containing opendir... " >&6; }
-if test "${ac_cv_search_opendir+set}" = set; then :
+if ${ac_cv_search_opendir+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
@@ -4550,11 +4693,11 @@ for ac_lib in '' x; do
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext
-  if test "${ac_cv_search_opendir+set}" = set; then :
+  if ${ac_cv_search_opendir+:} false; then :
   break
 fi
 done
-if test "${ac_cv_search_opendir+set}" = set; then :
+if ${ac_cv_search_opendir+:} false; then :
 
 else
   ac_cv_search_opendir=no
@@ -4572,10 +4715,41 @@ fi
 
 fi
 
+for ac_header in sys/param.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_param_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_PARAM_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in sys/sysctl.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+# endif
+
+"
+if test "x$ac_cv_header_sys_sysctl_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_SYSCTL_H 1
+_ACEOF
+
+fi
+
+done
+
+
 for ac_header in \
        ar.h \
        err.h \
        fcntl.h \
+       libgen.h \
+       limits.h \
        paths.h \
        poll.h \
        ranlib.h \
@@ -4583,7 +4757,6 @@ for ac_header in \
        sys/mman.h \
        sys/select.h \
        sys/socket.h \
-       sys/sysctl.h \
        sys/time.h \
        sys/uio.h \
        unistd.h \
@@ -4592,8 +4765,7 @@ for ac_header in \
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-eval as_val=\$$as_ac_Header
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -4604,7 +4776,7 @@ done
 
 
 ac_fn_c_check_header_mongrel "$LINENO" "sys/cdefs.h" "ac_cv_header_sys_cdefs_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_cdefs_h" = x""yes; then :
+if test "x$ac_cv_header_sys_cdefs_h" = xyes; then :
   echo $ECHO_N "checking whether sys/cdefs.h is compatible... $ECHO_C" >&6
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -4631,7 +4803,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__" >&5
 $as_echo_n "checking for __attribute__... " >&6; }
-if test "${ac_cv___attribute__+set}" = set; then :
+if ${ac_cv___attribute__+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -4640,10 +4812,6 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_
 
 #include <stdlib.h>
 
-int
-main ()
-{
-
 static void foo(void) __attribute__ ((noreturn));
 
 static void
@@ -4652,16 +4820,20 @@ foo(void)
   exit(1);
 }
 
-  ;
-  return 0;
+int
+main(int argc, char **argv)
+{
+       foo();
 }
+
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv___attribute__=yes
 else
   ac_cv___attribute__=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 fi
 
 if test "$ac_cv___attribute__" = "yes"; then
@@ -4674,7 +4846,7 @@ $as_echo "$ac_cv___attribute__" >&6; }
 
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
 $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if test "${ac_cv_c_bigendian+set}" = set; then :
+if ${ac_cv_c_bigendian+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_c_bigendian=unknown
@@ -4892,13 +5064,13 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUI
 
      ;; #(
    *)
-     as_fn_error "unknown endianness
+     as_fn_error $? "unknown endianness
  presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
  esac
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
 $as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if test "${ac_cv_c_const+set}" = set; then :
+if ${ac_cv_c_const+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4907,11 +5079,11 @@ else
 int
 main ()
 {
-/* FIXME: Include the comments suggested by Paul. */
+
 #ifndef __cplusplus
-  /* Ultrix mips cc rejects this.  */
+  /* Ultrix mips cc rejects this sort of thing.  */
   typedef int charset[2];
-  const charset cs;
+  const charset cs = { 0, 0 };
   /* SunOS 4.1.1 cc rejects this.  */
   char const *const *pcpcc;
   char **ppc;
@@ -4928,8 +5100,9 @@ main ()
   ++pcpcc;
   ppc = (char**) pcpcc;
   pcpcc = (char const *const *) ppc;
-  { /* SCO 3.2v4 cc rejects this.  */
-    char *t;
+  { /* SCO 3.2v4 cc rejects this sort of thing.  */
+    char tx;
+    char *t = &tx;
     char const *s = 0 ? (char *) 0 : (char const *) 0;
 
     *t++ = 0;
@@ -4945,10 +5118,10 @@ main ()
     iptr p = 0;
     ++p;
   }
-  { /* AIX XL C 1.02.0.0 rejects this saying
+  { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-    struct s { int j; const int *ap[3]; };
-    struct s *b; b->j = 5;
+    struct s { int j; const int *ap[3]; } bx;
+    struct s *b = &bx; b->j = 5;
   }
   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
     const int foo = 10;
@@ -4976,8 +5149,19 @@ $as_echo "#define const /**/" >>confdefs
 
 fi
 
+ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
+if test "x$ac_cv_type_mode_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define mode_t int
+_ACEOF
+
+fi
+
 ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
-if test "x$ac_cv_type_off_t" = x""yes; then :
+if test "x$ac_cv_type_off_t" = xyes; then :
 
 else
 
@@ -4988,7 +5172,7 @@ _ACEOF
 fi
 
 ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
-if test "x$ac_cv_type_pid_t" = x""yes; then :
+if test "x$ac_cv_type_pid_t" = xyes; then :
 
 else
 
@@ -4999,7 +5183,7 @@ _ACEOF
 fi
 
 ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = x""yes; then :
+if test "x$ac_cv_type_size_t" = xyes; then :
 
 else
 
@@ -5009,6 +5193,20 @@ _ACEOF
 
 fi
 
+ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t"
+case $ac_cv_c_uint32_t in #(
+  no|yes) ;; #(
+  *)
+
+$as_echo "#define _UINT32_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint32_t $ac_cv_c_uint32_t
+_ACEOF
+;;
+  esac
+
 ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "#include <signal.h>
 /* NetBSD declares sys_siglist in unistd.h.  */
 #ifdef HAVE_UNISTD_H
@@ -5016,7 +5214,7 @@ ac_fn_c_check_decl "$LINENO" "sys_siglis
 #endif
 
 "
-if test "x$ac_cv_have_decl_sys_siglist" = x""yes; then :
+if test "x$ac_cv_have_decl_sys_siglist" = xyes; then :
   ac_have_decl=1
 else
   ac_have_decl=0
@@ -5029,7 +5227,7 @@ _ACEOF
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
-if test "${ac_cv_header_time+set}" = set; then :
+if ${ac_cv_header_time+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -5064,7 +5262,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
-if test "${ac_cv_struct_tm+set}" = set; then :
+if ${ac_cv_struct_tm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -5100,7 +5298,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
 $as_echo_n "checking return type of signal handlers... " >&6; }
-if test "${ac_cv_type_signal+set}" = set; then :
+if ${ac_cv_type_signal+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -5134,7 +5332,7 @@ _ACEOF
 for ac_header in vfork.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default"
-if test "x$ac_cv_header_vfork_h" = x""yes; then :
+if test "x$ac_cv_header_vfork_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_VFORK_H 1
 _ACEOF
@@ -5147,8 +5345,7 @@ for ac_func in fork vfork
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -5159,7 +5356,7 @@ done
 if test "x$ac_cv_func_fork" = xyes; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
 $as_echo_n "checking for working fork... " >&6; }
-if test "${ac_cv_func_fork_works+set}" = set; then :
+if ${ac_cv_func_fork_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -5212,7 +5409,7 @@ ac_cv_func_vfork_works=$ac_cv_func_vfork
 if test "x$ac_cv_func_vfork" = xyes; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
 $as_echo_n "checking for working vfork... " >&6; }
-if test "${ac_cv_func_vfork_works+set}" = set; then :
+if ${ac_cv_func_vfork_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -5348,13 +5545,13 @@ fi
 for ac_func in vprintf
 do :
   ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf"
-if test "x$ac_cv_func_vprintf" = x""yes; then :
+if test "x$ac_cv_func_vprintf" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_VPRINTF 1
 _ACEOF
 
 ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt"
-if test "x$ac_cv_func__doprnt" = x""yes; then :
+if test "x$ac_cv_func__doprnt" = xyes; then :
 
 $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h
 
@@ -5366,7 +5563,7 @@ done
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wait3 that fills in rusage" >&5
 $as_echo_n "checking for wait3 that fills in rusage... " >&6; }
-if test "${ac_cv_func_wait3_rusage+set}" = set; then :
+if ${ac_cv_func_wait3_rusage+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -5462,8 +5659,7 @@ for ac_func in \
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -5472,36 +5668,63 @@ fi
 done
 
 
-for ac_func in \
-       realpath \
-       dirname \
-       stresep \
-       strlcpy \
+ac_fn_c_check_func "$LINENO" "realpath" "ac_cv_func_realpath"
+if test "x$ac_cv_func_realpath" = xyes; then :
+  $as_echo "#define HAVE_REALPATH 1" >>confdefs.h
 
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
-   if test "x$as_val" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+else
+  case " $LIBOBJS " in
+  *" realpath.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS realpath.$ac_objext"
+ ;;
+esac
+
+fi
+
+ac_fn_c_check_func "$LINENO" "dirname" "ac_cv_func_dirname"
+if test "x$ac_cv_func_dirname" = xyes; then :
+  $as_echo "#define HAVE_DIRNAME 1" >>confdefs.h
 
 else
   case " $LIBOBJS " in
-  *" $ac_func.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
+  *" dirname.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS dirname.$ac_objext"
+ ;;
+esac
+
+fi
+
+ac_fn_c_check_func "$LINENO" "stresep" "ac_cv_func_stresep"
+if test "x$ac_cv_func_stresep" = xyes; then :
+  $as_echo "#define HAVE_STRESEP 1" >>confdefs.h
+
+else
+  case " $LIBOBJS " in
+  *" stresep.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS stresep.$ac_objext"
+ ;;
+esac
+
+fi
+
+ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy"
+if test "x$ac_cv_func_strlcpy" = xyes; then :
+  $as_echo "#define HAVE_STRLCPY 1" >>confdefs.h
+
+else
+  case " $LIBOBJS " in
+  *" strlcpy.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS strlcpy.$ac_objext"
  ;;
 esac
 
 fi
-done
 
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for emalloc in -lutil" >&5
 $as_echo_n "checking for emalloc in -lutil... " >&6; }
-if test "${ac_cv_lib_util_emalloc+set}" = set; then :
+if ${ac_cv_lib_util_emalloc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -5535,10 +5758,10 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_emalloc" >&5
 $as_echo "$ac_cv_lib_util_emalloc" >&6; }
-if test "x$ac_cv_lib_util_emalloc" = x""yes; then :
+if test "x$ac_cv_lib_util_emalloc" = xyes; then :
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for erealloc in -lutil" >&5
 $as_echo_n "checking for erealloc in -lutil... " >&6; }
-if test "${ac_cv_lib_util_erealloc+set}" = set; then :
+if ${ac_cv_lib_util_erealloc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -5572,10 +5795,10 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_erealloc" >&5
 $as_echo "$ac_cv_lib_util_erealloc" >&6; }
-if test "x$ac_cv_lib_util_erealloc" = x""yes; then :
+if test "x$ac_cv_lib_util_erealloc" = xyes; then :
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for estrdup in -lutil" >&5
 $as_echo_n "checking for estrdup in -lutil... " >&6; }
-if test "${ac_cv_lib_util_estrdup+set}" = set; then :
+if ${ac_cv_lib_util_estrdup+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -5609,10 +5832,10 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_estrdup" >&5
 $as_echo "$ac_cv_lib_util_estrdup" >&6; }
-if test "x$ac_cv_lib_util_estrdup" = x""yes; then :
+if test "x$ac_cv_lib_util_estrdup" = xyes; then :
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for estrndup in -lutil" >&5
 $as_echo_n "checking for estrndup in -lutil... " >&6; }
-if test "${ac_cv_lib_util_estrndup+set}" = set; then :
+if ${ac_cv_lib_util_estrndup+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -5646,7 +5869,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_estrndup" >&5
 $as_echo "$ac_cv_lib_util_estrndup" >&6; }
-if test "x$ac_cv_lib_util_estrndup" = x""yes; then :
+if test "x$ac_cv_lib_util_estrndup" = xyes; then :
    LIBS="$LIBS -lutil"
            CPPFLAGS="$CPPFLAGS -DUSE_EMALLOC"
 fi
@@ -5660,7 +5883,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5
 $as_echo_n "checking whether stat file-mode macros are broken... " >&6; }
-if test "${ac_cv_header_stat_broken+set}" = set; then :
+if ${ac_cv_header_stat_broken+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -5701,7 +5924,7 @@ $as_echo "#define STAT_MACROS_BROKEN 1" 
 fi
 
 ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default"
-if test "x$ac_cv_member_struct_stat_st_rdev" = x""yes; then :
+if test "x$ac_cv_member_struct_stat_st_rdev" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_STAT_ST_RDEV 1
@@ -5772,7 +5995,7 @@ echo "defaults: MACHINE=$machine, MACHIN
 # Check whether --with-machine was given.
 if test "${with_machine+set}" = set; then :
   withval=$with_machine; case "${withval}" in
-yes)   as_fn_error "bad value ${withval} given for bmake MACHINE" "$LINENO" 5 ;;
+yes)   as_fn_error $? "bad value ${withval} given for bmake MACHINE" "$LINENO" 5 ;;
 no)    ;;
 generic) machine=`$srcdir/machine.sh`;;
 *)     machine=$with_machine;;
@@ -5805,7 +6028,7 @@ fi
 # Check whether --with-machine_arch was given.
 if test "${with_machine_arch+set}" = set; then :
   withval=$with_machine_arch; case "${withval}" in
-yes)   as_fn_error "bad value ${withval} given for bmake MACHINE_ARCH" "$LINENO" 5 ;;
+yes)   as_fn_error $? "bad value ${withval} given for bmake MACHINE_ARCH" "$LINENO" 5 ;;
 no)    ;;
 *)     machine_arch=$with_machine_arch;;
 esac
@@ -5817,7 +6040,7 @@ default_sys_path=\${prefix}/share/mk
 # Check whether --with-default-sys-path was given.
 if test "${with_default_sys_path+set}" = set; then :
   withval=$with_default_sys_path; case "${withval}" in
-yes)   as_fn_error "bad value ${withval} given for bmake _PATH_DEFSYSPATH" "$LINENO" 5 ;;
+yes)   as_fn_error $? "bad value ${withval} given for bmake _PATH_DEFSYSPATH" "$LINENO" 5 ;;
 no)    ;;
 *)     default_sys_path="$with_default_sys_path"
        ;;
@@ -5828,7 +6051,7 @@ fi
 # Check whether --with-path-objdirprefix was given.
 if test "${with_path_objdirprefix+set}" = set; then :
   withval=$with_path_objdirprefix; case "${withval}" in
-yes)   as_fn_error "bad value ${withval} given for bmake _PATH_OBJDIRPREFIX" "$LINENO" 5 ;;
+yes)   as_fn_error $? "bad value ${withval} given for bmake _PATH_OBJDIRPREFIX" "$LINENO" 5 ;;
 no)    CPPFLAGS="$CPPFLAGS -DNO_PATH_OBJDIRPREFIX" ;;
 *)     CPPFLAGS="$CPPFLAGS \"-D_PATH_OBJDIRPREFIX=\\\"$with_path-objdir\\\"\"" ;;
 esac
@@ -5839,7 +6062,7 @@ if test "${enable_pwd_override+set}" = s
   enableval=$enable_pwd_override; case "${enableval}" in
 yes)   ;;
 no)    CPPFLAGS="$CPPFLAGS -DNO_PWD_OVERRIDE" ;;
-*)     as_fn_error "bad value ${enableval} given for pwd-override option" "$LINENO" 5 ;;
+*)     as_fn_error $? "bad value ${enableval} given for pwd-override option" "$LINENO" 5 ;;
 esac
 fi
 
@@ -5848,7 +6071,7 @@ if test "${enable_check_make_chdir+set}"
   enableval=$enable_check_make_chdir; case "${enableval}" in
 yes)   ;;
 no)    CPPFLAGS="$CPPFLAGS -DNO_CHECK_MAKE_CHDIR" ;;
-*)     as_fn_error "bad value ${enableval} given for check-make-chdir option" "$LINENO" 5 ;;
+*)     as_fn_error $? "bad value ${enableval} given for check-make-chdir option" "$LINENO" 5 ;;
 esac
 fi
 
@@ -5858,7 +6081,7 @@ if test "${with_mksrc+set}" = set; then 
   withval=$with_mksrc; case "${withval}" in
 ""|yes|no) ;;
 *) test -s $withval/install-mk && mksrc=$withval ||
-as_fn_error "bad value ${withval} given for mksrc cannot find install-mk" "$LINENO" 5
+as_fn_error $? "bad value ${withval} given for mksrc cannot find install-mk" "$LINENO" 5
 ;;
 esac
 
@@ -5901,7 +6124,13 @@ fi
 
 
 
-ac_config_files="$ac_config_files makefile Makefile.config make-bootstrap.sh unit-tests/Makefile"
+
+
+bm_outfiles="Makefile.config unit-tests/Makefile.config make-bootstrap.sh"
+if test $use_makefile = yes; then
+   bm_outfiles="makefile $bm_outfiles"
+fi
+ac_config_files="$ac_config_files $bm_outfiles"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -5967,10 +6196,21 @@ $as_echo "$as_me: WARNING: cache variabl
      :end' >>confcache
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
-    test "x$cache_file" != "x/dev/null" &&
+    if test "x$cache_file" != "x/dev/null"; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
 $as_echo "$as_me: updating cache $cache_file" >&6;}
-    cat confcache >$cache_file
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+       cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+         mv -f confcache "$cache_file"$$ &&
+         mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+         mv -f confcache "$cache_file" ;;
+       esac
+      fi
+    fi
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
@@ -5986,6 +6226,7 @@ DEFS=-DHAVE_CONFIG_H
 
 ac_libobjs=
 ac_ltlibobjs=
+U=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
@@ -6002,7 +6243,7 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-: ${CONFIG_STATUS=./config.status}
+: "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
@@ -6103,6 +6344,7 @@ fi
 IFS=" ""       $as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -6148,19 +6390,19 @@ export LANGUAGE
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
 
-# as_fn_error ERROR [LINENO LOG_FD]
-# ---------------------------------
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with status $?, using 1 if that was 0.
+# script with STATUS, using 1 if that was 0.
 as_fn_error ()
 {
-  as_status=$?; test $as_status -eq 0 && as_status=1
-  if test "$3"; then
-    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
   fi
-  $as_echo "$as_me: error: $1" >&2
+  $as_echo "$as_me: error: $2" >&2
   as_fn_exit $as_status
 } # as_fn_error
 
@@ -6298,16 +6540,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -6356,7 +6598,7 @@ $as_echo X"$as_dir" |
       test -d "$as_dir" && break
     done
     test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
 
 
 } # as_fn_mkdir_p
@@ -6367,28 +6609,16 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-       test -d "$1/.";
-      else
-       case $1 in #(
-       -*)set "./$1";;
-       esac;
-       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-       ???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -6409,8 +6639,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by bmake $as_me 20140214, which was
-generated by GNU Autoconf 2.64.  Invocation command line was
+This file was extended by bmake $as_me 20200418, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -6449,6 +6679,7 @@ Usage: $0 [OPTION]... [TAG]...
 
   -h, --help       print this help, then exit
   -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
   -q, --quiet, --silent
                    do not print progress messages
   -d, --debug      don't remove temporary files
@@ -6468,12 +6699,13 @@ Report bugs to <sjg%NetBSD.org@localhost>."
 
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-bmake config.status 20140214
-configured by $0, generated by GNU Autoconf 2.64,
-  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+bmake config.status 20200418
+configured by $0, generated by GNU Autoconf 2.69,
+  with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2009 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -6489,11 +6721,16 @@ ac_need_defaults=:
 while test $# != 0
 do
   case $1 in
-  --*=*)
+  --*=?*)
     ac_option=`expr "X$1" : 'X\([^=]*\)='`
     ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
     ac_shift=:
     ;;
+  --*=)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
   *)
     ac_option=$1
     ac_optarg=$2
@@ -6507,12 +6744,15 @@ do
     ac_cs_recheck=: ;;
   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
     $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
   --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
     $ac_shift
     case $ac_optarg in
     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
     esac
     as_fn_append CONFIG_FILES " '$ac_optarg'"
     ac_need_defaults=false;;
@@ -6525,7 +6765,7 @@ do
     ac_need_defaults=false;;
   --he | --h)
     # Conflict between --help and --header
-    as_fn_error "ambiguous option: \`$1'
+    as_fn_error $? "ambiguous option: \`$1'
 Try \`$0 --help' for more information.";;
   --help | --hel | -h )
     $as_echo "$ac_cs_usage"; exit ;;
@@ -6534,7 +6774,7 @@ Try \`$0 --help' for more information.";
     ac_cs_silent=: ;;
 
   # This is an error.
-  -*) as_fn_error "unrecognized option: \`$1'
+  -*) as_fn_error $? "unrecognized option: \`$1'
 Try \`$0 --help' for more information." ;;
 
   *) as_fn_append ac_config_targets " $1"
@@ -6554,7 +6794,7 @@ fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
@@ -6584,12 +6824,9 @@ for ac_config_target in $ac_config_targe
 do
   case $ac_config_target in
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
-    "makefile") CONFIG_FILES="$CONFIG_FILES makefile" ;;
-    "Makefile.config") CONFIG_FILES="$CONFIG_FILES Makefile.config" ;;
-    "make-bootstrap.sh") CONFIG_FILES="$CONFIG_FILES make-bootstrap.sh" ;;
-    "unit-tests/Makefile") CONFIG_FILES="$CONFIG_FILES unit-tests/Makefile" ;;
+    "$bm_outfiles") CONFIG_FILES="$CONFIG_FILES $bm_outfiles" ;;
 
-  *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
 done
 
@@ -6611,9 +6848,10 @@ fi
 # after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  tmp=
+  tmp= ac_tmp=
   trap 'exit_status=$?
-  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
 ' 0
   trap 'as_fn_exit 1' 1 2 13 15
 }
@@ -6621,12 +6859,13 @@ $debug ||
 
 {
   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
+  test -d "$tmp"
 }  ||
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
-} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
 
 # Set up the scripts for CONFIG_FILES section.
 # No need to generate them if there are no CONFIG_FILES.
@@ -6643,12 +6882,12 @@ if test "x$ac_cr" = x; then
 fi
 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
-  ac_cs_awk_cr='\r'
+  ac_cs_awk_cr='\\r'
 else
   ac_cs_awk_cr=$ac_cr
 fi
 
-echo 'BEGIN {' >"$tmp/subs1.awk" &&
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
 _ACEOF
 
 
@@ -6657,18 +6896,18 @@ _ACEOF
   echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
   echo "_ACEOF"
 } >conf$$subs.sh ||
-  as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   . ./conf$$subs.sh ||
-    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
 
   ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
   if test $ac_delim_n = $ac_delim_num; then
     break
   elif $ac_last_try; then
-    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
@@ -6676,7 +6915,7 @@ done
 rm -f conf$$subs.sh
 
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
 _ACEOF
 sed -n '
 h
@@ -6690,7 +6929,7 @@ s/'"$ac_delim"'$//
 t delim
 :nl
 h
-s/\(.\{148\}\).*/\1/
+s/\(.\{148\}\)..*/\1/
 t more1
 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
 p
@@ -6704,7 +6943,7 @@ s/.\{148\}//
 t nl
 :delim
 h
-s/\(.\{148\}\).*/\1/
+s/\(.\{148\}\)..*/\1/
 t more2
 s/["\\]/\\&/g; s/^/"/; s/$/"/
 p
@@ -6724,7 +6963,7 @@ t delim
 rm -f conf$$subs.awk
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACAWK
-cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
   for (key in S) S_is_set[key] = 1
   FS = ""
 
@@ -6756,21 +6995,29 @@ if sed "s/$ac_cr//" < /dev/null > /dev/n
   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
 else
   cat
-fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
-  || as_fn_error "could not setup config files machinery" "$LINENO" 5
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
 _ACEOF
 
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
 # trailing colons and then remove the whole line if VPATH becomes empty
 # (actually we leave an empty line to preserve line numbers).
 if test "x$srcdir" = x.; then
-  ac_vpsub='/^[         ]*VPATH[        ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[    ]*\):*/\1/
+  ac_vpsub='/^[         ]*VPATH[        ]*=[    ]*/{
+h
+s///
+s/^/:/
+s/[     ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
 s/:*$//
+x
+s/\(=[  ]*\).*/\1/
+G
+s/\n//
 s/^[^=]*=[      ]*$//
 }'
 fi
@@ -6782,7 +7029,7 @@ fi # test -n "$CONFIG_FILES"
 # No need to generate them if there are no CONFIG_HEADERS.
 # This happens for instance with `./config.status Makefile'.
 if test -n "$CONFIG_HEADERS"; then
-cat >"$tmp/defines.awk" <<\_ACAWK ||
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
 BEGIN {
 _ACEOF
 
@@ -6794,11 +7041,11 @@ _ACEOF
 # handling of long lines.
 ac_delim='%!_!# '
 for ac_last_try in false false :; do
-  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_t"; then
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
     break
   elif $ac_last_try; then
-    as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
@@ -6883,7 +7130,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ
 _ACAWK
 _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-  as_fn_error "could not setup config headers machinery" "$LINENO" 5
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
 fi # test -n "$CONFIG_HEADERS"
 
 
@@ -6896,7 +7143,7 @@ do
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
@@ -6915,7 +7162,7 @@ do
     for ac_f
     do
       case $ac_f in
-      -) ac_f="$tmp/stdin";;
+      -) ac_f="$ac_tmp/stdin";;
       *) # Look for the file first in the build tree, then in the source tree
         # (if the path is not absolute).  The absolute path cannot be DOS-style,
         # because $ac_f cannot contain `:'.
@@ -6924,7 +7171,7 @@ do
           [\\/$]*) false;;
           *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
           esac ||
-          as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+          as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
       esac
       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
       as_fn_append ac_file_inputs " '$ac_f'"
@@ -6950,8 +7197,8 @@ $as_echo "$as_me: creating $ac_file" >&6
     esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin" \
-      || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
     esac
     ;;
   esac
@@ -7081,23 +7328,24 @@ s&@abs_top_builddir@&$ac_abs_top_builddi
 s&@INSTALL@&$ac_INSTALL&;t t
 $ac_datarootdir_hack
 "
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
-  || as_fn_error "could not create $ac_file" "$LINENO" 5
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined." >&5
+which seems to be undefined.  Please make sure it is defined" >&5
 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined." >&2;}
+which seems to be undefined.  Please make sure it is defined" >&2;}
 
-  rm -f "$tmp/stdin"
+  rm -f "$ac_tmp/stdin"
   case $ac_file in
-  -) cat "$tmp/out" && rm -f "$tmp/out";;
-  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
   esac \
-  || as_fn_error "could not create $ac_file" "$LINENO" 5
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
  ;;
   :H)
   #
@@ -7106,21 +7354,21 @@ which seems to be undefined.  Please mak
   if test x"$ac_file" != x-; then
     {
       $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
-    } >"$tmp/config.h" \
-      || as_fn_error "could not create $ac_file" "$LINENO" 5
-    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
 $as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
       rm -f "$ac_file"
-      mv "$tmp/config.h" "$ac_file" \
-       || as_fn_error "could not create $ac_file" "$LINENO" 5
+      mv "$ac_tmp/config.h" "$ac_file" \
+       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
     fi
   else
     $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
-      || as_fn_error "could not create -" "$LINENO" 5
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
   fi
  ;;
 
@@ -7135,7 +7383,7 @@ _ACEOF
 ac_clean_files=$ac_clean_files_save
 
 test $ac_write_fail = 0 ||
-  as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
 
 
 # configure is writing to config.log, and then calls config.status.
@@ -7156,14 +7404,13 @@ if test "$no_create" != yes; then
   exec 5>>config.log
   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
   # would make configure fail if this is the last instruction.
-  $ac_cs_success || as_fn_exit $?
+  $ac_cs_success || as_fn_exit 1
 fi
 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
-
 cat <<EOF
 
 You can now run

Index: pkgsrc/devel/bmake/files/configure.in
diff -u pkgsrc/devel/bmake/files/configure.in:1.14 pkgsrc/devel/bmake/files/configure.in:1.15
--- pkgsrc/devel/bmake/files/configure.in:1.14  Tue Aug 15 15:54:06 2017
+++ pkgsrc/devel/bmake/files/configure.in       Sun May 24 11:09:43 2020
@@ -1,11 +1,11 @@
 dnl
 dnl RCSid:
-dnl    $Id: configure.in,v 1.14 2017/08/15 15:54:06 brook Exp $
+dnl    $Id: configure.in,v 1.15 2020/05/24 11:09:43 nia Exp $
 dnl
 dnl Process this file with autoconf to produce a configure script
 dnl
 AC_PREREQ(2.50)
-AC_INIT([bmake], [20140214], [sjg%NetBSD.org@localhost])
+AC_INIT([bmake], [20200418], [sjg%NetBSD.org@localhost])
 AC_CONFIG_HEADERS(config.h)
 
 dnl make srcdir absolute
@@ -16,6 +16,7 @@ esac
 
 dnl get _MAKE_VERSION
 . $srcdir/VERSION
+OS=`uname -s`
 
 dnl
 AC_ARG_WITH(defshell,
@@ -32,6 +33,17 @@ no)    ;;
        ;;
        esac])
 dnl
+case "$OS" in
+CYGWIN*|MINGW*) use_makefile=no;;
+*) use_makefile=yes;;
+esac
+AC_ARG_WITH(makefile,
+[ --without-makefile dissable use of generated makefile],
+[case "${withval}" in
+yes|no) use_makefile=${withval};;
+*) AC_MSG_ERROR(bad value ${withval} given for makefile) ;;
+esac])
+dnl
 use_meta=yes
 AC_ARG_WITH(meta,
 [ --without-meta dissable use of meta-mode],
@@ -41,30 +53,41 @@ yes|no) use_meta=${withval};;
 esac])
 dnl
 AC_ARG_WITH(filemon,
-[ --with-filemon=path/filemon.h indicate path to filemon.h for meta-mode],
+[ --with-filemon={no,dev,ktrace,path/filemon.h} indicate filemon method for meta-mode. Path to filemon.h implies dev],
 [ case "/${withval}" in
-/no|*/filemon.h) filemon_h="${withval}";;
+/no) use_filemon=no;;
+/*trace) filemon_h=no use_filemon="${withval}";;
+*/filemon.h) filemon_h="${withval}";;
 */filemon*) filemon_h="${withval}/filemon.h";;
 *) AC_MSG_ERROR(bad value ${withval} given for filemon) ;;
 esac],
 [
-OS=`uname -s`
-for d in "/usr/include/dev/filemon" "$prefix/include/dev/filemon" "$srcdir/filemon" "$srcdir/../filemon" "$srcdir/../../sys/dev/filemon"
-do
-       for x in "/$OS" ""
-       do
-               filemon_h="$d$x/filemon.h"
-               test -s "$filemon_h" && break
-       done
-       test -s "$filemon_h" && break
-done
-test -s "${filemon_h:-/dev/null}" || filemon_h=no
+case "$OS" in
+NetBSD) filemon_h=no use_filemon=ktrace;;
+*)
+    for d in "/usr/include/dev/filemon" "$prefix/include/dev/filemon" "$srcdir/../../sys/dev/filemon"
+    do  
+        for x in "/$OS" ""
+        do
+            filemon_h="$d$x/filemon.h"
+            test -s "$filemon_h" && break
+        done
+        test -s "$filemon_h" && { use_filemon=dev; break; }
+    done
+    ;;
+esac
+use_filemon=${use_filemon:-no}
+case "$use_filemon" in
+dev) ;;
+*) filemon_h=no;;
+esac
 ])
-dnl echo "Note: use_meta=$use_meta filemon_h=$filemon_h" >&6
+dnl echo "Note: use_meta=$use_meta use_filemon=$use_filemon filemon_h=$filemon_h" >&6
 case "$use_meta" in
 yes)
-       case "$filemon_h" in
-       *.h) echo "Using: filemon=$filemon_h" >&6;;
+       case "$use_filemon" in
+       no) ;;
+       *) echo "Using: filemon_${use_filemon}.c" >&6;;
        esac
        ;;
 esac
@@ -104,10 +127,20 @@ AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
 AC_HEADER_DIRENT
 dnl Keep this list sorted
+AC_CHECK_HEADERS(sys/param.h)
+dnl On BSDi at least we really need sys/param.h for sys/sysctl.h
+AC_CHECK_HEADERS([sys/sysctl.h], [], [],
+[#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+# endif
+])
+
 AC_CHECK_HEADERS( \
        ar.h \
        err.h \
        fcntl.h \
+       libgen.h \
+       limits.h \
        paths.h \
        poll.h \
        ranlib.h \
@@ -115,7 +148,6 @@ AC_CHECK_HEADERS( \
        sys/mman.h \
        sys/select.h \
        sys/socket.h \
-       sys/sysctl.h \
        sys/time.h \
        sys/uio.h \
        unistd.h \
@@ -142,9 +174,11 @@ dnl Checks for typedefs, structures, and
 AC_C___ATTRIBUTE__
 AC_C_BIGENDIAN
 AC_C_CONST
+AC_TYPE_MODE_T
 AC_TYPE_OFF_T
 AC_TYPE_PID_T
 AC_TYPE_SIZE_T
+AC_TYPE_UINT32_T
 AC_DECL_SYS_SIGLIST
 AC_HEADER_TIME
 AC_STRUCT_TM
@@ -377,10 +411,14 @@ AC_SUBST(INSTALL)
 AC_SUBST(GCC)
 AC_SUBST(diff_u)
 AC_SUBST(use_meta)
+AC_SUBST(use_filemon)
 AC_SUBST(filemon_h)
 AC_SUBST(_MAKE_VERSION)
-AC_OUTPUT(makefile Makefile.config make-bootstrap.sh unit-tests/Makefile)
-
+bm_outfiles="Makefile.config unit-tests/Makefile.config make-bootstrap.sh"
+if test $use_makefile = yes; then
+   bm_outfiles="makefile $bm_outfiles"
+fi
+AC_OUTPUT($bm_outfiles)
 cat <<EOF
 
 You can now run
Index: pkgsrc/devel/bmake/files/main.c
diff -u pkgsrc/devel/bmake/files/main.c:1.14 pkgsrc/devel/bmake/files/main.c:1.15
--- pkgsrc/devel/bmake/files/main.c:1.14        Sun Jan 24 16:14:44 2016
+++ pkgsrc/devel/bmake/files/main.c     Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.14 2016/01/24 16:14:44 jperkin Exp $        */
+/*     $NetBSD: main.c,v 1.15 2020/05/24 11:09:43 nia Exp $    */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.14 2016/01/24 16:14:44 jperkin Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.15 2020/05/24 11:09:43 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
@@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)main.c     8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.14 2016/01/24 16:14:44 jperkin Exp $");
+__RCSID("$NetBSD: main.c,v 1.15 2020/05/24 11:09:43 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -125,7 +125,6 @@ __RCSID("$NetBSD: main.c,v 1.14 2016/01/
 #include "wait.h"
 
 #include <errno.h>
-#include <fcntl.h>
 #include <signal.h>
 #include <stdarg.h>
 #include <stdio.h>
@@ -156,10 +155,13 @@ Lst                       create;         /* Targets to be made */
 time_t                 now;            /* Time at start of make */
 GNode                  *DEFAULT;       /* .DEFAULT node */
 Boolean                        allPrecious;    /* .PRECIOUS given on line by itself */
+Boolean                        deleteOnError;  /* .DELETE_ON_ERROR: set */
 
 static Boolean         noBuiltins;     /* -r flag */
 static Lst             makefiles;      /* ordered list of makefiles to read */
-static Boolean         printVars;      /* print value of one or more vars */
+static int             printVars;      /* -[vV] argument */
+#define COMPAT_VARS 1
+#define EXPAND_VARS 2
 static Lst             variables;      /* list of variables to print */
 int                    maxJobs;        /* -j argument */
 static int             maxJobTokens;   /* -j argument */
@@ -172,6 +174,7 @@ Boolean                     keepgoing;      /* -k flag */
 Boolean                        queryFlag;      /* -q flag */
 Boolean                        touchFlag;      /* -t flag */
 Boolean                        enterFlag;      /* -w flag */
+Boolean                        enterFlagObj;   /* -w and objdir != srcdir */
 Boolean                        ignoreErrors;   /* -i flag */
 Boolean                        beSilent;       /* -s flag */
 Boolean                        oldVars;        /* variable substitution style */
@@ -186,6 +189,7 @@ static const char * tracefile;
 static void            MainParseArgs(int, char **);
 static int             ReadMakefile(const void *, const void *);
 static void            usage(void) MAKE_ATTR_DEAD;
+static void            purge_cached_realpaths(void);
 
 static Boolean         ignorePWD;      /* if we use -C, PWD is meaningless */
 static char objdir[MAXPATHLEN + 1];    /* where we chdir'ed to */
@@ -195,6 +199,8 @@ char *makeDependfile;
 pid_t myPid;
 int makelevel;
 
+FILE *debug_file;
+
 Boolean forceJobs = FALSE;
 
 /*
@@ -335,7 +341,7 @@ parse_debug_options(const char *argvalue
                                goto debug_setbuf;
                        }
                        len = strlen(modules);
-                       fname = malloc(len + 20);
+                       fname = bmake_malloc(len + 20);
                        memcpy(fname, modules, len + 1);
                        /* Let the filename be modified by the pid */
                        if (strcmp(fname + len - 3, ".%d") == 0)
@@ -366,6 +372,32 @@ debug_setbuf:
        }
 }
 
+/*
+ * does path contain any relative components
+ */
+static int
+is_relpath(const char *path)
+{
+       const char *cp;
+
+       if (path[0] != '/')
+               return TRUE;
+       cp = path;
+       do {
+               cp = strstr(cp, "/.");
+               if (!cp)
+                       break;
+               cp += 2;
+               if (cp[0] == '/' || cp[0] == '\0')
+                       return TRUE;
+               else if (cp[0] == '.') {
+                       if (cp[1] == '/' || cp[1] == '\0')
+                               return TRUE;
+               }
+       } while (cp);
+       return FALSE;
+}
+
 /*-
  * MainParseArgs --
  *     Parse a given argument vector. Called from main() and from
@@ -388,11 +420,12 @@ MainParseArgs(int argc, char **argv)
        int arginc;
        char *argvalue;
        const char *getopt_def;
+       struct stat sa, sb;
        char *optscan;
        Boolean inOption, dashDash = FALSE;
        char found_path[MAXPATHLEN + 1];        /* for searching for sys.mk */
 
-#define OPTFLAGS "BC:D:I:J:NST:V:WXd:ef:ij:km:nqrstw"
+#define OPTFLAGS "BC:D:I:J:NST:V:WXd:ef:ij:km:nqrstv:w"
 /* Can't actually use getopt(3) because rescanning is not portable */
 
        getopt_def = OPTFLAGS;
@@ -456,6 +489,12 @@ rearg:     
                                (void)fprintf(stderr, "%s: %s.\n", progname, strerror(errno));
                                exit(2);
                        }
+                       if (!is_relpath(argvalue) &&
+                           stat(argvalue, &sa) != -1 &&
+                           stat(curdir, &sb) != -1 &&
+                           sa.st_ino == sb.st_ino &&
+                           sa.st_dev == sb.st_dev)
+                               strncpy(curdir, argvalue, MAXPATHLEN);
                        ignorePWD = TRUE;
                        break;
                case 'D':
@@ -511,8 +550,9 @@ rearg:      
                        Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL);
                        break;
                case 'V':
+               case 'v':
                        if (argvalue == NULL) goto noarg;
-                       printVars = TRUE;
+                       printVars = c == 'v' ? EXPAND_VARS : COMPAT_VARS;
                        (void)Lst_AtEnd(variables, argvalue);
                        Var_Append(MAKEFLAGS, "-V", VAR_GLOBAL);
                        Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL);
@@ -695,8 +735,7 @@ Main_ParseArgLine(const char *line)
 #endif
        buf = bmake_malloc(len = strlen(line) + strlen(argv0) + 2);
        (void)snprintf(buf, len, "%s %s", argv0, line);
-       if (p1)
-               free(p1);
+       free(p1);
 
        argv = brk_string(buf, &argc, TRUE, &args);
        if (argv == NULL) {
@@ -712,22 +751,22 @@ Main_ParseArgLine(const char *line)
 }
 
 Boolean
-Main_SetObjdir(const char *path)
+Main_SetObjdir(const char *fmt, ...)
 {
        struct stat sb;
-       char *p = NULL;
+       char *path;
        char buf[MAXPATHLEN + 1];
+       char buf2[MAXPATHLEN + 1];
        Boolean rc = FALSE;
+       va_list ap;
 
-       /* expand variable substitutions */
-       if (strchr(path, '$') != 0) {
-               snprintf(buf, MAXPATHLEN, "%s", path);
-               path = p = Var_Subst(NULL, buf, VAR_GLOBAL, 0);
-       }
+       va_start(ap, fmt);
+       vsnprintf(path = buf, MAXPATHLEN, fmt, ap);
+       va_end(ap);
 
        if (path[0] != '/') {
-               snprintf(buf, MAXPATHLEN, "%s/%s", curdir, path);
-               path = buf;
+               snprintf(buf2, MAXPATHLEN, "%s/%s", curdir, path);
+               path = buf2;
        }
 
        /* look for the directory and try to chdir there */
@@ -740,15 +779,39 @@ Main_SetObjdir(const char *path)
                        Var_Set(".OBJDIR", objdir, VAR_GLOBAL, 0);
                        setenv("PWD", objdir, 1);
                        Dir_InitDot();
+                       purge_cached_realpaths();
                        rc = TRUE;
+                       if (enterFlag && strcmp(objdir, curdir) != 0)
+                               enterFlagObj = TRUE;
                }
        }
 
-       if (p)
-               free(p);
        return rc;
 }
 
+static Boolean
+Main_SetVarObjdir(const char *var, const char *suffix)
+{
+       char *p, *path, *xpath;
+
+       if ((path = Var_Value(var, VAR_CMD, &p)) == NULL ||
+           *path == '\0')
+               return FALSE;
+
+       /* expand variable substitutions */
+       if (strchr(path, '$') != 0)
+               xpath = Var_Subst(NULL, path, VAR_GLOBAL, VARF_WANTRES);
+       else
+               xpath = path;
+
+       (void)Main_SetObjdir("%s%s", xpath, suffix);
+
+       if (xpath != path)
+               free(xpath);
+       free(p);
+       return TRUE;
+}
+
 /*-
  * ReadAllMakefiles --
  *     wrapper around ReadMakefile() to read all.
@@ -803,7 +866,8 @@ MakeMode(const char *mode)
     char *mp = NULL;
 
     if (!mode)
-       mode = mp = Var_Subst(NULL, "${" MAKE_MODE ":tl}", VAR_GLOBAL, 0);
+       mode = mp = Var_Subst(NULL, "${" MAKE_MODE ":tl}",
+                             VAR_GLOBAL, VARF_WANTRES);
 
     if (mode && *mode) {
        if (strstr(mode, "compat")) {
@@ -815,8 +879,91 @@ MakeMode(const char *mode)
            meta_mode_init(mode);
 #endif
     }
-    if (mp)
-       free(mp);
+
+    free(mp);
+}
+
+static void
+doPrintVars(void)
+{
+       LstNode ln;
+       Boolean expandVars;
+
+       if (printVars == EXPAND_VARS)
+               expandVars = TRUE;
+       else if (debugVflag)
+               expandVars = FALSE;
+       else
+               expandVars = getBoolean(".MAKE.EXPAND_VARIABLES", FALSE);
+
+       for (ln = Lst_First(variables); ln != NULL;
+           ln = Lst_Succ(ln)) {
+               char *var = (char *)Lst_Datum(ln);
+               char *value;
+               char *p1;
+               
+               if (strchr(var, '$')) {
+                       value = p1 = Var_Subst(NULL, var, VAR_GLOBAL,
+                           VARF_WANTRES);
+               } else if (expandVars) {
+                       char tmp[128];
+                       int len = snprintf(tmp, sizeof(tmp), "${%s}", var);
+                                                       
+                       if (len >= (int)sizeof(tmp))
+                               Fatal("%s: variable name too big: %s",
+                                   progname, var);
+                       value = p1 = Var_Subst(NULL, tmp, VAR_GLOBAL,
+                           VARF_WANTRES);
+               } else {
+                       value = Var_Value(var, VAR_GLOBAL, &p1);
+               }
+               printf("%s\n", value ? value : "");
+               free(p1);
+       }
+}
+
+static Boolean
+runTargets(void)
+{
+       Lst targs;      /* target nodes to create -- passed to Make_Init */
+       Boolean outOfDate;      /* FALSE if all targets up to date */
+
+       /*
+        * Have now read the entire graph and need to make a list of
+        * targets to create. If none was given on the command line,
+        * we consult the parsing module to find the main target(s)
+        * to create.
+        */
+       if (Lst_IsEmpty(create))
+               targs = Parse_MainName();
+       else
+               targs = Targ_FindList(create, TARG_CREATE);
+
+       if (!compatMake) {
+               /*
+                * Initialize job module before traversing the graph
+                * now that any .BEGIN and .END targets have been read.
+                * This is done only if the -q flag wasn't given
+                * (to prevent the .BEGIN from being executed should
+                * it exist).
+                */
+               if (!queryFlag) {
+                       Job_Init();
+                       jobsRunning = TRUE;
+               }
+
+               /* Traverse the graph, checking on all the targets */
+               outOfDate = Make_Run(targs);
+       } else {
+               /*
+                * Compat_Init will take care of creating all the
+                * targets as well as initializing the module.
+                */
+               Compat_Run(targs);
+               outOfDate = FALSE;
+       }
+       Lst_Destroy(targs, NULL);
+       return outOfDate;
 }
 
 /*-
@@ -839,8 +986,7 @@ MakeMode(const char *mode)
 int
 main(int argc, char **argv)
 {
-       Lst targs;      /* target nodes to create -- passed to Make_Init */
-       Boolean outOfDate = FALSE;      /* FALSE if all targets up to date */
+       Boolean outOfDate;      /* FALSE if all targets up to date */
        struct stat sb, sa;
        char *p1, *path;
        char mdpath[MAXPATHLEN];
@@ -916,14 +1062,6 @@ main(int argc, char **argv)
 #endif
        }
 
-       /*
-        * Hardcode default pkgsrc MACHINE_ARCH.  There is only one legitimate
-        * way to override the variable, and that is through the environment,
-        * handled above.  We need to use PKGSRC_MACHINE_ARCH as some OS define
-        * MACHINE_ARCH in their system headers.
-        */
-       machine_arch = PKGSRC_MACHINE_ARCH;
-
        if (!machine_arch) {
 #if defined(MAKE_NATIVE) && defined(HAVE_SYSCTL) && defined(CTL_HW) && defined(HW_MACHINE_ARCH)
            static char machine_arch_buf[sizeof(utsname.machine)];
@@ -977,7 +1115,7 @@ main(int argc, char **argv)
 
        create = Lst_Init(FALSE);
        makefiles = Lst_Init(FALSE);
-       printVars = FALSE;
+       printVars = 0;
        debugVflag = FALSE;
        variables = Lst_Init(FALSE);
        beSilent = FALSE;               /* Print commands as executed */
@@ -986,6 +1124,7 @@ main(int argc, char **argv)
        noRecursiveExecute = FALSE;     /* Execute all .MAKE targets */
        keepgoing = FALSE;              /* Stop on error */
        allPrecious = FALSE;            /* Remove targets when interrupted */
+       deleteOnError = FALSE;          /* Historical default behavior */
        queryFlag = FALSE;              /* This is not just a check-run */
        noBuiltins = FALSE;             /* Read the built-in rules */
        touchFlag = FALSE;              /* Actually update targets */
@@ -1021,7 +1160,7 @@ main(int argc, char **argv)
            /*
             * A relative path, canonicalize it.
             */
-           p1 = realpath(argv[0], mdpath);
+           p1 = cached_realpath(argv[0], mdpath);
            if (!p1 || *p1 != '/' || stat(p1, &sb) < 0) {
                p1 = argv[0];           /* realpath failed */
            }
@@ -1060,6 +1199,8 @@ main(int argc, char **argv)
 #ifdef USE_META
        meta_init();
 #endif
+       Dir_Init(NULL);         /* Dir_* safe to call from MainParseArgs */
+
        /*
         * First snag any flags out of the MAKE environment variable.
         * (Note this is *not* MAKEFLAGS since /bin/make uses that and it's
@@ -1135,38 +1276,21 @@ main(int argc, char **argv)
         * MAKEOBJDIR is set in the environment, try only that value
         * and fall back to .CURDIR if it does not exist.
         *
-        * Otherwise, try _PATH_OBJDIR.MACHINE, _PATH_OBJDIR, and
-        * finally _PATH_OBJDIRPREFIX`pwd`, in that order.  If none
+        * Otherwise, try _PATH_OBJDIR.MACHINE-MACHINE_ARCH, _PATH_OBJDIR.MACHINE,
+        * and * finally _PATH_OBJDIRPREFIX`pwd`, in that order.  If none
         * of these paths exist, just use .CURDIR.
         */
        Dir_Init(curdir);
-       (void)Main_SetObjdir(curdir);
+       (void)Main_SetObjdir("%s", curdir);
 
-       if ((path = Var_Value("MAKEOBJDIRPREFIX", VAR_CMD, &p1)) != NULL) {
-               (void)snprintf(mdpath, MAXPATHLEN, "%s%s", path, curdir);
-               (void)Main_SetObjdir(mdpath);
-               free(p1);
-       } else if ((path = Var_Value("MAKEOBJDIR", VAR_CMD, &p1)) != NULL) {
-               (void)Main_SetObjdir(path);
-               free(p1);
-       } else {
-               (void)snprintf(mdpath, MAXPATHLEN, "%s.%s", _PATH_OBJDIR, machine);
-               if (!Main_SetObjdir(mdpath) && !Main_SetObjdir(_PATH_OBJDIR)) {
-                       (void)snprintf(mdpath, MAXPATHLEN, "%s%s", 
-                                       _PATH_OBJDIRPREFIX, curdir);
-                       (void)Main_SetObjdir(mdpath);
-               }
-       }
+       if (!Main_SetVarObjdir("MAKEOBJDIRPREFIX", curdir) &&
+           !Main_SetVarObjdir("MAKEOBJDIR", "") &&
+           !Main_SetObjdir("%s.%s-%s", _PATH_OBJDIR, machine, machine_arch) &&
+           !Main_SetObjdir("%s.%s", _PATH_OBJDIR, machine) &&
+           !Main_SetObjdir("%s", _PATH_OBJDIR))
+               (void)Main_SetObjdir("%s%s", _PATH_OBJDIRPREFIX, curdir);
 
        /*
-        * Be compatible if user did not specify -j and did not explicitly
-        * turned compatibility on
-        */
-       if (!compatMake && !forceJobs) {
-               compatMake = TRUE;
-       }
-       
-       /*
         * Initialize archive, target and suffix modules in preparation for
         * parsing the makefile(s)
         */
@@ -1257,7 +1381,7 @@ main(int argc, char **argv)
                            (char *)Lst_Datum(ln));
        } else {
            p1 = Var_Subst(NULL, "${" MAKEFILE_PREFERENCE "}",
-               VAR_CMD, 0);
+               VAR_CMD, VARF_WANTRES);
            if (p1) {
                (void)str2Lst_Append(makefiles, p1, NULL);
                (void)Lst_Find(makefiles, NULL, ReadMakefile);
@@ -1268,17 +1392,49 @@ main(int argc, char **argv)
        /* In particular suppress .depend for '-r -V .OBJDIR -f /dev/null' */
        if (!noBuiltins || !printVars) {
            makeDependfile = Var_Subst(NULL, "${.MAKE.DEPENDFILE:T}",
-               VAR_CMD, 0);
+               VAR_CMD, VARF_WANTRES);
            doing_depend = TRUE;
            (void)ReadMakefile(makeDependfile, NULL);
            doing_depend = FALSE;
        }
 
+       if (enterFlagObj)
+               printf("%s: Entering directory `%s'\n", progname, objdir);
+       
        MakeMode(NULL);
 
        Var_Append("MFLAGS", Var_Value(MAKEFLAGS, VAR_GLOBAL, &p1), VAR_GLOBAL);
-       if (p1)
-           free(p1);
+       free(p1);
+
+       if (!forceJobs && !compatMake &&
+           Var_Exists(".MAKE.JOBS", VAR_GLOBAL)) {
+           char *value;
+           int n;
+
+           value = Var_Subst(NULL, "${.MAKE.JOBS}", VAR_GLOBAL, VARF_WANTRES);
+           n = strtol(value, NULL, 0);
+           if (n < 1) {
+               (void)fprintf(stderr, "%s: illegal value for .MAKE.JOBS -- must be positive integer!\n",
+                   progname);
+               exit(1);
+           }
+           if (n != maxJobs) {
+               Var_Append(MAKEFLAGS, "-j", VAR_GLOBAL);
+               Var_Append(MAKEFLAGS, value, VAR_GLOBAL);
+           }
+           maxJobs = n;
+           maxJobTokens = maxJobs;
+           forceJobs = TRUE;
+           free(value);
+       }
+
+       /*
+        * Be compatible if user did not specify -j and did not explicitly
+        * turned compatibility on
+        */
+       if (!compatMake && !forceJobs) {
+           compatMake = TRUE;
+       }
 
        if (!compatMake)
            Job_ServerStart(maxJobTokens, jp_0, jp_1);
@@ -1286,8 +1442,9 @@ main(int argc, char **argv)
            fprintf(debug_file, "job_pipe %d %d, maxjobs %d, tokens %d, compat %d\n",
                jp_0, jp_1, maxJobs, maxJobTokens, compatMake);
 
-       Main_ExportMAKEFLAGS(TRUE);     /* initial export */
-
+       if (!printVars)
+           Main_ExportMAKEFLAGS(TRUE); /* initial export */
+       
        /*
         * For compatibility, look at the directories in the VPATH variable
         * and add them to the search path, if the variable is defined. The
@@ -1303,7 +1460,7 @@ main(int argc, char **argv)
                 */
                static char VPATH[] = "${VPATH}";
 
-               vpath = Var_Subst(NULL, VPATH, VAR_CMD, FALSE);
+               vpath = Var_Subst(NULL, VPATH, VAR_CMD, VARF_WANTRES);
                path = vpath;
                do {
                        /* skip to end of directory */
@@ -1337,72 +1494,13 @@ main(int argc, char **argv)
 
        /* print the values of any variables requested by the user */
        if (printVars) {
-               LstNode ln;
-               Boolean expandVars;
-
-               if (debugVflag)
-                       expandVars = FALSE;
-               else
-                       expandVars = getBoolean(".MAKE.EXPAND_VARIABLES", FALSE);
-               for (ln = Lst_First(variables); ln != NULL;
-                   ln = Lst_Succ(ln)) {
-                       char *var = (char *)Lst_Datum(ln);
-                       char *value;
-                       
-                       if (strchr(var, '$')) {
-                               value = p1 = Var_Subst(NULL, var, VAR_GLOBAL, 0);
-                       } else if (expandVars) {
-                               char tmp[128];
-                                                               
-                               if (snprintf(tmp, sizeof(tmp), "${%s}", var) >= (int)(sizeof(tmp)))
-                                       Fatal("%s: variable name too big: %s",
-                                             progname, var);
-                               value = p1 = Var_Subst(NULL, tmp, VAR_GLOBAL, 0);
-                       } else {
-                               value = Var_Value(var, VAR_GLOBAL, &p1);
-                       }
-                       printf("%s\n", value ? value : "");
-                       if (p1)
-                               free(p1);
-               }
+               doPrintVars();
+               outOfDate = FALSE;
        } else {
-               /*
-                * Have now read the entire graph and need to make a list of
-                * targets to create. If none was given on the command line,
-                * we consult the parsing module to find the main target(s)
-                * to create.
-                */
-               if (Lst_IsEmpty(create))
-                       targs = Parse_MainName();
-               else
-                       targs = Targ_FindList(create, TARG_CREATE);
-
-               if (!compatMake) {
-                       /*
-                        * Initialize job module before traversing the graph
-                        * now that any .BEGIN and .END targets have been read.
-                        * This is done only if the -q flag wasn't given
-                        * (to prevent the .BEGIN from being executed should
-                        * it exist).
-                        */
-                       if (!queryFlag) {
-                               Job_Init();
-                               jobsRunning = TRUE;
-                       }
-
-                       /* Traverse the graph, checking on all the targets */
-                       outOfDate = Make_Run(targs);
-               } else {
-                       /*
-                        * Compat_Init will take care of creating all the
-                        * targets as well as initializing the module.
-                        */
-                       Compat_Run(targs);
-               }
+               outOfDate = runTargets();
        }
 
 #ifdef CLEANUP
-       Lst_Destroy(targs, NULL);
        Lst_Destroy(variables, NULL);
        Lst_Destroy(makefiles, NULL);
        Lst_Destroy(create, (FreeProc *)free);
@@ -1414,9 +1512,14 @@ main(int argc, char **argv)
 
        Trace_Log(MAKEEND, 0);
 
+       if (enterFlagObj)
+               printf("%s: Leaving directory `%s'\n", progname, objdir);
        if (enterFlag)
                printf("%s: Leaving directory `%s'\n", progname, curdir);
 
+#ifdef USE_META
+       meta_finish();
+#endif
        Suff_End();
         Targ_End();
        Arch_End();
@@ -1485,8 +1588,7 @@ ReadMakefile(const void *p, const void *
                        name = Dir_FindFile(fname,
                                Lst_IsEmpty(sysIncPath) ? defIncPath : sysIncPath);
                if (!name || (fd = open(name, O_RDONLY)) == -1) {
-                       if (name)
-                               free(name);
+                       free(name);
                        free(path);
                        return(-1);
                }
@@ -1857,10 +1959,70 @@ usage(void)
 "usage: %s [-BeikNnqrstWwX] \n\
             [-C directory] [-D variable] [-d flags] [-f makefile]\n\
             [-I directory] [-J private] [-j max_jobs] [-m directory] [-T file]\n\
-            [-V variable] [variable=value] [target ...]\n", progname);
+            [-V variable] [-v variable] [variable=value] [target ...]\n",
+           progname);
        exit(2);
 }
 
+/*
+ * realpath(3) can get expensive, cache results...
+ */
+static GNode *cached_realpaths = NULL;
+
+static GNode *
+get_cached_realpaths(void)
+{
+
+    if (!cached_realpaths) {
+       cached_realpaths = Targ_NewGN("Realpath");
+#ifndef DEBUG_REALPATH_CACHE
+       cached_realpaths->flags = INTERNAL;
+#endif
+    }
+
+    return cached_realpaths;
+}
+
+/* purge any relative paths */
+static void
+purge_cached_realpaths(void)
+{
+    GNode *cache = get_cached_realpaths();
+    Hash_Entry *he, *nhe;
+    Hash_Search hs;
+
+    he = Hash_EnumFirst(&cache->context, &hs);
+    while (he) {
+       nhe = Hash_EnumNext(&hs);
+       if (he->name[0] != '/') {
+           if (DEBUG(DIR))
+               fprintf(stderr, "cached_realpath: purging %s\n", he->name);
+           Hash_DeleteEntry(&cache->context, he);
+       }
+       he = nhe;
+    }
+}
+
+char *
+cached_realpath(const char *pathname, char *resolved)
+{
+    GNode *cache;
+    char *rp, *cp;
+
+    if (!pathname || !pathname[0])
+       return NULL;
+
+    cache = get_cached_realpaths();
+
+    if ((rp = Var_Value(pathname, cache, &cp)) != NULL) {
+       /* a hit */
+       strlcpy(resolved, rp, MAXPATHLEN);
+    } else if ((rp = realpath(pathname, resolved)) != NULL) {
+       Var_Set(pathname, rp, cache, 0);
+    }
+    free(cp);
+    return rp ? resolved : NULL;
+}
 
 int
 PrintAddr(void *a, void *b)
@@ -1870,6 +2032,14 @@ PrintAddr(void *a, void *b)
 }
 
 
+static int
+addErrorCMD(void *cmdp, void *gnp MAKE_ATTR_UNUSED)
+{
+    if (cmdp == NULL)
+       return 1;                       /* stop */
+    Var_Append(".ERROR_CMD", cmdp, VAR_GLOBAL);
+    return 0;
+}
 
 void
 PrintOnError(GNode *gn, const char *s)
@@ -1890,15 +2060,19 @@ PrintOnError(GNode *gn, const char *s)
         * We can print this even if there is no .ERROR target.
         */
        Var_Set(".ERROR_TARGET", gn->name, VAR_GLOBAL, 0);
+       Var_Delete(".ERROR_CMD", VAR_GLOBAL);
+       Lst_ForEach(gn->commands, addErrorCMD, gn);
     }
     strncpy(tmp, "${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'\n@}",
            sizeof(tmp) - 1);
-    cp = Var_Subst(NULL, tmp, VAR_GLOBAL, 0);
+    cp = Var_Subst(NULL, tmp, VAR_GLOBAL, VARF_WANTRES);
     if (cp) {
        if (*cp)
            printf("%s", cp);
        free(cp);
     }
+    fflush(stdout);
+
     /*
      * Finally, see if there is a .ERROR target, and run it if so.
      */
@@ -1922,7 +2096,7 @@ Main_ExportMAKEFLAGS(Boolean first)
     
     strncpy(tmp, "${.MAKEFLAGS} ${.MAKEOVERRIDES:O:u:@v@$v=${$v:Q}@}",
            sizeof(tmp));
-    s = Var_Subst(NULL, tmp, VAR_CMD, 0);
+    s = Var_Subst(NULL, tmp, VAR_CMD, VARF_WANTRES);
     if (s && *s) {
 #ifdef POSIX
        setenv("MAKEFLAGS", s, 1);
@@ -1944,7 +2118,8 @@ getTmpdir(void)
         * Honor $TMPDIR but only if it is valid.
         * Ensure it ends with /.
         */
-       tmpdir = Var_Subst(NULL, "${TMPDIR:tA:U" _PATH_TMP "}/", VAR_GLOBAL, 0);
+       tmpdir = Var_Subst(NULL, "${TMPDIR:tA:U" _PATH_TMP "}/", VAR_GLOBAL,
+                          VARF_WANTRES);
        if (stat(tmpdir, &st) < 0 || !S_ISDIR(st.st_mode)) {
            free(tmpdir);
            tmpdir = bmake_strdup(_PATH_TMP);
@@ -1984,6 +2159,44 @@ mkTempFile(const char *pattern, char **f
     return fd;
 }
 
+/*
+ * Convert a string representation of a boolean.
+ * Anything that looks like "No", "False", "Off", "0" etc,
+ * is FALSE, otherwise TRUE.
+ */
+Boolean
+s2Boolean(const char *s, Boolean bf)
+{
+    if (s) {
+       switch(*s) {
+       case '\0':                      /* not set - the default wins */
+           break;
+       case '0':
+       case 'F':
+       case 'f':
+       case 'N':
+       case 'n':
+           bf = FALSE;
+           break;
+       case 'O':
+       case 'o':
+           switch (s[1]) {
+           case 'F':
+           case 'f':
+               bf = FALSE;
+               break;
+           default:
+               bf = TRUE;
+               break;
+           }
+           break;
+       default:
+           bf = TRUE;
+           break;
+       }
+    }
+    return (bf);
+}
 
 /*
  * Return a Boolean based on setting of a knob.
@@ -1998,32 +2211,11 @@ getBoolean(const char *name, Boolean bf)
     char tmp[64];
     char *cp;
 
-    if (snprintf(tmp, sizeof(tmp), "${%s:tl}", name) < (int)(sizeof(tmp))) {
-       cp = Var_Subst(NULL, tmp, VAR_GLOBAL, 0);
+    if (snprintf(tmp, sizeof(tmp), "${%s:U:tl}", name) < (int)(sizeof(tmp))) {
+       cp = Var_Subst(NULL, tmp, VAR_GLOBAL, VARF_WANTRES);
 
        if (cp) {
-           switch(*cp) {
-           case '\0':                  /* not set - the default wins */
-               break;
-           case '0':
-           case 'f':
-           case 'n':
-               bf = FALSE;
-               break;
-           case 'o':
-               switch (cp[1]) {
-               case 'f':
-                   bf = FALSE;
-                   break;
-               default:
-                   bf = TRUE;
-                   break;
-               }
-               break;
-           default:
-               bf = TRUE;
-               break;
-           }
+           bf = s2Boolean(cp, bf);
            free(cp);
        }
     }
Index: pkgsrc/devel/bmake/files/util.c
diff -u pkgsrc/devel/bmake/files/util.c:1.14 pkgsrc/devel/bmake/files/util.c:1.15
--- pkgsrc/devel/bmake/files/util.c:1.14        Sat Jul  4 07:12:08 2015
+++ pkgsrc/devel/bmake/files/util.c     Sun May 24 11:09:43 2020
@@ -1,9 +1,9 @@
-/*     $NetBSD: util.c,v 1.14 2015/07/04 07:12:08 ryoon Exp $  */
+/*     $NetBSD: util.c,v 1.15 2020/05/24 11:09:43 nia Exp $    */
 
 /*
  * Missing stuff from OS's
  *
- *     $Id: util.c,v 1.14 2015/07/04 07:12:08 ryoon Exp $
+ *     $Id: util.c,v 1.15 2020/05/24 11:09:43 nia Exp $
  */
 #if defined(__MINT__) || defined(__linux__)
 #include <signal.h>
@@ -12,10 +12,10 @@
 #include "make.h"
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: util.c,v 1.14 2015/07/04 07:12:08 ryoon Exp $";
+static char rcsid[] = "$NetBSD: util.c,v 1.15 2020/05/24 11:09:43 nia Exp $";
 #else
 #ifndef lint
-__RCSID("$NetBSD: util.c,v 1.14 2015/07/04 07:12:08 ryoon Exp $");
+__RCSID("$NetBSD: util.c,v 1.15 2020/05/24 11:09:43 nia Exp $");
 #endif
 #endif
 
@@ -229,32 +229,6 @@ killpg(int pid, int sig)
     return kill(-pid, sig);
 }
 
-#if !defined(__hpux__) && !defined(__hpux)
-void
-srandom(long seed)
-{
-    srand48(seed);
-}
-
-long
-random(void)
-{
-    return lrand48();
-}
-#endif
-
-#if !defined(__hpux__) && !defined(__hpux)
-int
-utimes(char *file, struct timeval tvp[2])
-{
-    struct utimbuf t;
-
-    t.actime  = tvp[0].tv_sec;
-    t.modtime = tvp[1].tv_sec;
-    return(utime(file, &t));
-}
-#endif
-
 #if !defined(BSD) && !defined(d_fileno)
 # define d_fileno d_ino
 #endif
@@ -383,11 +357,7 @@ bmake_signal(int s, void (*a)(int)))(int
 
     sa.sa_handler = a;
     sigemptyset(&sa.sa_mask);
-#ifdef SA_RESTART
     sa.sa_flags = SA_RESTART;
-#else
-    sa.sa_flags = 0;
-#endif
 
     if (sigaction(s, &sa, &osa) == -1)
        return SIG_ERR;

Index: pkgsrc/devel/bmake/files/dir.c
diff -u pkgsrc/devel/bmake/files/dir.c:1.6 pkgsrc/devel/bmake/files/dir.c:1.7
--- pkgsrc/devel/bmake/files/dir.c:1.6  Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/dir.c      Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.c,v 1.6 2015/05/19 22:01:19 joerg Exp $    */
+/*     $NetBSD: dir.c,v 1.7 2020/05/24 11:09:43 nia Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: dir.c,v 1.6 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: dir.c,v 1.7 2020/05/24 11:09:43 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)dir.c      8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: dir.c,v 1.6 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: dir.c,v 1.7 2020/05/24 11:09:43 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -244,6 +244,7 @@ static Hash_Table mtimes;   /* Results o
                             * be two rules to update a single file, so this
                             * should be ok, but... */
 
+static Hash_Table lmtimes;  /* same as mtimes but for lstat */
 
 static int DirFindName(const void *, const void *);
 static int DirMatchFiles(const char *, Path *, Lst);
@@ -256,6 +257,79 @@ static char *DirLookupSubdir(Path *, con
 static char *DirFindDot(Boolean, const char *, const char *);
 static char *DirLookupAbs(Path *, const char *, const char *);
 
+
+/*
+ * We use stat(2) a lot, cache the results
+ * mtime and mode are all we care about.
+ */
+struct cache_st {
+    time_t mtime;
+    mode_t  mode;
+};
+
+/* minimize changes below */
+#define CST_LSTAT 1
+#define CST_UPDATE 2
+
+static int
+cached_stats(Hash_Table *htp, const char *pathname, struct stat *st, int flags)
+{
+    Hash_Entry *entry;
+    struct cache_st *cst;
+    int rc;
+
+    if (!pathname || !pathname[0])
+       return -1;
+
+    entry = Hash_FindEntry(htp, pathname);
+
+    if (entry && (flags & CST_UPDATE) == 0) {
+       cst = entry->clientPtr;
+
+       memset(st, 0, sizeof(*st));
+       st->st_mtime = cst->mtime;
+       st->st_mode = cst->mode;
+        if (DEBUG(DIR)) {
+            fprintf(debug_file, "Using cached time %s for %s\n",
+               Targ_FmtTime(st->st_mtime), pathname);
+       }
+       return 0;
+    }
+
+    rc = (flags & CST_LSTAT) ? lstat(pathname, st) : stat(pathname, st);
+    if (rc == -1)
+       return -1;
+
+    if (st->st_mtime == 0)
+       st->st_mtime = 1;      /* avoid confusion with missing file */
+
+    if (!entry)
+       entry = Hash_CreateEntry(htp, pathname, NULL);
+    if (!entry->clientPtr)
+       entry->clientPtr = bmake_malloc(sizeof(*cst));
+    cst = entry->clientPtr;
+    cst->mtime = st->st_mtime;
+    cst->mode = st->st_mode;
+    if (DEBUG(DIR)) {
+       fprintf(debug_file, "   Caching %s for %s\n",
+           Targ_FmtTime(st->st_mtime), pathname);
+    }
+
+    return 0;
+}
+
+int
+cached_stat(const char *pathname, void *st)
+{
+    return cached_stats(&mtimes, pathname, st, 0);
+}
+
+int
+cached_lstat(const char *pathname, void *st)
+{
+    return cached_stats(&lmtimes, pathname, st, CST_LSTAT);
+}
+
 /*-
  *-----------------------------------------------------------------------
  * Dir_Init --
@@ -271,10 +345,13 @@ static char *DirLookupAbs(Path *, const 
 void
 Dir_Init(const char *cdname)
 {
-    dirSearchPath = Lst_Init(FALSE);
-    openDirectories = Lst_Init(FALSE);
-    Hash_InitTable(&mtimes, 0);
-
+    if (!cdname) {
+       dirSearchPath = Lst_Init(FALSE);
+       openDirectories = Lst_Init(FALSE);
+       Hash_InitTable(&mtimes, 0);
+       Hash_InitTable(&lmtimes, 0);
+       return;
+    }
     Dir_InitCur(cdname);
 
     dotLast = bmake_malloc(sizeof(Path));
@@ -725,11 +802,11 @@ DirExpandInt(const char *word, Lst path,
  *-----------------------------------------------------------------------
  */
 static int
-DirPrintWord(void *word, void *dummy)
+DirPrintWord(void *word, void *dummy MAKE_ATTR_UNUSED)
 {
     fprintf(debug_file, "%s ", (char *)word);
 
-    return(dummy ? 0 : 0);
+    return 0;
 }
 
 /*-
@@ -901,7 +978,6 @@ static char *
 DirLookupSubdir(Path *p, const char *name)
 {
     struct stat          stb;          /* Buffer for stat, if necessary */
-    Hash_Entry  *entry;        /* Entry for mtimes table */
     char        *file;         /* the current filename to check */
 
     if (p != dot) {
@@ -917,19 +993,7 @@ DirLookupSubdir(Path *p, const char *nam
        fprintf(debug_file, "checking %s ...\n", file);
     }
 
-    if (stat(file, &stb) == 0) {
-       if (stb.st_mtime == 0)
-               stb.st_mtime = 1;
-       /*
-        * Save the modification time so if it's needed, we don't have
-        * to fetch it again.
-        */
-       if (DEBUG(DIR)) {
-           fprintf(debug_file, "   Caching %s for %s\n", Targ_FmtTime(stb.st_mtime),
-                   file);
-       }
-       entry = Hash_CreateEntry(&mtimes, file, NULL);
-       Hash_SetTimeValue(entry, stb.st_mtime);
+    if (cached_stat(file, &stb) == 0) {
        nearmisses += 1;
        return (file);
     }
@@ -1061,7 +1125,6 @@ Dir_FindFile(const char *name, Lst path)
     Boolean      hasLastDot = FALSE;   /* true we should search dot last */
     Boolean      hasSlash;             /* true if 'name' contains a / */
     struct stat          stb;                  /* Buffer for stat, if necessary */
-    Hash_Entry   *entry;               /* Entry for mtimes table */
     const char   *trailing_dot = ".";
 
     /*
@@ -1242,8 +1305,14 @@ Dir_FindFile(const char *name, Lst path)
            fprintf(debug_file, "   Trying exact path matches...\n");
        }
 
-       if (!hasLastDot && cur && (file = DirLookupAbs(cur, name, cp)) != NULL)
-           return *file?file:NULL;
+       if (!hasLastDot && cur && ((file = DirLookupAbs(cur, name, cp))
+               != NULL)) {
+           if (file[0] == '\0') {
+               free(file);
+               return NULL;
+           }
+           return file;
+       }
 
        (void)Lst_Open(path);
        while ((ln = Lst_Next(path)) != NULL) {
@@ -1252,13 +1321,23 @@ Dir_FindFile(const char *name, Lst path)
                continue;
            if ((file = DirLookupAbs(p, name, cp)) != NULL) {
                Lst_Close(path);
-               return *file?file:NULL;
+               if (file[0] == '\0') {
+                   free(file);
+                   return NULL;
+               }
+               return file;
            }
        }
        Lst_Close(path);
 
-       if (hasLastDot && cur && (file = DirLookupAbs(cur, name, cp)) != NULL)
-           return *file?file:NULL;
+       if (hasLastDot && cur && ((file = DirLookupAbs(cur, name, cp))
+               != NULL)) {
+           if (file[0] == '\0') {
+               free(file);
+               return NULL;
+           }
+           return file;
+       }
     }
 
     /*
@@ -1306,28 +1385,14 @@ Dir_FindFile(const char *name, Lst path)
     }
 
     bigmisses += 1;
-    entry = Hash_FindEntry(&mtimes, name);
-    if (entry != NULL) {
-       if (DEBUG(DIR)) {
-           fprintf(debug_file, "   got it (in mtime cache)\n");
-       }
-       return(bmake_strdup(name));
-    } else if (stat(name, &stb) == 0) {
-       if (stb.st_mtime == 0)
-               stb.st_mtime = 1;
-       entry = Hash_CreateEntry(&mtimes, name, NULL);
-       if (DEBUG(DIR)) {
-           fprintf(debug_file, "   Caching %s for %s\n", Targ_FmtTime(stb.st_mtime),
-                   name);
-       }
-       Hash_SetTimeValue(entry, stb.st_mtime);
+    if (cached_stat(name, &stb) == 0) {
        return (bmake_strdup(name));
-    } else {
-       if (DEBUG(DIR)) {
-           fprintf(debug_file, "   failed. Returning NULL\n");
-       }
-       return NULL;
     }
+
+    if (DEBUG(DIR)) {
+       fprintf(debug_file, "   failed. Returning NULL\n");
+    }
+    return NULL;
 #endif /* notdef */
 }
 
@@ -1368,7 +1433,7 @@ Dir_FindHereOrAbove(char *here, char *se
 
                /* try and stat(2) it ... */
                snprintf(try, sizeof(try), "%s/%s", dirbase, search_path);
-               if (stat(try, &st) != -1) {
+               if (cached_stat(try, &st) != -1) {
                        /*
                         * success!  if we found a file, chop off
                         * the filename so we return a directory.
@@ -1433,7 +1498,6 @@ Dir_MTime(GNode *gn, Boolean recheck)
 {
     char          *fullName;  /* the full pathname of name */
     struct stat          stb;        /* buffer for finding the mod time */
-    Hash_Entry   *entry;
 
     if (gn->type & OP_ARCHV) {
        return Arch_MTime(gn);
@@ -1484,17 +1548,7 @@ Dir_MTime(GNode *gn, Boolean recheck)
        fullName = bmake_strdup(gn->name);
     }
 
-    if (!recheck)
-       entry = Hash_FindEntry(&mtimes, fullName);
-    else
-       entry = NULL;
-    if (entry != NULL) {
-       if (DEBUG(DIR)) {
-           fprintf(debug_file, "Using cached time %s for %s\n",
-                   Targ_FmtTime(Hash_GetTimeValue(entry)), fullName);
-       }
-       stb.st_mtime = Hash_GetTimeValue(entry);
-    } else if (stat(fullName, &stb) < 0) {
+    if (cached_stats(&mtimes, fullName, &stb, recheck ? CST_UPDATE : 0) < 0) {
        if (gn->type & OP_MEMBER) {
            if (fullName != gn->path)
                free(fullName);
@@ -1502,18 +1556,8 @@ Dir_MTime(GNode *gn, Boolean recheck)
        } else {
            stb.st_mtime = 0;
        }
-    } else {
-       if (stb.st_mtime == 0) {
-               /*
-                * 0 handled specially by the code, if the time is really 0,
-                * return something else instead
-                */
-               stb.st_mtime = 1;
-       }
-       entry = Hash_CreateEntry(&mtimes, fullName, NULL);
-       Hash_SetTimeValue(entry, stb.st_mtime);
     }
-       
+
     if (fullName && gn->path == NULL) {
        gn->path = fullName;
     }
@@ -1792,10 +1836,10 @@ Dir_PrintDirectories(void)
 }
 
 static int
-DirPrintDir(void *p, void *dummy)
+DirPrintDir(void *p, void *dummy MAKE_ATTR_UNUSED)
 {
     fprintf(debug_file, "%s ", ((Path *)p)->name);
-    return (dummy ? 0 : 0);
+    return 0;
 }
 
 void
Index: pkgsrc/devel/bmake/files/make-bootstrap.sh.in
diff -u pkgsrc/devel/bmake/files/make-bootstrap.sh.in:1.6 pkgsrc/devel/bmake/files/make-bootstrap.sh.in:1.7
--- pkgsrc/devel/bmake/files/make-bootstrap.sh.in:1.6   Tue Aug 15 15:54:06 2017
+++ pkgsrc/devel/bmake/files/make-bootstrap.sh.in       Sun May 24 11:09:43 2020
@@ -16,13 +16,17 @@ CFLAGS="@CFLAGS@ -I. -I${srcdir} @DEFS@ 
 MAKE_VERSION=@_MAKE_VERSION@
 
 MDEFS="-DMAKE_VERSION=\"$MAKE_VERSION\" \
--D@force_machine@MACHINE=\"@machine@\" -DPKGSRC_MACHINE_ARCH=\"@machine_arch@\" \
+-D@force_machine@MACHINE=\"@machine@\" -DMACHINE_ARCH=\"@machine_arch@\" \
 -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\""
 
 
 LDFLAGS="@LDFLAGS@"
 LIBS="@LIBS@"
 
+toUpper() {
+    ${TR:-tr} abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
+}
+
 do_compile2() {
        obj="$1"; shift
        src="$1"; shift
@@ -32,7 +36,10 @@ do_compile2() {
 
 do_compile() {
        obj="$1"; shift
-       src=`basename "$obj" .o`.c
+       case "$1" in
+       *.c) src=$1; shift;;
+       *) src=`basename "$obj" .o`.c;;
+       esac
 
        for d in "$srcdir" "$srcdir/lst.lib"
        do
@@ -52,7 +59,7 @@ do_link() {
 }
 
 BASE_OBJECTS="arch.o buf.o compat.o cond.o dir.o for.o getopt hash.o \
-job.o make.o make_malloc.o parse.o sigcompat.o str.o strlist.o \
+make.o make_malloc.o metachar.o parse.o sigcompat.o str.o strlist.o \
 suff.o targ.o trace.o var.o util.o"
 
 LST_OBJECTS="lstAppend.o lstDupl.o lstInit.o lstOpen.o \
@@ -73,12 +80,22 @@ done
 
 case "@use_meta@" in
 yes)
-        case "@filemon_h@" in
-       */filemon.h) FDEFS="-DHAVE_FILEMON_H -I`dirname @filemon_h@`";;
+       case "@use_filemon@" in
+       no) MDEFS=;;
+       *)
+               MDEFS="-DUSE_FILEMON -DUSE_FILEMON_`echo @use_filemon@ | toUpper`"
+               case "@use_filemon@,@filemon_h@" in
+               dev,*/filemon.h) FDEFS="-DHAVE_FILEMON_H -I`dirname @filemon_h@`";;
+               *) FDEFS=;;
+               esac
+               do_compile filemon_@use_filemon@.o filemon/filemon_@use_filemon@.c ${FDEFS}
+               BASE_OBJECTS="filemon_@use_filemon@.o $BASE_OBJECTS"
+               ;;
        esac
-        do_compile meta.o ${FDEFS}
-        BASE_OBJECTS="meta.o ${BASE_OBJECTS}"
-        ;;
+       do_compile meta.o ${MDEFS}
+       BASE_OBJECTS="meta.o ${BASE_OBJECTS}"
+       ;;
 esac
+do_compile job.o ${MDEFS}
 
-do_link bmake main.o ${BASE_OBJECTS} ${LST_OBJECTS} ${LIB_OBJECTS}
+do_link bmake main.o job.o ${BASE_OBJECTS} ${LST_OBJECTS} ${LIB_OBJECTS}
Index: pkgsrc/devel/bmake/files/make.c
diff -u pkgsrc/devel/bmake/files/make.c:1.6 pkgsrc/devel/bmake/files/make.c:1.7
--- pkgsrc/devel/bmake/files/make.c:1.6 Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/make.c     Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.c,v 1.6 2015/05/19 22:01:19 joerg Exp $   */
+/*     $NetBSD: make.c,v 1.7 2020/05/24 11:09:43 nia Exp $     */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: make.c,v 1.6 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: make.c,v 1.7 2020/05/24 11:09:43 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)make.c     8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: make.c,v 1.6 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: make.c,v 1.7 2020/05/24 11:09:43 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -308,7 +308,7 @@ Make_OODate(GNode *gn)
        if (DEBUG(MAKE)) {
            if (gn->cmgn != NULL && gn->mtime < gn->cmgn->mtime) {
                fprintf(debug_file, "modified before source %s...",
-                   gn->cmgn->path);
+                   gn->cmgn->path ? gn->cmgn->path : gn->cmgn->name);
            } else if (gn->mtime == 0) {
                fprintf(debug_file, "non-existent and no sources...");
            } else {
@@ -482,10 +482,9 @@ Make_HandleUse(GNode *cgn, GNode *pgn)
            if (gn->uname == NULL) {
                gn->uname = gn->name;
            } else {
-               if (gn->name)
-                   free(gn->name);
+               free(gn->name);
            }
-           gn->name = Var_Subst(NULL, gn->uname, pgn, FALSE);
+           gn->name = Var_Subst(NULL, gn->uname, pgn, VARF_WANTRES);
            if (gn->name && gn->uname && strcmp(gn->name, gn->uname) != 0) {
                /* See if we have a target for this node. */
                tgn = Targ_FindNode(gn->name, TARG_NOCREATE);
@@ -692,8 +691,7 @@ Make_Update(GNode *cgn)
     checked++;
 
     cname = Var_Value(TARGET, cgn, &p1);
-    if (p1)
-       free(p1);
+    free(p1);
 
     if (DEBUG(MAKE))
        fprintf(debug_file, "Make_Update: %s%s\n", cgn->name, cgn->cohort_num);
@@ -838,8 +836,7 @@ Make_Update(GNode *cgn)
                    Var_Set(PREFIX, cpref, pgn, 0);
            }
        }
-       if (p1)
-           free(p1);
+       free(p1);
        Lst_Close(cgn->iParents);
     }
 }
@@ -907,8 +904,7 @@ MakeAddAllSrc(void *cgnp, void *pgnp)
        }
        if (allsrc != NULL)
                Var_Append(ALLSRC, allsrc, pgn);
-       if (p2)
-           free(p2);
+       free(p2);
        if (pgn->type & OP_JOIN) {
            if (cgn->made == MADE) {
                Var_Append(OODATE, child, pgn);
@@ -934,8 +930,7 @@ MakeAddAllSrc(void *cgnp, void *pgnp)
             */
            Var_Append(OODATE, child, pgn);
        }
-       if (p1)
-           free(p1);
+       free(p1);
     }
     return (0);
 }
@@ -981,8 +976,7 @@ Make_DoAllVar(GNode *gn)
     if (gn->type & OP_JOIN) {
        char *p1;
        Var_Set(TARGET, Var_Value(ALLSRC, gn, &p1), gn, 0);
-       if (p1)
-           free(p1);
+       free(p1);
     }
     gn->flags |= DONE_ALLSRC;
 }
Index: pkgsrc/devel/bmake/files/sigcompat.c
diff -u pkgsrc/devel/bmake/files/sigcompat.c:1.6 pkgsrc/devel/bmake/files/sigcompat.c:1.7
--- pkgsrc/devel/bmake/files/sigcompat.c:1.6    Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/sigcompat.c        Sun May 24 11:09:43 2020
@@ -104,7 +104,7 @@
 
 #if defined(LIBC_SCCS) && !defined(lint)
 /*static char *sccsid = "from: @(#)sigcompat.c 5.3 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id: sigcompat.c,v 1.6 2015/05/19 22:01:19 joerg Exp $";
+static char *rcsid = "$Id: sigcompat.c,v 1.7 2020/05/24 11:09:43 nia Exp $";
 #endif                         /* LIBC_SCCS and not lint */
 
 #undef signal
Index: pkgsrc/devel/bmake/files/targ.c
diff -u pkgsrc/devel/bmake/files/targ.c:1.6 pkgsrc/devel/bmake/files/targ.c:1.7
--- pkgsrc/devel/bmake/files/targ.c:1.6 Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/targ.c     Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: targ.c,v 1.6 2015/05/19 22:01:19 joerg Exp $   */
+/*     $NetBSD: targ.c,v 1.7 2020/05/24 11:09:43 nia Exp $     */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: targ.c,v 1.6 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: targ.c,v 1.7 2020/05/24 11:09:43 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)targ.c     8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: targ.c,v 1.6 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: targ.c,v 1.7 2020/05/24 11:09:43 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -292,10 +292,8 @@ TargFreeGN(void *gnp)
 
 
     free(gn->name);
-    if (gn->uname)
-       free(gn->uname);
-    if (gn->path)
-       free(gn->path);
+    free(gn->uname);
+    free(gn->path);
     /* gn->fname points to name allocated when file was opened, don't free */
 
     Lst_Destroy(gn->iParents, NULL);
@@ -523,10 +521,10 @@ TargPrintName(void *gnp, void *pflags MA
 
 
 int
-Targ_PrintCmd(void *cmd, void *dummy)
+Targ_PrintCmd(void *cmd, void *dummy MAKE_ATTR_UNUSED)
 {
     fprintf(debug_file, "\t%s\n", (char *)cmd);
-    return (dummy ? 0 : 0);
+    return 0;
 }
 
 /*-
Index: pkgsrc/devel/bmake/files/trace.c
diff -u pkgsrc/devel/bmake/files/trace.c:1.6 pkgsrc/devel/bmake/files/trace.c:1.7
--- pkgsrc/devel/bmake/files/trace.c:1.6        Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/trace.c    Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: trace.c,v 1.6 2015/05/19 22:01:19 joerg Exp $  */
+/*     $NetBSD: trace.c,v 1.7 2020/05/24 11:09:43 nia Exp $    */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,11 +31,11 @@
 
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: trace.c,v 1.6 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: trace.c,v 1.7 2020/05/24 11:09:43 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: trace.c,v 1.6 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: trace.c,v 1.7 2020/05/24 11:09:43 nia Exp $");
 #endif /* not lint */
 #endif
 

Index: pkgsrc/devel/bmake/files/job.c
diff -u pkgsrc/devel/bmake/files/job.c:1.18 pkgsrc/devel/bmake/files/job.c:1.19
--- pkgsrc/devel/bmake/files/job.c:1.18 Sun Dec 23 23:29:28 2018
+++ pkgsrc/devel/bmake/files/job.c      Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.18 2018/12/23 23:29:28 sevan Exp $   */
+/*     $NetBSD: job.c,v 1.19 2020/05/24 11:09:43 nia 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.18 2018/12/23 23:29:28 sevan Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.19 2020/05/24 11:09:43 nia 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.18 2018/12/23 23:29:28 sevan Exp $");
+__RCSID("$NetBSD: job.c,v 1.19 2020/05/24 11:09:43 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -102,7 +102,7 @@ __RCSID("$NetBSD: job.c,v 1.18 2018/12/2
  *                             a time given by the SEL_* constants, below,
  *                             or until output is ready.
  *
- *     Job_Init                Called to intialize this module. in addition,
+ *     Job_Init                Called to initialize this module. in addition,
  *                             any commands attached to the .BEGIN target
  *                             are executed before this function returns.
  *                             Hence, the makefile must have been parsed
@@ -144,7 +144,6 @@ __RCSID("$NetBSD: job.c,v 1.18 2018/12/2
 
 #include <assert.h>
 #include <errno.h>
-#include <fcntl.h>
 #if !defined(USE_SELECT) && defined(HAVE_POLL_H)
 #include <poll.h>
 #else
@@ -343,17 +342,14 @@ static Job childExitJob;  /* child exit p
 #define        CHILD_EXIT      "."
 #define        DO_JOB_RESUME   "R"
 
+static const int npseudojobs = 2; /* number of pseudo-jobs */
+
 #define TARG_FMT  "%s %s ---\n" /* Default format */
 #define MESSAGE(fp, gn) \
        if (maxJobs != 1 && targPrefix && *targPrefix) \
            (void)fprintf(fp, TARG_FMT, targPrefix, gn->name)
 
 static sigset_t caught_signals;        /* Set of signals we handle */
-#if defined(SYSV)
-#define KILLPG(pid, sig)       kill(-(pid), (sig))
-#else
-#define KILLPG(pid, sig)       killpg((pid), (sig))
-#endif
 
 static void JobChildSig(int);
 static void JobContinueSig(int);
@@ -374,9 +370,20 @@ static void JobSigLock(sigset_t *);
 static void JobSigUnlock(sigset_t *);
 static void JobSigReset(void);
 
-#if defined(__NetBSD__)
-const char *malloc_options="A";
+#if !defined(MALLOC_OPTIONS)
+# define MALLOC_OPTIONS "A"
+#endif
+const char *malloc_options= MALLOC_OPTIONS;
+
+static unsigned
+nfds_per_job(void)
+{
+#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV)
+    if (useMeta)
+       return 2;
 #endif
+    return 1;
+}
 
 static void
 job_table_dump(const char *where)
@@ -391,6 +398,21 @@ job_table_dump(const char *where)
 }
 
 /*
+ * Delete the target of a failed, interrupted, or otherwise
+ * unsuccessful job unless inhibited by .PRECIOUS.
+ */
+static void
+JobDeleteTarget(GNode *gn)
+{
+       if ((gn->type & (OP_JOIN|OP_PHONY)) == 0 && !Targ_Precious(gn)) {
+           char *file = (gn->path == NULL ? gn->name : gn->path);
+           if (!noExecute && eunlink(file) != -1) {
+               Error("*** %s removed", file);
+           }
+       }
+}
+
+/*
  * JobSigLock/JobSigUnlock
  *
  * Signal lock routines to get exclusive access. Currently used to
@@ -412,7 +434,7 @@ static void JobSigUnlock(sigset_t *omask
 static void
 JobCreatePipe(Job *job, int minfd)
 {
-    int i, fd;
+    int i, fd, flags;
 
     if (pipe(job->jobPipe) == -1)
        Punt("Cannot create pipe: %s", strerror(errno));
@@ -427,8 +449,10 @@ JobCreatePipe(Job *job, int minfd)
     }
     
     /* Set close-on-exec flag for both */
-    (void)fcntl(job->jobPipe[0], F_SETFD, 1);
-    (void)fcntl(job->jobPipe[1], F_SETFD, 1);
+    if (fcntl(job->jobPipe[0], F_SETFD, FD_CLOEXEC) == -1)
+       Punt("Cannot set close-on-exec: %s", strerror(errno));
+    if (fcntl(job->jobPipe[1], F_SETFD, FD_CLOEXEC) == -1)
+       Punt("Cannot set close-on-exec: %s", strerror(errno));
 
     /*
      * We mark the input side of the pipe non-blocking; we poll(2) the
@@ -436,8 +460,12 @@ JobCreatePipe(Job *job, int minfd)
      * race for the token when a new one becomes available, so the read 
      * from the pipe should not block.
      */
-    fcntl(job->jobPipe[0], F_SETFL, 
-       fcntl(job->jobPipe[0], F_GETFL, 0) | O_NONBLOCK);
+    flags = fcntl(job->jobPipe[0], F_GETFL, 0);
+    if (flags == -1)
+       Punt("Cannot get flags: %s", strerror(errno));
+    flags |= O_NONBLOCK;
+    if (fcntl(job->jobPipe[0], F_SETFL, flags) == -1)
+       Punt("Cannot set flags: %s", strerror(errno));
 }
 
 /*-
@@ -717,7 +745,7 @@ JobPrintCommand(void *cmdp, void *jobp)
 
     numCommands += 1;
 
-    cmdStart = cmd = Var_Subst(NULL, cmd, job->node, FALSE);
+    cmdStart = cmd = Var_Subst(NULL, cmd, job->node, VARF_WANTRES);
 
     cmdTemplate = "%s\n";
 
@@ -739,6 +767,7 @@ JobPrintCommand(void *cmdp, void *jobp)
                 * but this one needs to be - use compat mode just for it.
                 */
                CompatRunCommand(cmdp, job->node);
+               free(cmdStart);
                return 0;
            }
            break;
@@ -868,8 +897,7 @@ JobPrintCommand(void *cmdp, void *jobp)
     
     DBPRINTF(cmdTemplate, cmd);
     free(cmdStart);
-    if (escCmd)
-        free(escCmd);
+    free(escCmd);
     if (errOff) {
        /*
         * If echoing is already off, there's no point in issuing the
@@ -905,7 +933,7 @@ JobPrintCommand(void *cmdp, void *jobp)
 static int
 JobSaveCommand(void *cmd, void *gn)
 {
-    cmd = Var_Subst(NULL, (char *)cmd, (GNode *)gn, FALSE);
+    cmd = Var_Subst(NULL, (char *)cmd, (GNode *)gn, VARF_WANTRES);
     (void)Lst_AtEnd(postCommands->commands, cmd);
     return(0);
 }
@@ -1037,6 +1065,9 @@ JobFinish (Job *job, WAIT_T status)
                if (job->flags & JOB_IGNERR) {
                    WAIT_STATUS(status) = 0;
                } else {
+                   if (deleteOnError) {
+                       JobDeleteTarget(job->node);
+                   }
                    PrintOnError(job->node, NULL);
                }
            } else if (DEBUG(JOB)) {
@@ -1054,13 +1085,20 @@ JobFinish (Job *job, WAIT_T status)
            }
            (void)printf("*** [%s] Signal %d\n",
                        job->node->name, WTERMSIG(status));
+           if (deleteOnError) {
+               JobDeleteTarget(job->node);
+           }
        }
        (void)fflush(stdout);
     }
 
 #ifdef USE_META
     if (useMeta) {
-       meta_job_finish(job);
+       int x;
+
+       if ((x = meta_job_finish(job)) != 0 && status == 0) {
+           status = x;
+       }
     }
 #endif
     
@@ -1236,8 +1274,7 @@ Job_CheckCommands(GNode *gn, void (*abor
             */
            Make_HandleUse(DEFAULT, gn);
            Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), gn, 0);
-           if (p1)
-               free(p1);
+           free(p1);
        } else if (Dir_MTime(gn, 0) == 0 && (gn->type & OP_SPECIAL) == 0) {
            /*
             * The node wasn't the target of an operator we have no .DEFAULT
@@ -1359,15 +1396,27 @@ JobExec(Job *job, char **argv)
            execError("dup2", "job->cmdFILE");
            _exit(1);
        }
-       (void)fcntl(0, F_SETFD, 0);
-       (void)lseek(0, (off_t)0, SEEK_SET);
+       if (fcntl(0, F_SETFD, 0) == -1) {
+           execError("fcntl clear close-on-exec", "stdin");
+           _exit(1);
+       }
+       if (lseek(0, (off_t)0, SEEK_SET) == -1) {
+           execError("lseek to 0", "stdin");
+           _exit(1);
+       }
 
        if (job->node->type & (OP_MAKE | OP_SUBMAKE)) {
                /*
                 * Pass job token pipe to submakes.
                 */
-               fcntl(tokenWaitJob.inPipe, F_SETFD, 0);
-               fcntl(tokenWaitJob.outPipe, F_SETFD, 0);                
+               if (fcntl(tokenWaitJob.inPipe, F_SETFD, 0) == -1) {
+                   execError("clear close-on-exec", "tokenWaitJob.inPipe");
+                   _exit(1);
+               }
+               if (fcntl(tokenWaitJob.outPipe, F_SETFD, 0) == -1) {
+                   execError("clear close-on-exec", "tokenWaitJob.outPipe");
+                   _exit(1);
+               }
        }
        
        /*
@@ -1384,7 +1433,10 @@ JobExec(Job *job, char **argv)
         * it before routing the shell's error output to the same place as
         * its standard output.
         */
-       (void)fcntl(1, F_SETFD, 0);
+       if (fcntl(1, F_SETFD, 0) == -1) {
+           execError("clear close-on-exec", "stdout");
+           _exit(1);
+       }
        if (dup2(1, 2) == -1) {
            execError("dup2", "1, 2");
            _exit(1);
@@ -1418,6 +1470,12 @@ JobExec(Job *job, char **argv)
 
     Trace_Log(JOBSTART, job);
 
+#ifdef USE_META
+    if (useMeta) {
+       meta_job_parent(job, cpid);
+    }
+#endif
+
     /*
      * Set the current position in the buffer to the beginning
      * and mark another stream to watch in the outputs mask
@@ -1600,7 +1658,7 @@ JobStart(GNode *gn, int flags)
        if (job->cmdFILE == NULL) {
            Punt("Could not fdopen %s", tfile);
        }
-       (void)fcntl(FILENO(job->cmdFILE), F_SETFD, 1);
+       (void)fcntl(FILENO(job->cmdFILE), F_SETFD, FD_CLOEXEC);
        /*
         * Send the commands to the command file, flush all its buffers then
         * rewind and remove the thing.
@@ -2084,10 +2142,7 @@ Job_CatchOutput(void)
        case 0:
            Punt("unexpected eof on token pipe");
        case -1:
-#ifndef __minix
            Punt("token pipe read: %s", strerror(errno));
-#endif
-           break;
        case 1:
            if (token == DO_JOB_RESUME[0])
                /* Complete relay requested from our SIGCONT handler */
@@ -2103,12 +2158,24 @@ Job_CatchOutput(void)
     if (nready == 0)
            return;
 
-    for (i = 2; i < nfds; i++) {
+    for (i = npseudojobs*nfds_per_job(); i < nfds; i++) {
        if (!fds[i].revents)
            continue;
        job = jobfds[i];
        if (job->job_state == JOB_ST_RUNNING)
            JobDoOutput(job, FALSE);
+#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV)
+       /*
+        * With meta mode, we may have activity on the job's filemon
+        * descriptor too, which at the moment is any pollfd other than
+        * job->inPollfd.
+        */
+       if (useMeta && job->inPollfd != &fds[i]) {
+           if (meta_job_event(job) <= 0) {
+               fds[i].events = 0; /* never mind */
+           }
+       }
+#endif
        if (--nready == 0)
                return;
     }
@@ -2199,7 +2266,8 @@ Job_SetPrefix(void)
        Var_Set(MAKE_JOB_PREFIX, "---", VAR_GLOBAL, 0);
     }
 
-    targPrefix = Var_Subst(NULL, "${" MAKE_JOB_PREFIX "}", VAR_GLOBAL, 0);
+    targPrefix = Var_Subst(NULL, "${" MAKE_JOB_PREFIX "}",
+                          VAR_GLOBAL, VARF_WANTRES);
 }
 
 /*-
@@ -2252,9 +2320,11 @@ Job_Init(void)
 
     JobCreatePipe(&childExitJob, 3);
 
-    /* We can only need to wait for tokens, children and output from each job */
-    fds = bmake_malloc(sizeof (*fds) * (2 + maxJobs));
-    jobfds = bmake_malloc(sizeof (*jobfds) * (2 + maxJobs));
+    /* Preallocate enough for the maximum number of jobs.  */
+    fds = bmake_malloc(sizeof(*fds) *
+       (npseudojobs + maxJobs) * nfds_per_job());
+    jobfds = bmake_malloc(sizeof(*jobfds) *
+       (npseudojobs + maxJobs) * nfds_per_job());
 
     /* These are permanent entries and take slots 0 and 1 */
     watchfd(&tokenWaitJob);
@@ -2406,8 +2476,7 @@ Job_ParseShell(char *line)
        line++;
     }
 
-    if (shellArgv)
-       free(UNCONST(shellArgv));
+    free(UNCONST(shellArgv));
 
     memset(&newShell, 0, sizeof(newShell));
 
@@ -2582,12 +2651,7 @@ JobInterrupt(int runINTERRUPT, int signo
 
        gn = job->node;
 
-       if ((gn->type & (OP_JOIN|OP_PHONY)) == 0 && !Targ_Precious(gn)) {
-           char *file = (gn->path == NULL ? gn->name : gn->path);
-           if (!noExecute && eunlink(file) != -1) {
-               Error("*** %s removed", file);
-           }
-       }
+       JobDeleteTarget(gn);
        if (job->pid) {
            if (DEBUG(JOB)) {
                (void)fprintf(debug_file,
@@ -2655,8 +2719,7 @@ void
 Job_End(void)
 {
 #ifdef CLEANUP
-    if (shellArgv)
-       free(shellArgv);
+    free(shellArgv);
 #endif
 }
 
@@ -2780,6 +2843,14 @@ watchfd(Job *job)
     jobfds[nfds] = job;
     job->inPollfd = &fds[nfds];
     nfds++;
+#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV)
+    if (useMeta) {
+       fds[nfds].fd = meta_job_fd(job);
+       fds[nfds].events = fds[nfds].fd == -1 ? 0 : POLLIN;
+       jobfds[nfds] = job;
+       nfds++;
+    }
+#endif
 }
 
 static void
@@ -2790,6 +2861,18 @@ clearfd(Job *job)
        Punt("Unwatching unwatched job");
     i = job->inPollfd - fds;
     nfds--;
+#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV)
+    if (useMeta) {
+       /*
+        * Sanity check: there should be two fds per job, so the job's
+        * pollfd number should be even.
+        */
+       assert(nfds_per_job() == 2);
+       if (i % 2)
+           Punt("odd-numbered fd with meta");
+       nfds--;
+    }
+#endif
     /*
      * Move last job in table into hole made by dead job.
      */
@@ -2797,6 +2880,12 @@ clearfd(Job *job)
        fds[i] = fds[nfds];
        jobfds[i] = jobfds[nfds];
        jobfds[i]->inPollfd = &fds[i];
+#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV)
+       if (useMeta) {
+           fds[i + 1] = fds[nfds + 1];
+           jobfds[i + 1] = jobfds[nfds + 1];
+       }
+#endif
     }
     job->inPollfd = NULL;
 }
@@ -2855,8 +2944,8 @@ Job_ServerStart(int max_tokens, int jp_0
        /* Pipe passed in from parent */
        tokenWaitJob.inPipe = jp_0;
        tokenWaitJob.outPipe = jp_1;
-       (void)fcntl(jp_0, F_SETFD, 1);
-       (void)fcntl(jp_1, F_SETFD, 1);
+       (void)fcntl(jp_0, F_SETFD, FD_CLOEXEC);
+       (void)fcntl(jp_1, F_SETFD, FD_CLOEXEC);
        return;
     }
 
@@ -2938,7 +3027,6 @@ Job_TokenWithdraw(void)
        }
        if (DEBUG(JOB))
            fprintf(debug_file, "(%d) blocked for token\n", getpid());
-       wantToken = 1;
        return FALSE;
     }
 

Index: pkgsrc/devel/bmake/files/machine.sh
diff -u pkgsrc/devel/bmake/files/machine.sh:1.11 pkgsrc/devel/bmake/files/machine.sh:1.12
--- pkgsrc/devel/bmake/files/machine.sh:1.11    Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/machine.sh Sun May 24 11:09:43 2020
@@ -2,7 +2,7 @@
 # derrived from /etc/rc_d/os.sh
 
 # RCSid:
-#      $Id: machine.sh,v 1.11 2015/05/19 22:01:19 joerg Exp $
+#      $Id: machine.sh,v 1.12 2020/05/24 11:09:43 nia Exp $
 #
 #      @(#) Copyright (c) 1994-2002 Simon J. Gerraty
 #
@@ -44,6 +44,12 @@ Which() {
 }
 
 case $OS in
+AIX)   # from http://gnats.netbsd.org/29386
+       OSMAJOR=`uname -v`
+       OSMINOR=`uname -r`
+       MACHINE=$OS$OSMAJOR.$OSMINOR
+       MACHINE_ARCH=`bootinfo -T`
+       ;;
 OpenBSD)
        MACHINE=$OS$OSMAJOR.$machine
        arch=`Which arch /usr/bin:/usr/ucb:$PATH`
Index: pkgsrc/devel/bmake/files/os.sh
diff -u pkgsrc/devel/bmake/files/os.sh:1.11 pkgsrc/devel/bmake/files/os.sh:1.12
--- pkgsrc/devel/bmake/files/os.sh:1.11 Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/os.sh      Sun May 24 11:09:43 2020
@@ -17,7 +17,7 @@
 #      Simon J. Gerraty <sjg%crufty.net@localhost>
 
 # RCSid:
-#      $Id: os.sh,v 1.11 2015/05/19 22:01:19 joerg Exp $
+#      $Id: os.sh,v 1.12 2020/05/24 11:09:43 nia Exp $
 #
 #      @(#) Copyright (c) 1994 Simon J. Gerraty
 #
@@ -44,7 +44,7 @@ MACHINE_ARCH=`uname -p 2>/dev/null || ec
 # there is at least one case of `uname -p` outputting
 # a bunch of usless drivel
 case "$MACHINE_ARCH" in
-*[!A-Za-z0-9_-]*) MACHINE_ARCH="$MACHINE";;
+unknown|*[!A-Za-z0-9_-]*) MACHINE_ARCH="$MACHINE";;
 esac
         
 # we need this here, and it is not always available...
@@ -56,10 +56,10 @@ Which() {
        case "$1" in
        /*)     test $t $1 && echo $1;;
        *)
-               # some shells cannot correctly handle `IFS`
-               # in conjunction with the for loop.
-               _dirs=`IFS=:; echo ${2:-$PATH}`
-               for d in $_dirs
+               # some shells cannot correctly handle `IFS`
+               # in conjunction with the for loop.
+               _dirs=`IFS=:; echo ${2:-$PATH}`
+               for d in $_dirs
                do
                        test $t $d/$1 && { echo $d/$1; break; }
                done
@@ -70,11 +70,11 @@ Which() {
 # tr is insanely non-portable wrt char classes, so we need to
 # spell out the alphabet. sed y/// would work too.
 toUpper() {
-        ${TR:-tr} abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
+       ${TR:-tr} abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
 }
 
 toLower() {
-        ${TR:-tr} ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
+       ${TR:-tr} ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
 }
 
 K=
@@ -91,7 +91,7 @@ SunOS)
        export CHOWN
        
        # Great! Solaris keeps moving arch(1)
-        # should just bite the bullet and use uname -p
+       # should just bite the bullet and use uname -p
        arch=`Which arch /usr/bin:/usr/ucb`
        
        MAILER=/usr/ucb/Mail
@@ -105,8 +105,8 @@ SunOS)
                MACHINE=$MACHINE_ARCH
                ;;
        4*)
-                MACHINE_ARCH=`arch`
-                ;;
+               MACHINE_ARCH=`arch`
+               ;;
        5*)
                K=-k
                LOCAL_FS=ufs
@@ -116,8 +116,8 @@ SunOS)
                # overwriting an existing file!!!!! We want one that works!
                test -x /usr/xpg4/bin/ln && LN=${LN:-/usr/xpg4/bin/ln}
                # wonderful, 5.8's tr again require's []'s
-                # but /usr/xpg4/bin/tr causes problems if LC_COLLATE is set!
-                # use toUpper/toLower instead.
+               # but /usr/xpg4/bin/tr causes problems if LC_COLLATE is set!
+               # use toUpper/toLower instead.
                ;;
        esac
        case "$OS/$MACHINE_ARCH" in
@@ -137,11 +137,15 @@ SunOS)
        # NetBSD at least has good backward compatibility
        # so NetBSD/i386 is good enough
        case $OS in
-       NetBSD) SHARE_ARCH=$OS/${MACHINE_ARCH:-$MACHINE};;
+       NetBSD)
+               LOCALBASE=/usr/pkg
+               HOST_ARCH=$MACHINE
+               SHARE_ARCH=$OS/$HOST_ARCH
+               ;;
        OpenBSD)
-               arch=`Which arch /usr/bin:/usr/ucb:$PATH`
-                MACHINE_ARCH=`$arch -s`
-                ;;
+               arch=`Which arch /usr/bin:/usr/ucb:$PATH`
+               MACHINE_ARCH=`$arch -s`
+               ;;
        esac
        NAWK=awk
        export NAWK
@@ -193,6 +197,7 @@ Haiku)
        esac
        ;;
 esac
+LOCALBASE=${LOCALBASE:-/usr/local}
 
 HOSTNAME=${HOSTNAME:-`( hostname ) 2>/dev/null`}
 HOSTNAME=${HOSTNAME:-`( uname -n ) 2>/dev/null`}
@@ -203,28 +208,48 @@ esac
 
 TMP_DIRS=${TMP_DIRS:-"/tmp /var/tmp"}
 MACHINE_ARCH=${MACHINE_ARCH:-$MACHINE}
+case "$MACHINE_ARCH" in
+x86*64|amd64) MACHINE32_ARCH=i386;;
+*64) MACHINE32_ARCH=`echo $MACHINE_ARCH | sed 's,64,32,'`;;
+*) MACHINE32_ARCH=$MACHINE_ARCH;;
+esac
+HOST_ARCH=${HOST_ARCH:-$MACHINE_ARCH}
+HOST_ARCH32=${HOST_ARCH32:-$MACHINE32_ARCH}
 # we mount server:/share/arch/$SHARE_ARCH as /usr/local
-SHARE_ARCH=${SHARE_ARCH:-$OS/$OSMAJOR.X/$MACHINE_ARCH}
+SHARE_ARCH_DEFAULT=$OS/$OSMAJOR.X/$HOST_ARCH
+SHARE_ARCH=${SHARE_ARCH:-$SHARE_ARCH_DEFAULT}
 LN=${LN:-ln}
 TR=${TR:-tr}
 
 # Some people like have /share/$HOST_TARGET/bin etc.
-HOST_TARGET=`echo ${OS}${OSMAJOR}-${MACHINE_ARCH} | toLower`
-export HOST_TARGET
+HOST_TARGET=`echo ${OS}${OSMAJOR}-$HOST_ARCH | tr -d / | toLower`
+HOST_TARGET32=`echo ${OS}${OSMAJOR}-$HOST_ARCH32 | tr -d / | toLower`
+export HOST_TARGET HOST_TARGET32
 
 case `echo -n .` in -n*) N=; C="\c";; *) N=-n; C=;; esac
 
-export HOSTNAME HOST        
+Echo() {
+       case "$1" in
+       -n) _n=$N _c=$C; shift;;
+       *) _n= _c=;;
+       esac
+       echo $_n "$@" $_c
+}
+
+export HOSTNAME HOST       
 export OS MACHINE MACHINE_ARCH OSREL OSMAJOR LOCAL_FS TMP_DIRS MAILER N C K PS_AXC
 export LN SHARE_ARCH TR
+export LOCALBASE
 
 case /$0 in
 */os.sh)
-        for v in $*
+       for v in $*
        do
-                eval vv=\$$v
-                echo "$v='$vv'"
+               eval vv=\$$v
+               echo "$v='$vv'"
        done
-        ;;
+       ;;
+*/host_target32) echo $HOST_TARGET32;;
+*/host_target) echo $HOST_TARGET;;
 esac
 

Index: pkgsrc/devel/bmake/files/metachar.c
diff -u pkgsrc/devel/bmake/files/metachar.c:1.1.1.1 pkgsrc/devel/bmake/files/metachar.c:1.2
--- pkgsrc/devel/bmake/files/metachar.c:1.1.1.1 Sun May 24 05:35:52 2020
+++ pkgsrc/devel/bmake/files/metachar.c Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: metachar.c,v 1.1.1.1 2020/05/24 05:35:52 nia Exp $     */
+/*     $NetBSD: metachar.c,v 1.2 2020/05/24 11:09:43 nia Exp $ */
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 #endif
 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: metachar.c,v 1.1.1.1 2020/05/24 05:35:52 nia Exp $");
+__RCSID("$NetBSD: metachar.c,v 1.2 2020/05/24 11:09:43 nia Exp $");
 #endif
 
 #include "metachar.h"
Index: pkgsrc/devel/bmake/files/metachar.h
diff -u pkgsrc/devel/bmake/files/metachar.h:1.1.1.1 pkgsrc/devel/bmake/files/metachar.h:1.2
--- pkgsrc/devel/bmake/files/metachar.h:1.1.1.1 Sun May 24 05:35:52 2020
+++ pkgsrc/devel/bmake/files/metachar.h Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: metachar.h,v 1.1.1.1 2020/05/24 05:35:52 nia Exp $     */
+/*     $NetBSD: metachar.h,v 1.2 2020/05/24 11:09:43 nia Exp $ */
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.

Index: pkgsrc/devel/bmake/files/PSD.doc/Makefile
diff -u pkgsrc/devel/bmake/files/PSD.doc/Makefile:1.3 pkgsrc/devel/bmake/files/PSD.doc/Makefile:1.4
--- pkgsrc/devel/bmake/files/PSD.doc/Makefile:1.3       Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/PSD.doc/Makefile   Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.3 2015/05/19 22:01:19 joerg Exp $
+#      $NetBSD: Makefile,v 1.4 2020/05/24 11:09:43 nia Exp $
 #      @(#)Makefile    8.1 (Berkeley) 8/14/93
 
 SECTION=reference/ref1

Index: pkgsrc/devel/bmake/files/PSD.doc/tutorial.ms
diff -u pkgsrc/devel/bmake/files/PSD.doc/tutorial.ms:1.4 pkgsrc/devel/bmake/files/PSD.doc/tutorial.ms:1.5
--- pkgsrc/devel/bmake/files/PSD.doc/tutorial.ms:1.4    Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/PSD.doc/tutorial.ms        Sun May 24 11:09:43 2020
@@ -1,4 +1,4 @@
-.\"    $NetBSD: tutorial.ms,v 1.4 2015/05/19 22:01:19 joerg Exp $
+.\"    $NetBSD: tutorial.ms,v 1.5 2020/05/24 11:09:43 nia Exp $
 .\" Copyright (c) 1988, 1989, 1993
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
@@ -117,6 +117,15 @@
 .de No
 .br
 .ne 0.5i
+.ie n \{\
+.nr g3 \w'NOTE '
+.po -\\n(g3u
+.br
+NOTE
+.br
+.po +\\n(g3u
+.\}
+.el \{\
 .po -0.5i
 .br
 .mk 
@@ -148,12 +157,14 @@
 .rt 
 .ft \\n(g3
 .ps \\n(g4
+.\}
 ..
 .de Bp
 .ie !\\n(.$ .IP \(bu 2
 .el .IP "\&" 2
 ..
-.po +.3i
+.ie n .po +\w'NOTE  'u
+.el .po +.3i
 .TL
 PMake \*- A Tutorial
 .AU

Index: pkgsrc/devel/bmake/files/filemon/filemon.h
diff -u pkgsrc/devel/bmake/files/filemon/filemon.h:1.1.1.1 pkgsrc/devel/bmake/files/filemon/filemon.h:1.2
--- pkgsrc/devel/bmake/files/filemon/filemon.h:1.1.1.1  Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/filemon/filemon.h  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: filemon.h,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $      */
+/*     $NetBSD: filemon.h,v 1.2 2020/05/24 11:09:44 nia Exp $  */
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
Index: pkgsrc/devel/bmake/files/filemon/filemon_dev.c
diff -u pkgsrc/devel/bmake/files/filemon/filemon_dev.c:1.1.1.1 pkgsrc/devel/bmake/files/filemon/filemon_dev.c:1.2
--- pkgsrc/devel/bmake/files/filemon/filemon_dev.c:1.1.1.1      Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/filemon/filemon_dev.c      Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: filemon_dev.c,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $  */
+/*     $NetBSD: filemon_dev.c,v 1.2 2020/05/24 11:09:44 nia Exp $      */
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
Index: pkgsrc/devel/bmake/files/filemon/filemon_ktrace.c
diff -u pkgsrc/devel/bmake/files/filemon/filemon_ktrace.c:1.1.1.1 pkgsrc/devel/bmake/files/filemon/filemon_ktrace.c:1.2
--- pkgsrc/devel/bmake/files/filemon/filemon_ktrace.c:1.1.1.1   Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/filemon/filemon_ktrace.c   Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: filemon_ktrace.c,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $       */
+/*     $NetBSD: filemon_ktrace.c,v 1.2 2020/05/24 11:09:44 nia Exp $   */
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.

Index: pkgsrc/devel/bmake/files/lst.lib/lstAppend.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstAppend.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstAppend.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstAppend.c:1.4    Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstAppend.c        Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstAppend.c,v 1.4 2015/05/19 22:01:19 joerg Exp $      */
+/*     $NetBSD: lstAppend.c,v 1.5 2020/05/24 11:09:44 nia Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstAppend.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstAppend.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstAppend.c        8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstAppend.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstAppend.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstAtEnd.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstAtEnd.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstAtEnd.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstAtEnd.c:1.4     Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstAtEnd.c Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstAtEnd.c,v 1.4 2015/05/19 22:01:19 joerg Exp $       */
+/*     $NetBSD: lstAtEnd.c,v 1.5 2020/05/24 11:09:44 nia Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstAtEnd.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstAtEnd.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstAtEnd.c 8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstAtEnd.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstAtEnd.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstAtFront.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstAtFront.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstAtFront.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstAtFront.c:1.4   Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstAtFront.c       Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstAtFront.c,v 1.4 2015/05/19 22:01:19 joerg Exp $     */
+/*     $NetBSD: lstAtFront.c,v 1.5 2020/05/24 11:09:44 nia Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstAtFront.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstAtFront.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstAtFront.c       8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstAtFront.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstAtFront.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstConcat.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstConcat.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstConcat.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstConcat.c:1.4    Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstConcat.c        Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstConcat.c,v 1.4 2015/05/19 22:01:19 joerg Exp $      */
+/*     $NetBSD: lstConcat.c,v 1.5 2020/05/24 11:09:44 nia Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstConcat.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstConcat.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstConcat.c        8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstConcat.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstConcat.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstDatum.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstDatum.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstDatum.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstDatum.c:1.4     Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstDatum.c Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstDatum.c,v 1.4 2015/05/19 22:01:19 joerg Exp $       */
+/*     $NetBSD: lstDatum.c,v 1.5 2020/05/24 11:09:44 nia Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstDatum.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstDatum.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstDatum.c 8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstDatum.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstDatum.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstDeQueue.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstDeQueue.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstDeQueue.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstDeQueue.c:1.4   Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstDeQueue.c       Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstDeQueue.c,v 1.4 2015/05/19 22:01:19 joerg Exp $     */
+/*     $NetBSD: lstDeQueue.c,v 1.5 2020/05/24 11:09:44 nia Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstDeQueue.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstDeQueue.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstDeQueue.c       8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstDeQueue.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstDeQueue.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstDestroy.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstDestroy.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstDestroy.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstDestroy.c:1.4   Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstDestroy.c       Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstDestroy.c,v 1.4 2015/05/19 22:01:19 joerg Exp $     */
+/*     $NetBSD: lstDestroy.c,v 1.5 2020/05/24 11:09:44 nia Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstDestroy.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstDestroy.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstDestroy.c       8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstDestroy.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstDestroy.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstDupl.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstDupl.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstDupl.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstDupl.c:1.4      Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstDupl.c  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstDupl.c,v 1.4 2015/05/19 22:01:19 joerg Exp $        */
+/*     $NetBSD: lstDupl.c,v 1.5 2020/05/24 11:09:44 nia Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstDupl.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstDupl.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstDupl.c  8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstDupl.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstDupl.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstEnQueue.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstEnQueue.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstEnQueue.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstEnQueue.c:1.4   Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstEnQueue.c       Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstEnQueue.c,v 1.4 2015/05/19 22:01:19 joerg Exp $     */
+/*     $NetBSD: lstEnQueue.c,v 1.5 2020/05/24 11:09:44 nia Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstEnQueue.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstEnQueue.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstEnQueue.c       8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstEnQueue.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstEnQueue.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstFind.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstFind.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstFind.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstFind.c:1.4      Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstFind.c  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstFind.c,v 1.4 2015/05/19 22:01:19 joerg Exp $        */
+/*     $NetBSD: lstFind.c,v 1.5 2020/05/24 11:09:44 nia Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstFind.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstFind.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstFind.c  8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstFind.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstFind.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstFindFrom.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstFindFrom.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstFindFrom.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstFindFrom.c:1.4  Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstFindFrom.c      Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstFindFrom.c,v 1.4 2015/05/19 22:01:19 joerg Exp $    */
+/*     $NetBSD: lstFindFrom.c,v 1.5 2020/05/24 11:09:44 nia Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstFindFrom.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstFindFrom.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstFindFrom.c      8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstFindFrom.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstFindFrom.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstFirst.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstFirst.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstFirst.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstFirst.c:1.4     Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstFirst.c Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstFirst.c,v 1.4 2015/05/19 22:01:19 joerg Exp $       */
+/*     $NetBSD: lstFirst.c,v 1.5 2020/05/24 11:09:44 nia Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstFirst.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstFirst.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstFirst.c 8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstFirst.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstFirst.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstForEach.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstForEach.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstForEach.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstForEach.c:1.4   Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstForEach.c       Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstForEach.c,v 1.4 2015/05/19 22:01:19 joerg Exp $     */
+/*     $NetBSD: lstForEach.c,v 1.5 2020/05/24 11:09:44 nia Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstForEach.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstForEach.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstForEach.c       8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstForEach.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstForEach.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstForEachFrom.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstForEachFrom.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstForEachFrom.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstForEachFrom.c:1.4       Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstForEachFrom.c   Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstForEachFrom.c,v 1.4 2015/05/19 22:01:19 joerg Exp $ */
+/*     $NetBSD: lstForEachFrom.c,v 1.5 2020/05/24 11:09:44 nia Exp $   */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstForEachFrom.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstForEachFrom.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstForEachFrom.c   8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstForEachFrom.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstForEachFrom.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstInit.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstInit.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstInit.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstInit.c:1.4      Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstInit.c  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstInit.c,v 1.4 2015/05/19 22:01:19 joerg Exp $        */
+/*     $NetBSD: lstInit.c,v 1.5 2020/05/24 11:09:44 nia Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstInit.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstInit.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstInit.c  8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstInit.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstInit.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstInsert.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstInsert.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstInsert.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstInsert.c:1.4    Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstInsert.c        Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstInsert.c,v 1.4 2015/05/19 22:01:19 joerg Exp $      */
+/*     $NetBSD: lstInsert.c,v 1.5 2020/05/24 11:09:44 nia Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstInsert.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstInsert.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstInsert.c        8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstInsert.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstInsert.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstIsEmpty.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstIsEmpty.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstIsEmpty.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstIsEmpty.c:1.4   Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstIsEmpty.c       Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstIsEmpty.c,v 1.4 2015/05/19 22:01:19 joerg Exp $     */
+/*     $NetBSD: lstIsEmpty.c,v 1.5 2020/05/24 11:09:44 nia Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstIsEmpty.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstIsEmpty.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstIsEmpty.c       8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstIsEmpty.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstIsEmpty.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstLast.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstLast.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstLast.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstLast.c:1.4      Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstLast.c  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstLast.c,v 1.4 2015/05/19 22:01:19 joerg Exp $        */
+/*     $NetBSD: lstLast.c,v 1.5 2020/05/24 11:09:44 nia Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstLast.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstLast.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstLast.c  8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstLast.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstLast.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstMember.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstMember.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstMember.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstMember.c:1.4    Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstMember.c        Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstMember.c,v 1.4 2015/05/19 22:01:19 joerg Exp $      */
+/*     $NetBSD: lstMember.c,v 1.5 2020/05/24 11:09:44 nia Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstMember.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstMember.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstMember.c        8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstMember.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstMember.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstNext.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstNext.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstNext.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstNext.c:1.4      Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstNext.c  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstNext.c,v 1.4 2015/05/19 22:01:19 joerg Exp $        */
+/*     $NetBSD: lstNext.c,v 1.5 2020/05/24 11:09:44 nia Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstNext.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstNext.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstNext.c  8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstNext.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstNext.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstOpen.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstOpen.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstOpen.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstOpen.c:1.4      Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstOpen.c  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstOpen.c,v 1.4 2015/05/19 22:01:19 joerg Exp $        */
+/*     $NetBSD: lstOpen.c,v 1.5 2020/05/24 11:09:44 nia Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstOpen.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstOpen.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstOpen.c  8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstOpen.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstOpen.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstRemove.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstRemove.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstRemove.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstRemove.c:1.4    Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstRemove.c        Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstRemove.c,v 1.4 2015/05/19 22:01:19 joerg Exp $      */
+/*     $NetBSD: lstRemove.c,v 1.5 2020/05/24 11:09:44 nia Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstRemove.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstRemove.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstRemove.c        8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstRemove.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstRemove.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstReplace.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstReplace.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstReplace.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstReplace.c:1.4   Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstReplace.c       Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstReplace.c,v 1.4 2015/05/19 22:01:19 joerg Exp $     */
+/*     $NetBSD: lstReplace.c,v 1.5 2020/05/24 11:09:44 nia Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstReplace.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstReplace.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstReplace.c       8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstReplace.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstReplace.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstSucc.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstSucc.c:1.4 pkgsrc/devel/bmake/files/lst.lib/lstSucc.c:1.5
--- pkgsrc/devel/bmake/files/lst.lib/lstSucc.c:1.4      Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstSucc.c  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstSucc.c,v 1.4 2015/05/19 22:01:19 joerg Exp $        */
+/*     $NetBSD: lstSucc.c,v 1.5 2020/05/24 11:09:44 nia Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstSucc.c,v 1.4 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstSucc.c,v 1.5 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstSucc.c  8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstSucc.c,v 1.4 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstSucc.c,v 1.5 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif

Index: pkgsrc/devel/bmake/files/lst.lib/lstClose.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstClose.c:1.3 pkgsrc/devel/bmake/files/lst.lib/lstClose.c:1.4
--- pkgsrc/devel/bmake/files/lst.lib/lstClose.c:1.3     Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstClose.c Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstClose.c,v 1.3 2015/05/19 22:01:19 joerg Exp $       */
+/*     $NetBSD: lstClose.c,v 1.4 2020/05/24 11:09:44 nia Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstClose.c,v 1.3 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstClose.c,v 1.4 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstClose.c 8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstClose.c,v 1.3 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstClose.c,v 1.4 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif
Index: pkgsrc/devel/bmake/files/lst.lib/lstIsAtEnd.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstIsAtEnd.c:1.3 pkgsrc/devel/bmake/files/lst.lib/lstIsAtEnd.c:1.4
--- pkgsrc/devel/bmake/files/lst.lib/lstIsAtEnd.c:1.3   Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstIsAtEnd.c       Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstIsAtEnd.c,v 1.3 2015/05/19 22:01:19 joerg Exp $     */
+/*     $NetBSD: lstIsAtEnd.c,v 1.4 2020/05/24 11:09:44 nia Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstIsAtEnd.c,v 1.3 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstIsAtEnd.c,v 1.4 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstIsAtEnd.c       8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstIsAtEnd.c,v 1.3 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstIsAtEnd.c,v 1.4 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif

Index: pkgsrc/devel/bmake/files/lst.lib/lstInt.h
diff -u pkgsrc/devel/bmake/files/lst.lib/lstInt.h:1.7 pkgsrc/devel/bmake/files/lst.lib/lstInt.h:1.8
--- pkgsrc/devel/bmake/files/lst.lib/lstInt.h:1.7       Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstInt.h   Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstInt.h,v 1.7 2015/05/19 22:01:19 joerg Exp $ */
+/*     $NetBSD: lstInt.h,v 1.8 2020/05/24 11:09:44 nia Exp $   */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993

Index: pkgsrc/devel/bmake/files/lst.lib/lstPrev.c
diff -u pkgsrc/devel/bmake/files/lst.lib/lstPrev.c:1.2 pkgsrc/devel/bmake/files/lst.lib/lstPrev.c:1.3
--- pkgsrc/devel/bmake/files/lst.lib/lstPrev.c:1.2      Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/lst.lib/lstPrev.c  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstPrev.c,v 1.2 2015/05/19 22:01:19 joerg Exp $        */
+/*     $NetBSD: lstPrev.c,v 1.3 2020/05/24 11:09:44 nia Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstPrev.c,v 1.2 2015/05/19 22:01:19 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstPrev.c,v 1.3 2020/05/24 11:09:44 nia Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstSucc.c  8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstPrev.c,v 1.2 2015/05/19 22:01:19 joerg Exp $");
+__RCSID("$NetBSD: lstPrev.c,v 1.3 2020/05/24 11:09:44 nia Exp $");
 #endif
 #endif /* not lint */
 #endif

Index: pkgsrc/devel/bmake/files/missing/sys/cdefs.h
diff -u pkgsrc/devel/bmake/files/missing/sys/cdefs.h:1.5 pkgsrc/devel/bmake/files/missing/sys/cdefs.h:1.6
--- pkgsrc/devel/bmake/files/missing/sys/cdefs.h:1.5    Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/missing/sys/cdefs.h        Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: cdefs.h,v 1.5 2015/05/19 22:01:19 joerg Exp $  */
+/*     $NetBSD: cdefs.h,v 1.6 2020/05/24 11:09:44 nia Exp $    */
 
 /*
  * Copyright (c) 1991, 1993

Index: pkgsrc/devel/bmake/files/mk/README
diff -u pkgsrc/devel/bmake/files/mk/README:1.1.1.1 pkgsrc/devel/bmake/files/mk/README:1.2
--- pkgsrc/devel/bmake/files/mk/README:1.1.1.1  Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/README  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-#      $Id: README,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $Id: README,v 1.2 2020/05/24 11:09:44 nia Exp $
 
 This directory contains some macro's derrived from the NetBSD bsd.*.mk
 macros.  They have the same names but without the bsd., separate macro
@@ -6,7 +6,7 @@ files are needed to ensure we can make t
 builing things outside of /usr/src.  Nearly all the comments below
 apply. 
 
-#      $NetBSD: README,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $NetBSD: README,v 1.2 2020/05/24 11:09:44 nia Exp $
 #      @(#)bsd.README  5.1 (Berkeley) 5/11/90
 
 This is the README file for the new make "include" files for the BSD
Index: pkgsrc/devel/bmake/files/mk/auto.dep.mk
diff -u pkgsrc/devel/bmake/files/mk/auto.dep.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/auto.dep.mk:1.2
--- pkgsrc/devel/bmake/files/mk/auto.dep.mk:1.1.1.1     Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/auto.dep.mk     Sun May 24 11:09:44 2020
@@ -1,6 +1,6 @@
 #
 # RCSid:
-#      $Id: auto.dep.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $Id: auto.dep.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2010, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/auto.obj.mk
diff -u pkgsrc/devel/bmake/files/mk/auto.obj.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/auto.obj.mk:1.2
--- pkgsrc/devel/bmake/files/mk/auto.obj.mk:1.1.1.1     Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/auto.obj.mk     Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: auto.obj.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: auto.obj.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2004, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/autoconf.mk
diff -u pkgsrc/devel/bmake/files/mk/autoconf.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/autoconf.mk:1.2
--- pkgsrc/devel/bmake/files/mk/autoconf.mk:1.1.1.1     Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/autoconf.mk     Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: autoconf.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: autoconf.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 1996-2009, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/autodep.mk
diff -u pkgsrc/devel/bmake/files/mk/autodep.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/autodep.mk:1.2
--- pkgsrc/devel/bmake/files/mk/autodep.mk:1.1.1.1      Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/autodep.mk      Sun May 24 11:09:44 2020
@@ -1,6 +1,6 @@
 #
 # RCSid:
-#      $Id: autodep.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $Id: autodep.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 1999-2010, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/compiler.mk
diff -u pkgsrc/devel/bmake/files/mk/compiler.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/compiler.mk:1.2
--- pkgsrc/devel/bmake/files/mk/compiler.mk:1.1.1.1     Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/compiler.mk     Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: compiler.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: compiler.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2019, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/cython.mk
diff -u pkgsrc/devel/bmake/files/mk/cython.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/cython.mk:1.2
--- pkgsrc/devel/bmake/files/mk/cython.mk:1.1.1.1       Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/cython.mk       Sun May 24 11:09:44 2020
@@ -1,5 +1,5 @@
 # RCSid:
-#      $Id: cython.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $Id: cython.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2014, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/dep.mk
diff -u pkgsrc/devel/bmake/files/mk/dep.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/dep.mk:1.2
--- pkgsrc/devel/bmake/files/mk/dep.mk:1.1.1.1  Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/dep.mk  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: dep.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: dep.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 
 .if !target(__${.PARSEFILE}__)
 __${.PARSEFILE}__:
Index: pkgsrc/devel/bmake/files/mk/dirdeps-options.mk
diff -u pkgsrc/devel/bmake/files/mk/dirdeps-options.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/dirdeps-options.mk:1.2
--- pkgsrc/devel/bmake/files/mk/dirdeps-options.mk:1.1.1.1      Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/dirdeps-options.mk      Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: dirdeps-options.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: dirdeps-options.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2018, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/dirdeps-targets.mk
diff -u pkgsrc/devel/bmake/files/mk/dirdeps-targets.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/dirdeps-targets.mk:1.2
--- pkgsrc/devel/bmake/files/mk/dirdeps-targets.mk:1.1.1.1      Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/dirdeps-targets.mk      Sun May 24 11:09:44 2020
@@ -1,5 +1,5 @@
 # RCSid:
-#       $Id: dirdeps-targets.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#       $Id: dirdeps-targets.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #       @(#) Copyright (c) 2019 Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/dirdeps.mk
diff -u pkgsrc/devel/bmake/files/mk/dirdeps.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/dirdeps.mk:1.2
--- pkgsrc/devel/bmake/files/mk/dirdeps.mk:1.1.1.1      Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/dirdeps.mk      Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: dirdeps.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: dirdeps.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 
 # Copyright (c) 2010-2020, Simon J. Gerraty
 # Copyright (c) 2010-2018, Juniper Networks, Inc.
Index: pkgsrc/devel/bmake/files/mk/doc.mk
diff -u pkgsrc/devel/bmake/files/mk/doc.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/doc.mk:1.2
--- pkgsrc/devel/bmake/files/mk/doc.mk:1.1.1.1  Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/doc.mk  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: doc.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: doc.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 
 .if !target(__${.PARSEFILE}__)
 __${.PARSEFILE}__:
Index: pkgsrc/devel/bmake/files/mk/dpadd.mk
diff -u pkgsrc/devel/bmake/files/mk/dpadd.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/dpadd.mk:1.2
--- pkgsrc/devel/bmake/files/mk/dpadd.mk:1.1.1.1        Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/dpadd.mk        Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: dpadd.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: dpadd.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2004, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/files.mk
diff -u pkgsrc/devel/bmake/files/mk/files.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/files.mk:1.2
--- pkgsrc/devel/bmake/files/mk/files.mk:1.1.1.1        Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/files.mk        Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: files.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: files.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2017, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/final.mk
diff -u pkgsrc/devel/bmake/files/mk/final.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/final.mk:1.2
--- pkgsrc/devel/bmake/files/mk/final.mk:1.1.1.1        Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/final.mk        Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: final.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: final.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 
 .if !target(__${.PARSEFILE}__)
 __${.PARSEFILE}__:
Index: pkgsrc/devel/bmake/files/mk/gendirdeps.mk
diff -u pkgsrc/devel/bmake/files/mk/gendirdeps.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/gendirdeps.mk:1.2
--- pkgsrc/devel/bmake/files/mk/gendirdeps.mk:1.1.1.1   Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/gendirdeps.mk   Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: gendirdeps.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: gendirdeps.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 
 # Copyright (c) 2011-2020, Simon J. Gerraty
 # Copyright (c) 2010-2018, Juniper Networks, Inc.
Index: pkgsrc/devel/bmake/files/mk/host-target.mk
diff -u pkgsrc/devel/bmake/files/mk/host-target.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/host-target.mk:1.2
--- pkgsrc/devel/bmake/files/mk/host-target.mk:1.1.1.1  Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/host-target.mk  Sun May 24 11:09:44 2020
@@ -1,5 +1,5 @@
 # RCSid:
-#      $Id: host-target.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $Id: host-target.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 
 # Host platform information; may be overridden
 .if !defined(_HOST_OSNAME)
Index: pkgsrc/devel/bmake/files/mk/host.libnames.mk
diff -u pkgsrc/devel/bmake/files/mk/host.libnames.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/host.libnames.mk:1.2
--- pkgsrc/devel/bmake/files/mk/host.libnames.mk:1.1.1.1        Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/host.libnames.mk        Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: host.libnames.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: host.libnames.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2007-2009, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/inc.mk
diff -u pkgsrc/devel/bmake/files/mk/inc.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/inc.mk:1.2
--- pkgsrc/devel/bmake/files/mk/inc.mk:1.1.1.1  Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/inc.mk  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: inc.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: inc.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2008, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/init.mk
diff -u pkgsrc/devel/bmake/files/mk/init.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/init.mk:1.2
--- pkgsrc/devel/bmake/files/mk/init.mk:1.1.1.1 Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/init.mk Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: init.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: init.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2002, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/install-mk
diff -u pkgsrc/devel/bmake/files/mk/install-mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/install-mk:1.2
--- pkgsrc/devel/bmake/files/mk/install-mk:1.1.1.1      Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/install-mk      Sun May 24 11:09:44 2020
@@ -55,7 +55,7 @@
 #       Simon J. Gerraty <sjg%crufty.net@localhost>
 
 # RCSid:
-#      $Id: install-mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $Id: install-mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 1994 Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/install-new.mk
diff -u pkgsrc/devel/bmake/files/mk/install-new.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/install-new.mk:1.2
--- pkgsrc/devel/bmake/files/mk/install-new.mk:1.1.1.1  Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/install-new.mk  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: install-new.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: install-new.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2009, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/java.mk
diff -u pkgsrc/devel/bmake/files/mk/java.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/java.mk:1.2
--- pkgsrc/devel/bmake/files/mk/java.mk:1.1.1.1 Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/java.mk Sun May 24 11:09:44 2020
@@ -1,6 +1,6 @@
 #
 # RCSid:
-#      $Id: java.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $Id: java.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 
 #      @(#) Copyright (c) 1998-2001, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/ldorder.mk
diff -u pkgsrc/devel/bmake/files/mk/ldorder.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/ldorder.mk:1.2
--- pkgsrc/devel/bmake/files/mk/ldorder.mk:1.1.1.1      Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/ldorder.mk      Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: ldorder.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: ldorder.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2015, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/lib.mk
diff -u pkgsrc/devel/bmake/files/mk/lib.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/lib.mk:1.2
--- pkgsrc/devel/bmake/files/mk/lib.mk:1.1.1.1  Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/lib.mk  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: lib.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: lib.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 
 .if !target(__${.PARSEFILE}__)
 __${.PARSEFILE}__:
Index: pkgsrc/devel/bmake/files/mk/libnames.mk
diff -u pkgsrc/devel/bmake/files/mk/libnames.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/libnames.mk:1.2
--- pkgsrc/devel/bmake/files/mk/libnames.mk:1.1.1.1     Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/libnames.mk     Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: libnames.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: libnames.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2007-2009, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/libs.mk
diff -u pkgsrc/devel/bmake/files/mk/libs.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/libs.mk:1.2
--- pkgsrc/devel/bmake/files/mk/libs.mk:1.1.1.1 Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/libs.mk Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: libs.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: libs.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2006, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/links.mk
diff -u pkgsrc/devel/bmake/files/mk/links.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/links.mk:1.2
--- pkgsrc/devel/bmake/files/mk/links.mk:1.1.1.1        Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/links.mk        Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: links.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: links.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2005, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/man.mk
diff -u pkgsrc/devel/bmake/files/mk/man.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/man.mk:1.2
--- pkgsrc/devel/bmake/files/mk/man.mk:1.1.1.1  Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/man.mk  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: man.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: man.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 
 .if !target(__${.PARSEFILE}__)
 __${.PARSEFILE}__:
Index: pkgsrc/devel/bmake/files/mk/manifest.mk
diff -u pkgsrc/devel/bmake/files/mk/manifest.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/manifest.mk:1.2
--- pkgsrc/devel/bmake/files/mk/manifest.mk:1.1.1.1     Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/manifest.mk     Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: manifest.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: manifest.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2014, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/meta.autodep.mk
diff -u pkgsrc/devel/bmake/files/mk/meta.autodep.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/meta.autodep.mk:1.2
--- pkgsrc/devel/bmake/files/mk/meta.autodep.mk:1.1.1.1 Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/meta.autodep.mk Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: meta.autodep.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: meta.autodep.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 
 #
 #      @(#) Copyright (c) 2010, Simon J. Gerraty
Index: pkgsrc/devel/bmake/files/mk/meta.stage.mk
diff -u pkgsrc/devel/bmake/files/mk/meta.stage.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/meta.stage.mk:1.2
--- pkgsrc/devel/bmake/files/mk/meta.stage.mk:1.1.1.1   Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/meta.stage.mk   Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: meta.stage.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: meta.stage.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2011-2017, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/meta.subdir.mk
diff -u pkgsrc/devel/bmake/files/mk/meta.subdir.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/meta.subdir.mk:1.2
--- pkgsrc/devel/bmake/files/mk/meta.subdir.mk:1.1.1.1  Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/meta.subdir.mk  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: meta.subdir.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: meta.subdir.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 
 #
 #      @(#) Copyright (c) 2010, Simon J. Gerraty
Index: pkgsrc/devel/bmake/files/mk/meta.sys.mk
diff -u pkgsrc/devel/bmake/files/mk/meta.sys.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/meta.sys.mk:1.2
--- pkgsrc/devel/bmake/files/mk/meta.sys.mk:1.1.1.1     Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/meta.sys.mk     Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: meta.sys.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: meta.sys.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 
 #
 #      @(#) Copyright (c) 2010-2020, Simon J. Gerraty
Index: pkgsrc/devel/bmake/files/mk/meta2deps.py
diff -u pkgsrc/devel/bmake/files/mk/meta2deps.py:1.1.1.1 pkgsrc/devel/bmake/files/mk/meta2deps.py:1.2
--- pkgsrc/devel/bmake/files/mk/meta2deps.py:1.1.1.1    Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/meta2deps.py    Sun May 24 11:09:44 2020
@@ -37,7 +37,7 @@ We only pay attention to a subset of the
 
 """
 RCSid:
-       $Id: meta2deps.py,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+       $Id: meta2deps.py,v 1.2 2020/05/24 11:09:44 nia Exp $
 
        Copyright (c) 2011-2019, Simon J. Gerraty
        Copyright (c) 2011-2017, Juniper Networks, Inc.
Index: pkgsrc/devel/bmake/files/mk/meta2deps.sh
diff -u pkgsrc/devel/bmake/files/mk/meta2deps.sh:1.1.1.1 pkgsrc/devel/bmake/files/mk/meta2deps.sh:1.2
--- pkgsrc/devel/bmake/files/mk/meta2deps.sh:1.1.1.1    Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/meta2deps.sh    Sun May 24 11:09:44 2020
@@ -77,7 +77,7 @@
 
 
 # RCSid:
-#      $Id: meta2deps.sh,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $Id: meta2deps.sh,v 1.2 2020/05/24 11:09:44 nia Exp $
 
 # Copyright (c) 2010-2013, Juniper Networks, Inc.
 # All rights reserved.
Index: pkgsrc/devel/bmake/files/mk/mk-files.txt
diff -u pkgsrc/devel/bmake/files/mk/mk-files.txt:1.1.1.1 pkgsrc/devel/bmake/files/mk/mk-files.txt:1.2
--- pkgsrc/devel/bmake/files/mk/mk-files.txt:1.1.1.1    Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/mk-files.txt    Sun May 24 11:09:44 2020
@@ -499,5 +499,5 @@ where you unpacked the tar file, you can
 .. _mk.tar.gz: http://www.crufty.net/ftp/pub/sjg/mk.tar.gz
 
 :Author: sjg%crufty.net@localhost
-:Revision: $Id: mk-files.txt,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+:Revision: $Id: mk-files.txt,v 1.2 2020/05/24 11:09:44 nia Exp $
 :Copyright: Crufty.NET
Index: pkgsrc/devel/bmake/files/mk/mkopt.sh
diff -u pkgsrc/devel/bmake/files/mk/mkopt.sh:1.1.1.1 pkgsrc/devel/bmake/files/mk/mkopt.sh:1.2
--- pkgsrc/devel/bmake/files/mk/mkopt.sh:1.1.1.1        Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/mkopt.sh        Sun May 24 11:09:44 2020
@@ -1,5 +1,5 @@
 :
-# $Id: mkopt.sh,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: mkopt.sh,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2014, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/nls.mk
diff -u pkgsrc/devel/bmake/files/mk/nls.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/nls.mk:1.2
--- pkgsrc/devel/bmake/files/mk/nls.mk:1.1.1.1  Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/nls.mk  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-#      $NetBSD: nls.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $NetBSD: nls.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 
 .if !target(.MAIN)
 # init.mk not included
Index: pkgsrc/devel/bmake/files/mk/obj.mk
diff -u pkgsrc/devel/bmake/files/mk/obj.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/obj.mk:1.2
--- pkgsrc/devel/bmake/files/mk/obj.mk:1.1.1.1  Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/obj.mk  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: obj.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: obj.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 1999-2010, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/options.mk
diff -u pkgsrc/devel/bmake/files/mk/options.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/options.mk:1.2
--- pkgsrc/devel/bmake/files/mk/options.mk:1.1.1.1      Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/options.mk      Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: options.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: options.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2012, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/own.mk
diff -u pkgsrc/devel/bmake/files/mk/own.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/own.mk:1.2
--- pkgsrc/devel/bmake/files/mk/own.mk:1.1.1.1  Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/own.mk  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: own.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: own.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 
 .if !target(__${.PARSEFILE}__)
 __${.PARSEFILE}__:
Index: pkgsrc/devel/bmake/files/mk/prlist.mk
diff -u pkgsrc/devel/bmake/files/mk/prlist.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/prlist.mk:1.2
--- pkgsrc/devel/bmake/files/mk/prlist.mk:1.1.1.1       Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/prlist.mk       Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: prlist.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: prlist.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2006, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/prog.mk
diff -u pkgsrc/devel/bmake/files/mk/prog.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/prog.mk:1.2
--- pkgsrc/devel/bmake/files/mk/prog.mk:1.1.1.1 Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/prog.mk Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-#      $Id: prog.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $Id: prog.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 
 .if !target(__${.PARSEFILE}__)
 __${.PARSEFILE}__:
Index: pkgsrc/devel/bmake/files/mk/progs.mk
diff -u pkgsrc/devel/bmake/files/mk/progs.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/progs.mk:1.2
--- pkgsrc/devel/bmake/files/mk/progs.mk:1.1.1.1        Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/progs.mk        Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: progs.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: progs.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2006, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/rst2htm.mk
diff -u pkgsrc/devel/bmake/files/mk/rst2htm.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/rst2htm.mk:1.2
--- pkgsrc/devel/bmake/files/mk/rst2htm.mk:1.1.1.1      Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/rst2htm.mk      Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: rst2htm.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: rst2htm.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2009, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/scripts.mk
diff -u pkgsrc/devel/bmake/files/mk/scripts.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/scripts.mk:1.2
--- pkgsrc/devel/bmake/files/mk/scripts.mk:1.1.1.1      Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/scripts.mk      Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: scripts.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: scripts.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2006, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/srctop.mk
diff -u pkgsrc/devel/bmake/files/mk/srctop.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/srctop.mk:1.2
--- pkgsrc/devel/bmake/files/mk/srctop.mk:1.1.1.1       Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/srctop.mk       Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: srctop.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: srctop.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2012, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/stage-install.sh
diff -u pkgsrc/devel/bmake/files/mk/stage-install.sh:1.1.1.1 pkgsrc/devel/bmake/files/mk/stage-install.sh:1.2
--- pkgsrc/devel/bmake/files/mk/stage-install.sh:1.1.1.1        Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/stage-install.sh        Sun May 24 11:09:44 2020
@@ -33,7 +33,7 @@
 #      
 
 # RCSid:
-#      $Id: stage-install.sh,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $Id: stage-install.sh,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2013, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/subdir.mk
diff -u pkgsrc/devel/bmake/files/mk/subdir.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/subdir.mk:1.2
--- pkgsrc/devel/bmake/files/mk/subdir.mk:1.1.1.1       Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/subdir.mk       Sun May 24 11:09:44 2020
@@ -1,7 +1,7 @@
-#      $Id: subdir.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $Id: subdir.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #      skip missing directories...
 
-#      $NetBSD: subdir.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $NetBSD: subdir.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #      @(#)bsd.subdir.mk       5.9 (Berkeley) 2/1/91
 
 .if ${.MAKE.LEVEL} == 0 && ${.MAKE.MODE:Uno:Mmeta*} != ""
Index: pkgsrc/devel/bmake/files/mk/sys.clean-env.mk
diff -u pkgsrc/devel/bmake/files/mk/sys.clean-env.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/sys.clean-env.mk:1.2
--- pkgsrc/devel/bmake/files/mk/sys.clean-env.mk:1.1.1.1        Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/sys.clean-env.mk        Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: sys.clean-env.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: sys.clean-env.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2009, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/sys.debug.mk
diff -u pkgsrc/devel/bmake/files/mk/sys.debug.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/sys.debug.mk:1.2
--- pkgsrc/devel/bmake/files/mk/sys.debug.mk:1.1.1.1    Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/sys.debug.mk    Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: sys.debug.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: sys.debug.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2009, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/sys.dependfile.mk
diff -u pkgsrc/devel/bmake/files/mk/sys.dependfile.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/sys.dependfile.mk:1.2
--- pkgsrc/devel/bmake/files/mk/sys.dependfile.mk:1.1.1.1       Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/sys.dependfile.mk       Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: sys.dependfile.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: sys.dependfile.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2012, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/sys.mk
diff -u pkgsrc/devel/bmake/files/mk/sys.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/sys.mk:1.2
--- pkgsrc/devel/bmake/files/mk/sys.mk:1.1.1.1  Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/sys.mk  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: sys.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: sys.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2003-2009, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/sys.vars.mk
diff -u pkgsrc/devel/bmake/files/mk/sys.vars.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/sys.vars.mk:1.2
--- pkgsrc/devel/bmake/files/mk/sys.vars.mk:1.1.1.1     Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/sys.vars.mk     Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: sys.vars.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: sys.vars.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2003-2009, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/target-flags.mk
diff -u pkgsrc/devel/bmake/files/mk/target-flags.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/target-flags.mk:1.2
--- pkgsrc/devel/bmake/files/mk/target-flags.mk:1.1.1.1 Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/target-flags.mk Sun May 24 11:09:44 2020
@@ -37,7 +37,7 @@
 
 
 # RCSid:
-#      $Id: target-flags.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $Id: target-flags.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 1998-2002, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/warnings.mk
diff -u pkgsrc/devel/bmake/files/mk/warnings.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/warnings.mk:1.2
--- pkgsrc/devel/bmake/files/mk/warnings.mk:1.1.1.1     Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/warnings.mk     Sun May 24 11:09:44 2020
@@ -1,5 +1,5 @@
 # RCSid:
-#      $Id: warnings.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $Id: warnings.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2002, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/whats.mk
diff -u pkgsrc/devel/bmake/files/mk/whats.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/whats.mk:1.2
--- pkgsrc/devel/bmake/files/mk/whats.mk:1.1.1.1        Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/whats.mk        Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: whats.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: whats.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 #      @(#) Copyright (c) 2014-2020, Simon J. Gerraty
 #
Index: pkgsrc/devel/bmake/files/mk/yacc.mk
diff -u pkgsrc/devel/bmake/files/mk/yacc.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/yacc.mk:1.2
--- pkgsrc/devel/bmake/files/mk/yacc.mk:1.1.1.1 Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/yacc.mk Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: yacc.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: yacc.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 
 #
 #      @(#) Copyright (c) 1999-2011, Simon J. Gerraty

Index: pkgsrc/devel/bmake/files/mk/sys/AIX.mk
diff -u pkgsrc/devel/bmake/files/mk/sys/AIX.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/sys/AIX.mk:1.2
--- pkgsrc/devel/bmake/files/mk/sys/AIX.mk:1.1.1.1      Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/sys/AIX.mk      Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-#      $NetBSD: AIX.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $NetBSD: AIX.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #      @(#)sys.mk      5.11 (Berkeley) 3/13/91
 
 OS=            AIX
Index: pkgsrc/devel/bmake/files/mk/sys/Darwin.mk
diff -u pkgsrc/devel/bmake/files/mk/sys/Darwin.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/sys/Darwin.mk:1.2
--- pkgsrc/devel/bmake/files/mk/sys/Darwin.mk:1.1.1.1   Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/sys/Darwin.mk   Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-#      $NetBSD: Darwin.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $NetBSD: Darwin.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #      @(#)sys.mk      8.2 (Berkeley) 3/21/94
 
 OS=            Darwin
Index: pkgsrc/devel/bmake/files/mk/sys/Generic.mk
diff -u pkgsrc/devel/bmake/files/mk/sys/Generic.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/sys/Generic.mk:1.2
--- pkgsrc/devel/bmake/files/mk/sys/Generic.mk:1.1.1.1  Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/sys/Generic.mk  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-#      $Id: Generic.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $Id: Generic.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 
 # some reasonable defaults
Index: pkgsrc/devel/bmake/files/mk/sys/HP-UX.mk
diff -u pkgsrc/devel/bmake/files/mk/sys/HP-UX.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/sys/HP-UX.mk:1.2
--- pkgsrc/devel/bmake/files/mk/sys/HP-UX.mk:1.1.1.1    Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/sys/HP-UX.mk    Sun May 24 11:09:44 2020
@@ -1,5 +1,5 @@
-#      $Id: HP-UX.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
-#      $NetBSD: HP-UX.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $Id: HP-UX.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
+#      $NetBSD: HP-UX.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #      @(#)sys.mk      5.11 (Berkeley) 3/13/91
 
 OS=            HP-UX
Index: pkgsrc/devel/bmake/files/mk/sys/IRIX.mk
diff -u pkgsrc/devel/bmake/files/mk/sys/IRIX.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/sys/IRIX.mk:1.2
--- pkgsrc/devel/bmake/files/mk/sys/IRIX.mk:1.1.1.1     Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/sys/IRIX.mk     Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-#      $NetBSD: IRIX.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $NetBSD: IRIX.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #      @(#)sys.mk      8.2 (Berkeley) 3/21/94
 
 .if ${.PARSEFILE} == "sys.mk"
Index: pkgsrc/devel/bmake/files/mk/sys/Linux.mk
diff -u pkgsrc/devel/bmake/files/mk/sys/Linux.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/sys/Linux.mk:1.2
--- pkgsrc/devel/bmake/files/mk/sys/Linux.mk:1.1.1.1    Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/sys/Linux.mk    Sun May 24 11:09:44 2020
@@ -1,5 +1,5 @@
-#      $Id: Linux.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
-#      $NetBSD: Linux.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $Id: Linux.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
+#      $NetBSD: Linux.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #      @(#)sys.mk      5.11 (Berkeley) 3/13/91
 
 OS?=           Linux
Index: pkgsrc/devel/bmake/files/mk/sys/NetBSD.mk
diff -u pkgsrc/devel/bmake/files/mk/sys/NetBSD.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/sys/NetBSD.mk:1.2
--- pkgsrc/devel/bmake/files/mk/sys/NetBSD.mk:1.1.1.1   Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/sys/NetBSD.mk   Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-#      $NetBSD: NetBSD.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $NetBSD: NetBSD.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #      @(#)sys.mk      8.2 (Berkeley) 3/21/94
 
 OS=            NetBSD
Index: pkgsrc/devel/bmake/files/mk/sys/OSF1.mk
diff -u pkgsrc/devel/bmake/files/mk/sys/OSF1.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/sys/OSF1.mk:1.2
--- pkgsrc/devel/bmake/files/mk/sys/OSF1.mk:1.1.1.1     Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/sys/OSF1.mk     Sun May 24 11:09:44 2020
@@ -1,5 +1,5 @@
-#      $Id: OSF1.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
-#      $NetBSD: OSF1.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $Id: OSF1.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
+#      $NetBSD: OSF1.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #      @(#)sys.mk      5.11 (Berkeley) 3/13/91
 
 OS?=           OSF1
Index: pkgsrc/devel/bmake/files/mk/sys/OpenBSD.mk
diff -u pkgsrc/devel/bmake/files/mk/sys/OpenBSD.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/sys/OpenBSD.mk:1.2
--- pkgsrc/devel/bmake/files/mk/sys/OpenBSD.mk:1.1.1.1  Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/sys/OpenBSD.mk  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-#      $NetBSD: OpenBSD.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $NetBSD: OpenBSD.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #      @(#)sys.mk      8.2 (Berkeley) 3/21/94
 
 OS=            OpenBSD
Index: pkgsrc/devel/bmake/files/mk/sys/SunOS.mk
diff -u pkgsrc/devel/bmake/files/mk/sys/SunOS.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/sys/SunOS.mk:1.2
--- pkgsrc/devel/bmake/files/mk/sys/SunOS.mk:1.1.1.1    Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/sys/SunOS.mk    Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-#      $Id: SunOS.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $Id: SunOS.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 
 .if ${.PARSEFILE} == "sys.mk"
 .include <host-target.mk>
Index: pkgsrc/devel/bmake/files/mk/sys/UnixWare.mk
diff -u pkgsrc/devel/bmake/files/mk/sys/UnixWare.mk:1.1.1.1 pkgsrc/devel/bmake/files/mk/sys/UnixWare.mk:1.2
--- pkgsrc/devel/bmake/files/mk/sys/UnixWare.mk:1.1.1.1 Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/mk/sys/UnixWare.mk Sun May 24 11:09:44 2020
@@ -1,6 +1,6 @@
-#      $Id: UnixWare.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $Id: UnixWare.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #      based on "Id: SunOS.5.sys.mk,v 1.6 2003/09/30 16:42:23 sjg Exp "
-#      $NetBSD: UnixWare.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+#      $NetBSD: UnixWare.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #      @(#)sys.mk      5.11 (Berkeley) 3/13/91
 
 OS?=           UnixWare

Index: pkgsrc/devel/bmake/files/unit-tests/Makefile
diff -u pkgsrc/devel/bmake/files/unit-tests/Makefile:1.1.1.1 pkgsrc/devel/bmake/files/unit-tests/Makefile:1.2
--- pkgsrc/devel/bmake/files/unit-tests/Makefile:1.1.1.1        Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/unit-tests/Makefile        Sun May 24 11:09:44 2020
@@ -1,6 +1,6 @@
-# $Id: Makefile,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: Makefile,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
-# $NetBSD: Makefile,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $NetBSD: Makefile,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 # Unit tests for make(1)
 # The main targets are:
Index: pkgsrc/devel/bmake/files/unit-tests/Makefile.config.in
diff -u pkgsrc/devel/bmake/files/unit-tests/Makefile.config.in:1.1.1.1 pkgsrc/devel/bmake/files/unit-tests/Makefile.config.in:1.2
--- pkgsrc/devel/bmake/files/unit-tests/Makefile.config.in:1.1.1.1      Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/unit-tests/Makefile.config.in      Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: Makefile.config.in,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $Id: Makefile.config.in,v 1.2 2020/05/24 11:09:44 nia Exp $
 
 srcdir= @srcdir@
 DIFF_FLAGS?= @diff_u@
Index: pkgsrc/devel/bmake/files/unit-tests/cond-late.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/cond-late.mk:1.1.1.1 pkgsrc/devel/bmake/files/unit-tests/cond-late.mk:1.2
--- pkgsrc/devel/bmake/files/unit-tests/cond-late.mk:1.1.1.1    Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/unit-tests/cond-late.mk    Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $NetBSD: cond-late.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $NetBSD: cond-late.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 # Using the :? modifier, variable expressions can contain conditional
 # expressions that are evaluated late.  Any variables appearing in these
Index: pkgsrc/devel/bmake/files/unit-tests/dollar.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/dollar.mk:1.1.1.1 pkgsrc/devel/bmake/files/unit-tests/dollar.mk:1.2
--- pkgsrc/devel/bmake/files/unit-tests/dollar.mk:1.1.1.1       Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/unit-tests/dollar.mk       Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $NetBSD: dollar.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $NetBSD: dollar.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 # Test the various places where a dollar character can appear and
 # see what happens.  There are lots of surprises here.
Index: pkgsrc/devel/bmake/files/unit-tests/include-main.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/include-main.mk:1.1.1.1 pkgsrc/devel/bmake/files/unit-tests/include-main.mk:1.2
--- pkgsrc/devel/bmake/files/unit-tests/include-main.mk:1.1.1.1 Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/unit-tests/include-main.mk Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $NetBSD: include-main.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $NetBSD: include-main.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 # Demonstrates that the .INCLUDEDFROMFILE magic variable does not behave
 # as described in the manual page.
Index: pkgsrc/devel/bmake/files/unit-tests/include-sub.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/include-sub.mk:1.1.1.1 pkgsrc/devel/bmake/files/unit-tests/include-sub.mk:1.2
--- pkgsrc/devel/bmake/files/unit-tests/include-sub.mk:1.1.1.1  Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/unit-tests/include-sub.mk  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $NetBSD: include-sub.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $NetBSD: include-sub.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 
 .if ${.INCLUDEDFROMFILE} == "include-main.mk"
 LOG+=          sub-before-ok
Index: pkgsrc/devel/bmake/files/unit-tests/include-subsub.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/include-subsub.mk:1.1.1.1 pkgsrc/devel/bmake/files/unit-tests/include-subsub.mk:1.2
--- pkgsrc/devel/bmake/files/unit-tests/include-subsub.mk:1.1.1.1       Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/unit-tests/include-subsub.mk       Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $NetBSD: include-subsub.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $NetBSD: include-subsub.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 
 .if ${.INCLUDEDFROMFILE:T} == "include-sub.mk"
 LOG+=          subsub-ok
Index: pkgsrc/devel/bmake/files/unit-tests/varmod-edge.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/varmod-edge.mk:1.1.1.1 pkgsrc/devel/bmake/files/unit-tests/varmod-edge.mk:1.2
--- pkgsrc/devel/bmake/files/unit-tests/varmod-edge.mk:1.1.1.1  Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/unit-tests/varmod-edge.mk  Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-edge.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $NetBSD: varmod-edge.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 # Tests for edge cases in variable modifiers.
 #
Index: pkgsrc/devel/bmake/files/unit-tests/varquote.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/varquote.mk:1.1.1.1 pkgsrc/devel/bmake/files/unit-tests/varquote.mk:1.2
--- pkgsrc/devel/bmake/files/unit-tests/varquote.mk:1.1.1.1     Sun May 24 05:35:53 2020
+++ pkgsrc/devel/bmake/files/unit-tests/varquote.mk     Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $NetBSD: varquote.mk,v 1.1.1.1 2020/05/24 05:35:53 nia Exp $
+# $NetBSD: varquote.mk,v 1.2 2020/05/24 11:09:44 nia Exp $
 #
 # Test VAR:q modifier
 

Index: pkgsrc/devel/bmake/files/unit-tests/cond1.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/cond1.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/cond1.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/cond1.mk:1.2    Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/cond1.mk        Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: cond1.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: cond1.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 
 # hard code these!
 TEST_UNAME_S= NetBSD
Index: pkgsrc/devel/bmake/files/unit-tests/cond2.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/cond2.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/cond2.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/cond2.mk:1.2    Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/cond2.mk        Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: cond2.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: cond2.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 
 TEST_UNAME_S= NetBSD
 
@@ -21,5 +21,9 @@ Y!= echo TEST_NOT_SET is empty or not de
 Y= oops
 .endif
 
+.if defined(.NDEF) && ${.NDEF} > 0
+Z= yes
+.endif
+
 all:
        @echo $@
Index: pkgsrc/devel/bmake/files/unit-tests/doterror.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/doterror.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/doterror.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/doterror.mk:1.2 Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/doterror.mk     Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: doterror.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: doterror.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 
 
 .BEGIN:
Index: pkgsrc/devel/bmake/files/unit-tests/dotwait.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/dotwait.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/dotwait.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/dotwait.mk:1.2  Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/dotwait.mk      Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $NetBSD: dotwait.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $NetBSD: dotwait.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 
 THISMAKEFILE:= ${.PARSEDIR}/${.PARSEFILE}
 
@@ -11,7 +11,7 @@ PAUSE= sleep 1
 # Ignore "--- target ---" lines printed by parallel make.
 all:
 .for t in ${TESTS}
-       @${.MAKE} -f ${THISMAKEFILE} -j4 $t | grep -v "^--- "
+       @${.MAKE} -f ${THISMAKEFILE} -j4 $t 2>&1 | grep -v "^--- "
 .endfor
 
 #
Index: pkgsrc/devel/bmake/files/unit-tests/error.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/error.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/error.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/error.mk:1.2    Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/error.mk        Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: error.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: error.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 
 .info just FYI
 .warning this could be serious
Index: pkgsrc/devel/bmake/files/unit-tests/escape.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/escape.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/escape.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/escape.mk:1.2   Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/escape.mk       Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: escape.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: escape.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 #
 # Test backslash escaping.
 
@@ -35,8 +35,8 @@
 # Also, our practice is that an even number of backslashes before a
 # newline in a variable assignment simply stores the backslashes as part
 # of the value, and treats the newline as though it was not escaped.
-# Similarly, ann even number of backslashes before a newline in a
-# command simply uses the backslashes as part of the command test, but
+# Similarly, an even number of backslashes before a newline in a
+# command simply uses the backslashes as part of the command, but
 # does not escape the newline.  This is compatible with GNU make.
 
 all: .PHONY
Index: pkgsrc/devel/bmake/files/unit-tests/export-all.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/export-all.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/export-all.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/export-all.mk:1.2       Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/export-all.mk   Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: export-all.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: export-all.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 
 UT_OK=good
 UT_F=fine
Index: pkgsrc/devel/bmake/files/unit-tests/export-env.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/export-env.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/export-env.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/export-env.mk:1.2       Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/export-env.mk   Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: export-env.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: export-env.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 
 # our normal .export, subsequent changes affect the environment
 UT_TEST=this
@@ -15,9 +15,12 @@ UT_EXP=before-export
 export UT_EXP=exported
 UT_EXP=not-exported
 
+UT_LIT= literal ${UT_TEST}
+.export-literal UT_LIT
+
 all:
-       @echo make:; ${UT_TEST UT_ENV UT_EXP:L:@v@echo $v=${$v};@}
-       @echo env:; ${UT_TEST UT_ENV UT_EXP:L:@v@echo $v=$${$v};@}
+       @echo make:; ${UT_TEST UT_ENV UT_EXP UT_LIT:L:@v@echo $v=${$v};@}
+       @echo env:; ${UT_TEST UT_ENV UT_EXP UT_LIT:L:@v@echo $v=$${$v};@}
 
 
 
Index: pkgsrc/devel/bmake/files/unit-tests/export.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/export.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/export.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/export.mk:1.2   Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/export.mk       Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: export.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: export.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 
 UT_TEST=export
 UT_FOO=foo${BAR}
Index: pkgsrc/devel/bmake/files/unit-tests/forloop.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/forloop.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/forloop.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/forloop.mk:1.2  Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/forloop.mk      Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: forloop.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: forloop.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 
 all: for-loop
 
@@ -33,7 +33,15 @@ X!= echo 'cfl=${cfl}' >&2; echo
 .for a b in ${EMPTY}
 X!= echo 'a=$a b=$b' >&2; echo
 .endfor
-.endif
+
+# Since at least 1993, iteration stops at the first newline.
+# Back then, the .newline variable didn't exist, therefore it was unlikely
+# that a newline ever occured.
+.for var in a${.newline}b${.newline}c
+X!= echo 'newline-item=('${var:Q}')' 1>&2; echo
+.endfor
+
+.endif # for-fail
 
 .for a b in ${LIST} ${LIST:tu} ${XTRA_LIST}
 X!= echo 'a=$a b=$b' >&2; echo
Index: pkgsrc/devel/bmake/files/unit-tests/forsubst.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/forsubst.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/forsubst.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/forsubst.mk:1.2 Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/forsubst.mk     Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: forsubst.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: forsubst.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 
 all: for-subst
 
Index: pkgsrc/devel/bmake/files/unit-tests/impsrc.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/impsrc.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/impsrc.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/impsrc.mk:1.2   Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/impsrc.mk       Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $NetBSD: impsrc.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $NetBSD: impsrc.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 
 # Does ${.IMPSRC} work properly?
 # It should be set, in order of precedence, to ${.TARGET} of:
Index: pkgsrc/devel/bmake/files/unit-tests/misc.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/misc.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/misc.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/misc.mk:1.2     Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/misc.mk Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: misc.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: misc.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 
 .if !exists(${.CURDIR}/)
 .warning ${.CURDIR}/ doesn't exist ?
Index: pkgsrc/devel/bmake/files/unit-tests/moderrs.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/moderrs.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/moderrs.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/moderrs.mk:1.2  Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/moderrs.mk      Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: moderrs.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: moderrs.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 #
 # various modifier error tests
 
Index: pkgsrc/devel/bmake/files/unit-tests/modmisc.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/modmisc.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/modmisc.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/modmisc.mk:1.2  Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/modmisc.mk      Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: modmisc.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: modmisc.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 #
 # miscellaneous modifier tests
 
Index: pkgsrc/devel/bmake/files/unit-tests/modorder.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/modorder.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/modorder.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/modorder.mk:1.2 Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/modorder.mk     Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $NetBSD: modorder.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $NetBSD: modorder.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 
 LIST=          one two three four five six seven eight nine ten
 LISTX=         ${LIST:Ox}
@@ -12,8 +12,9 @@ all:
        @echo "LIST:O    = ${LIST:O}"
        # 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 the test
-       # will incorrectly fail with probability 2.8E-7.
+       # support checking probabilistic output, so we accept that each of the
+       # 3 :Ox tests will incorrectly fail with probability 2.756E-7, which
+       # lets the whole test fail once in 1.209.600 runs, on average.
        @echo "LIST:Ox   = `test '${LIST:Ox}' != '${LIST:Ox}' ${TEST_RESULT}`"
        @echo "LIST:O:Ox = `test '${LIST:O:Ox}' != '${LIST:O:Ox}' ${TEST_RESULT}`"
        @echo "LISTX     = `test '${LISTX}' != '${LISTX}' ${TEST_RESULT}`"
Index: pkgsrc/devel/bmake/files/unit-tests/modword.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/modword.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/modword.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/modword.mk:1.2  Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/modword.mk      Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: modword.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: modword.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 #
 # Test behaviour of new :[] modifier
 
Index: pkgsrc/devel/bmake/files/unit-tests/order.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/order.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/order.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/order.mk:1.2    Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/order.mk        Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $NetBSD: order.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $NetBSD: order.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 
 # Test that .ORDER is handled correctly.
 # The explicit dependency the.o: the.h will make us examine the.h
Index: pkgsrc/devel/bmake/files/unit-tests/phony-end.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/phony-end.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/phony-end.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/phony-end.mk:1.2        Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/phony-end.mk    Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: phony-end.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: phony-end.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 
 all ok also.ok bug phony:
        @echo '${.TARGET .PREFIX .IMPSRC:L:@v@$v="${$v}"@}'
Index: pkgsrc/devel/bmake/files/unit-tests/posix.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/posix.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/posix.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/posix.mk:1.2    Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/posix.mk        Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: posix.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: posix.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 
 all:   x plus subs err
 
Index: pkgsrc/devel/bmake/files/unit-tests/posix1.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/posix1.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/posix1.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/posix1.mk:1.2   Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/posix1.mk       Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $NetBSD: posix1.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $NetBSD: posix1.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 
 # Keep the default suffixes from interfering, just in case.
 .SUFFIXES:
Index: pkgsrc/devel/bmake/files/unit-tests/qequals.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/qequals.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/qequals.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/qequals.mk:1.2  Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/qequals.mk      Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: qequals.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: qequals.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 
 M= i386
 V.i386= OK
Index: pkgsrc/devel/bmake/files/unit-tests/suffixes.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/suffixes.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/suffixes.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/suffixes.mk:1.2 Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/suffixes.mk     Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $NetBSD: suffixes.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $NetBSD: suffixes.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 
 # Issues from PR 49086
 
Index: pkgsrc/devel/bmake/files/unit-tests/sysv.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/sysv.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/sysv.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/sysv.mk:1.2     Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/sysv.mk Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: sysv.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: sysv.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 
 FOO ?=
 FOOBAR = ${FOO:=bar}
@@ -11,7 +11,7 @@ FUN = ${B}${S}fun
 SUN = the Sun
 
 # we expect nothing when FOO is empty
-all: foo fun
+all: foo fun sam bla
 
 foo:
        @echo FOOBAR = ${FOOBAR}
@@ -24,3 +24,20 @@ fun:
        @echo ${FUN:${B}${S}fun=fun}
        @echo ${FUN:${B}${S}%=%}
        @echo ${In:L:%=% ${SUN}}
+
+
+SAM=sam.c
+
+sam:
+       @echo ${SAM:s%.c=acme}
+       @echo ${SAM:s%.c=a%.d}
+       @echo ${SAM:s.c=a%.d}
+       @echo ${SAM:sam.c=a%.c}
+       @echo ${SAM:%=a%.c}
+       @echo ${SAM:%.c=a%.c}
+       @echo ${SAM:sam%=a%.c}
+
+BLA=
+
+bla:
+       @echo $(BLA:%=foo/%x)
Index: pkgsrc/devel/bmake/files/unit-tests/unexport-env.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/unexport-env.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/unexport-env.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/unexport-env.mk:1.2     Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/unexport-env.mk Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: unexport-env.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: unexport-env.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 
 # pick up a bunch of exported vars
 .include "export.mk"
Index: pkgsrc/devel/bmake/files/unit-tests/unexport.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/unexport.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/unexport.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/unexport.mk:1.2 Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/unexport.mk     Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: unexport.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: unexport.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 
 # pick up a bunch of exported vars
 .include "export.mk"
Index: pkgsrc/devel/bmake/files/unit-tests/varcmd.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/varcmd.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/varcmd.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/varcmd.mk:1.2   Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/varcmd.mk       Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: varcmd.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: varcmd.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 #
 # Test behaviour of recursive make and vars set on command line.
 
@@ -15,7 +15,7 @@ show:
        @echo "${TAG} FU=<v>${FU}</v> FOO=<v>${FOO}</v> VAR=<v>${VAR}</v>"
 
 one:   show
-       @${.MAKE} -f ${MAKEFILE} FU=bar FOO=goo two
+       @${.MAKE} -f ${MAKEFILE} FU=bar FOO+=goo two
 
 two:   show
        @${.MAKE} -f ${MAKEFILE} three
@@ -24,6 +24,17 @@ three:       show
        @${.MAKE} -f ${MAKEFILE} four
 
 
+.ifmake two
+# this should not work
+FU+= oops
+FOO+= oops
+_FU:= ${FU}
+_FOO:= ${FOO}
+two: immutable
+immutable:
+       @echo "$@ FU='${_FU}'"
+       @echo "$@ FOO='${_FOO}'"
+.endif
 .ifmake four
 VAR=Internal
 .MAKEOVERRIDES+= VAR
Index: pkgsrc/devel/bmake/files/unit-tests/varmisc.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/varmisc.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/varmisc.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/varmisc.mk:1.2  Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/varmisc.mk      Sun May 24 11:09:44 2020
@@ -1,8 +1,62 @@
-# $Id: varmisc.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: varmisc.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 #
 # Miscellaneous variable tests.
 
-all: unmatched_var_paren
+all: unmatched_var_paren D_true U_true D_false U_false Q_lhs Q_rhs NQ_none \
+       strftime cmpv
 
 unmatched_var_paren:
        @echo ${foo::=foo-text}
+
+True = ${echo true >&2:L:sh}TRUE
+False= ${echo false >&2:L:sh}FALSE
+
+VSET= is set
+.undef UNDEF
+
+U_false:
+       @echo :U skipped when var set
+       @echo ${VSET:U${False}}
+
+D_false:
+       @echo :D skipped if var undef
+       @echo ${UNDEF:D${False}}
+
+U_true:
+       @echo :U expanded when var undef
+       @echo ${UNDEF:U${True}}
+
+D_true:
+       @echo :D expanded when var set
+       @echo ${VSET:D${True}}
+
+Q_lhs:
+       @echo :? only lhs when value true
+       @echo ${1:L:?${True}:${False}}
+
+Q_rhs:
+       @echo :? only rhs when value false
+       @echo ${0:L:?${True}:${False}}
+
+NQ_none:
+       @echo do not evaluate or expand :? if discarding
+       @echo ${VSET:U${1:L:?${True}:${False}}}
+
+April1= 1459494000
+
+# slightly contorted syntax to use utc via variable
+strftime:
+       @echo ${year=%Y month=%m day=%d:L:gmtime=1459494000}
+       @echo date=${%Y%m%d:L:${gmtime=${April1}:L}}
+
+# big jumps to handle 3 digits per step
+M_cmpv.units = 1 1000 1000000
+M_cmpv = S,., ,g:_:range:@i@+ $${_:[-$$i]} \* $${M_cmpv.units:[$$i]}@:S,^,expr 0 ,1:sh
+
+Version = 123.456.789
+cmpv.only = target specific vars
+
+cmpv:
+       @echo Version=${Version} == ${Version:${M_cmpv}}
+       @echo Literal=3.4.5 == ${3.4.5:L:${M_cmpv}}
+       @echo We have ${${.TARGET:T}.only}
Index: pkgsrc/devel/bmake/files/unit-tests/varshell.mk
diff -u pkgsrc/devel/bmake/files/unit-tests/varshell.mk:1.2 pkgsrc/devel/bmake/files/unit-tests/varshell.mk:1.3
--- pkgsrc/devel/bmake/files/unit-tests/varshell.mk:1.2 Tue May 19 22:01:19 2015
+++ pkgsrc/devel/bmake/files/unit-tests/varshell.mk     Sun May 24 11:09:44 2020
@@ -1,4 +1,4 @@
-# $Id: varshell.mk,v 1.2 2015/05/19 22:01:19 joerg Exp $
+# $Id: varshell.mk,v 1.3 2020/05/24 11:09:44 nia Exp $
 #
 # Test VAR != shell command
 



Home | Main Index | Thread Index | Old Index