Do not define LIB_{PERL,CPAN}{,_GEN} if NO_PERL is defined. This changes no functionality, but makes it clear which of these rules are needed under NO_PERL=Y. See 20d2a30f8ff (Makefile: replace perl/Makefile.PL with simple make rules, 2017-12-10) for the initial implementation. We do for better or worse rely on "install-doc" calling "install-man-perl" regardless of whether NO_PERL=Y is defined or not, i.e. we'll always end up with that manual page, even if we don't have any of the Perl code installed. Let's add a comment about that adjacent to the rules that build perl/build. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> --- Makefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 11da97de233..06405825a24 100644 --- a/Makefile +++ b/Makefile @@ -2684,19 +2684,12 @@ endif po/build/locale/%/LC_MESSAGES/git.mo: po/%.po $(QUIET_MSGFMT)mkdir -p $(dir $@) && $(MSGFMT) -o $@ $< +ifndef NO_PERL LIB_PERL := $(wildcard perl/Git.pm perl/Git/*.pm perl/Git/*/*.pm perl/Git/*/*/*.pm) LIB_PERL_GEN := $(patsubst perl/%.pm,perl/build/lib/%.pm,$(LIB_PERL)) LIB_CPAN := $(wildcard perl/FromCPAN/*.pm perl/FromCPAN/*/*.pm) LIB_CPAN_GEN := $(patsubst perl/%.pm,perl/build/lib/%.pm,$(LIB_CPAN)) -ifndef NO_PERL -all:: $(LIB_PERL_GEN) -ifndef NO_PERL_CPAN_FALLBACKS -all:: $(LIB_CPAN_GEN) -endif -NO_PERL_CPAN_FALLBACKS_SQ = $(subst ','\'',$(NO_PERL_CPAN_FALLBACKS)) -endif - perl/build/lib/%.pm: perl/%.pm GIT-PERL-DEFINES $(QUIET_GEN)mkdir -p $(dir $@) && \ sed -e 's|@@LOCALEDIR@@|$(perl_localedir_SQ)|g' \ @@ -2704,6 +2697,14 @@ perl/build/lib/%.pm: perl/%.pm GIT-PERL-DEFINES -e 's|@@NO_PERL_CPAN_FALLBACKS@@|$(NO_PERL_CPAN_FALLBACKS_SQ)|g' \ < $< > $@ +all:: $(LIB_PERL_GEN) +ifndef NO_PERL_CPAN_FALLBACKS +all:: $(LIB_CPAN_GEN) +endif +NO_PERL_CPAN_FALLBACKS_SQ = $(subst ','\'',$(NO_PERL_CPAN_FALLBACKS)) +endif + +# install-man depends on Git.3pm even with NO_PERL=Y perl/build/man/man3/Git.3pm: perl/Git.pm $(QUIET_GEN)mkdir -p $(dir $@) && \ pod2man $< $@ -- 2.34.0.796.g2c87ed6146a