Il ven 15 nov 2024, 22:15 Rob Landley <r...@landley.net> ha scritto:

> On 11/14/24 17:33, Paolo Bonzini wrote:
> > On 11/15/24 00:10, Rob Landley wrote:
> >> Seems a _bit_ awkward to do that (and potentially fail on a random new
> >> dependency) just to delete it all again?
> >
> > That's just how Make works.
>
> Linux and busybox and so on use make, and I've never seen "make clean"
> trigger a "make defconfig" there.
>

Yeah, they don't have a separate (and lengthy) configure phase. But they
might invoke some rules in a more hidden way if something changes in
scripts/. I don't know, Kbuild is black magic.

(Or do you mean "Make" is different from "gmake" the way "kbuild" is
> different from "make" and you distinguish your build system from the
> make command by capitalizing it?


No, I meant "any implementation of the POSIX utility".

> If it finds that Makefile is old, it first
> > regenerates Makefile and only then looks at the target.
>
> I'm pretty sure the make command doesn't internally know how to run the
> configure script, the Makefile would have to include plumbing to make
> that decision


It does, the chain is config-host.mak <- configure. The special processing
of Makefiles extends to all includes ("all Makefiles" in the GNU manual).

and it at least LOOKS like it's trying not to in the top level Makefile
> line 336:
>
>    # Don't try to regenerate Makefile or configure
>    # We don't generate any of them
>    Makefile: ;
>    configure: ;
>

Makefile and configure are not generated but other included files are. Most
likely the one you're hitting is config-host.mak..

I note that if you run "make clean" twice in a row, it doesn't re-run
> configure in between. It's only when a stale target exists, which seems
> to involve dependencies making a decision.


... and the second time, it is not stale anymore.

(The file NOT existing doesn't trigger action, but the file being "old"
> does.)
>

config-host.mak is only cleaned by distclean, not clean.

So it's an artifact of the way you're using make, and hard to fix then?
>

Maybe not too hard, I suppose one could strip the includes if make goals
are only of the form %clean.

Paolo

*shrug* I'd use 'git clean -fdx' instead but I'm not sure how that
> interacts with multiple submodules.
>

Reply via email to