22 lines
513 B
Bash
Executable File
22 lines
513 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# 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>/$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
|