aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2015-06-03 19:17:12 -0400
committerKevin O'Connor <kevin@koconnor.net>2015-06-03 19:22:38 -0400
commit624e812764beda88b47c0018b1cee3b86d5c59eb (patch)
tree2e1286a36fb05a9f5f78f9267c3825410f6523a1 /scripts
parentbe050664fdd1699fe7bcf3a9b6faff07172a83d6 (diff)
downloadseabios-hppa-624e812764beda88b47c0018b1cee3b86d5c59eb.zip
seabios-hppa-624e812764beda88b47c0018b1cee3b86d5c59eb.tar.gz
seabios-hppa-624e812764beda88b47c0018b1cee3b86d5c59eb.tar.bz2
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-xscripts/buildversion.sh16
1 files changed, 10 insertions, 6 deletions
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