git: 9dc4bcb1a63a - main - build(7): Document KERNBUILDDIR

From: Warner Losh <imp_at_FreeBSD.org>
Date: Sat, 08 Mar 2025 17:05:49 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=9dc4bcb1a63acbbe32b4e80b690a843dd37315e7

commit 9dc4bcb1a63acbbe32b4e80b690a843dd37315e7
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2025-03-08 01:32:58 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2025-03-08 16:59:03 +0000

    build(7): Document KERNBUILDDIR
    
    KERNBUILDDIR is used by kmod.mk to find the opt_*.h when matching a
    kernel to the module. Usually one doesn't need this nob (since most
    modules are option invariant or default to the default options everyone
    uses), but there are times this generalization doesn't hold.
    
    Sponsored by:           Netflix
---
 share/man/man7/build.7 | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/share/man/man7/build.7 b/share/man/man7/build.7
index 1df9b084726f..2195d1147820 100644
--- a/share/man/man7/build.7
+++ b/share/man/man7/build.7
@@ -25,7 +25,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd February 3, 2025
+.Dd March 8, 2025
 .Dt BUILD 7
 .Os
 .Sh NAME
@@ -554,6 +554,13 @@ Overrides which kernel to build and install for the various kernel
 make targets.
 It defaults to
 .Cm GENERIC .
+.It Va KERNBUILDDIR
+Overrides the default directory to get all the opt_*.h files for
+building a kernel module.
+Useful for stand-alone modules that depend on
+.Xr config 8
+options.
+Automatically set for modules built with a kernel.
 .It Va KERNCONFDIR
 Overrides the directory in which
 .Va KERNCONF