Skip to content

Commit 2530afd

Browse files
szedergitster
authored andcommitted
Makefile: generate Git(3pm) as dependency of the 'doc' and 'man' targets
Since commit 20d2a30 (Makefile: replace perl/Makefile.PL with simple make rules, 2017-12-10), the Git(3pm) man page is only generated as an indirect dependency of the 'install-doc' and 'install-man' Makefile targets. Consequently, if someone runs 'make man && sudo make install-man' (or their 'doc' counterparts), then Git(3pm) will be generated as root, and the resulting root-owned files and directories will in turn cause the next user-run 'make clean' to fail. This was not an issue in the past, because Git(3pm) was generated when 'make all' descended into 'perl/', which is usually not run as root. List Git(3pm) as a dependency of the 'doc' and 'man' Makefile targets, too, so it gets generated by targets that are usually built as ordinary users. While at it, add 'install-man-perl' to the list of .PHONY targets. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 7a7bfc7 commit 2530afd

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2193,13 +2193,15 @@ $(VCSSVN_LIB): $(VCSSVN_OBJS)
21932193

21942194
export DEFAULT_EDITOR DEFAULT_PAGER
21952195

2196-
.PHONY: doc man html info pdf
2197-
doc:
2196+
.PHONY: doc man man-perl html info pdf
2197+
doc: man-perl
21982198
$(MAKE) -C Documentation all
21992199

2200-
man:
2200+
man: man-perl
22012201
$(MAKE) -C Documentation man
22022202

2203+
man-perl: perl/build/man/man3/Git.3pm
2204+
22032205
html:
22042206
$(MAKE) -C Documentation html
22052207

@@ -2596,7 +2598,7 @@ endif
25962598
done && \
25972599
./check_bindir "z$$bindir" "z$$execdir" "$$bindir/git-add$X"
25982600

2599-
.PHONY: install-gitweb install-doc install-man install-html install-info install-pdf
2601+
.PHONY: install-gitweb install-doc install-man install-man-perl install-html install-info install-pdf
26002602
.PHONY: quick-install-doc quick-install-man quick-install-html
26012603
install-gitweb:
26022604
$(MAKE) -C gitweb install
@@ -2607,7 +2609,7 @@ install-doc: install-man-perl
26072609
install-man: install-man-perl
26082610
$(MAKE) -C Documentation install-man
26092611

2610-
install-man-perl: perl/build/man/man3/Git.3pm
2612+
install-man-perl: man-perl
26112613
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(mandir_SQ)/man3'
26122614
(cd perl/build/man/man3 && $(TAR) cf - .) | \
26132615
(cd '$(DESTDIR_SQ)$(mandir_SQ)/man3' && umask 022 && $(TAR) xof -)

0 commit comments

Comments
 (0)