Sun Nov 1 17:47:26 2020 UTC ()
make(1): negate NoExecute to GNode_ShouldExecute


(rillig)
diff -r1.172 -r1.173 src/usr.bin/make/compat.c
diff -r1.299 -r1.300 src/usr.bin/make/job.c
diff -r1.185 -r1.186 src/usr.bin/make/make.c
diff -r1.178 -r1.179 src/usr.bin/make/make.h

cvs diff -r1.172 -r1.173 src/usr.bin/make/compat.c (expand / switch to context diff)
--- src/usr.bin/make/compat.c 2020/10/31 18:20:00 1.172
+++ src/usr.bin/make/compat.c 2020/11/01 17:47:26 1.173
@@ -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;
 	}

cvs diff -r1.299 -r1.300 src/usr.bin/make/job.c (expand / switch to context diff)
--- src/usr.bin/make/job.c 2020/11/01 17:07:03 1.299
+++ src/usr.bin/make/job.c 2020/11/01 17:47:26 1.300
@@ -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.

cvs diff -r1.185 -r1.186 src/usr.bin/make/make.c (expand / switch to context diff)
--- src/usr.bin/make/make.c 2020/10/31 18:41:07 1.185
+++ src/usr.bin/make/make.c 2020/11/01 17:47:26 1.186
@@ -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));

cvs diff -r1.178 -r1.179 src/usr.bin/make/make.h (expand / switch to context diff)
--- src/usr.bin/make/make.h 2020/10/31 11:54:33 1.178
+++ src/usr.bin/make/make.h 2020/11/01 17:47:26 1.179
@@ -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