@@ -294,9 +294,6 @@ all::
294294#
295295# Define PERL_PATH to the path of your Perl binary (usually /usr/bin/perl).
296296#
297- # Define NO_PERL_MAKEMAKER if you cannot use Makefiles generated by perl's
298- # MakeMaker (e.g. using ActiveState under Cygwin).
299- #
300297# Define NO_PERL if you do not want Perl scripts or libraries at all.
301298#
302299# Define PYTHON_PATH to the path of your Python binary (often /usr/bin/python
@@ -479,6 +476,7 @@ gitexecdir = libexec/git-core
479476mergetoolsdir = $(gitexecdir ) /mergetools
480477sharedir = $(prefix ) /share
481478gitwebdir = $(sharedir ) /gitweb
479+ perllibdir = $(sharedir ) /perl5
482480localedir = $(sharedir ) /locale
483481template_dir = share/git-core/templates
484482htmldir = $(prefix ) /share/doc/git-doc
@@ -492,7 +490,7 @@ mandir_relative = $(patsubst $(prefix)/%,%,$(mandir))
492490infodir_relative = $(patsubst $(prefix ) /% ,% ,$(infodir ) )
493491htmldir_relative = $(patsubst $(prefix ) /% ,% ,$(htmldir ) )
494492
495- export prefix bindir sharedir sysconfdir gitwebdir localedir
493+ export prefix bindir sharedir sysconfdir gitwebdir perllibdir localedir
496494
497495CC = cc
498496AR = ar
@@ -1543,9 +1541,6 @@ ifdef SHA1_MAX_BLOCK_SIZE
15431541 LIB_OBJS += compat/sha1-chunked.o
15441542 BASIC_CFLAGS += -DSHA1_MAX_BLOCK_SIZE="$(SHA1_MAX_BLOCK_SIZE)"
15451543endif
1546- ifdef NO_PERL_MAKEMAKER
1547- export NO_PERL_MAKEMAKER
1548- endif
15491544ifdef NO_HSTRERROR
15501545 COMPAT_CFLAGS += -DNO_HSTRERROR
15511546 COMPAT_OBJS += compat/hstrerror.o
@@ -1732,8 +1727,10 @@ ETC_GITATTRIBUTES_SQ = $(subst ','\'',$(ETC_GITATTRIBUTES))
17321727DESTDIR_SQ = $(subst ','\'',$(DESTDIR ) )
17331728bindir_SQ = $(subst ','\'',$(bindir ) )
17341729bindir_relative_SQ = $(subst ','\'',$(bindir_relative ) )
1730+ mandir_SQ = $(subst ','\'',$(mandir ) )
17351731mandir_relative_SQ = $(subst ','\'',$(mandir_relative ) )
17361732infodir_relative_SQ = $(subst ','\'',$(infodir_relative ) )
1733+ perllibdir_SQ = $(subst ','\'',$(perllibdir ) )
17371734localedir_SQ = $(subst ','\'',$(localedir ) )
17381735gitexecdir_SQ = $(subst ','\'',$(gitexecdir ) )
17391736template_dir_SQ = $(subst ','\'',$(template_dir ) )
@@ -1843,9 +1840,6 @@ all::
18431840ifndef NO_TCLTK
18441841 $(QUIET_SUBDIR0)git-gui $(QUIET_SUBDIR1) gitexecdir='$(gitexec_instdir_SQ)' all
18451842 $(QUIET_SUBDIR0)gitk-git $(QUIET_SUBDIR1) all
1846- endif
1847- ifndef NO_PERL
1848- $(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' localedir='$(localedir_SQ)' all
18491843endif
18501844 $(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1) SHELL_PATH='$(SHELL_PATH_SQ)' PERL_PATH='$(PERL_PATH_SQ)'
18511845
@@ -1928,7 +1922,8 @@ common-cmds.h: $(wildcard Documentation/git-*.txt)
19281922
19291923SCRIPT_DEFINES = $(SHELL_PATH_SQ ) :$(DIFF_SQ ) :$(GIT_VERSION ) :\
19301924 $(localedir_SQ ) :$(NO_CURL ) :$(USE_GETTEXT_SCHEME ) :$(SANE_TOOL_PATH_SQ ) :\
1931- $(gitwebdir_SQ ) :$(PERL_PATH_SQ ) :$(SANE_TEXT_GREP ) :$(PAGER_ENV )
1925+ $(gitwebdir_SQ ) :$(PERL_PATH_SQ ) :$(SANE_TEXT_GREP ) :$(PAGER_ENV ) :\
1926+ $(perllibdir_SQ )
19321927define cmd_munge_script
19331928$(RM ) $@ $@ + && \
19341929sed -e '1s|# !.*/sh|#!$(SHELL_PATH_SQ)|' \
@@ -1972,23 +1967,12 @@ git.res: git.rc GIT-VERSION-FILE
19721967$(SCRIPT_PERL_GEN ) : GIT-BUILD-OPTIONS
19731968
19741969ifndef NO_PERL
1975- $(SCRIPT_PERL_GEN ) : perl/perl.mak
1976-
1977- perl/perl.mak : perl/PM.stamp
1978-
1979- perl/PM.stamp : FORCE
1980- @$(FIND ) perl -type f -name ' *.pm' | sort > $@ + && \
1981- $(PERL_PATH ) -V >> $@ + && \
1982- { cmp $@ + $@ > /dev/null 2> /dev/null || mv $@ + $@ ; } && \
1983- $(RM ) $@ +
1984-
1985- perl/perl.mak : GIT-CFLAGS GIT-PREFIX perl/Makefile perl/Makefile.PL
1986- $(QUIET_SUBDIR0 ) perl $(QUIET_SUBDIR1 ) PERL_PATH=' $(PERL_PATH_SQ)' prefix=' $(prefix_SQ)' $(@F )
1970+ $(SCRIPT_PERL_GEN ) :
19871971
1988- PERL_DEFINES = $(PERL_PATH_SQ ) :$(PERLLIB_EXTRA_SQ )
1989- $(SCRIPT_PERL_GEN ) : % : % .perl perl/perl.mak GIT-PERL-DEFINES GIT-VERSION-FILE
1972+ PERL_DEFINES = $(PERL_PATH_SQ ) :$(PERLLIB_EXTRA_SQ ) : $( perllibdir_SQ )
1973+ $(SCRIPT_PERL_GEN ) : % : % .perl GIT-PERL-DEFINES GIT-VERSION-FILE
19901974 $(QUIET_GEN )$(RM ) $@ $@ + && \
1991- INSTLIBDIR=` MAKEFLAGS= $( MAKE ) -C perl -s --no-print-directory instlibdir ` && \
1975+ INSTLIBDIR=' $(perllibdir_SQ) ' && \
19921976 INSTLIBDIR_EXTRA=' $(PERLLIB_EXTRA_SQ)' && \
19931977 INSTLIBDIR=" $$ INSTLIBDIR$$ {INSTLIBDIR_EXTRA:+:$$ INSTLIBDIR_EXTRA}" && \
19941978 sed -e ' 1{' \
@@ -2312,6 +2296,21 @@ endif
23122296po/build/locale/% /LC_MESSAGES/git.mo : po/% .po
23132297 $(QUIET_MSGFMT ) mkdir -p $(dir $@ ) && $(MSGFMT ) -o $@ $<
23142298
2299+ LIB_PERL := $(wildcard perl/Git.pm perl/Git/* .pm perl/Git/* /* .pm perl/Git/* /* /* .pm)
2300+ LIB_PERL_GEN := $(patsubst perl/% .pm,perl/build/lib/% .pm,$(LIB_PERL ) )
2301+
2302+ ifndef NO_PERL
2303+ all :: $(LIB_PERL_GEN )
2304+ endif
2305+
2306+ perl/build/lib/% .pm : perl/% .pm
2307+ $(QUIET_GEN ) mkdir -p $(dir $@ ) && \
2308+ sed -e ' s|@@LOCALEDIR@@|$(localedir_SQ)|g' < $< > $@
2309+
2310+ perl/build/man/man3/Git.3pm : perl/Git.pm
2311+ $(QUIET_GEN ) mkdir -p $(dir $@ ) && \
2312+ pod2man $< $@
2313+
23152314FIND_SOURCE_FILES = ( \
23162315 git ls-files \
23172316 '*.[hcS]' \
@@ -2572,7 +2571,9 @@ ifndef NO_GETTEXT
25722571 (cd '$(DESTDIR_SQ)$(localedir_SQ)' && umask 022 && $(TAR) xof -)
25732572endif
25742573ifndef NO_PERL
2575- $(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install
2574+ $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perllibdir_SQ)'
2575+ (cd perl/build/lib && $(TAR) cf - .) | \
2576+ (cd '$(DESTDIR_SQ)$(perllibdir_SQ)' && umask 022 && $(TAR) xof -)
25762577 $(MAKE) -C gitweb install
25772578endif
25782579ifndef NO_TCLTK
@@ -2622,12 +2623,17 @@ endif
26222623install-gitweb :
26232624 $(MAKE ) -C gitweb install
26242625
2625- install-doc :
2626+ install-doc : install-man-perl
26262627 $(MAKE ) -C Documentation install
26272628
2628- install-man :
2629+ install-man : install-man-perl
26292630 $(MAKE ) -C Documentation install-man
26302631
2632+ install-man-perl : perl/build/man/man3/Git.3pm
2633+ $(INSTALL ) -d -m 755 ' $(DESTDIR_SQ)$(mandir_SQ)/man3'
2634+ (cd perl/build/man/man3 && $( TAR) cf - .) | \
2635+ (cd ' $(DESTDIR_SQ)$(mandir_SQ)/man3' && umask 022 && $( TAR) xof -)
2636+
26312637install-html :
26322638 $(MAKE ) -C Documentation install-html
26332639
@@ -2719,7 +2725,7 @@ clean: profile-clean coverage-clean
27192725 $(MAKE ) -C Documentation/ clean
27202726ifndef NO_PERL
27212727 $(MAKE) -C gitweb clean
2722- $(MAKE ) -C perl clean
2728+ $(RM ) -r perl/build/
27232729endif
27242730 $(MAKE) -C templates/ clean
27252731 $(MAKE) -C t/ clean
0 commit comments