diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2015-06-03 19:17:12 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2015-06-03 19:22:38 -0400 |
commit | 624e812764beda88b47c0018b1cee3b86d5c59eb (patch) | |
tree | 2e1286a36fb05a9f5f78f9267c3825410f6523a1 /scripts | |
parent | be050664fdd1699fe7bcf3a9b6faff07172a83d6 (diff) | |
download | seabios-624e812764beda88b47c0018b1cee3b86d5c59eb.tar.gz |
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 <kevin@koconnor.net>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/buildversion.sh | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/scripts/buildversion.sh b/scripts/buildversion.sh index e5ce96c6..516aff5b 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 |