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): convert NoExecute to non-inline



details:   https://anonhg.NetBSD.org/src/rev/63527e31ab5f
branches:  trunk
changeset: 1015228:63527e31ab5f
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Oct 18 11:09:08 2020 +0000

description:
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.

diffstat:

 usr.bin/make/make.c |  10 ++++++++--
 usr.bin/make/make.h |   9 ++-------
 2 files changed, 10 insertions(+), 9 deletions(-)

diffs (54 lines):

diff -r e4c7bb1f352b -r 63527e31ab5f usr.bin/make/make.c
--- a/usr.bin/make/make.c       Sun Oct 18 10:57:30 2020 +0000
+++ b/usr.bin/make/make.c       Sun Oct 18 11:09:08 2020 +0000
@@ -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 @@
            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)
diff -r e4c7bb1f352b -r 63527e31ab5f usr.bin/make/make.h
--- a/usr.bin/make/make.h       Sun Oct 18 10:57:30 2020 +0000
+++ b/usr.bin/make/make.h       Sun Oct 18 11:09:08 2020 +0000
@@ -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 @@
 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



Home | Main Index | Thread Index | Old Index