Re: [PATCH] kbuild: Do not run kernel-doc when building external modules

Jani Nikula
2026-02-04T09:10:44Z

On Wed, 04 Feb 2026, Masahiro Yamada <masahiroy@kernel.org> wrote:
> Since kernel-doc is a part of Kbuild,
> all dependent libraries should exist under scripts/.

Huh. I've always wondered why all the Kbuild makefiles are placed in
scripts/, which appears to be a haphazard collection of, well, scripts
and tools. But then you also have tools/.

I've followed the kernel-doc refactoring from the sidelines, commenting
on some things, but it never crossed my mind the build shouldn't depend
on something outside of scripts/. (That's what I'm inferring here
anyway.) And apparently that thought didn't occur to a lot of other
people either, with even more kernel experience than myself.

Sounds like the kernel config and build system would deserve a top-level
directory like build/ or kbuild/, which collects everything needed for
the build, nothing more, nothing less. Because scripts/ is not *that*.

I understand all of this may be a historical accident, and possibly too
painful to fix now, but is any of this documented anywhere either?

BR,
Jani.

--
Jani Nikula, Intel