Code

Allow INSTALL, bindir, mandir to be set in main Makefile
authorJakub Narebski <jnareb@gmail.com>
Thu, 29 Jun 2006 20:11:25 +0000 (22:11 +0200)
committerJunio C Hamano <junkio@cox.net>
Fri, 30 Jun 2006 06:49:16 +0000 (23:49 -0700)
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).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/Makefile
Makefile
contrib/emacs/Makefile
contrib/git-svn/Makefile

index 2b0efe7921b61fa3c3c84273054112373aac75ba..ca6b77df286fa724a6fe93f07f2833288bc68f84 100644 (file)
@@ -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=
index cde619c498da717ea665430f7d395358d0b1d06e..b8fe669720462e395c434f7167389f29824a1504 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -100,6 +100,8 @@ template_dir = $(prefix)/share/git-core/templates/
 GIT_PYTHON_DIR = $(prefix)/share/git-core/python
 # DESTDIR=
 
+export prefix bindir gitexecdir template_dir GIT_PYTHON_DIR
+
 CC = gcc
 AR = ar
 TAR = tar
index d3619db510f4e4878eba49fcd80da3e78d564911..350846de904b31fb9dd86fee0c64613a7632c6aa 100644 (file)
@@ -3,9 +3,9 @@
 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)
index 7c209469438bcef2a5cee0988448a41a56ec30cc..1a6585eeec1551ecd0557829d7603de4d87760b6 100644 (file)
@@ -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