diff options
author | Patrick Georgi <pgeorgi@google.com> | 2015-03-04 15:02:03 +0100 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-03-05 15:15:43 +0100 |
commit | c0e394b7425b40c7d6c49d170054b71200d20515 (patch) | |
tree | 25f4e6336225077cbd94bc71566e9863d064e131 | |
parent | c42a613ff52d9cda91abaa5fa86ec4fd5b50aba6 (diff) |
build system: Only test for git once
And then use the variable to decide what to do.
Change-Id: I48a801ecdbf774c4a8b64d7efaf9cf0ef2c2d438
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: http://review.coreboot.org/8600
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
-rw-r--r-- | Makefile.inc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Makefile.inc b/Makefile.inc index b8ab4bea77..951cfeef3f 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -17,11 +17,13 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## +GIT:=$(shell [ -d "$(top)/.git" ] && command -v git) + ####################################################################### # misleadingly named, this is the coreboot version -export KERNELVERSION := $(shell if [ -d "$(top)/.git" -a -f "$(command -v git)" ]; \ - then git describe --dirty --always || git describe; \ - else echo 4.0$(KERNELREVISION); fi) +export KERNELVERSION := $(strip $(if $(GIT),\ + $(shell git describe --dirty --always || git describe),\ + 4.0$(KERNELREVISION))) ####################################################################### # Test for coreboot toolchain (except when explicitely not requested) @@ -140,13 +142,11 @@ ramstage-c-ccopts+=-fprofile-arcs -ftest-coverage endif # try to fetch non-optional submodules if the source is under git -forgetthis:=$(shell if [ -d "$(top)/.git" -a -f "$(command -v git)" ]; \ - then git submodule update --init; fi) +forgetthis:=$(if $(GIT),$(shell git submodule update --init)) ifeq ($(CONFIG_USE_BLOBS),y) # this is necessary because 3rdparty is update=none, and so is ignored # unless explicitly requested and enabled through --checkout -forgetthis:=$(shell if [ -d "$(top)/.git" -a -f "$(command -v git)" ]; \ - then git submodule update --init --checkout 3rdparty; fi) +forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty)) endif bootblock-c-ccopts:=-D__BOOT_BLOCK__ -D__PRE_RAM__ |