Import bmake-20160315

This commit is contained in:
Simon J. Gerraty 2016-03-18 17:27:26 +00:00
parent d58aa1959c
commit b7ff84ad75
15 changed files with 104 additions and 39 deletions

View File

@ -1,3 +1,20 @@
2016-03-15 Simon J. Gerraty <sjg@bad.crufty.net>
* 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>
* Makefile (_MAKE_VERSION): rename variable to avoid interference
with checks for ${MAKE_VERSION}
2016-03-10 Simon J. Gerraty <sjg@bad.crufty.net>
* 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> 2016-03-07 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile (MAKE_VERSION): 20160307 * Makefile (MAKE_VERSION): 20160307

View File

@ -1,7 +1,7 @@
# $Id: Makefile,v 1.55 2016/03/07 22:02:47 sjg Exp $ # $Id: Makefile,v 1.58 2016/03/15 23:39:12 sjg Exp $
# Base version on src date # Base version on src date
MAKE_VERSION= 20160307 _MAKE_VERSION= 20160315
PROG= bmake PROG= bmake
@ -76,7 +76,7 @@ CFLAGS+= ${CPPFLAGS}
CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\" CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\"
CFLAGS+= -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE CFLAGS+= -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE
CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}} 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
FILEMON_H ?= /usr/include/dev/filemon/filemon.h FILEMON_H ?= /usr/include/dev/filemon/filemon.h

View File

@ -1,4 +1,4 @@
.\" $NetBSD: make.1,v 1.254 2016/02/20 01:43:28 wiz Exp $ .\" $NetBSD: make.1,v 1.255 2016/03/14 07:42:15 matthias Exp $
.\" .\"
.\" Copyright (c) 1990, 1993 .\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved. .\" The Regents of the University of California. All rights reserved.
@ -685,6 +685,9 @@ or it will not be recognized.
.It Va .TARGET .It Va .TARGET
The name of the target; also known as The name of the target; also known as
.Ql Va @ . .Ql Va @ .
For compatibility with other makes this is an alias for
.Ic .ARCHIVE
in archive member rules.
.El .El
.Pp .Pp
The shorter forms The shorter forms

View File

@ -438,7 +438,9 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS
suffixes declared with ..SSUUFFFFIIXXEESS or it will not be recog- suffixes declared with ..SSUUFFFFIIXXEESS or it will not be recog-
nized. nized.
_._T_A_R_G_E_T The name of the target; also known as `_@'. _._T_A_R_G_E_T The name of the target; also known as `_@'. For compati-
bility with other makes this is an alias for ..AARRCCHHIIVVEE in
archive member rules.
The shorter forms (`_>', `_!', `_<', `_%', `_?', `_*', and `_@') are permitted The shorter forms (`_>', `_!', `_<', `_%', `_?', `_*', and `_@') are permitted
for backward compatibility with historical makefiles and legacy POSIX for backward compatibility with historical makefiles and legacy POSIX

5
make.1
View File

@ -1,4 +1,4 @@
.\" $NetBSD: make.1,v 1.254 2016/02/20 01:43:28 wiz Exp $ .\" $NetBSD: make.1,v 1.255 2016/03/14 07:42:15 matthias Exp $
.\" .\"
.\" Copyright (c) 1990, 1993 .\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved. .\" The Regents of the University of California. All rights reserved.
@ -685,6 +685,9 @@ or it will not be recognized.
.It Va .TARGET .It Va .TARGET
The name of the target; also known as The name of the target; also known as
.Ql Va @ . .Ql Va @ .
For compatibility with other makes this is an alias for
.Ic .ARCHIVE
in archive member rules.
.El .El
.Pp .Pp
The shorter forms The shorter forms

8
meta.c
View File

@ -1,4 +1,4 @@
/* $NetBSD: meta.c,v 1.53 2016/03/07 21:45:43 christos Exp $ */ /* $NetBSD: meta.c,v 1.54 2016/03/11 07:01:21 sjg Exp $ */
/* /*
* Implement 'meta' mode. * Implement 'meta' mode.
@ -1190,6 +1190,7 @@ meta_oodate(GNode *gn, Boolean oodate)
if ((link_src != NULL && lstat(p, &fs) < 0) || if ((link_src != NULL && lstat(p, &fs) < 0) ||
(link_src == NULL && stat(p, &fs) < 0)) { (link_src == NULL && stat(p, &fs) < 0)) {
if (Lst_Find(missingFiles, p, string_match) == NULL)
Lst_AtEnd(missingFiles, bmake_strdup(p)); Lst_AtEnd(missingFiles, bmake_strdup(p));
} }
break; break;
@ -1281,9 +1282,8 @@ meta_oodate(GNode *gn, Boolean oodate)
* A referenced file outside of CWD is missing. * A referenced file outside of CWD is missing.
* We cannot catch every eventuality here... * We cannot catch every eventuality here...
*/ */
if (DEBUG(META)) if (Lst_Find(missingFiles, p, string_match) == NULL)
fprintf(debug_file, "%s: %d: file '%s' may have moved?...\n", fname, lineno, p); Lst_AtEnd(missingFiles, bmake_strdup(p));
oodate = TRUE;
} }
} }
if (buf[0] == 'E') { if (buf[0] == 'E') {

View File

@ -1,3 +1,26 @@
2016-03-15 Simon J. Gerraty <sjg@bad.crufty.net>
* install-mk (MK_VERSION): 20160315
* meta.stage.mk (LN_CP_SCRIPT): do not ln(1) if we have to chmod(1)
normally only applies to scripts.
* dirdeps.mk: NO_DIRDEPS_BELOW to supress DIRDEPS below RELDIR as
well as outside it.
2016-03-10 Simon J. Gerraty <sjg@bad.crufty.net>
* install-mk (MK_VERSION): 20160310
* dirdeps.mk: use targets rather than a list to track DIRDEPS that
we have processed; the list gets very inefficient as number of
DIRDEPS gets large.
* sys.dependfile.mk: fix comment wrt MACHINE
* meta.autodep.mk: ignore staged DPADDs when bootstrapping.
patch from Bryan Drewery
2016-03-02 Simon J. Gerraty <sjg@bad.crufty.net> 2016-03-02 Simon J. Gerraty <sjg@bad.crufty.net>
* meta2deps.sh: don't ignore subdirs. * meta2deps.sh: don't ignore subdirs.

View File

@ -1,4 +1,4 @@
# $Id: dirdeps.mk,v 1.59 2016/02/26 23:32:29 sjg Exp $ # $Id: dirdeps.mk,v 1.62 2016/03/16 00:11:53 sjg Exp $
# Copyright (c) 2010-2013, Juniper Networks, Inc. # Copyright (c) 2010-2013, Juniper Networks, Inc.
# All rights reserved. # All rights reserved.
@ -135,7 +135,6 @@ start_utc := ${now_utc}
# make sure these are empty to start with # make sure these are empty to start with
_DEP_TARGET_SPEC = _DEP_TARGET_SPEC =
_DIRDEP_CHECKED =
# If TARGET_SPEC_VARS is other than just MACHINE # If TARGET_SPEC_VARS is other than just MACHINE
# it should be set by sys.mk or similar by now. # it should be set by sys.mk or similar by now.
@ -225,7 +224,7 @@ _DEP_TARGET_SPEC = ${_last_dependfile:${M_dep_qual_fixes:ts:}:E}
.endif .endif
.if !empty(_last_dependfile) .if !empty(_last_dependfile)
# record that we've read dependfile for this # record that we've read dependfile for this
_DIRDEP_CHECKED += ${_CURDIR}.${TARGET_SPEC} _dirdeps_checked.${_CURDIR}.${TARGET_SPEC}:
.endif .endif
.endif .endif
@ -306,8 +305,10 @@ DEP_SKIP_DIR = ${SKIP_DIR} \
NSkipDir = ${DEP_SKIP_DIR:${M_ListToSkip}} NSkipDir = ${DEP_SKIP_DIR:${M_ListToSkip}}
.if defined(NO_DIRDEPS) || defined(NODIRDEPS) || defined(WITHOUT_DIRDEPS) .if defined(NO_DIRDEPS) || defined(NODIRDEPS) || defined(WITHOUT_DIRDEPS)
# confine ourselves to the original dir # confine ourselves to the original dir and below.
DIRDEPS_FILTER += M${_DEP_RELDIR}* DIRDEPS_FILTER += M${_DEP_RELDIR}*
.elif defined(NO_DIRDEPS_BELOW)
DIRDEPS_FILTER += M${_DEP_RELDIR}
.endif .endif
# this is what we run below # this is what we run below
@ -597,9 +598,9 @@ ${_this_dir}.$m: ${_build_dirs:M*.$m:N${_this_dir}.$m}
# Now find more dependencies - and recurse. # Now find more dependencies - and recurse.
.for d in ${_build_all_dirs} .for d in ${_build_all_dirs}
.if ${_DIRDEP_CHECKED:M$d} == "" .if !target(_dirdeps_checked.$d)
# once only # once only
_DIRDEP_CHECKED += $d _dirdeps_checked.$d:
.if ${_debug_search} .if ${_debug_search}
.info checking $d .info checking $d
.endif .endif

View File

@ -55,7 +55,7 @@
# Simon J. Gerraty <sjg@crufty.net> # Simon J. Gerraty <sjg@crufty.net>
# RCSid: # RCSid:
# $Id: install-mk,v 1.121 2016/02/27 00:23:02 sjg Exp $ # $Id: install-mk,v 1.123 2016/03/16 00:13:16 sjg Exp $
# #
# @(#) Copyright (c) 1994 Simon J. Gerraty # @(#) Copyright (c) 1994 Simon J. Gerraty
# #
@ -70,7 +70,7 @@
# sjg@crufty.net # sjg@crufty.net
# #
MK_VERSION=20160226 MK_VERSION=20160315
OWNER= OWNER=
GROUP= GROUP=
MODE=444 MODE=444

View File

@ -1,4 +1,4 @@
# $Id: meta.autodep.mk,v 1.40 2016/02/22 22:44:58 sjg Exp $ # $Id: meta.autodep.mk,v 1.41 2016/03/11 01:29:38 sjg Exp $
# #
# @(#) Copyright (c) 2010, Simon J. Gerraty # @(#) Copyright (c) 2010, Simon J. Gerraty
@ -195,7 +195,7 @@ gendirdeps: ${_DEPENDFILE}
# The pseudo machine "host" is used for HOST_TARGET # The pseudo machine "host" is used for HOST_TARGET
DIRDEPS += \ DIRDEPS += \
${DPADD:M${_OBJTOP}*:H:C,${_OBJTOP}[^/]*/,,:N.:O:u} \ ${DPADD:M${_OBJTOP}*:H:C,${_OBJTOP}[^/]*/,,:N.:O:u} \
${DPADD:M${_OBJROOT}*:N${_OBJTOP}*:H:S,${_OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} ${DPADD:M${_OBJROOT}*:N${_OBJTOP}*:N${STAGE_ROOT:U${_OBJTOP}}/*:H:S,${_OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u}
.endif .endif
.endif .endif

View File

@ -1,4 +1,4 @@
# $Id: meta.stage.mk,v 1.43 2016/02/24 18:46:32 sjg Exp $ # $Id: meta.stage.mk,v 1.44 2016/03/16 18:21:23 sjg Exp $
# #
# @(#) Copyright (c) 2011, Simon J. Gerraty # @(#) Copyright (c) 2011, Simon J. Gerraty
# #
@ -58,7 +58,7 @@ GENDIRDEPS_FILTER += Nnot-empty-is-important \
LN_CP_SCRIPT = LnCp() { \ LN_CP_SCRIPT = LnCp() { \
rm -f $$2 2> /dev/null; \ rm -f $$2 2> /dev/null; \
ln $$1 $$2 2> /dev/null || \ { [ -z "$$mode" ] && ln $$1 $$2 2> /dev/null; } || \
cp -p $$1 $$2; } cp -p $$1 $$2; }
# a staging conflict should cause an error # a staging conflict should cause an error

View File

@ -1,4 +1,4 @@
# $Id: sys.dependfile.mk,v 1.7 2016/02/20 01:57:39 sjg Exp $ # $Id: sys.dependfile.mk,v 1.8 2016/03/11 01:34:13 sjg Exp $
# #
# @(#) Copyright (c) 2012, Simon J. Gerraty # @(#) Copyright (c) 2012, Simon J. Gerraty
# #
@ -48,7 +48,7 @@ _e := ${.MAKE.DEPENDFILE_PREFERENCE:@m@${exists($m):?$m:}@}
# MACHINE specific depend files are supported, but *not* default. # MACHINE specific depend files are supported, but *not* default.
# If any already exist, we should follow suit. # If any already exist, we should follow suit.
_aml = ${ALL_MACHINE_LIST:Uarm amd64 i386 powerpc:N${MACHINE}} ${MACHINE} _aml = ${ALL_MACHINE_LIST:Uarm amd64 i386 powerpc:N${MACHINE}} ${MACHINE}
# MACHINE must be the last entry in _aml ;-) # make sure we restore MACHINE
_m := ${MACHINE} _m := ${MACHINE}
_e := ${_aml:@MACHINE@${.MAKE.DEPENDFILE_PREFERENCE:@m@${exists($m):?$m:}@}@} _e := ${_aml:@MACHINE@${.MAKE.DEPENDFILE_PREFERENCE:@m@${exists($m):?$m:}@}@}
MACHINE := ${_m} MACHINE := ${_m}

View File

@ -1,4 +1,4 @@
/* $NetBSD: parse.c,v 1.212 2016/02/19 06:19:06 sjg Exp $ */ /* $NetBSD: parse.c,v 1.213 2016/03/11 13:54:47 matthias Exp $ */
/* /*
* Copyright (c) 1988, 1989, 1990, 1993 * Copyright (c) 1988, 1989, 1990, 1993
@ -69,14 +69,14 @@
*/ */
#ifndef MAKE_NATIVE #ifndef MAKE_NATIVE
static char rcsid[] = "$NetBSD: parse.c,v 1.212 2016/02/19 06:19:06 sjg Exp $"; static char rcsid[] = "$NetBSD: parse.c,v 1.213 2016/03/11 13:54:47 matthias Exp $";
#else #else
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
#if 0 #if 0
static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94";
#else #else
__RCSID("$NetBSD: parse.c,v 1.212 2016/02/19 06:19:06 sjg Exp $"); __RCSID("$NetBSD: parse.c,v 1.213 2016/03/11 13:54:47 matthias Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
#endif #endif
@ -1261,6 +1261,7 @@ ParseDoDependency(char *line)
goto out; goto out;
} else { } else {
/* Done with this word; on to the next. */ /* Done with this word; on to the next. */
cp = line;
continue; continue;
} }
} }

27
suff.c
View File

@ -1,4 +1,4 @@
/* $NetBSD: suff.c,v 1.78 2016/02/18 18:29:14 christos Exp $ */ /* $NetBSD: suff.c,v 1.81 2016/03/15 18:30:14 matthias Exp $ */
/* /*
* Copyright (c) 1988, 1989, 1990, 1993 * Copyright (c) 1988, 1989, 1990, 1993
@ -69,14 +69,14 @@
*/ */
#ifndef MAKE_NATIVE #ifndef MAKE_NATIVE
static char rcsid[] = "$NetBSD: suff.c,v 1.78 2016/02/18 18:29:14 christos Exp $"; static char rcsid[] = "$NetBSD: suff.c,v 1.81 2016/03/15 18:30:14 matthias Exp $";
#else #else
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
#if 0 #if 0
static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94";
#else #else
__RCSID("$NetBSD: suff.c,v 1.78 2016/02/18 18:29:14 christos Exp $"); __RCSID("$NetBSD: suff.c,v 1.81 2016/03/15 18:30:14 matthias Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
#endif #endif
@ -1894,6 +1894,7 @@ SuffFindArchiveDeps(GNode *gn, Lst slst)
TARGET, /* Must be first */ TARGET, /* Must be first */
PREFIX, /* Must be second */ PREFIX, /* Must be second */
}; };
LstNode ln, nln; /* Next suffix node to check */
int i; /* Index into copy and vals */ int i; /* Index into copy and vals */
Suff *ms; /* Suffix descriptor for member */ Suff *ms; /* Suffix descriptor for member */
char *name; /* Start of member's name */ char *name; /* Start of member's name */
@ -1955,6 +1956,20 @@ SuffFindArchiveDeps(GNode *gn, Lst slst)
Var_Set(MEMBER, name, gn, 0); Var_Set(MEMBER, name, gn, 0);
Var_Set(ARCHIVE, gn->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) { if (ms != NULL) {
/* /*
* Member has a known suffix, so look for a transformation rule from * Member has a known suffix, so look for a transformation rule from
@ -1962,7 +1977,6 @@ SuffFindArchiveDeps(GNode *gn, Lst slst)
* through the entire list, we just look at suffixes to which the * through the entire list, we just look at suffixes to which the
* member's suffix may be transformed... * member's suffix may be transformed...
*/ */
LstNode ln;
SuffixCmpData sd; /* Search string data */ SuffixCmpData sd; /* Search string data */
/* /*
@ -2002,9 +2016,10 @@ SuffFindArchiveDeps(GNode *gn, Lst slst)
/* /*
* Flag the member as such so we remember to look in the archive for * 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;
} }
/*- /*-

10
var.c
View File

@ -1,4 +1,4 @@
/* $NetBSD: var.c,v 1.206 2016/03/07 20:20:35 sjg Exp $ */ /* $NetBSD: var.c,v 1.207 2016/03/11 15:12:39 matthias Exp $ */
/* /*
* Copyright (c) 1988, 1989, 1990, 1993 * Copyright (c) 1988, 1989, 1990, 1993
@ -69,14 +69,14 @@
*/ */
#ifndef MAKE_NATIVE #ifndef MAKE_NATIVE
static char rcsid[] = "$NetBSD: var.c,v 1.206 2016/03/07 20:20:35 sjg Exp $"; static char rcsid[] = "$NetBSD: var.c,v 1.207 2016/03/11 15:12:39 matthias Exp $";
#else #else
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
#if 0 #if 0
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94";
#else #else
__RCSID("$NetBSD: var.c,v 1.206 2016/03/07 20:20:35 sjg Exp $"); __RCSID("$NetBSD: var.c,v 1.207 2016/03/11 15:12:39 matthias Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
#endif #endif
@ -3699,11 +3699,11 @@ Var_Parse(const char *str, GNode *ctxt, int flags,
case '@': case '@':
return UNCONST("$(.TARGET)"); return UNCONST("$(.TARGET)");
case '%': case '%':
return UNCONST("$(.ARCHIVE)"); return UNCONST("$(.MEMBER)");
case '*': case '*':
return UNCONST("$(.PREFIX)"); return UNCONST("$(.PREFIX)");
case '!': case '!':
return UNCONST("$(.MEMBER)"); return UNCONST("$(.ARCHIVE)");
} }
} }
/* /*