{"thread":{"id":"30932","subject":"[PATCH] contrib/subtree: fix Makefile to respect non-configure `make`","startedAt":"2012-07-01T18:55:13Z","lastAt":"2012-07-01T18:55:13Z","messageCount":1,"participants":["Dan McGee"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"194457","messageId":"1341168913-14598-1-git-send-email-dpmcgee@gmail.com","threadId":"30932","inReplyTo":null,"subject":"[PATCH] contrib/subtree: fix Makefile to respect non-configure `make`","fromName":"Dan McGee","fromEmail":"dpmcgee@gmail.com","sentAt":"2012-07-01T18:55:13Z","receivedAt":"2012-07-01T18:55:13Z","isPatch":true,"sender":{"key":"dpmcgee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/265817?v=4"},"body":"* DESTDIR being defined had no effect.\n* prefix was handled inconsistently.\n* Unlike the top-level Makefile, this required libexecdir to be defined,\n  not gitexecdir.\n* The Makefile assumed the git it could use via the shell was the\n  correct version, which is not true at all from a packager's\n  standpoint. Don't shell out to git at all, use the standard version\n  logic like Documentation/ does.\n\nAfter these changes, it is actually possible to install git-subtree when\npackaging git into a temporary install directory, rather than installing\nit on the running system.\n\nSigned-off-by: Dan McGee <dpmcgee@gmail.com>\n---\n\nPackaging this tool in the git package for Arch Linux turned out to be much\nmore of a process than I expected. We've used the non-configure-based make\nsystem since git has been in our repositories, and it looks like the install\nprocess for this command was never tested with this build system.\n\nThe one thing I didn't do here was add some of the sophistication around\nrelative vs. absolute paths in mandir and gitexecdir that the top-level\nMakefile performs. Opinions or thoughts on that? This version will support\nrelative paths only.\n\n contrib/subtree/Makefile | 18 +++++++++++-------\n 1 file changed, 11 insertions(+), 7 deletions(-)\n\ndiff --git a/contrib/subtree/Makefile b/contrib/subtree/Makefile\nindex 05cdd5c..919464a 100644\n--- a/contrib/subtree/Makefile\n+++ b/contrib/subtree/Makefile\n@@ -2,12 +2,14 @@\n -include ../../config.mak\n \n prefix ?= /usr/local\n-mandir ?= $(prefix)/share/man\n-libexecdir ?= $(prefix)/libexec/git-core\n-gitdir ?= $(shell git --exec-path)\n+mandir ?= share/man\n+gitexecdir ?= libexec/git-core\n man1dir ?= $(mandir)/man1\n \n-gitver ?= $(word 3,$(shell git --version))\n+../../GIT-VERSION-FILE: FORCE\n+\t$(MAKE) -C ../../ GIT-VERSION-FILE\n+\n+-include ../../GIT-VERSION-FILE\n \n # this should be set to a 'standard' bsd-type install program\n INSTALL ?= install\n@@ -30,19 +32,19 @@ $(GIT_SUBTREE): $(GIT_SUBTREE_SH)\n doc: $(GIT_SUBTREE_DOC)\n \n install: $(GIT_SUBTREE)\n-\t$(INSTALL) -m 755 $(GIT_SUBTREE) $(libexecdir)\n+\t$(INSTALL) -m 755 $(GIT_SUBTREE) $(DESTDIR)$(prefix)/$(gitexecdir)\n \n install-doc: install-man\n \n install-man: $(GIT_SUBTREE_DOC)\n-\t$(INSTALL) -m 644 $^ $(man1dir)\n+\t$(INSTALL) -m 644 $^ $(DESTDIR)$(prefix)/$(man1dir)\n \n $(GIT_SUBTREE_DOC): $(GIT_SUBTREE_XML)\n \txmlto -m $(MANPAGE_NORMAL_XSL)  man $^\n \n $(GIT_SUBTREE_XML): $(GIT_SUBTREE_TXT)\n \tasciidoc -b docbook -d manpage -f $(ASCIIDOC_CONF) \\\n-\t\t-agit_version=$(gitver) $^\n+\t\t-agit_version=$(GIT_VERSION) $^\n \n test:\n \t$(MAKE) -C t/ test\n@@ -50,3 +52,5 @@ test:\n clean:\n \trm -f *~ *.xml *.html *.1\n \trm -rf subproj mainline\n+\n+.PHONY: FORCE\n-- \n1.7.11.1\n"}]}