Re: [PATCH 1/2] Makefile: use order-only prereq for UNIT_TEST_BIN

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 29, 2024 at 09:22:01PM +0100, SZEDER Gábor wrote:

> > If it is a problem, there are two alternatives:
> > 
> >   - we can just "mkdir -p" in the recipe to build the individual
> >     binaries. This will mean some redundant "mkdir" calls, but only when
> >     actually invoking the compiler.
> > 
> >   - we could stop making the directory on the fly, and just add it with
> >     a .gitignore of "*". This would work fine, but might be awkward when
> >     moving back and forth in history.
> 
> A third alternative is to use $(call mkdir_p_parent_template) in the
> recipe and get rid of the thus unnecessary UNIT_TEST_BIN dependency
> and target.  It will only run mkdir when needed, and it's a well
> established pattern in our Makefile, so you won't have to spend a
> paragraph or two arguing about potential problems with GNU-isms :)

Thanks, I somehow didn't know about that (and didn't find it when
grepping around for similar cases, probably because "mkdir -p" no longer
appears in those cases ;) ).

I agree it's a better solution here. I'll send a v2 in a moment with
that.

(Ironically, that template requires "call" which is in make 3.81, but
the commit adding it didn't discuss that at all).

> On a related note, 'make clean' doesn't remove this 't/unit-tests/bin'
> directory.

Not the end of the world, as we do clean out the contents, so "ls-files
-o" would not mention any leftover cruft. But I agree that we should
strive for "make clean" to be the opposite of "make" as much as
possible.

I'll add in a patch to v2.

-Peff




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux