[SeaBIOS] [PATCH] update version banner
Gerd Hoffmann
kraxel at redhat.com
Mon Mar 19 13:56:01 CET 2012
This patch changes the seabios version banner printed. When building
from a git repository 'git describe' is used to generate a version tag
which includes the (short) commit hash and thus can be used to identify
the commit used to build the binary.
Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>
---
Makefile | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index abbac8c..6577ad3 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,18 @@
# This file may be distributed under the terms of the GNU LGPLv3 license.
# Program version
-VERSION=pre-1.6.4-$(shell date +"%Y%m%d_%H%M%S")-$(shell hostname)
+RELEASE := pre-1.6.4
+
+GIT_DESC := $(shell test -d .git && git describe --tags)
+ifeq ($(GIT_DESC),)
+ # building from release tarball
+ VERSION := $(RELEASE)
+else
+ # building from git repository
+ VERSION := $(GIT_DESC)
+endif
+VERSION += $(shell date +"%Y%m%d_%H%M%S")
+VERSION += $(shell hostname)
# Output directory
OUT=out/
--
1.7.1
More information about the SeaBIOS
mailing list