Skip to contentSkip to conversation

Allow INSTALL, bindir, mandir to be set in main Makefile

PATCH In review Jakub Narebski 2 participants 5 messages Jun 15, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Allow INSTALL, bindir, mandir to be set in main Makefile

Makefiles in subdirectories now use existing value of INSTALL, bindir, mandir if it is set, allowing those to be set in main Makefile or in included config.mak. Main Makefile exports variables which it sets.

Accidentally it renames bin to bindir in Documentation/Makefile (should be bindir from start, but is unused, perhaps to be removed).

---
Series only because second patch in series depends textually on first, even though changes are independent.

 Documentation/Makefile   |    4 ++--
 Makefile                 |    2 ++
 contrib/emacs/Makefile   |    4 ++--
 contrib/git-svn/Makefile |    4 ++--
 4 files changed, 8 insertions(+), 6 deletions(-)
Documentation/Makefile +2 -2
index 2b0efe7..ca6b77d 100644
@@ -25,8 +25,8 @@ DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT
 DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
 
 prefix?=$(HOME)
-bin=$(prefix)/bin
-mandir=$(prefix)/man
+bindir?=$(prefix)/bin
+mandir?=$(prefix)/man
 man1=$(mandir)/man1
 man7=$(mandir)/man7
 # DESTDIR=
Makefile +2 -0
index cde619c..b8fe669 100644
@@ -100,6 +100,8 @@ template_dir = $(prefix)/share/git-core/
 GIT_PYTHON_DIR = $(prefix)/share/git-core/python
 # DESTDIR=
 
+export prefix bindir gitexecdir template_dir GIT_PYTHON_DIR
+
 CC = gcc
 AR = ar
 TAR = tar
contrib/emacs/Makefile +2 -2
index d3619db..350846d 100644
@@ -3,9 +3,9 @@ ## Build and install stuff
 EMACS = emacs
 
 ELC = git.elc vc-git.elc
-INSTALL = install
+INSTALL ?= install
 INSTALL_ELC = $(INSTALL) -m 644
-prefix = $(HOME)
+prefix ?= $(HOME)
 emacsdir = $(prefix)/share/emacs/site-lisp
 
 all: $(ELC)
contrib/git-svn/Makefile +2 -2
index 7c20946..1a6585e 100644
@@ -1,8 +1,8 @@
 all: git-svn
 
 prefix?=$(HOME)
-bindir=$(prefix)/bin
-mandir=$(prefix)/man
+bindir?=$(prefix)/bin
+mandir?=$(prefix)/man
 man1=$(mandir)/man1
 INSTALL?=install
 doc_conf=../../Documentation/asciidoc.conf
Signature · 1 line
1.4.0
#1 lore raw

PATCH 2/2 Rename man1 and man7 variables to man1dir and man7dir

This patch renames man1 and man7 variables to man1dir and man7dir, according to "Makefile Conventions: Variables for Installation Directories" in make.info of GNU Make.

---

Depends on the earlier patch in "series" only via context

 Documentation/Makefile   |   10 +++++-----
 contrib/git-svn/Makefile |    4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)
Documentation/Makefile +5 -5
index ca6b77d..cc83610 100644
@@ -27,8 +27,8 @@ DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT
 prefix?=$(HOME)
 bindir?=$(prefix)/bin
 mandir?=$(prefix)/man
-man1=$(mandir)/man1
-man7=$(mandir)/man7
+man1dir=$(mandir)/man1
+man7dir=$(mandir)/man7
 # DESTDIR=
 
 INSTALL?=install
@@ -52,9 +52,9 @@ man1: $(DOC_MAN1)
 man7: $(DOC_MAN7)
 
 install: man
-	$(INSTALL) -d -m755 $(DESTDIR)$(man1) $(DESTDIR)$(man7)
-	$(INSTALL) $(DOC_MAN1) $(DESTDIR)$(man1)
-	$(INSTALL) $(DOC_MAN7) $(DESTDIR)$(man7)
+	$(INSTALL) -d -m755 $(DESTDIR)$(man1dir) $(DESTDIR)$(man7dir)
+	$(INSTALL) $(DOC_MAN1) $(DESTDIR)$(man1dir)
+	$(INSTALL) $(DOC_MAN7) $(DESTDIR)$(man7dir)
 
 
 #
contrib/git-svn/Makefile +2 -2
index 1a6585e..8cac688 100644
@@ -3,7 +3,7 @@ all: git-svn
 prefix?=$(HOME)
 bindir?=$(prefix)/bin
 mandir?=$(prefix)/man
-man1=$(mandir)/man1
+man1dir=$(mandir)/man1
 INSTALL?=install
 doc_conf=../../Documentation/asciidoc.conf
 -include ../../config.mak
@@ -17,7 +17,7 @@ install: all
 	$(INSTALL) git-svn $(DESTDIR)$(bindir)
 
 install-doc: doc
-	$(INSTALL) git-svn.1 $(DESTDIR)$(man1)
+	$(INSTALL) git-svn.1 $(DESTDIR)$(man1dir)
 
 doc: git-svn.1
 git-svn.1 : git-svn.xml
Signature · 1 line
1.4.0
#2 lore raw

Re: [PATCH 2/2] Rename man1 and man7 variables to man1dir and man7dir

Doesn't this break "make dist-doc" by _REMOVING_ make variables man1 and man7, which I mentioned earlier?

#3 lore raw

PATCH 2/2 Rename man1 and man7 variables to man1dir and man7dir

This patch renames man1 and man7 variables to man1dir and man7dir, according to "Makefile Conventions: Variables for Installation Directories" in make.info of GNU Make.

---

Quoted 2 lines · Junio C Hamano

Doesn't this break "make dist-doc" by _REMOVING_ make variables man1 and man7, which I mentioned earlier?

This is corrected patch. I think I catched all occurences, but I cannot do 'make dist-doc' because I haven't got asciidoc installed.

Could some kind soul check changes introduced by this patch, please?

P.S. This patch is sent from newsreader, not mail program. I hope it doesn't mangle whitespaces in patch.

 Documentation/Makefile   |   10 +++++-----
 Makefile                 |    4 ++--
 contrib/git-svn/Makefile |    4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)
Documentation/Makefile +5 -5
index ca6b77d..cc83610 100644
@@ -27,8 +27,8 @@ DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT
 prefix?=$(HOME)
 bindir?=$(prefix)/bin
 mandir?=$(prefix)/man
-man1=$(mandir)/man1
-man7=$(mandir)/man7
+man1dir=$(mandir)/man1
+man7dir=$(mandir)/man7
 # DESTDIR=
 
 INSTALL?=install
@@ -52,9 +52,9 @@ man1: $(DOC_MAN1)
 man7: $(DOC_MAN7)
 
 install: man
-       $(INSTALL) -d -m755 $(DESTDIR)$(man1) $(DESTDIR)$(man7)
-       $(INSTALL) $(DOC_MAN1) $(DESTDIR)$(man1)
-       $(INSTALL) $(DOC_MAN7) $(DESTDIR)$(man7)
+       $(INSTALL) -d -m755 $(DESTDIR)$(man1dir) $(DESTDIR)$(man7dir)
+       $(INSTALL) $(DOC_MAN1) $(DESTDIR)$(man1dir)
+       $(INSTALL) $(DOC_MAN7) $(DESTDIR)$(man7dir)
 
 
 #
Makefile +2 -2
index b8fe669..ccd7c62 100644
@@ -714,8 +714,8 @@ dist-doc:
        rm -fr .doc-tmp-dir
        mkdir .doc-tmp-dir .doc-tmp-dir/man1 .doc-tmp-dir/man7
        $(MAKE) -C Documentation DESTDIR=./ \
-               man1=../.doc-tmp-dir/man1 \
-               man7=../.doc-tmp-dir/man7 \
+               man1dir=../.doc-tmp-dir/man1 \
+               man7dir=../.doc-tmp-dir/man7 \
                install
        cd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar .
        gzip -n -9 -f $(manpages).tar
contrib/git-svn/Makefile +2 -2
index 1a6585e..8cac688 100644
@@ -3,7 +3,7 @@ all: git-svn
 prefix?=$(HOME)
 bindir?=$(prefix)/bin
 mandir?=$(prefix)/man
-man1=$(mandir)/man1
+man1dir=$(mandir)/man1
 INSTALL?=install
 doc_conf=../../Documentation/asciidoc.conf
 -include ../../config.mak
@@ -17,7 +17,7 @@ install: all
        $(INSTALL) git-svn $(DESTDIR)$(bindir)
 
 install-doc: doc
-       $(INSTALL) git-svn.1 $(DESTDIR)$(man1)
+       $(INSTALL) git-svn.1 $(DESTDIR)$(man1dir)
 
 doc: git-svn.1
 git-svn.1 : git-svn.xml
Signature · 1 line
1.4.0
#4 lore raw

Re: [PATCH 2/2] Rename man1 and man7 variables to man1dir and man7dir

Quoted 4 lines · Jakub Narebski

This is corrected patch. I think I catched all occurences, but I cannot do 'make dist-doc' because I haven't got asciidoc installed.

Could some kind soul check changes introduced by this patch, please?

Thanks. Will do.