From 0c8d33951400f7d7175e1dad51e970fb70849f2b Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Fri, 6 Dec 2024 14:24:39 +0100 Subject: Makefile: propagate Git version via generated header We set up a couple of preprocessor macros when compiling Git that propagate the version that Git was built from to `git version` et al. The way this is set up makes it harder than necessary to reuse the infrastructure across the different build systems. Refactor this such that we generate a "version-def.h" header via `GIT-VERSION-GEN` instead. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- version-def.h.in | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 version-def.h.in (limited to 'version-def.h.in') diff --git a/version-def.h.in b/version-def.h.in new file mode 100644 index 0000000000..347995df06 --- /dev/null +++ b/version-def.h.in @@ -0,0 +1,8 @@ +#ifndef VERSION_DEF_H +#define VERSION_DEF_H + +#define GIT_VERSION "@GIT_VERSION@" +#define GIT_BUILT_FROM_COMMIT "@GIT_BUILT_FROM_COMMIT@" +#define GIT_USER_AGENT "@GIT_USER_AGENT@" + +#endif /* VERSION_DEF_H */ -- cgit v1.3