Skip to content

Commit

Permalink
Update to bmake-20200710
Browse files Browse the repository at this point in the history
Key changes include reduced noise at end of failed build log
and avoid evaluation of unnecessary terms in conditionals.
In META MODE; a target flagged .META is out-of-date if meta file
is missing

MFC after:      1 week
  • Loading branch information
sgerraty committed Jul 12, 2020
2 parents cdfea68 + 367d32e commit 3841c28
Show file tree
Hide file tree
Showing 88 changed files with 3,823 additions and 3,646 deletions.
95 changes: 95 additions & 0 deletions contrib/bmake/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,98 @@
2020-07-10 Simon J Gerraty <[email protected]>

* configure.in: use AC_INCLUDES_DEFAULT rather than AC_HEADER_STDC

* VERSION (_MAKE_VERSION): 20200710
Merge with NetBSD make, pick up
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

2020-07-09 Simon J Gerraty <[email protected]>

* VERSION (_MAKE_VERSION): 20200709
Merge with NetBSD make, pick up
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.

2020-07-04 Simon J Gerraty <[email protected]>

* VERSION (_MAKE_VERSION): 20200704
Merge with NetBSD make, pick up
(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.

2020-07-02 Simon J Gerraty <[email protected]>

* VERSION (_MAKE_VERSION): 20200702
Merge with NetBSD make, pick up
o var.c: more improvements to avoiding unnecessary evaluation
use enums for flags
o remove flags arg to Var_Set which outside of var.c is always 0

2020-07-01 Simon J Gerraty <[email protected]>

* VERSION (_MAKE_VERSION): 20200701
Merge with NetBSD make, pick up
o var.c: with change to cond.c; ensure that nested variables
within a variable name are expanded.
o unit-tests/varmisc.mk: test for nested varname

2020-06-29 Simon J Gerraty <[email protected]>

* VERSION (_MAKE_VERSION): 20200629
Merge with NetBSD make, pick up
o cond.c: do not eval unnecessary terms of conditionals.

2020-06-25 Simon J Gerraty <[email protected]>

* VERSION (_MAKE_VERSION): 20200625
Merge with NetBSD make, pick up
o meta.c: report error if lseek in filemon_read fails

2020-06-22 Simon J Gerraty <[email protected]>

* VERSION (_MAKE_VERSION): 20200622
Merge with NetBSD make, pick up
o dieQuietly: ignore OP_SUBMAKE as too aggressive

2020-06-19 Simon J Gerraty <[email protected]>

* VERSION (_MAKE_VERSION): 20200619
Merge with NetBSD make, pick up
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

2020-06-10 Simon J Gerraty <[email protected]>

* FILES: add LICENSE to appease some packagers.
This is an attempt to fairly represent the license on almost
200 files, which are almost all BSD-3-Clause
The few exceptions being more liberal.

* VERSION (_MAKE_VERSION): 20200610
Merge with NetBSD make, pick up
o unit test for :Or

2020-06-06 Simon J Gerraty <[email protected]>

* VERSION (_MAKE_VERSION): 20200606
Expand Down
3 changes: 3 additions & 0 deletions contrib/bmake/FILES
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ChangeLog
FILES
LICENSE
Makefile
Makefile.config.in
PSD.doc/Makefile
Expand Down Expand Up @@ -107,6 +108,8 @@ unit-tests/cond2.exp
unit-tests/cond2.mk
unit-tests/cond-late.mk
unit-tests/cond-late.exp
unit-tests/cond-short.mk
unit-tests/cond-short.exp
unit-tests/dollar.exp
unit-tests/dollar.mk
unit-tests/doterror.exp
Expand Down
2 changes: 1 addition & 1 deletion contrib/bmake/VERSION
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# keep this compatible with sh and make
_MAKE_VERSION=20200606
_MAKE_VERSION=20200710
48 changes: 24 additions & 24 deletions contrib/bmake/arch.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: arch.c,v 1.71 2019/10/05 23:35:57 mrg Exp $ */
/* $NetBSD: arch.c,v 1.73 2020/07/03 08:02:55 rillig Exp $ */

/*
* Copyright (c) 1988, 1989, 1990, 1993
Expand Down Expand Up @@ -69,14 +69,14 @@
*/

#ifndef MAKE_NATIVE
static char rcsid[] = "$NetBSD: arch.c,v 1.71 2019/10/05 23:35:57 mrg Exp $";
static char rcsid[] = "$NetBSD: arch.c,v 1.73 2020/07/03 08:02:55 rillig 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.71 2019/10/05 23:35:57 mrg Exp $");
__RCSID("$NetBSD: arch.c,v 1.73 2020/07/03 08:02:55 rillig Exp $");
#endif
#endif /* not lint */
#endif
Expand Down Expand Up @@ -312,7 +312,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode *ctxt)
free(freeIt);

if (result == var_Error) {
return(FAILURE);
return FAILURE;
} else {
subLibName = TRUE;
}
Expand Down Expand Up @@ -354,7 +354,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode *ctxt)
free(freeIt);

if (result == var_Error) {
return(FAILURE);
return FAILURE;
} else {
doSubst = TRUE;
}
Expand All @@ -372,7 +372,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode *ctxt)
*/
if (*cp == '\0') {
printf("No closing parenthesis in archive specification\n");
return (FAILURE);
return FAILURE;
}

/*
Expand Down Expand Up @@ -426,7 +426,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode *ctxt)

if (gn == NULL) {
free(buf);
return(FAILURE);
return FAILURE;
} else {
gn->type |= OP_ARCHV;
(void)Lst_AtEnd(nodeLst, gn);
Expand All @@ -437,7 +437,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode *ctxt)
* ourselves.
*/
free(buf);
return(FAILURE);
return FAILURE;
}
/*
* Free buffer and continue with our work.
Expand All @@ -461,7 +461,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode *ctxt)
gn = Targ_FindNode(nameBuf, TARG_CREATE);
if (gn == NULL) {
free(nameBuf);
return (FAILURE);
return FAILURE;
} else {
/*
* We've found the node, but have to make sure the rest of
Expand All @@ -483,7 +483,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode *ctxt)
gn = Targ_FindNode(nameBuf, TARG_CREATE);
free(nameBuf);
if (gn == NULL) {
return (FAILURE);
return FAILURE;
} else {
/*
* We've found the node, but have to make sure the rest of the
Expand Down Expand Up @@ -520,7 +520,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode *ctxt)
} while (*cp != '\0' && isspace ((unsigned char)*cp));

*linePtr = cp;
return (SUCCESS);
return SUCCESS;
}

/*-
Expand All @@ -544,7 +544,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode *ctxt)
static int
ArchFindArchive(const void *ar, const void *archName)
{
return (strcmp(archName, ((const Arch *)ar)->name));
return strcmp(archName, ((const Arch *)ar)->name);
}

/*-
Expand Down Expand Up @@ -602,7 +602,7 @@ ArchStatMember(char *archive, char *member, Boolean hash)
he = Hash_FindEntry(&ar->members, member);

if (he != NULL) {
return ((struct ar_hdr *)Hash_GetValue(he));
return (struct ar_hdr *)Hash_GetValue(he);
} else {
/* Try truncated name */
char copy[AR_MAX_NAME_LEN+1];
Expand All @@ -614,7 +614,7 @@ ArchStatMember(char *archive, char *member, Boolean hash)
copy[AR_MAX_NAME_LEN] = '\0';
}
if ((he = Hash_FindEntry(&ar->members, copy)) != NULL)
return ((struct ar_hdr *)Hash_GetValue(he));
return (struct ar_hdr *)Hash_GetValue(he);
return NULL;
}
}
Expand All @@ -635,7 +635,7 @@ ArchStatMember(char *archive, char *member, Boolean hash)
return NULL;
} else {
fclose(arch);
return (&sarh);
return &sarh;
}
}

Expand Down Expand Up @@ -753,7 +753,7 @@ ArchStatMember(char *archive, char *member, Boolean hash)
he = Hash_FindEntry(&ar->members, member);

if (he != NULL) {
return ((struct ar_hdr *)Hash_GetValue(he));
return (struct ar_hdr *)Hash_GetValue(he);
} else {
return NULL;
}
Expand Down Expand Up @@ -962,7 +962,7 @@ ArchFindMember(char *archive, char *member, struct ar_hdr *arhPtr,
fclose(arch);
return NULL;
}
return (arch);
return arch;
}
} else
#ifdef AR_EFMT1
Expand Down Expand Up @@ -996,7 +996,7 @@ ArchFindMember(char *archive, char *member, struct ar_hdr *arhPtr,
fclose(arch);
return NULL;
}
return (arch);
return arch;
}
if (fseek(arch, -elen, SEEK_CUR) != 0) {
fclose(arch);
Expand Down Expand Up @@ -1152,7 +1152,7 @@ Arch_MTime(GNode *gn)
}

gn->mtime = modTime;
return (modTime);
return modTime;
}

/*-
Expand All @@ -1179,7 +1179,7 @@ Arch_MemMTime(GNode *gn)

if (Lst_Open(gn->parents) != SUCCESS) {
gn->mtime = 0;
return (0);
return 0;
}
while ((ln = Lst_Next(gn->parents)) != NULL) {
pgn = (GNode *)Lst_Datum(ln);
Expand Down Expand Up @@ -1211,7 +1211,7 @@ Arch_MemMTime(GNode *gn)

Lst_Close(gn->parents);

return (gn->mtime);
return gn->mtime;
}

/*-
Expand Down Expand Up @@ -1252,9 +1252,9 @@ Arch_FindLib(GNode *gn, Lst path)
free(libName);

#ifdef LIBRARIES
Var_Set(TARGET, gn->name, gn, 0);
Var_Set(TARGET, gn->name, gn);
#else
Var_Set(TARGET, gn->path == NULL ? gn->name : gn->path, gn, 0);
Var_Set(TARGET, gn->path == NULL ? gn->name : gn->path, gn);
#endif /* LIBRARIES */
}

Expand Down Expand Up @@ -1337,7 +1337,7 @@ Arch_LibOODate(GNode *gn)
oodate = FALSE;
#endif
}
return (oodate);
return oodate;
}

/*-
Expand Down
8 changes: 4 additions & 4 deletions contrib/bmake/buf.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: buf.c,v 1.25 2012/04/24 20:26:58 sjg Exp $ */
/* $NetBSD: buf.c,v 1.26 2020/07/03 08:02:55 rillig Exp $ */

/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
Expand Down Expand Up @@ -70,14 +70,14 @@
*/

#ifndef MAKE_NATIVE
static char rcsid[] = "$NetBSD: buf.c,v 1.25 2012/04/24 20:26:58 sjg Exp $";
static char rcsid[] = "$NetBSD: buf.c,v 1.26 2020/07/03 08:02:55 rillig 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.25 2012/04/24 20:26:58 sjg Exp $");
__RCSID("$NetBSD: buf.c,v 1.26 2020/07/03 08:02:55 rillig Exp $");
#endif
#endif /* not lint */
#endif
Expand Down Expand Up @@ -160,7 +160,7 @@ Buf_GetAll(Buffer *bp, int *numBytesPtr)
if (numBytesPtr != NULL)
*numBytesPtr = bp->count;

return (bp->buffer);
return bp->buffer;
}

/*-
Expand Down
Loading

0 comments on commit 3841c28

Please sign in to comment.