Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make make(1): negate NoExecute to GNode_ShouldExecute
details: https://anonhg.NetBSD.org/src/rev/64327ba0fc9c
branches: trunk
changeset: 956562:64327ba0fc9c
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Nov 01 17:47:26 2020 +0000
description:
make(1): negate NoExecute to GNode_ShouldExecute
diffstat:
usr.bin/make/compat.c | 12 ++++++------
usr.bin/make/job.c | 12 ++++++------
usr.bin/make/make.c | 10 +++++-----
usr.bin/make/make.h | 4 ++--
4 files changed, 19 insertions(+), 19 deletions(-)
diffs (162 lines):
diff -r 89873f0c216b -r 64327ba0fc9c usr.bin/make/compat.c
--- a/usr.bin/make/compat.c Sun Nov 01 17:29:13 2020 +0000
+++ b/usr.bin/make/compat.c Sun Nov 01 17:47:26 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat.c,v 1.172 2020/10/31 18:20:00 rillig Exp $ */
+/* $NetBSD: compat.c,v 1.173 2020/11/01 17:47:26 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -96,7 +96,7 @@
#include "pathnames.h"
/* "@(#)compat.c 8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: compat.c,v 1.172 2020/10/31 18:20:00 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.173 2020/11/01 17:47:26 rillig Exp $");
static GNode *curTarg = NULL;
static pid_t compatChild;
@@ -274,7 +274,7 @@
* Print the command before echoing if we're not supposed to be quiet for
* this one. We also print the command if -n given.
*/
- if (!silent || NoExecute(gn)) {
+ if (!silent || !GNode_ShouldExecute(gn)) {
printf("%s\n", cmd);
fflush(stdout);
}
@@ -283,7 +283,7 @@
* If we're not supposed to execute any commands, this is as far as
* we go...
*/
- if (!doIt && NoExecute(gn)) {
+ if (!doIt && !GNode_ShouldExecute(gn)) {
return 0;
}
DEBUG1(JOB, "Execute: '%s'\n", cmd);
@@ -548,7 +548,7 @@
if (!opts.touchFlag || (gn->type & OP_MAKE)) {
curTarg = gn;
#ifdef USE_META
- if (useMeta && !NoExecute(gn)) {
+ if (useMeta && GNode_ShouldExecute(gn)) {
meta_job_start(NULL, gn);
}
#endif
@@ -561,7 +561,7 @@
gn->made = ERROR;
}
#ifdef USE_META
- if (useMeta && !NoExecute(gn)) {
+ if (useMeta && GNode_ShouldExecute(gn)) {
if (meta_job_finish(NULL) != 0)
gn->made = ERROR;
}
diff -r 89873f0c216b -r 64327ba0fc9c usr.bin/make/job.c
--- a/usr.bin/make/job.c Sun Nov 01 17:29:13 2020 +0000
+++ b/usr.bin/make/job.c Sun Nov 01 17:47:26 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: job.c,v 1.299 2020/11/01 17:07:03 rillig Exp $ */
+/* $NetBSD: job.c,v 1.300 2020/11/01 17:47:26 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -143,7 +143,7 @@
#include "trace.h"
/* "@(#)job.c 8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: job.c,v 1.299 2020/11/01 17:07:03 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.300 2020/11/01 17:47:26 rillig Exp $");
/* A shell defines how the commands are run. All commands for a target are
* written into a single file, which is then given to the shell to execute
@@ -731,7 +731,7 @@
char *cmdStart; /* Start of expanded command */
char *escCmd = NULL; /* Command with quotes/backticks escaped */
- noSpecials = NoExecute(job->node);
+ noSpecials = !GNode_ShouldExecute(job->node);
#define DBPRINTF(fmt, arg) if (DEBUG(JOB)) { \
debug_printf(fmt, arg); \
@@ -1142,12 +1142,12 @@
return;
}
- if (!silent || NoExecute(gn)) {
+ if (!silent || !GNode_ShouldExecute(gn)) {
(void)fprintf(stdout, "touch %s\n", gn->name);
(void)fflush(stdout);
}
- if (NoExecute(gn)) {
+ if (!GNode_ShouldExecute(gn)) {
return;
}
@@ -1600,7 +1600,7 @@
}
free(tfile);
- } else if (NoExecute(gn)) {
+ } else if (!GNode_ShouldExecute(gn)) {
/*
* Not executing anything -- just print all the commands to stdout
* in one fell swoop. This will still set up job->tailCmds correctly.
diff -r 89873f0c216b -r 64327ba0fc9c usr.bin/make/make.c
--- a/usr.bin/make/make.c Sun Nov 01 17:29:13 2020 +0000
+++ b/usr.bin/make/make.c Sun Nov 01 17:47:26 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: make.c,v 1.185 2020/10/31 18:41:07 rillig Exp $ */
+/* $NetBSD: make.c,v 1.186 2020/11/01 17:47:26 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -107,7 +107,7 @@
#include "job.h"
/* "@(#)make.c 8.1 (Berkeley) 6/6/93" */
-MAKE_RCSID("$NetBSD: make.c,v 1.185 2020/10/31 18:41:07 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.186 2020/11/01 17:47:26 rillig Exp $");
/* Sequence # to detect recursion. */
static unsigned int checked = 1;
@@ -178,9 +178,9 @@
}
Boolean
-NoExecute(GNode *gn)
+GNode_ShouldExecute(GNode *gn)
{
- return (gn->type & OP_MAKE) ? opts.noRecursiveExecute : opts.noExecute;
+ return !((gn->type & OP_MAKE) ? opts.noRecursiveExecute : opts.noExecute);
}
/* Update the youngest child of the node, according to the given child. */
@@ -547,7 +547,7 @@
* the target is made now. Otherwise archives with ... rules
* don't work!
*/
- if (NoExecute(gn) || (gn->type & OP_SAVE_CMDS) ||
+ if (!GNode_ShouldExecute(gn) || (gn->type & OP_SAVE_CMDS) ||
(mtime == 0 && !(gn->type & OP_WAIT))) {
DEBUG2(MAKE, " recheck(%s): update time from %s to now\n",
gn->name, Targ_FmtTime(gn->mtime));
diff -r 89873f0c216b -r 64327ba0fc9c usr.bin/make/make.h
--- a/usr.bin/make/make.h Sun Nov 01 17:29:13 2020 +0000
+++ b/usr.bin/make/make.h Sun Nov 01 17:47:26 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: make.h,v 1.178 2020/10/31 11:54:33 rillig Exp $ */
+/* $NetBSD: make.h,v 1.179 2020/11/01 17:47:26 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -629,7 +629,7 @@
int mkTempFile(const char *, char **);
int str2Lst_Append(StringList *, char *, const char *);
void GNode_FprintDetails(FILE *, const char *, const GNode *, const char *);
-Boolean NoExecute(GNode *gn);
+Boolean GNode_ShouldExecute(GNode *gn);
/* See if the node was seen on the left-hand side of a dependency operator. */
static MAKE_ATTR_UNUSED Boolean
Home |
Main Index |
Thread Index |
Old Index