From 3812597c668b795d4fc85578021e501f2a56f6b9 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Tue, 19 Apr 2016 20:15:16 -0600 Subject: [PATCH] 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 Reviewed-on: https://review.coreboot.org/14392 Tested-by: build bot (Jenkins) Reviewed-by: Alexander Couzens --- Makefile.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile.inc b/Makefile.inc index 0a3b92c06b..02ea674f12 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -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)