All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Makefile: clean .depend dirs under COMPUTE_HEADER_DEPENDENCIES != yes
@ 2021-09-22 20:17 Ævar Arnfjörð Bjarmason
  2021-09-22 20:26 ` Jeff King
  0 siblings, 1 reply; 3+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-09-22 20:17 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Carlo Marcelo Arenas Belón, Jeff King,
	Jonathan Nieder, Ævar Arnfjörð Bjarmason

Fix a logic error in dfea575017d (Makefile: lazily compute header
dependencies, 2010-01-26) where we'd make whether we cleaned the
.depend dirs contingent on the currently configured
COMPUTE_HEADER_DEPENDENCIES value. Before this running e.g.:

    make COMPUTE_HEADER_DEPENDENCIES=yes grep.o
    make COMPUTE_HEADER_DEPENDENCIES=no clean

Would leave behind the .depend directory, now it'll be removed.

Normally we'd need to use another variable, but in this case there's
no other uses of $(dep_dirs), as opposed to $(dep_args) which is used
as an argument to $(CC). So just deleting this line makes everything
work correctly.

See http://lore.kernel.org/git/xmqqmto48ufz.fsf@gitster.g for a report
about this issue.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Makefile b/Makefile
index 9df565f27bb..bc987daf495 100644
--- a/Makefile
+++ b/Makefile
@@ -2466,7 +2466,6 @@ dep_args = -MF $(dep_file) -MQ $@ -MMD -MP
 endif
 
 ifneq ($(COMPUTE_HEADER_DEPENDENCIES),yes)
-dep_dirs =
 missing_dep_dirs =
 dep_args =
 endif
-- 
2.33.0.1225.g9f062250122


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Makefile: clean .depend dirs under COMPUTE_HEADER_DEPENDENCIES != yes
  2021-09-22 20:17 [PATCH] Makefile: clean .depend dirs under COMPUTE_HEADER_DEPENDENCIES != yes Ævar Arnfjörð Bjarmason
@ 2021-09-22 20:26 ` Jeff King
  2021-09-22 20:31   ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff King @ 2021-09-22 20:26 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: git, Junio C Hamano, Carlo Marcelo Arenas Belón, Jonathan Nieder

On Wed, Sep 22, 2021 at 10:17:06PM +0200, Ævar Arnfjörð Bjarmason wrote:

> Fix a logic error in dfea575017d (Makefile: lazily compute header
> dependencies, 2010-01-26) where we'd make whether we cleaned the
> .depend dirs contingent on the currently configured
> COMPUTE_HEADER_DEPENDENCIES value. Before this running e.g.:
> 
>     make COMPUTE_HEADER_DEPENDENCIES=yes grep.o
>     make COMPUTE_HEADER_DEPENDENCIES=no clean
> 
> Would leave behind the .depend directory, now it'll be removed.
> 
> Normally we'd need to use another variable, but in this case there's
> no other uses of $(dep_dirs), as opposed to $(dep_args) which is used
> as an argument to $(CC). So just deleting this line makes everything
> work correctly.
> 
> See http://lore.kernel.org/git/xmqqmto48ufz.fsf@gitster.g for a report
> about this issue.

This makes perfect sense to me. Nicely explained, and the patch is
simpler than I'd have expected. :)

-Peff

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Makefile: clean .depend dirs under COMPUTE_HEADER_DEPENDENCIES != yes
  2021-09-22 20:26 ` Jeff King
@ 2021-09-22 20:31   ` Junio C Hamano
  0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2021-09-22 20:31 UTC (permalink / raw)
  To: Jeff King
  Cc: Ævar Arnfjörð Bjarmason, git,
	Carlo Marcelo Arenas Belón, Jonathan Nieder

Jeff King <peff@peff.net> writes:

>> See http://lore.kernel.org/git/xmqqmto48ufz.fsf@gitster.g for a report
>> about this issue.
>
> This makes perfect sense to me. Nicely explained, and the patch is
> simpler than I'd have expected. :)

For the record, I did *not* (and I right now do not) consider this
behaviour as an "issue" when I mentioned it.  It's like building
with a setting that requires some compat/ stuff and then cleaning
without the setting, no?  i.e. cruft left behind is something the
user deserves to see.

Since there is no other useful purpose for these .depend directories
to exist, I do not mind if "make clean" removed them, though ;-)

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-22 20:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-22 20:17 [PATCH] Makefile: clean .depend dirs under COMPUTE_HEADER_DEPENDENCIES != yes Ævar Arnfjörð Bjarmason
2021-09-22 20:26 ` Jeff King
2021-09-22 20:31   ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.