On Fri, Apr 24, 2026 at 12:51:21PM -0400, Sasha Levin wrote: ... > diff --git a/kernel/Makefile b/kernel/Makefile > index 6785982013dce..5643151536439 100644 > --- a/kernel/Makefile > +++ b/kernel/Makefile > @@ -59,6 +59,9 @@ obj-y += dma/ > obj-y += entry/ > obj-y += unwind/ > obj-$(CONFIG_MODULES) += module/ > +obj-$(CONFIG_KAPI_SPEC) += api/ > +# Ensure api/ is always cleaned even when CONFIG_KAPI_SPEC is not set > +obj- += api/ > > obj-$(CONFIG_KCMP) += kcmp.o ... > diff --git a/kernel/api/Makefile b/kernel/api/Makefile > new file mode 100644 > index 0000000000000..c0a13fc590e4a > --- /dev/null > +++ b/kernel/api/Makefile > @@ -0,0 +1,14 @@ > +# SPDX-License-Identifier: GPL-2.0 > +# > +# Makefile for the Kernel API Specification Framework > +# > + > +# Core API specification framework > +obj-$(CONFIG_KAPI_SPEC) += kernel_api_spec.o
Bike-shedding: I'd use 'obj-y' here, to state clearly that kernel_api_spec.c is the core part in the kernel/api/ subdir. If CONFIG_KAPI_SPEC is unset, the subfir will not be entered at all. -- Nicolas

