diff mbox series

[02/16] Makefile: clean perl/build/ even with NO_PERL=Y

Message ID patch-02.16-2d8049f792c-20211106T205717Z-avarab@gmail.com (mailing list archive)
State Superseded
Headers show
Series Makefiles: dependency correctness & speedup | expand

Commit Message

Ævar Arnfjörð Bjarmason Nov. 6, 2021, 9:03 p.m. UTC
Fix a regression in 499c29394ce (Makefile: allow building without
perl, 2009-04-03) where we'd stop cleaning the perl/* directory
because NO_PERL was defined, thus leaving behind litter if the flag at
"clean" time didn't match that of build time.

In 499c29394ce this was done to avoid relying on the perl/Makefile.PL,
but since my 20d2a30f8ff (Makefile: replace perl/Makefile.PL with
simple make rules, 2017-12-10) we can clean things in that directory
unconditionally.

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

Comments

Junio C Hamano Nov. 9, 2021, 11:10 p.m. UTC | #1
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> Fix a regression in 499c29394ce (Makefile: allow building without
> perl, 2009-04-03) where we'd stop cleaning the perl/* directory
> because NO_PERL was defined, thus leaving behind litter if the flag at
> "clean" time didn't match that of build time.
>
> In 499c29394ce this was done to avoid relying on the perl/Makefile.PL,
> but since my 20d2a30f8ff (Makefile: replace perl/Makefile.PL with
> simple make rules, 2017-12-10) we can clean things in that directory
> unconditionally.

Nicely analyzed. And it is a nice touch to move the removal next to
where we remove the Python stuff.

>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 9f57c34e954..82eb8ea446b 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -3234,6 +3234,7 @@ clean: profile-clean coverage-clean cocciclean
>  	$(RM) $(HCC)
>  	$(RM) -r bin-wrappers $(dep_dirs) $(compdb_dir) compile_commands.json
>  	$(RM) -r po/build/
> +	$(RM) -r perl/build/
>  	$(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope*
>  	$(RM) -r .dist-tmp-dir .doc-tmp-dir
>  	$(RM) $(GIT_TARNAME).tar.gz
> @@ -3242,7 +3243,6 @@ clean: profile-clean coverage-clean cocciclean
>  	$(RM) Documentation/GIT-EXCLUDED-PROGRAMS
>  ifndef NO_PERL
>  	$(MAKE) -C gitweb clean
> -	$(RM) -r perl/build/
>  endif
>  	$(MAKE) -C templates/ clean
>  	$(MAKE) -C t/ clean
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 9f57c34e954..82eb8ea446b 100644
--- a/Makefile
+++ b/Makefile
@@ -3234,6 +3234,7 @@  clean: profile-clean coverage-clean cocciclean
 	$(RM) $(HCC)
 	$(RM) -r bin-wrappers $(dep_dirs) $(compdb_dir) compile_commands.json
 	$(RM) -r po/build/
+	$(RM) -r perl/build/
 	$(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope*
 	$(RM) -r .dist-tmp-dir .doc-tmp-dir
 	$(RM) $(GIT_TARNAME).tar.gz
@@ -3242,7 +3243,6 @@  clean: profile-clean coverage-clean cocciclean
 	$(RM) Documentation/GIT-EXCLUDED-PROGRAMS
 ifndef NO_PERL
 	$(MAKE) -C gitweb clean
-	$(RM) -r perl/build/
 endif
 	$(MAKE) -C templates/ clean
 	$(MAKE) -C t/ clean