From: Junio C Hamano Date: Fri, 7 Jul 2006 20:04:35 +0000 (-0700) Subject: Work around sed and make interactions on the backslash at the end of line. X-Git-Tag: v1.4.3-rc1~2^2~13 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=998c4daaf4a921fb03d478b50d6e06223326d7ef;p=git.git Work around sed and make interactions on the backslash at the end of line. Traditionally 'i' and 'a' commands to sed have been unfriendly with make, primarily because different make implementations did unexpected things to backslashes at the end of lines. So work it around by not using 'i' command. Signed-off-by: Junio C Hamano --- diff --git a/Makefile b/Makefile index 71657ec90..01b9a9482 100644 --- a/Makefile +++ b/Makefile @@ -550,9 +550,13 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): perl/Makefile $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl rm -f $@ $@+ INSTLIBDIR=`$(MAKE) -C perl -s --no-print-directory instlibdir` && \ - sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|1' \ - -e '2i\ - use lib (split(/:/, $$ENV{GITPERLLIB} || '\'"$$INSTLIBDIR"\''));' \ + sed -e '1{' \ + -e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \ + -e ' h' \ + -e ' s=.*=use lib (split(/:/, $$ENV{GITPERLLIB} || "@@INSTLIBDIR@@"));=' \ + -e ' H' \ + -e ' x' \ + -e '}' \ -e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \ -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ $@.perl >$@+