Git fork

Makefile: introduce template for GIT-VERSION-GEN

Introduce a new template to call GIT-VERSION-GEN. This will allow us to
iterate on how exactly the script is called in subsequent commits
without having to adapt all call sites every time.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Patrick Steinhardt and committed by
Junio C Hamano
114494ae b329f2eb

+13 -5
+2 -2
Documentation/Makefile
··· 211 211 XMLTO_EXTRA += -x manpage.xsl 212 212 213 213 asciidoctor-extensions.rb: asciidoctor-extensions.rb.in FORCE 214 - $(QUIET_GEN)GIT_USER_AGENT="$(GIT_USER_AGENT)" $(SHELL_PATH) ../GIT-VERSION-GEN "$(shell pwd)/.." $< $@ 214 + $(QUIET_GEN)$(call version_gen,"$(shell pwd)/..",$<,$@) 215 215 else 216 216 asciidoc.conf: asciidoc.conf.in FORCE 217 - $(QUIET_GEN)GIT_USER_AGENT="$(GIT_USER_AGENT)" $(SHELL_PATH) ../GIT-VERSION-GEN "$(shell pwd)/.." $< $@ 217 + $(QUIET_GEN)$(call version_gen,"$(shell pwd)/..",$<,$@) 218 218 endif 219 219 220 220 ASCIIDOC_DEPS += docinfo.html
+3 -3
Makefile
··· 593 593 594 594 GIT-VERSION-FILE: FORCE 595 595 @OLD=$$(cat $@ 2>/dev/null || :) && \ 596 - $(SHELL_PATH) ./GIT-VERSION-GEN "$(shell pwd)" GIT-VERSION-FILE.in $@ && \ 596 + $(call version_gen,"$(shell pwd)",GIT-VERSION-FILE.in,$@) && \ 597 597 NEW=$$(cat $@ 2>/dev/null || :) && \ 598 598 if test "$$OLD" != "$$NEW"; then echo "$$NEW" >&2; fi 599 599 -include GIT-VERSION-FILE ··· 2509 2509 -DPAGER_ENV='$(PAGER_ENV_CQ_SQ)' 2510 2510 2511 2511 version-def.h: version-def.h.in GIT-VERSION-GEN GIT-VERSION-FILE GIT-USER-AGENT 2512 - $(QUIET_GEN)GIT_USER_AGENT="$(GIT_USER_AGENT)" $(SHELL_PATH) ./GIT-VERSION-GEN "$(shell pwd)" $< $@ 2512 + $(QUIET_GEN)$(call version_gen,"$(shell pwd)",$<,$@) 2513 2513 2514 2514 version.sp version.s version.o: version-def.h 2515 2515 ··· 2550 2550 mv $@+ $@ 2551 2551 2552 2552 git.rc: git.rc.in GIT-VERSION-GEN GIT-VERSION-FILE 2553 - $(QUIET_GEN)$(SHELL_PATH) ./GIT-VERSION-GEN "$(shell pwd)" $< $@ 2553 + $(QUIET_GEN)$(call version_gen,"$(shell pwd)",$<,$@) 2554 2554 2555 2555 git.res: git.rc GIT-PREFIX 2556 2556 $(QUIET_RC)$(RC) -i $< -o $@
+8
shared.mak
··· 116 116 define libpath_template 117 117 -L$(1) $(if $(filter-out -L,$(CC_LD_DYNPATH)),$(CC_LD_DYNPATH)$(1)) 118 118 endef 119 + 120 + # Populate build information into a file via GIT-VERSION-GEN. Requires the 121 + # absolute path to the root source directory as well as input and output files 122 + # as arguments, in that order. 123 + define version_gen 124 + GIT_USER_AGENT="$(GIT_USER_AGENT)" \ 125 + $(SHELL_PATH) "$(1)/GIT-VERSION-GEN" "$(1)" "$(2)" "$(3)" 126 + endef