Module Name:    src
Committed By:   rillig
Date:           Sun Oct 18 11:09:08 UTC 2020

Modified Files:
        src/usr.bin/make: make.c make.h

Log Message:
make(1): convert NoExecute to non-inline

The header make.h is not only used by usr.bin/make but also by
usr.bin/xinstall, to get the needshell function.

That program does not declare the variables noRecursiveExecute and
noExecute, leading to an "unresolved reference" at link time.  To fix
this, move the inline functions away from make.h.

It's a quirk that make.h gets included by other programs since it
contains a whole lot of definitions that are only useful in make itself.
If any, there should be a separate header that defines the public
library API of make, and only that.


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/usr.bin/make/make.c
cvs rdiff -u -r1.156 -r1.157 src/usr.bin/make/make.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/make.c
diff -u src/usr.bin/make/make.c:1.158 src/usr.bin/make/make.c:1.159
--- src/usr.bin/make/make.c:1.158	Sat Oct 17 17:47:14 2020
+++ src/usr.bin/make/make.c	Sun Oct 18 11:09:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.c,v 1.158 2020/10/17 17:47:14 rillig Exp $	*/
+/*	$NetBSD: make.c,v 1.159 2020/10/18 11:09:08 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.158 2020/10/17 17:47:14 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.159 2020/10/18 11:09:08 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked = 1;
@@ -177,6 +177,12 @@ GNode_FprintDetails(FILE *f, const char 
 	    suffix);
 }
 
+Boolean
+NoExecute(GNode *gn)
+{
+    return (gn->type & OP_MAKE) ? noRecursiveExecute : noExecute;
+}
+
 /* Update the youngest child of the node, according to the given child. */
 void
 Make_TimeStamp(GNode *pgn, GNode *cgn)

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.156 src/usr.bin/make/make.h:1.157
--- src/usr.bin/make/make.h:1.156	Mon Oct  5 22:15:45 2020
+++ src/usr.bin/make/make.h	Sun Oct 18 11:09:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.156 2020/10/05 22:15:45 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.157 2020/10/18 11:09:08 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -560,12 +560,7 @@ Boolean Main_SetObjdir(const char *, ...
 int mkTempFile(const char *, char **);
 int str2Lst_Append(StringList *, char *, const char *);
 void GNode_FprintDetails(FILE *, const char *, const GNode *, const char *);
-
-static Boolean MAKE_ATTR_UNUSED
-NoExecute(GNode *gn)
-{
-    return (gn->type & OP_MAKE) ? noRecursiveExecute : noExecute;
-}
+Boolean NoExecute(GNode *gn);
 
 /*
  * See if the node with the given type was not the object of a dependency

Reply via email to