diff options
author | Junio C Hamano <junkio@cox.net> | 2006-07-07 13:04:35 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-07-08 14:15:09 -0700 |
commit | 998c4daaf4a921fb03d478b50d6e06223326d7ef (patch) | |
tree | 29c91e185646fc524a219856afdf2eef675a3cb4 | |
parent | c7a30e56840b089c1d110b312475f692b5c1b6a4 (diff) | |
download | git-998c4daaf4a921fb03d478b50d6e06223326d7ef.tar.gz git-998c4daaf4a921fb03d478b50d6e06223326d7ef.tar.xz |
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 <junkio@cox.net>
-rw-r--r-- | Makefile | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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 >$@+ |