summaryrefslogtreecommitdiffstats
path: root/shared.mak
diff options
context:
space:
mode:
Diffstat (limited to 'shared.mak')
-rw-r--r--shared.mak11
1 files changed, 11 insertions, 0 deletions
diff --git a/shared.mak b/shared.mak
index 29bebd30d8..1a99848a95 100644
--- a/shared.mak
+++ b/shared.mak
@@ -116,3 +116,14 @@ 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_BUILT_FROM_COMMIT="$(GIT_BUILT_FROM_COMMIT)" \
+GIT_DATE="$(GIT_DATE)" \
+GIT_USER_AGENT="$(GIT_USER_AGENT)" \
+GIT_VERSION="$(GIT_VERSION_OVERRIDE)" \
+$(SHELL_PATH) "$(1)/GIT-VERSION-GEN" "$(1)" "$(2)" "$(3)"
+endef