svn commit: r361986 - in head: contrib/bmake contrib/bmake/mk usr.bin/bmake

Simon J. Gerraty sjg at FreeBSD.org
Tue Jun 9 20:52:40 UTC 2020


Author: sjg
Date: Tue Jun  9 20:52:35 2020
New Revision: 361986
URL: https://svnweb.freebsd.org/changeset/base/361986

Log:
  Merge 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.

Modified:
  head/contrib/bmake/ChangeLog
  head/contrib/bmake/Makefile
  head/contrib/bmake/VERSION
  head/contrib/bmake/bmake.1
  head/contrib/bmake/bmake.cat1
  head/contrib/bmake/configure
  head/contrib/bmake/configure.in
  head/contrib/bmake/dir.c
  head/contrib/bmake/dirname.c
  head/contrib/bmake/make.1
  head/contrib/bmake/mk/ChangeLog
  head/contrib/bmake/mk/dirdeps-targets.mk
  head/contrib/bmake/mk/init.mk
  head/contrib/bmake/mk/install-mk
  head/contrib/bmake/mk/meta2deps.py
  head/contrib/bmake/var.c
  head/usr.bin/bmake/Makefile
  head/usr.bin/bmake/Makefile.config
  head/usr.bin/bmake/config.h
Directory Properties:
  head/contrib/bmake/   (props changed)

Modified: head/contrib/bmake/ChangeLog
==============================================================================
--- head/contrib/bmake/ChangeLog	Tue Jun  9 20:27:35 2020	(r361985)
+++ head/contrib/bmake/ChangeLog	Tue Jun  9 20:52:35 2020	(r361986)
@@ -1,3 +1,25 @@
+2020-06-06  Simon J Gerraty  <sjg at beast.crufty.net>
+
+	* VERSION (_MAKE_VERSION): 20200606
+	Merge with NetBSD make, pick up
+	o make.1: cleanup
+
+	* Makefile: fix depends for main.o which broke MAKE_VERSION
+
+2020-06-05  Simon J Gerraty  <sjg at beast.crufty.net>
+
+	* VERSION (_MAKE_VERSION): 20200605
+	Merge with NetBSD make, pick up
+	o dir.c: cached_stats - don't confuse stat and lstat results.
+	o var.c: add :Or for reverse sort.
+
+2020-05-24  Simon J Gerraty  <sjg at beast.crufty.net>
+
+	* configure.in: add AC_PROG_CC_C99 for mipspro compiler
+	also if --with-filemon= specifies path to filemon.h
+	set use_filemon=dev
+	* dirname.c: remove include of namespace.h
+
 2020-05-17  Simon J Gerraty  <sjg at beast.crufty.net>
 
 	* VERSION (_MAKE_VERSION): 20200517

Modified: head/contrib/bmake/Makefile
==============================================================================
--- head/contrib/bmake/Makefile	Tue Jun  9 20:27:35 2020	(r361985)
+++ head/contrib/bmake/Makefile	Tue Jun  9 20:52:35 2020	(r361986)
@@ -1,4 +1,4 @@
-#	$Id: Makefile,v 1.104 2020/02/06 01:33:54 sjg Exp $
+#	$Id: Makefile,v 1.107 2020/06/07 21:18:46 sjg Exp $
 
 PROG=	bmake
 
@@ -82,7 +82,7 @@ COPTS.main.c+= "-DMAKE_VERSION=\"${_MAKE_VERSION}\""
 # should be set by now
 USE_FILEMON ?= no
 .if ${USE_FILEMON:tl} != "no"
-.PATH:	${.CURDIR}/filemon
+.PATH:	${srcdir}/filemon
 SRCS+=	filemon_${USE_FILEMON}.c
 COPTS.meta.c+= -DUSE_FILEMON -DUSE_FILEMON_${USE_FILEMON:tu}
 COPTS.job.c+= ${COPTS.meta.c}
@@ -158,7 +158,7 @@ MAN1= ${MAN}
 .if (${PROG} != "make")
 CLEANFILES+= my.history
 .if make(${MAN}) || !exists(${srcdir}/${MAN})
-my.history: ${MAKEFILE}
+my.history:
 	@(echo ".Nm"; \
 	echo "is derived from NetBSD"; \
 	echo ".Xr make 1 ."; \
@@ -207,7 +207,7 @@ ${OBJS}: config.h
 # start-delete2 for bsd.after-import.mk
 
 # make sure that MAKE_VERSION gets updated.
-main.o: ${SRCS} ${.CURDIR}/VERSION
+main.o: ${srcdir}/VERSION
 
 .if ${MK_AUTOCONF_MK} == "yes"
 CONFIGURE_DEPS += ${.CURDIR}/VERSION

Modified: head/contrib/bmake/VERSION
==============================================================================
--- head/contrib/bmake/VERSION	Tue Jun  9 20:27:35 2020	(r361985)
+++ head/contrib/bmake/VERSION	Tue Jun  9 20:52:35 2020	(r361986)
@@ -1,2 +1,2 @@
 # keep this compatible with sh and make
-_MAKE_VERSION=20200517
+_MAKE_VERSION=20200606

Modified: head/contrib/bmake/bmake.1
==============================================================================
--- head/contrib/bmake/bmake.1	Tue Jun  9 20:27:35 2020	(r361985)
+++ head/contrib/bmake/bmake.1	Tue Jun  9 20:52:35 2020	(r361986)
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.273 2018/05/27 01:14:51 christos Exp $
+.\"	$NetBSD: make.1,v 1.282 2020/06/06 20:28:42 wiz 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 May 26, 2018
+.Dd June 5, 2020
 .Dt BMAKE 1
 .Os
 .Sh NAME
@@ -272,7 +272,7 @@ that do not depend on the target whose creation caused
 .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
@@ -280,7 +280,7 @@ option can be used multiple times to form a search pat
 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).
@@ -1196,10 +1196,8 @@ but selects all words which do not match
 .Ar pattern .
 .It Cm \&:O
 Order every word in variable alphabetically.
-To sort words in
-reverse order use the
-.Ql Cm \&:O:[-1..1]
-combination of modifiers.
+.It Cm \&:Or
+Order every word in variable in reverse alphabetical order.
 .It Cm \&:Ox
 Randomize words in variable.
 The results will be different each time you are referring to the
@@ -1234,7 +1232,7 @@ Quotes every shell meta-character in the variable, and
 characters so that it can be passed
 safely through recursive invocations of
 .Nm .
-This is equivalent to: 
+This is equivalent to:
 .Sq \&:S/\e\&$/&&/g:Q .
 .It Cm \&:R
 Replaces each word in the variable with everything but its suffix.
@@ -1429,6 +1427,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
@@ -1591,6 +1612,11 @@ then the words are output in reverse order.
 For example,
 .Ql Cm \&:[-1..1]
 selects all the words from last to first.
+If the list is already ordered, then this effectively reverses
+the list, but it is more efficient to use
+.Ql Cm \&:Or
+instead of
+.Ql Cm \&:O:[-1..1] .
 .\" :[*]
 .It Cm \&*
 Causes subsequent modifiers to treat the value as a single word
@@ -1623,9 +1649,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
@@ -2409,9 +2435,9 @@ file).
 .Sh 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.
+syntax is difficult to parse without actually acting on the data.
+For instance, finding the end of a variable's use should involve scanning
+each of 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.

Modified: head/contrib/bmake/bmake.cat1
==============================================================================
--- head/contrib/bmake/bmake.cat1	Tue Jun  9 20:27:35 2020	(r361985)
+++ head/contrib/bmake/bmake.cat1	Tue Jun  9 20:52:35 2020	(r361986)
@@ -779,9 +779,10 @@ BMAKE(1)                FreeBSD General Commands Manua
           This is identical to `:M', but selects all words which do not match
           pattern.
 
-     :O   Order every word in variable alphabetically.  To sort words in
-          reverse order use the `:O:[-1..1]' combination of modifiers.
+     :O   Order every word in variable alphabetically.
 
+     :Or  Order every word in variable in reverse alphabetical order.
+
      :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 behavior.  For example,
@@ -803,8 +804,12 @@ BMAKE(1)                FreeBSD General Commands Manua
                 due uno quattro tre
 
      :Q   Quotes every shell meta-character in the variable, so that it can be
-          passed safely through recursive invocations of bmake.
+          passed safely to the shell.
 
+     :q   Quotes every shell meta-character in the variable, and also doubles
+          `$' characters so that it can be passed safely through recursive
+          invocations of bmake.  This is equivalent to: `:S/\$/&&/g:Q'.
+
      :R   Replaces each word in the variable with everything but its suffix.
 
      :range[=count]
@@ -903,7 +908,15 @@ BMAKE(1)                FreeBSD General Commands Manua
           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
-          old_string to be replaced in new_string.
+          old_string to be replaced in new_string.  If only old_string con-
+          tains the pattern matching character %, and old_string matches, then
+          the result is the new_string.  If only the new_string contains the
+          pattern matching character %, then it is not treated specially and
+          it is printed as a literal % on match.  If there is more than one
+          pattern matching character (%) in either the new_string or
+          old_string, only the first instance is treated specially (as the
+          pattern character); all subsequent instances are treated as regular
+          characters
 
           Variable expansion occurs in the normal fashion inside both
           old_string and new_string with the single exception that a backslash
@@ -1003,7 +1016,9 @@ BMAKE(1)                FreeBSD General Commands Manua
                  `:[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.
+                 the words from last to first.  If the list is already
+                 ordered, then this effectively reverses the list, but it is
+                 more efficient to use `:Or' instead of `:O:[-1..1]'.
 
           *      Causes subsequent modifiers to treat the value as a single
                  word (possibly containing embedded white space).  Analogous
@@ -1021,7 +1036,7 @@ BMAKE(1)                FreeBSD General Commands Manua
      Makefile inclusion, conditional structures and for loops  reminiscent of
      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 .include <file> or .include "file".  Vari-
+     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
@@ -1184,7 +1199,7 @@ BMAKE(1)                FreeBSD General Commands Manua
      the ``make'' or ``defined'' expression is applied to it, depending on the
      form of the conditional.  If the form is `.ifdef', `.ifndef', or `.if'
      the ``defined'' expression is applied.  Similarly, if the form is
-     `.ifmake' or `.ifnmake, the' ``make'' expression is applied.
+     `.ifmake' or `.ifnmake', the ``make'' expression is applied.
 
      If the conditional evaluates to true the parsing of the makefile contin-
      ues as before.  If it evaluates to false, the following lines are
@@ -1533,12 +1548,12 @@ BMAKE(1)                FreeBSD General Commands Manua
      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.
+     The make syntax is difficult to parse without actually acting on the
+     data.  For instance, finding the end of a variable's use should involve
+     scanning each of 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
+FreeBSD 11.3                     June 5, 2020                     FreeBSD 11.3

Modified: head/contrib/bmake/configure
==============================================================================
Binary file (source and/or target). No diff available.

Modified: head/contrib/bmake/configure.in
==============================================================================
--- head/contrib/bmake/configure.in	Tue Jun  9 20:27:35 2020	(r361985)
+++ head/contrib/bmake/configure.in	Tue Jun  9 20:52:35 2020	(r361986)
@@ -1,11 +1,11 @@
 dnl
 dnl RCSid:
-dnl	$Id: configure.in,v 1.63 2020/04/19 05:17:57 sjg Exp $
+dnl	$Id: configure.in,v 1.65 2020/05/25 01:11:40 sjg Exp $
 dnl
 dnl Process this file with autoconf to produce a configure script
 dnl
 AC_PREREQ(2.50)
-AC_INIT([bmake], [20200418], [sjg at NetBSD.org])
+AC_INIT([bmake], [20200524], [sjg at NetBSD.org])
 AC_CONFIG_HEADERS(config.h)
 
 dnl make srcdir absolute
@@ -60,7 +60,11 @@ AC_ARG_WITH(filemon,
 */filemon.h) filemon_h="${withval}";;
 */filemon*) filemon_h="${withval}/filemon.h";;
 *) AC_MSG_ERROR(bad value ${withval} given for filemon) ;;
-esac],
+esac
+case "$use_filemon,$filemon_h" in
+,*.h) use_filemon=dev;;
+esac
+],
 [
 case "$OS" in
 NetBSD) filemon_h=no use_filemon=ktrace;;
@@ -100,7 +104,8 @@ dnl see _EXTENSIONS_ we use it.
 AC_USE_SYSTEM_EXTENSIONS
 dnl Checks for programs.
 AC_PROG_CC
-AC_PROG_GCC_TRADITIONAL
+AC_PROG_CC_C99
+dnl AC_PROG_GCC_TRADITIONAL
 AC_PROG_INSTALL
 dnl Executable suffix - normally empty; .exe on os2.
 AC_SUBST(ac_exe_suffix)dnl

Modified: head/contrib/bmake/dir.c
==============================================================================
--- head/contrib/bmake/dir.c	Tue Jun  9 20:27:35 2020	(r361985)
+++ head/contrib/bmake/dir.c	Tue Jun  9 20:52:35 2020	(r361986)
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.73 2018/07/12 18:03:31 christos Exp $	*/
+/*	$NetBSD: dir.c,v 1.74 2020/06/05 18:03:59 sjg 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.73 2018/07/12 18:03:31 christos Exp $";
+static char rcsid[] = "$NetBSD: dir.c,v 1.74 2020/06/05 18:03:59 sjg 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.73 2018/07/12 18:03:31 christos Exp $");
+__RCSID("$NetBSD: dir.c,v 1.74 2020/06/05 18:03:59 sjg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -263,7 +263,8 @@ static char *DirLookupAbs(Path *, const char *, const 
  * mtime and mode are all we care about.
  */
 struct cache_st {
-    time_t mtime;
+    time_t lmtime;			/* lstat */
+    time_t mtime;			/* stat */
     mode_t  mode;
 };
 
@@ -287,13 +288,15 @@ cached_stats(Hash_Table *htp, const char *pathname, st
 	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);
+	st->st_mtime = (flags & CST_LSTAT) ? cst->lmtime : cst->mtime;
+	if (st->st_mtime) {
+	    if (DEBUG(DIR)) {
+		fprintf(debug_file, "Using cached time %s for %s\n",
+			Targ_FmtTime(st->st_mtime), pathname);
+	    }
+	    return 0;
 	}
-	return 0;
     }
 
     rc = (flags & CST_LSTAT) ? lstat(pathname, st) : stat(pathname, st);
@@ -305,10 +308,16 @@ cached_stats(Hash_Table *htp, const char *pathname, st
 
     if (!entry)
 	entry = Hash_CreateEntry(htp, pathname, NULL);
-    if (!entry->clientPtr)
+    if (!entry->clientPtr) {
 	entry->clientPtr = bmake_malloc(sizeof(*cst));
+	memset(entry->clientPtr, 0, sizeof(*cst));
+    }
     cst = entry->clientPtr;
-    cst->mtime = st->st_mtime;
+    if ((flags & CST_LSTAT)) {
+	cst->lmtime = st->st_mtime;
+    } else {
+	cst->mtime = st->st_mtime;
+    }
     cst->mode = st->st_mode;
     if (DEBUG(DIR)) {
 	fprintf(debug_file, "   Caching %s for %s\n",

Modified: head/contrib/bmake/dirname.c
==============================================================================
--- head/contrib/bmake/dirname.c	Tue Jun  9 20:27:35 2020	(r361985)
+++ head/contrib/bmake/dirname.c	Tue Jun  9 20:52:35 2020	(r361986)
@@ -39,7 +39,6 @@
 __RCSID("$NetBSD: dirname.c,v 1.14 2018/09/27 00:45:34 kre Exp $");
 #endif /* !LIBC_SCCS && !lint */
 
-#include "namespace.h"
 #include <sys/param.h>
 #ifdef HAVE_LIBGEN_H
 #include <libgen.h>

Modified: head/contrib/bmake/make.1
==============================================================================
--- head/contrib/bmake/make.1	Tue Jun  9 20:27:35 2020	(r361985)
+++ head/contrib/bmake/make.1	Tue Jun  9 20:52:35 2020	(r361986)
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.280 2020/04/27 20:03:08 christos Exp $
+.\"	$NetBSD: make.1,v 1.282 2020/06/06 20:28:42 wiz 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 27, 2020
+.Dd June 5, 2020
 .Dt MAKE 1
 .Os
 .Sh NAME
@@ -1207,10 +1207,8 @@ but selects all words which do not match
 .Ar pattern .
 .It Cm \&:O
 Order every word in variable alphabetically.
-To sort words in
-reverse order use the
-.Ql Cm \&:O:[-1..1]
-combination of modifiers.
+.It Cm \&:Or
+Order every word in variable in reverse alphabetical order.
 .It Cm \&:Ox
 Randomize words in variable.
 The results will be different each time you are referring to the
@@ -1444,7 +1442,7 @@ If only
 .Ar old_string
 contains the pattern matching character
 .Ar % ,
-and 
+and
 .Ar old_string
 matches, then the result is the
 .Ar new_string .
@@ -1625,6 +1623,11 @@ then the words are output in reverse order.
 For example,
 .Ql Cm \&:[-1..1]
 selects all the words from last to first.
+If the list is already ordered, then this effectively reverses
+the list, but it is more efficient to use
+.Ql Cm \&:Or
+instead of
+.Ql Cm \&:O:[-1..1] .
 .\" :[*]
 .It Cm \&*
 Causes subsequent modifiers to treat the value as a single word

Modified: head/contrib/bmake/mk/ChangeLog
==============================================================================
--- head/contrib/bmake/mk/ChangeLog	Tue Jun  9 20:27:35 2020	(r361985)
+++ head/contrib/bmake/mk/ChangeLog	Tue Jun  9 20:52:35 2020	(r361986)
@@ -1,3 +1,20 @@
+2020-06-06  Simon J Gerraty  <sjg at beast.crufty.net>
+
+	* install-mk (MK_VERSION): 20200606
+
+	* dirdeps-targets.mk: allow for filtering of .TARGETS
+
+	* meta2deps.py: fix bug in processing 'L'ink and 'M'ove
+	entries - and we don't care about 'W'rite entries.
+	Also ignore absolute paths that do not exist.
+
+2020-05-25  Simon J Gerraty  <sjg at beast.crufty.net>
+
+	* install-mk (MK_VERSION): 20200525
+
+	* init.mk: expand and simplify handling of qualified vars
+	like CPPFLAGS.${.TARGET:T}
+
 2020-05-15  Simon J Gerraty  <sjg at beast.crufty.net>
 
 	* install-mk (MK_VERSION): 20200515

Modified: head/contrib/bmake/mk/dirdeps-targets.mk
==============================================================================
--- head/contrib/bmake/mk/dirdeps-targets.mk	Tue Jun  9 20:27:35 2020	(r361985)
+++ head/contrib/bmake/mk/dirdeps-targets.mk	Tue Jun  9 20:52:35 2020	(r361986)
@@ -1,7 +1,7 @@
 # RCSid:
-#       $Id: dirdeps-targets.mk,v 1.9 2019/10/06 20:07:50 sjg Exp $
+#       $Id: dirdeps-targets.mk,v 1.10 2020/06/06 22:41:02 sjg Exp $
 #
-#       @(#) Copyright (c) 2019 Simon J. Gerraty
+#       @(#) Copyright (c) 2019-2020 Simon J. Gerraty
 #
 #       This file is provided in the hope that it will
 #       be of use.  There is absolutely NO WARRANTY.
@@ -37,8 +37,11 @@ DIRDEPS_TARGETS_DIRS ?= targets targets/pseudo
 # they need to be stripped when looking for target dirs
 DIRDEPS_TARGETS_PREFIX_LIST ?= pkg- build-
 
+# some .TARGETS need filtering
+DIRDEPS_TARGETS_FILTER += Nall
+
 # matching target dirs if any
-tdirs := ${.TARGETS:Nall:${DIRDEPS_TARGETS_PREFIX_LIST:@p at S,^$p,,@:ts:}:@t@${DIRDEPS_TARGETS_DIRS:@d@$d/$t@}@:@d@${exists(${SRCTOP}/$d):?$d:}@}
+tdirs := ${.TARGETS:${DIRDEPS_TARGETS_FILTER:ts:}:${DIRDEPS_TARGETS_PREFIX_LIST:@p at S,^$p,,@:ts:}:@t@${DIRDEPS_TARGETS_DIRS:@d@$d/$t@}@:@d@${exists(${SRCTOP}/$d):?$d:}@}
 
 .if !empty(DEBUG_DIRDEPS_TARGETS)
 .info tdirs=${tdirs}

Modified: head/contrib/bmake/mk/init.mk
==============================================================================
--- head/contrib/bmake/mk/init.mk	Tue Jun  9 20:27:35 2020	(r361985)
+++ head/contrib/bmake/mk/init.mk	Tue Jun  9 20:52:35 2020	(r361986)
@@ -1,4 +1,4 @@
-# $Id: init.mk,v 1.16 2019/09/28 16:54:02 sjg Exp $
+# $Id: init.mk,v 1.17 2020/05/25 20:15:07 sjg Exp $
 #
 #	@(#) Copyright (c) 2002, Simon J. Gerraty
 #
@@ -36,8 +36,27 @@ CXX_SUFFIXES?= .cc .cpp .cxx .C
 .include <warnings.mk>
 .endif
 
-.for x in COPTS CPPFLAGS CPUFLAGS LDFLAGS
-$x += ${$x.${COMPILER_TYPE}:U} ${$x.${.IMPSRC:T}:U}
+# these are applied in order, least specific to most
+VAR_QUALIFIER_LIST += \
+	${TARGET_SPEC_VARS:UMACHINE:@v@${$v}@} \
+	${COMPILER_TYPE} \
+	${.TARGET:T:R} \
+	${.TARGET:T} \
+	${.IMPSRC:T} \
+	${VAR_QUALIFIER_XTRA_LIST}
+
+QUALIFIED_VAR_LIST += \
+	CFLAGS \
+	COPTS \
+	CPPFLAGS \
+	CPUFLAGS \
+	LDFLAGS \
+
+# a final :U avoids errors if someone uses :=
+.for V in ${QUALIFIED_VAR_LIST:O:u:@q@$q $q_LAST@}
+.for Q in ${VAR_QUALIFIER_LIST:u}
+$V += ${$V.$Q:U} ${$V.$Q.${COMPILER_TYPE}:U}
+.endfor
 .endfor
 
 CC_PG?= -pg

Modified: head/contrib/bmake/mk/install-mk
==============================================================================
--- head/contrib/bmake/mk/install-mk	Tue Jun  9 20:27:35 2020	(r361985)
+++ head/contrib/bmake/mk/install-mk	Tue Jun  9 20:52:35 2020	(r361986)
@@ -55,7 +55,7 @@
 #       Simon J. Gerraty <sjg at crufty.net>
 
 # RCSid:
-#	$Id: install-mk,v 1.170 2020/05/15 21:40:24 sjg Exp $
+#	$Id: install-mk,v 1.172 2020/06/06 22:41:15 sjg Exp $
 #
 #	@(#) Copyright (c) 1994 Simon J. Gerraty
 #
@@ -70,7 +70,7 @@
 #	sjg at crufty.net
 #
 
-MK_VERSION=20200515
+MK_VERSION=20200606
 OWNER=
 GROUP=
 MODE=444

Modified: head/contrib/bmake/mk/meta2deps.py
==============================================================================
--- head/contrib/bmake/mk/meta2deps.py	Tue Jun  9 20:27:35 2020	(r361985)
+++ head/contrib/bmake/mk/meta2deps.py	Tue Jun  9 20:52:35 2020	(r361986)
@@ -37,7 +37,7 @@ We only pay attention to a subset of the information i
 
 """
 RCSid:
-	$Id: meta2deps.py,v 1.28 2020/05/16 23:21:48 sjg Exp $
+	$Id: meta2deps.py,v 1.30 2020/06/08 23:05:00 sjg Exp $
 
 	Copyright (c) 2011-2019, Simon J. Gerraty
 	Copyright (c) 2011-2017, Juniper Networks, Inc.
@@ -81,7 +81,11 @@ def resolve(path, cwd, last_dir=None, debug=0, debug_o
     if path.endswith('/.'):
         path = path[0:-2]
     if len(path) > 0 and path[0] == '/':
-        return path
+        if os.path.exists(path):
+            return path
+        if debug > 2:
+            print("skipping non-existent:", path, file=debug_out)
+        return None
     if path == '.':
         return cwd
     if path.startswith('./'):
@@ -139,6 +143,8 @@ def abspath(path, cwd, last_dir=None, debug=0, debug_o
     rpath = resolve(path, cwd, last_dir, debug, debug_out)
     if rpath:
         path = rpath
+    elif len(path) > 0 and path[0] == '/':
+        return None
     if (path.find('/') < 0 or
         path.find('./') > 0 or
         path.endswith('/..')):
@@ -475,6 +481,10 @@ class MetaFile:
                 continue
             elif w[0] == 'C':
                 cwd = abspath(w[2], cwd, None, self.debug, self.debug_out)
+                if not cwd:
+                    cwd = w[2]
+                    if self.debug > 1:
+                        print("missing cwd=", cwd, file=self.debug_out)
                 if cwd.endswith('/.'):
                     cwd = cwd[0:-2]
                 self.last_dir = pid_last_dir[pid] = cwd
@@ -491,8 +501,8 @@ class MetaFile:
             if w[0] in 'ML':
                 # these are special, tread src as read and
                 # target as write
-                self.parse_path(w[1].strip("'"), cwd, 'R', w)
-                self.parse_path(w[2].strip("'"), cwd, 'W', w)
+                self.parse_path(w[2].strip("'"), cwd, 'R', w)
+                self.parse_path(w[3].strip("'"), cwd, 'W', w)
                 continue
             elif w[0] in 'ERWS':
                 path = w[2]
@@ -563,7 +573,7 @@ class MetaFile:
                     print("ldir=", self.last_dir, file=self.debug_out)
                 return
 
-        if op in 'ERW':
+        if op in 'ER':
             # finally, we get down to it
             if dir == self.cwd or dir == self.curdir:
                 return

Modified: head/contrib/bmake/var.c
==============================================================================
--- head/contrib/bmake/var.c	Tue Jun  9 20:27:35 2020	(r361985)
+++ head/contrib/bmake/var.c	Tue Jun  9 20:52:35 2020	(r361986)
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.223 2020/04/25 18:20:57 christos Exp $	*/
+/*	$NetBSD: var.c,v 1.224 2020/06/05 19:20:46 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.223 2020/04/25 18:20:57 christos Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.224 2020/06/05 19:20:46 sjg 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.223 2020/04/25 18:20:57 christos Exp $");
+__RCSID("$NetBSD: var.c,v 1.224 2020/06/05 19:20:46 sjg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2027,6 +2027,13 @@ VarWordCompare(const void *a, const void *b)
 	return r;
 }
 
+static int
+VarWordCompareReverse(const void *a, const void *b)
+{
+	int r = strcmp(*(const char * const *)b, *(const char * const *)a);
+	return r;
+}
+
 /*-
  *-----------------------------------------------------------------------
  * VarOrder --
@@ -2058,6 +2065,9 @@ VarOrder(const char *str, const char otype)
 
     if (ac > 0)
 	switch (otype) {
+	case 'r':	/* reverse sort alphabetically */
+	    qsort(av, ac, sizeof(char *), VarWordCompareReverse);
+	    break;
 	case 's':	/* sort alphabetically */
 	    qsort(av, ac, sizeof(char *), VarWordCompare);
 	    break;
@@ -3562,7 +3572,7 @@ ApplyModifiers(char *nstr, const char *tstr,
 		if (tstr[1] == endc || tstr[1] == ':') {
 		    otype = 's';
 		    termc = *cp;
-		} else if ( (tstr[1] == 'x') &&
+		} else if ( (tstr[1] == 'r' || tstr[1] == 'x') &&
 			    (tstr[2] == endc || tstr[2] == ':') ) {
 		    otype = tstr[1];
 		    cp = tstr + 2;

Modified: head/usr.bin/bmake/Makefile
==============================================================================
--- head/usr.bin/bmake/Makefile	Tue Jun  9 20:27:35 2020	(r361985)
+++ head/usr.bin/bmake/Makefile	Tue Jun  9 20:52:35 2020	(r361986)
@@ -12,7 +12,7 @@ CFLAGS+= -I${.CURDIR}
 CLEANDIRS+= FreeBSD
 CLEANFILES+= bootstrap
 
-#	$Id: Makefile,v 1.104 2020/02/06 01:33:54 sjg Exp $
+#	$Id: Makefile,v 1.107 2020/06/07 21:18:46 sjg Exp $
 
 PROG?=	${.CURDIR:T}
 
@@ -123,7 +123,7 @@ MAN1= ${MAN}
 .if (${PROG} != "make")
 CLEANFILES+= my.history
 .if make(${MAN}) || !exists(${srcdir}/${MAN})
-my.history: ${MAKEFILE}
+my.history:
 	@(echo ".Nm"; \
 	echo "is derived from NetBSD"; \
 	echo ".Xr make 1 ."; \

Modified: head/usr.bin/bmake/Makefile.config
==============================================================================
--- head/usr.bin/bmake/Makefile.config	Tue Jun  9 20:27:35 2020	(r361985)
+++ head/usr.bin/bmake/Makefile.config	Tue Jun  9 20:52:35 2020	(r361986)
@@ -7,7 +7,7 @@ SRCTOP?= ${.CURDIR:H:H}
 
 # things set by configure
 
-_MAKE_VERSION?=20200517
+_MAKE_VERSION?=20200606
 
 prefix?= /usr
 srcdir= ${SRCTOP}/contrib/bmake

Modified: head/usr.bin/bmake/config.h
==============================================================================
--- head/usr.bin/bmake/config.h	Tue Jun  9 20:27:35 2020	(r361985)
+++ head/usr.bin/bmake/config.h	Tue Jun  9 20:52:35 2020	(r361986)
@@ -245,7 +245,7 @@
 #define PACKAGE_NAME "bmake"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "bmake 20200418"
+#define PACKAGE_STRING "bmake 20200524"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "bmake"
@@ -254,7 +254,7 @@
 #define PACKAGE_URL ""
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "20200418"
+#define PACKAGE_VERSION "20200524"
 
 /* Define as the return type of signal handlers (`int' or `void'). */
 #define RETSIGTYPE void


More information about the svn-src-head mailing list