diff options
| author | rillig <rillig@NetBSD.org> | 2020-10-18 11:09:08 +0000 |
|---|---|---|
| committer | rillig <rillig@NetBSD.org> | 2020-10-18 11:09:08 +0000 |
| commit | 71c26ae4f192fcc8a32a9f2f0ecf2467d180e52d (patch) | |
| tree | f630eb4c72af1995b26fb6b06dddbefd1148d240 /usr.bin/make | |
| parent | e89b6c8f70a68bc6a84d848fa030b28a1bc7608c (diff) | |
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 (limited to 'usr.bin/make')
| -rw-r--r-- | usr.bin/make/make.c | 10 | ||||
| -rw-r--r-- | usr.bin/make/make.h | 9 |
2 files changed, 10 insertions, 9 deletions
diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c index 7d33e0dc685..102811e398d 100644 --- a/usr.bin/make/make.c +++ b/usr.bin/make/make.c @@ -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 *prefix, const GNode *gn, 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 --git a/usr.bin/make/make.h b/usr.bin/make/make.h index 57cf6b70a6e..a7769fc3669 100644 --- a/usr.bin/make/make.h +++ b/usr.bin/make/make.h @@ -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 *, ...) MAKE_ATTR_PRINTFLIKE(1, 2); 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 |
