The Makefile will now use a script (autoversion.sh) to update version.h, which in turn defines a VERSION string and gets included from common.h. The idea is that version.h normally receives a git-describe based identifier that represents the current checkout. In cases where git might not be available, e.g. for builds from a tarball, the script will instead fall back to a predefined version (that should reflect the most recent release tag). Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
19 lines
512 B
Bash
Executable File
19 lines
512 B
Bash
Executable File
#
|
|
# This script auto-updates a VERSION string definition.
|
|
# It outputs informational messages to stderr, while the actual
|
|
# output (on stdout) can easily be redirected to a file.
|
|
#
|
|
|
|
LATEST_RELEASE="v1.3"
|
|
|
|
if VER=`git describe --tags --dirty --always`; then
|
|
echo "Setting version information: ${VER}" >&2
|
|
else
|
|
VER=${LATEST_RELEASE}
|
|
echo "Unable to determine current version (using \"${VER}\" as fallback)" >&2
|
|
fi
|
|
echo >&2
|
|
|
|
echo "/* Auto-generated information. DO NOT EDIT */"
|
|
echo "#define VERSION \"${VER}\""
|