Makefile.inc: Stop running git repeatedly for each build

Currently, the coreboot makefiles repeatedly run git to try to set
the KERNELVERSION variable and to fetch the submodules.  This happens
three times for every build.  By exporting a variable, we can catch
this on recursive makes and not run each of these steps again.

Change-Id: I85ab867b40e80c36bd94d48510ffe3252c6cf93f
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14392
Tested-by: build bot (Jenkins)
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
This commit is contained in:
Martin Roth 2016-04-19 20:15:16 -06:00
parent 88e83e580d
commit 3812597c66
1 changed files with 5 additions and 0 deletions

View File

@ -22,6 +22,7 @@ CONFIG_FMDFILE:=$(call strip_quotes,$(CONFIG_FMDFILE))
#######################################################################
# misleadingly named, this is the coreboot version
ifeq ($(KERNELVERSION),)
ifeq ($(BUILD_TIMELESS),1)
export KERNELVERSION := TIMELESS
else
@ -31,6 +32,7 @@ export KERNELVERSION := $(strip $(if $(GIT),\
$(shell cat $(top)/.coreboot-version),\
coreboot-unknown$(KERNELREVISION))))
endif
endif
#######################################################################
# Basic component discovery
@ -174,6 +176,7 @@ ifeq ($(CONFIG_COVERAGE),y)
ramstage-c-ccopts += -fprofile-arcs -ftest-coverage
endif
ifneq ($(UPDATED_SUBMODULES),1)
# try to fetch non-optional submodules if the source is under git
forgetthis:=$(if $(GIT),$(shell git submodule update --init))
ifeq ($(CONFIG_USE_BLOBS),y)
@ -181,6 +184,8 @@ ifeq ($(CONFIG_USE_BLOBS),y)
# unless explicitly requested and enabled through --checkout
forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/blobs))
endif
export UPDATED_SUBMODULES:=1
endif
ramstage-c-deps:=$$(OPTION_TABLE_H)
romstage-c-deps:=$$(OPTION_TABLE_H)