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

From: Mauro Carvalho Chehab

Date: Wed Feb 04 2026 - 06:15:19 EST


On Wed, 04 Feb 2026 12:39:22 +0200
Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx> wrote:

> On Wed, 04 Feb 2026, Nicolas Schier <nsc@xxxxxxxxxx> wrote:
> > Well, sounds straight forward at first, but where should we make the
> > cut between kbuild and non-kbuild?
>
> I'll reply hypothetically, just for the sake of discussion, because
> realistically, I don't think any of this is going to happen.
>
> IMO the cut should be, "Is this required for configuring and building
> the kernel"?

Agreed. Going further, maybe the best would be to define it per make
target, placing them on 3 groups:

- kbuild - make targets related to actually build the kernel;
- docs-build - make targets related to build docs;
- non-kbuild - the remaining random stuff over there.

To properly define what should be there, maybe the best would be to
look at "make help" and define what belongs to each group:


Cleaning targets:
- mostly kbuild (documentation is also part of cleaning targets)

Configuration targets:
- kbuild

Configuration topic targets:
- kbuild (I guess)

Other generic targets:
- kbuild: all, vmlinux, modules, modules_install, vdso_install, dir/*
- There is a grey area here with targets like cscope, gtags, tags/TAGS.
I would consider those as non-kbuild.

Static analysers, Tools, Kernel selftest:
- I would also consider those as no-kbuild

Rust targets:
- dir/*: kbuild
- the other ones seem ancillary tooling. Probably, non-kbuild

Userspace tools targets:
- for sure no-kbuild

Kernel packaging:
- no-kbuild

Documentation targets:
- docs-build

Architecture-specific targets:
- kbuild

>
> scripts/ just sounds like a dumping ground for random scripts, and
> kbuild should be somewhere else. And let scripts/ be the dumping ground
> that it is. If kbuild was under kbuild/, nobody in their right mind
> would suggest adding random unrelated scripts there.
>
> If kbuild depends on some things like objtool from somewhere else, so be
> it, but at least don't pollute kbuild with unrelated things.

Agreed. Yet, better to document it somewhere.

>
> > I admit that there are some scripts below scripts/ that I'd rather
> > label as "contrib", but I don't think that these are too much.
>
> I've got to disagree there. I think there's so much that it's hard to
> follow what is and isn't actually required for build.
>
> At a *very* quick glance, there are things like checkpatch.pl,
> get_maintainer.pl, anything coccinelle, bash-completion, Lindent,
> macro_checker.py, bloat-o-meter, bootgraph.pl, etc, etc.

So true. on its current state, scripts/ is a place where people
ended adding random stuff over time.

--
Thanks,
Mauro