seperate GIT_TAG and GIT_HASH in version.c

This commit is contained in:
2025-08-06 20:09:16 -04:00
parent b24d97213e
commit 9d151c4dad
3 changed files with 11 additions and 1 deletions

View File

@@ -2,16 +2,20 @@
# Script to generate version information file
# Current git hash
HASH="$(git describe --always --dirty)"
# Current git tag
TAG="$(git describe --always --dirty --tags)"
# Output filename
OUTFILE='src/version.c'
sed -e "s/<HASH>/$TAG/g" <<EOF > "$OUTFILE"
sed -e "s/<HASH>/$HASH/g" -e "s/<TAG>/$TAG/g" <<EOF > "$OUTFILE"
/* Build version information. This file generated by genver.sh */
const char GIT_HASH[] = "<HASH>";
const char GIT_TAG[] = "<TAG>";
const char CC_VERSION[] = __VERSION__;
const char BUILD_DATE[] = __DATE__;
EOF