mirror of
https://github.com/git/git.git
synced 2026-01-10 01:56:42 +00:00
Makefile: generate "git.rc" via GIT-VERSION-GEN
The "git.rc" is used on Windows to embed information like the project name and version into the resulting executables. As such we need to inject the version information, which we do by using preprocessor defines. The logic to do so is non-trivial and needs to be kept in sync with the different build systems. Refactor the logic so that we generate "git.rc" via `GIT-VERSION-GEN`. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
0c8d339514
commit
9bb10d27e7
@@ -58,14 +58,18 @@ then
|
||||
GIT_USER_AGENT="git/$GIT_VERSION"
|
||||
fi
|
||||
|
||||
read GIT_MAJOR_VERSION GIT_MINOR_VERSION GIT_MICRO_VERSION trailing <<EOF
|
||||
$(echo "$GIT_VERSION" 0 0 0 | tr '.a-zA-Z-' ' ')
|
||||
# While released Git versions only have three numbers, development builds also
|
||||
# have a fourth number that corresponds to the number of patches since the last
|
||||
# release.
|
||||
read GIT_MAJOR_VERSION GIT_MINOR_VERSION GIT_MICRO_VERSION GIT_PATCH_LEVEL trailing <<EOF
|
||||
$(echo "$GIT_VERSION" 0 0 0 0 | tr '.a-zA-Z-' ' ')
|
||||
EOF
|
||||
|
||||
sed -e "s|@GIT_VERSION@|$GIT_VERSION|" \
|
||||
-e "s|@GIT_MAJOR_VERSION@|$GIT_MAJOR_VERSION|" \
|
||||
-e "s|@GIT_MINOR_VERSION@|$GIT_MINOR_VERSION|" \
|
||||
-e "s|@GIT_MICRO_VERSION@|$GIT_MICRO_VERSION|" \
|
||||
-e "s|@GIT_PATCH_LEVEL@|$GIT_PATCH_LEVEL|" \
|
||||
-e "s|@GIT_BUILT_FROM_COMMIT@|$GIT_BUILT_FROM_COMMIT|" \
|
||||
-e "s|@GIT_USER_AGENT@|$GIT_USER_AGENT|" \
|
||||
"$INPUT" >"$OUTPUT"+
|
||||
|
||||
Reference in New Issue
Block a user