summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-12-06 14:24:43 +0100
committerJunio C Hamano <gitster@pobox.com>2024-12-06 23:52:09 +0100
commite4b488049a5faa9b8c7255f483a89cea414d5eb4 (patch)
treef81806058aabee1316b410e38bb523d7763e3e0d /Makefile
parentMakefile: consistently use PERL_PATH (diff)
downloadgit-e4b488049a5faa9b8c7255f483a89cea414d5eb4.tar.xz
git-e4b488049a5faa9b8c7255f483a89cea414d5eb4.zip
Makefile: extract script to massage Perl scripts
Extract the script to inject various build-time parameters into our Perl scripts into a standalone script. This is done such that we can reuse it in other build systems. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 2 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 0e289d1dbc..e33c5b966c 100644
--- a/Makefile
+++ b/Makefile
@@ -2606,16 +2606,8 @@ endif
PERL_DEFINES += $(gitexecdir) $(perllibdir) $(localedir)
-$(SCRIPT_PERL_GEN): % : %.perl GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE
- $(QUIET_GEN) \
- sed -e '1{' \
- -e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \
- -e ' r GIT-PERL-HEADER' \
- -e ' G' \
- -e '}' \
- -e 's/@GIT_VERSION@/$(GIT_VERSION)/g' \
- $< >$@+ && \
- chmod +x $@+ && \
+$(SCRIPT_PERL_GEN): % : %.perl generate-perl.sh GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE
+ $(QUIET_GEN)$(SHELL_PATH) generate-perl.sh ./GIT-BUILD-OPTIONS ./GIT-VERSION-FILE GIT-PERL-HEADER "$<" "$@+" && \
mv $@+ $@
PERL_DEFINES := $(subst $(space),:,$(PERL_DEFINES))