Makefile.inc: Update submodules only when git is present

Instead of trying to update the submodules, then skipping each update if
git is not present, just don't try to update the submodules at all.

Signed-off-by: Martin Roth <gaumless@gmail.com>
Change-Id: I83ef48a21820c0983e38823331c9ba0fe0fc277f
Reviewed-on: https://review.coreboot.org/c/coreboot/+/65321
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
This commit is contained in:
Martin Roth 2022-06-22 18:33:43 -06:00 committed by Felix Singer
parent 553787bd32
commit 878574df94
1 changed files with 9 additions and 7 deletions

View File

@ -190,31 +190,33 @@ ramstage-generic-ccopts += -D__RAMSTAGE__
ifeq ($(CONFIG_COVERAGE),y) ifeq ($(CONFIG_COVERAGE),y)
ramstage-c-ccopts += -fprofile-arcs -ftest-coverage ramstage-c-ccopts += -fprofile-arcs -ftest-coverage
endif endif
ifneq ($(GIT),)
ifneq ($(UPDATED_SUBMODULES),1) ifneq ($(UPDATED_SUBMODULES),1)
$(info Updating git submodules.) $(info Updating git submodules.)
# try to fetch non-optional submodules if the source is under git # try to fetch non-optional submodules if the source is under git
forgetthis:=$(if $(GIT),$(shell git submodule update --init $(quiet_errors))) forgetthis:=$(shell git submodule update --init $(quiet_errors))
# Checkout Cmocka repository # Checkout Cmocka repository
forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/cmocka $(quiet_errors))) forgetthis:=$(shell git submodule update --init --checkout 3rdparty/cmocka $(quiet_errors))
ifeq ($(CONFIG_USE_BLOBS),y) ifeq ($(CONFIG_USE_BLOBS),y)
# These items are necessary because each has update=none in .gitmodules. They are ignored # These items are necessary because each has update=none in .gitmodules. They are ignored
# until expressly requested and enabled with --checkout # until expressly requested and enabled with --checkout
forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/blobs $(quiet_errors))) forgetthis:=$(shell git submodule update --init --checkout 3rdparty/blobs $(quiet_errors))
forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/intel-microcode $(quiet_errors))) forgetthis:=$(shell git submodule update --init --checkout 3rdparty/intel-microcode $(quiet_errors))
ifeq ($(CONFIG_FSP_USE_REPO),y) ifeq ($(CONFIG_FSP_USE_REPO),y)
forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/fsp $(quiet_errors))) forgetthis:=$(shell git submodule update --init --checkout 3rdparty/fsp $(quiet_errors))
endif endif
ifeq ($(CONFIG_USE_AMD_BLOBS),y) ifeq ($(CONFIG_USE_AMD_BLOBS),y)
forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/amd_blobs $(quiet_errors))) forgetthis:=$(shell git submodule update --init --checkout 3rdparty/amd_blobs $(quiet_errors))
endif endif
ifeq ($(CONFIG_USE_QC_BLOBS),y) ifeq ($(CONFIG_USE_QC_BLOBS),y)
forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/qc_blobs $(quiet_errors))) forgetthis:=$(shell git submodule update --init --checkout 3rdparty/qc_blobs $(quiet_errors))
endif endif
endif endif
UPDATED_SUBMODULES:=1 UPDATED_SUBMODULES:=1
COREBOOT_EXPORTS += UPDATED_SUBMODULES COREBOOT_EXPORTS += UPDATED_SUBMODULES
endif endif
endif # GIT != ""
postcar-c-deps:=$$(OPTION_TABLE_H) postcar-c-deps:=$$(OPTION_TABLE_H)
ramstage-c-deps:=$$(OPTION_TABLE_H) ramstage-c-deps:=$$(OPTION_TABLE_H)