version: allow stating the coreboot revision in .coreboot-version

If .git doesn't exist, try to fetch the coreboot version from a file, before
falling back to a hard-code.

Change-Id: Idee8019c9a2b766fe69535367614c5254498335a
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10908
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
diff --git a/.gitignore b/.gitignore
index f7447b4..770a62d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
 .config
 .config.old
+.coreboot-version
 .xcompile
 .ccwrap
 build/
diff --git a/Makefile.inc b/Makefile.inc
index 3995fbc..347e07b 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -23,7 +23,9 @@
 # misleadingly named, this is the coreboot version
 export KERNELVERSION := $(strip $(if $(GIT),\
 	$(shell git describe --dirty --always || git describe),\
-	4.0$(KERNELREVISION)))
+	$(if $(wildcard $(top)/.coreboot-version),\
+		$(shell cat $(top)/.coreboot-version),\
+		coreboot-unknown$(KERNELREVISION))))
 
 #######################################################################
 # Basic component discovery