Subject: Re: [PATCH v3 2/2] Makefile: use $(OBJECTS) instead of $(C_OBJ)

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Thu, 01 Sep 2022 16:52:05 +0200

On Wed, Aug 31 2022, Junio C Hamano wrote:

> Ævar Arnfjörð Bjarmason  <[email-masked]> writes:
>
>> In the preceding commit $(C_OBJ) added in c373991375a (Makefile: list
>> generated object files in OBJECTS, 2010-01-26) became synonymous with
>> $(OBJECTS). Let's avoid the indirection and use the $(OBJECTS)
>> variable directly instead.
>>
>> Signed-off-by: Ævar Arnfjörð Bjarmason <[email-masked]>
>> ---
>>  Makefile | 6 ++----
>>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> This is a declaration that we would never ever build .o files out of
> sources other than .c files.  While it does make sense to have it
> outside the scope of [PATCH 1/2], I am not sure if it even belongs
> to the same series.

I think it does. Before this the C_OBJ would be:

	C_OBJ := $(filter-out $(ASM_OBJ),$(OBJECTS))

but after 1/2 it's the same as $(OBJECTS). An earlier iteration of this
did this cleanup "while we're at it" (which I do think makes sense as an
atomic change), but I got the feedback that the cleanup wasn't strictly
necessary.

But as 1/2 has removed the ability to build those $(ASM_OBJ), as we had
only one of those, I don't think keeping this particular bit of
indirection makes sense.

Of course it doesn't really matter at all, the real change is the
removal of $(ASM_OBJ).

If we do start building *.o files out of *.S files (or other non-*.c)
again we'll need new rules anyway. I think we should just add any such
variables back then, and not keep this small bit of dead husk around.