From 624e812764beda88b47c0018b1cee3b86d5c59eb Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 3 Jun 2015 19:17:12 -0400 Subject: build: Support "make VERSION=xyz" to override the default build version Add a build option to explicitly set the version information compiled into the seabios and seavgabios binaries. This may assist in reproducible builds or to better link builds to distribution packages. If the new "VERSION=" parameter is not provided then the default build version remains unchanged. Signed-off-by: Kevin O'Connor --- scripts/buildversion.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/buildversion.sh b/scripts/buildversion.sh index e5ce96c..516aff5 100755 --- a/scripts/buildversion.sh +++ b/scripts/buildversion.sh @@ -4,14 +4,18 @@ OUTFILE="$1" VAR16MODE="$2" # Extract version info -if [ -d .git -o -f .git ]; then - VERSION="`git describe --tags --long --dirty`" -elif [ -f .version ]; then - VERSION="`cat .version`" +if [ -z "$BUILD_VERSION" ]; then + if [ -d .git -o -f .git ]; then + VERSION="`git describe --tags --long --dirty`" + elif [ -f .version ]; then + VERSION="`cat .version`" + else + VERSION="?" + fi + VERSION="${VERSION}-`date +"%Y%m%d_%H%M%S"`-`hostname`" else - VERSION="?" + VERSION="$BUILD_VERSION" fi -VERSION="${VERSION}-`date +"%Y%m%d_%H%M%S"`-`hostname`" echo "Version: ${VERSION}" # Build header file -- cgit v1.1