On Mon, Mar 30, 2026 at 05:09:54PM -0700, Andrew Morton wrote:
> On Sun, 29 Mar 2026 18:04:52 +0800 Li Wang <[email protected]> wrote:
>
> > > ts:/usr/src/25> cat Makefile
> > > # Automatically generated by /usr/src/25/Makefile: don't edit
> > > export KBUILD_OUTPUT = .
> > > export KBUILD_EXTMOD = /usr/src/25
> > > export KBUILD_EXTMOD_OUTPUT = /usr/src/25
> > > include /usr/src/25/Makefile
> > >
> > > I've done this twice in succession now. Any suggestions where I should
> > > look?
> >
> > When build selftests from the top-level, sub-makes entered via `-C` may
> > still inherit the caller's PWD from the environment.
> >
> > Some selftests use $(PWD) in recursive kbuild invocations, which can
> > then incorrectly resolve to the kernel top directory instead of the
> > current test directory.
> >
> > Maybe try export PWD in the ../selftests/lib.mk?
> >
> > export PWD := $(CURDIR)
>
> Thanks, I'll get onto this stuff soon.
I have created a patchset for those build tiny issues,
let me send out to you to have a early try?
> Meanwhile, shouldn't this work?
>
> ts:/usr/src/25/tools/testing/selftests/mm> make merge.i
> make: *** No rule to make target 'merge.i'. Stop.
That's probably because Makefile explicitly disables the implicit .c to .i rule.
In line#43 of Makefile:
MAKEFLAGS += --no-builtin-rules
I doubt do we really need to add back the 'gcc -E' approach?
The selftests build system intentionally kills built-in rules to prevent
half-broken implicit builds.
(the comment line# 33~42 in the Makefile explains why)
--
Regards,
Li Wang