From 114494ae2c6f473dd9c9745a9b4fc6c55b70f2e8 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Fri, 20 Dec 2024 20:44:23 +0100 Subject: 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 Signed-off-by: Junio C Hamano --- shared.mak | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'shared.mak') diff --git a/shared.mak b/shared.mak index 29bebd30d8..b23c5505c9 100644 --- a/shared.mak +++ b/shared.mak @@ -116,3 +116,11 @@ endef define libpath_template -L$(1) $(if $(filter-out -L,$(CC_LD_DYNPATH)),$(CC_LD_DYNPATH)$(1)) endef + +# Populate build information into a file via GIT-VERSION-GEN. Requires the +# absolute path to the root source directory as well as input and output files +# as arguments, in that order. +define version_gen +GIT_USER_AGENT="$(GIT_USER_AGENT)" \ +$(SHELL_PATH) "$(1)/GIT-VERSION-GEN" "$(1)" "$(2)" "$(3)" +endef -- cgit v1.2.3