summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder.dev@gmail.com>2018-02-15 02:14:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-02-15 18:05:32 (GMT)
commit2530afd3519a34b66e72cc29e7751d650cedc6dd (patch)
treeaeacc32301b9498e1e00f8d5a414ee94be0d595c /Makefile
parent7a7bfc7adceec0be66aec3a4999be2f9b33ccc24 (diff)
downloadgit-2530afd3519a34b66e72cc29e7751d650cedc6dd.zip
git-2530afd3519a34b66e72cc29e7751d650cedc6dd.tar.gz
git-2530afd3519a34b66e72cc29e7751d650cedc6dd.tar.bz2
Makefile: generate Git(3pm) as dependency of the 'doc' and 'man' targets
Since commit 20d2a30f8f (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>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 7 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 409e8f6..2091f5f 100644
--- a/Makefile
+++ b/Makefile
@@ -2193,13 +2193,15 @@ $(VCSSVN_LIB): $(VCSSVN_OBJS)
export DEFAULT_EDITOR DEFAULT_PAGER
-.PHONY: doc man html info pdf
-doc:
+.PHONY: doc man man-perl html info pdf
+doc: man-perl
$(MAKE) -C Documentation all
-man:
+man: man-perl
$(MAKE) -C Documentation man
+man-perl: perl/build/man/man3/Git.3pm
+
html:
$(MAKE) -C Documentation html
@@ -2596,7 +2598,7 @@ endif
done && \
./check_bindir "z$$bindir" "z$$execdir" "$$bindir/git-add$X"
-.PHONY: install-gitweb install-doc install-man install-html install-info install-pdf
+.PHONY: install-gitweb install-doc install-man install-man-perl install-html install-info install-pdf
.PHONY: quick-install-doc quick-install-man quick-install-html
install-gitweb:
$(MAKE) -C gitweb install
@@ -2607,7 +2609,7 @@ install-doc: install-man-perl
install-man: install-man-perl
$(MAKE) -C Documentation install-man
-install-man-perl: perl/build/man/man3/Git.3pm
+install-man-perl: man-perl
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(mandir_SQ)/man3'
(cd perl/build/man/man3 && $(TAR) cf - .) | \
(cd '$(DESTDIR_SQ)$(mandir_SQ)/man3' && umask 022 && $(TAR) xof -)