freebsd/src.git
22 months agoImport bmake-20200902vendor/NetBSD/bmake/20200902
Simon J. Gerraty [Sat, 5 Sep 2020 16:11:04 +0000 (5 16:11 +0000)]
Import bmake-20200902

Lots of code refactoring, simplification and cleanup.
Lots of new unit-tests providing much higher code coverage.
All courtesy of rillig at netbsd.

Other significant changes:

o new read-only variable .SHELL which provides the path of the shell
  used to run scripts (as defined by  the .SHELL target).

o new debug option -dl: LINT mode, does the equivalent of := for all
  variable assignments so that file and line number are reported for
  variable parse errors.

2 years agoImport bmake-20200710vendor/NetBSD/bmake/20200710
Simon J. Gerraty [Sat, 11 Jul 2020 22:45:05 +0000 (11 22:45 +0000)]
Import bmake-20200710

from ChangeLog:

    o filemon/filemon_dev.c: use O_CLOEXEC rather than extra syscall
    o meta.c: target flagged .META is out-of-date if meta file missing
    o cond.c: fix for compare_expression when doEval=0
    o unit-tests/Makefile: rework
    o filemon/filemon_dev.c: ensure filemon fd is closed on exec.

2 years agoImport bmake-20200704vendor/NetBSD/bmake/20200704
Simon J. Gerraty [Wed, 8 Jul 2020 18:32:15 +0000 (8 18:32 +0000)]
Import bmake-20200704

from ChangeLog:

    (most of this by rillig@)
    o lots of style and white-space cleanup
    o lots more unit tests for variable modifiers
    o simplified description of some functions
    o str.c: refactor Str_Match
    o var.c: debugging output for :@
      constify VarModify parameter
      fix :hash modifier on 16-bit platforms
      remove unnecessary forward declarations
      refactor ApplyModifier_SysV to have less indentation
      simplify code for :E and :R
      clean up code for :H and :T
      refactor ApplyModifiers

    * var.c: we need stdint.h on some platforms to get uint32_t
    * unit-test/Makefile: we need to supress the specific error
    for RE substitution error in modmisc, since it varies accross
    different OS.

2 years agoImport bmake-20200629vendor/NetBSD/bmake/20200629
Simon J. Gerraty [Wed, 1 Jul 2020 02:13:04 +0000 (1 02:13 +0000)]
Import bmake-20200629

from ChangeLog:

    o cond.c: do not eval unnecessary terms of conditionals.

    o meta.c: report error if lseek in filemon_read fails

    o str.c: performance improvement for Str_Match for multiple '*'

    o dieQuietly: supress the failure output from make
    when failing node is a sub-make or a sibling failed.
    This cuts down greatly on unhelpful noise at the end of
    build log.  Disabled by -dj or .MAKE.DIE_QUIETLY=no

    o unit test for :Or

2 years agoImport bmake-20200606vendor/NetBSD/bmake/20200606
Simon J. Gerraty [Tue, 9 Jun 2020 02:07:26 +0000 (9 02:07 +0000)]
Import bmake-20200606

Relevant items from ChangeLog:

o dir.c: cached_stats - don't confuse stat and lstat results.
o var.c: add :Or for reverse sort.

2 years agoImport bmake-20200517vendor/NetBSD/bmake/20200517
Simon J. Gerraty [Wed, 20 May 2020 19:34:48 +0000 (20 19:34 +0000)]
Import bmake-20200517

Changes since 20181221 are mostly portability related
hence the large gap in versions imported.

There are however some bug fixes, and a rework of filemon handling.
In NetBSD make/filemon/filemon_ktrace.c allows use of fktrace
and elimination of filemon(4) which has not had the TLC it needs.

FreeBSD filemon(4) is in much better shape, so bmake/filemon/filemon_dev.c
allows use of that, with a bit less overhead than the ktrace model.

Summary of changes from ChangeLog

o str.c: empty string does not match % pattern
  plus unit-test changes
o var.c: import handling of old sysV style modifier using '%'
o str.c: refactor brk_string
o meta.c: meta_oodate, CHECK_VALID_META is too aggressive for CMD
  a blank command is perfectly valid.
o meta.c: meta_oodate, check for corrupted meta file
  earlier and more often.
* meta.c: meta_compat_parent check for USE_FILEMON
  patch from Soeren Tempel
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
o meta.c: avoid passing NULL to filemon_*() when meta_needed()
  returns FALSE.
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.
o parse.c: don't pass NULL to realpath(3)
  some versions cannot handle it.
o parse.c: ParseDoDependency: free paths rather than assert

plus more unit-tests

2 years agobmake: import -fno-common fix build back from upstream
Kyle Evans [Mon, 30 Mar 2020 16:20:04 +0000 (30 16:20 +0000)]
bmake: import -fno-common fix build back from upstream

sjg@ committed the local patch previously committed upstream; pull it in to
vendor/ to ease any potential stress of future imports.

3 years agoImport bmake-20181221vendor/NetBSD/bmake/20181221
Simon J. Gerraty [Sat, 22 Dec 2018 21:32:17 +0000 (22 21:32 +0000)]
Import bmake-20181221

o parse.c: ParseVErrorInternal use .PARSEDIR
  and apply if relative, and then use .PARSEFILE
  for consistent result.
o var.c: avoid SEGFAULT in .unexport-env
  when MAKELEVEL is not set

3 years agoImport bmake-20180919vendor/NetBSD/bmake/20180919
Simon J. Gerraty [Thu, 6 Dec 2018 00:13:35 +0000 (6 00:13 +0000)]
Import bmake-20180919

4 years agoImport bmake-20180512vendor/NetBSD/bmake/20180512
Simon J. Gerraty [Fri, 18 May 2018 19:49:54 +0000 (18 19:49 +0000)]
Import bmake-20180512

Of relevance:

  o job.c: skip polling job token pipe
  o parse.c: be more cautious about detecting depenency line
    rather than sysV style include.

also in mk:

* dirdeps.mk: include local.dirdeps-build.mk when .MAKE.LEVEL > 0
  ie. we are building something.
* FILES: add dirdeps-options.mk to deal with optional DIRDEPS.
* ldorder.mk: describe how to use LDORDER_EXTERN_BARRIER
  if needed.

4 years agoImport bmake-20180222vendor/NetBSD/bmake/20180222
Simon J. Gerraty [Thu, 1 Mar 2018 23:45:44 +0000 (1 23:45 +0000)]
Import bmake-20180222

From ChangeLog

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

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

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

* 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.

* VERSION: 20171126

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

* 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.

4 years agoImport bmake-20171028vendor/NetBSD/bmake/20171028
Simon J. Gerraty [Wed, 1 Nov 2017 23:16:32 +0000 (1 23:16 +0000)]
Import bmake-20171028

From ChangeLog

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

        * 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>

        * 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>

        * machine.sh: entry for AIX

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

        * 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>

        * 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.

4 years agoImport bmake-20170720vendor/NetBSD/bmake/20170720
Simon J. Gerraty [Mon, 24 Jul 2017 00:52:52 +0000 (24 00:52 +0000)]
Import bmake-20170720

compat.c: pass SIGINT etc onto child and wait for it to exit
before we self-terminate.

5 years agoImport bmake-20170711vendor/NetBSD/bmake/20170711
Simon J. Gerraty [Sat, 15 Jul 2017 18:43:39 +0000 (15 18:43 +0000)]
Import bmake-20170711

Several misc cleanups, refactor main() to reduce size.
Adds -v option to always fully expand variables (only interesting to NetBSD)
And in particular (from ChangeLog):

  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.

5 years agoImport bmake-20170510
Simon J. Gerraty [Wed, 10 May 2017 22:40:27 +0000 (10 22:40 +0000)]
Import bmake-20170510

5 years agoImport bmake-20170420vendor/NetBSD/bmake/20170420
Simon J. Gerraty [Thu, 20 Apr 2017 23:12:37 +0000 (20 23:12 +0000)]
Import bmake-20170420

Only use -C arg "as is" if it contains no relative component.
Fix Main_SetObjdir() for relative paths (eg obj).
Fix a number of coverity complaints.

5 years agoImport bmake-20170413vendor/NetBSD/bmake/20170413
Simon J. Gerraty [Sat, 15 Apr 2017 00:51:18 +0000 (15 00:51 +0000)]
Import bmake-20170413

5 years agoImport bmake-20170301vendor/NetBSD/bmake/20170301
Simon J. Gerraty [Mon, 6 Mar 2017 19:54:54 +0000 (6 19:54 +0000)]
Import bmake-20170301

5 years agoImport bmake-20161212vendor/NetBSD/bmake/20161212
Simon J. Gerraty [Mon, 19 Dec 2016 21:50:59 +0000 (19 21:50 +0000)]
Import bmake-20161212

From ChangeLog
2016-12-12  Simon J. Gerraty  <sjg@bad.crufty.net>

* 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>

* 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>

* 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>

* 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>

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

mk/ChangeLog

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

* install-mk (MK_VERSION): 20161212

* meta2deps.py: set pid_cwd[pid] when we process 'C'hdir,
rather than when we detect pid change.

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

* install-mk (MK_VERSION): 20161207

* meta.stage.mk: add stage_as_and_symlink for staging packages.
  We build foo.tgz stage_as foo-${VERSION}.tgz but want to be able
  to use foo.tgz to reference the latest staged version - so we
  make foo.tgz a symlink to it.
  Using a target to do both operations ensures we stay in sync.

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

* install-mk (MK_VERSION): 20161126

* dirdeps.mk: set DIRDEPS_CACHE before we include local.dirdeps.mk
  so it can add dependencies.

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

* dirdeps.mk: set DEP_* before we expand .MAKE.DEPENDFILE_PREFERENCE
  do that they can influence the result correctly.

* dirdeps.mk (${DIRDEPS_CACHE}): make sure we pass on TARGET_SPEC

* dirdeps.mk: Add ONLY_TARGET_SPEC_LIST and NOT_TARGET_SPEC_LIST
  similar to ONLY_MACHINE_LIST and NOT_MACHINE_LIST

2016-10-05  Simon J. Gerraty  <sjg@bad.crufty.net>

* dirdeps.mk: remove dependence on jot (normal situations anyway).
  Before we read another Makefile.depend* set DEP_* vars from
  _DEP_TARGET_SPEC in case it uses any of them with :=
  When bootstrapping, trim any ,* from extention of chosen _src
  Makefile.depend* to get the machine value we subst for.

2016-09-30  Simon J. Gerraty  <sjg@bad.crufty.net>

* dirdeps.mk: use TARGET_SPEC_VARS to qualify components added to
  DEP_SKIP_DIR and DEP_DIRDEPS_FILTER

* sys.mk: extract some bits to sys.{debug,vars}.mk
  for easier re-use by others.

2016-09-23  Simon Gerraty  <sjg@sjg-mba13>

* lib.mk: Use ${PICO} for extension for PIC objects.
  default to .pico (like NetBSD) safe on case insensitive filesystem.

2016-08-19  Simon J. Gerraty  <sjg@bad.crufty.net>

* meta.sys.mk (META_COOKIE_TOUCH): use ${.OBJDIR}/${.TARGET:T} as default

5 years agoImport bmake-20160818vendor/NetBSD/bmake/20160818
Simon J. Gerraty [Thu, 8 Sep 2016 23:49:33 +0000 (8 23:49 +0000)]
Import bmake-20160818

Interesting changes:

  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.
  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.
  o meta.c: remove all missingFiles entries that match a deleted
    dir.
  o main.c: set .ERROR_CMD if possible.

6 years agoImport bmake-20160606vendor/NetBSD/bmake/20160606
Simon J. Gerraty [Wed, 8 Jun 2016 15:38:06 +0000 (8 15:38 +0000)]
Import bmake-20160606

From ChangeLog:

          o dir.c: extend mtimes cache to others via cached_stat()

6 years agoImport bmake-20160604vendor/NetBSD/bmake/20160604
Simon J. Gerraty [Sun, 5 Jun 2016 15:57:18 +0000 (5 15:57 +0000)]
Import bmake-20160604

Interesting items from ChangeLog:

          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.
          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

6 years agoImport bmake-20160512vendor/NetBSD/bmake/20160512
Simon J. Gerraty [Fri, 20 May 2016 16:19:56 +0000 (20 16:19 +0000)]
Import bmake-20160512

Interesting changes (from ChangeLog):
o meta.c: ignore paths that match .MAKE.META.IGNORE_PATTERNS
  this is useful for gcov builds.
o propagate errors from filemon(4).
o meta.c: apply realpath() before matching against metaIgnorePaths
o allow makefile to set .MAKE.JOBS

6 years agoImport bmake-20160315vendor/NetBSD/bmake/20160315
Simon J. Gerraty [Fri, 18 Mar 2016 17:27:26 +0000 (18 17:27 +0000)]
Import bmake-20160315

6 years agoImport bmake-20160307vendor/NetBSD/bmake/20160307
Simon J. Gerraty [Fri, 11 Mar 2016 00:37:02 +0000 (11 00:37 +0000)]
Import bmake-20160307

6 years agoImport bmake-20151220vendor/NetBSD/bmake/20151220
Simon J. Gerraty [Fri, 25 Dec 2015 08:09:48 +0000 (25 08:09 +0000)]
Import bmake-20151220

6 years agoImport bmake-20151201vendor/NetBSD/bmake/20151201
Simon J. Gerraty [Mon, 7 Dec 2015 22:51:25 +0000 (7 22:51 +0000)]
Import bmake-20151201

6 years agoImport bmake-20151020vendor/NetBSD/bmake/20151020
Simon J. Gerraty [Wed, 21 Oct 2015 22:14:23 +0000 (21 22:14 +0000)]
Import bmake-20151020

7 years agobmake-20150606vendor/NetBSD/bmake/20150606
Simon J. Gerraty [Wed, 10 Jun 2015 20:10:48 +0000 (10 20:10 +0000)]
bmake-20150606

7 years agoImport bmake-20150505 detect typo's in .if variable references.vendor/NetBSD/bmake/20150505
Simon J. Gerraty [Sun, 10 May 2015 20:01:54 +0000 (10 20:01 +0000)]
Import bmake-20150505 detect typo's in .if variable references.

7 years agoImport bmake-20150418vendor/NetBSD/bmake/20150418
Simon J. Gerraty [Mon, 20 Apr 2015 03:45:54 +0000 (20 03:45 +0000)]
Import bmake-20150418

8 years agoImport bmake-20140620vendor/NetBSD/bmake/20140620
Simon J. Gerraty [Wed, 2 Jul 2014 21:24:54 +0000 (2 21:24 +0000)]
Import bmake-20140620

8 years agoImport bmake-20140101vendor/NetBSD/bmake/20140101
Simon J. Gerraty [Sun, 26 Jan 2014 07:40:17 +0000 (26 07:40 +0000)]
Import bmake-20140101

8 years agoImport bmake-20130904vendor/NetBSD/bmake/20130904
Simon J. Gerraty [Thu, 5 Sep 2013 15:49:22 +0000 (5 15:49 +0000)]
Import bmake-20130904

8 years agoImport bmake-20130730 - allows folk to supress job tokens.vendor/NetBSD/bmake/20130730
Simon J. Gerraty [Fri, 2 Aug 2013 05:23:57 +0000 (2 05:23 +0000)]
Import bmake-20130730 - allows folk to supress job tokens.

9 years agoImport bmake-20130604vendor/NetBSD/bmake/20130604
Simon J. Gerraty [Wed, 5 Jun 2013 15:51:46 +0000 (5 15:51 +0000)]
Import bmake-20130604

9 years agoImport bmake-20130520 to keep us in sync.vendor/NetBSD/bmake/20130520
Simon J. Gerraty [Mon, 20 May 2013 22:35:32 +0000 (20 22:35 +0000)]
Import bmake-20130520 to keep us in sync.

9 years agoImport bmake-20130330vendor/NetBSD/bmake/20130330
Simon J. Gerraty [Mon, 1 Apr 2013 21:12:55 +0000 (1 21:12 +0000)]
Import bmake-20130330

9 years agoImport bmake-20130123vendor/NetBSD/bmake/20130123
Simon J. Gerraty [Thu, 31 Jan 2013 16:44:23 +0000 (31 16:44 +0000)]
Import bmake-20130123

Approved by: marcel (mentor)

9 years agoImport bmake-20121111 - pick up fix for .ORDERvendor/NetBSD/bmake/20121111
Simon J. Gerraty [Thu, 15 Nov 2012 22:01:30 +0000 (15 22:01 +0000)]
Import bmake-20121111 - pick up fix for .ORDER

Approved by: marcel (mentor)

9 years agoImport bmake-20121010vendor/NetBSD/bmake/20121010
Simon J. Gerraty [Thu, 25 Oct 2012 20:31:22 +0000 (25 20:31 +0000)]
Import bmake-20121010
Relevant items from ChangeLog:
          o [Makefile.in:] protect syntax that only bmake parses correctly.
          o compat.c: ignore empty commands - same as jobs mode.
          o make.1: document meta chars that cause use of shell

Approved by: marcelm (mentor)

9 years agoImport the 20120831 release of the "Portable" BSD make tool (from NetBSD).vendor/NetBSD/bmake/20120831
Marcel Moolenaar [Tue, 11 Sep 2012 02:56:02 +0000 (11 02:56 +0000)]
Import the 20120831 release of the "Portable" BSD make tool (from NetBSD).

Submitted by:   Simon Gerraty <sjg@juniper.net>

10 years agoImport the 20120704 release of the "Portable" BSD make tool (from NetBSD).vendor/NetBSD/bmake/20120704
David E. O'Brien [Fri, 6 Jul 2012 00:03:45 +0000 (6 00:03 +0000)]
Import the 20120704 release of the "Portable" BSD make tool (from NetBSD).

Submitted by: Simon Gerraty <sjg@juniper.net>

10 years agoImport the 20-June-2012 release of the "Portable" BSD make tool (from NetBSD).vendor/NetBSD/bmake/20120620
David E. O'Brien [Mon, 25 Jun 2012 22:20:51 +0000 (25 22:20 +0000)]
Import the 20-June-2012 release of the "Portable" BSD make tool (from NetBSD).

Submitted by: sjg@juniper.net

10 years agoImport the 6-May-2012 release of the "Portable" BSD make tool (from NetBSD).vendor/NetBSD/bmake/20120606
David E. O'Brien [Fri, 8 Jun 2012 21:57:36 +0000 (8 21:57 +0000)]
Import the 6-May-2012 release of the "Portable" BSD make tool (from NetBSD).

Submitted by: sjg@juniper.net

25 years agoFinish importing Lite2's src/usr.bin, except for ex, diff, grep, mail,
Bruce Evans [Sun, 6 Jul 1997 06:54:14 +0000 (6 06:54 +0000)]
Finish importing Lite2's src/usr.bin, except for ex, diff, grep, mail,
pascal and vmstat.sparc.  All changed files on the vendor branch should
already have been imported.

25 years agoImport Christos Zoulas' version of NetBSD's make onto the
Steve Price [Sun, 6 Oct 1996 16:45:32 +0000 (6 16:45 +0000)]
Import Christos Zoulas' version of NetBSD's make onto the
vendor branch for reference.

Obtained from: Christos Zoulas <christos@netbsd.org>

25 years agoImport the 4.4BSD-Lite2 version of make onto the vendor branch
Peter Wemm [Sun, 6 Oct 1996 15:57:15 +0000 (6 15:57 +0000)]
Import the 4.4BSD-Lite2 version of make onto the vendor branch
"for reference".  This doesn't change anything since all files
have been touched.

25 years agoThis commit was manufactured by cvs2svn to create branch 'CHRISTOS'.
cvs2svn [Sun, 6 Oct 1996 02:35:39 +0000 (6 02:35 +0000)]
This commit was manufactured by cvs2svn to create branch 'CHRISTOS'.