From: Matthieu Moy Date: Wed, 06 Feb 2013 18:11:30 GMT Subject: [PATCH 2/4] perl.mak: introduce $(GIT_ROOT_DIR) to allow inclusion from other directories Message-ID: <1360174292-14793-3-git-send-email-Matthieu.Moy@imag.fr> In-Reply-To: <1360174292-14793-1-git-send-email-Matthieu.Moy@imag.fr> perl.mak uses relative path, which is OK when called from the toplevel, but won't be anymore if one includes it from elsewhere. It is now possible to include the file using: GIT_ROOT_DIR= include $(GIT_ROOT_DIR)/perl.mak Signed-off-by: Matthieu Moy --- perl.mak | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/perl.mak b/perl.mak index 8bbeef3..a2b8717 100644 --- a/perl.mak +++ b/perl.mak @@ -1,5 +1,9 @@ # Rules to build Git commands written in perl +ifndef GIT_ROOT_DIR + GIT_ROOT_DIR = . +endif + ifndef PERL_PATH PERL_PATH = /usr/bin/perl endif @@ -11,12 +15,11 @@ NO_PERL = NoThanks endif ifndef NO_PERL -$(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak - +$(patsubst %.perl,%,$(SCRIPT_PERL)): $(GIT_ROOT_DIR)/perl/perl.mak -$(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl GIT-VERSION-FILE +$(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl $(GIT_ROOT_DIR)/GIT-VERSION-FILE $(QUIET_GEN)$(RM) $@ $@+ && \ - INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \ + INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C $(GIT_ROOT_DIR)/perl -s --no-print-directory instlibdir` && \ sed -e '1{' \ -e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \ -e ' h' \ -- 1.8.1.2.526.gf51a757