Martin L Roth has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/81026?usp=email )
Change subject: Makefiles: Download 3rdparty/chromeec when needed ......................................................................
Makefiles: Download 3rdparty/chromeec when needed
This adds the basic functionality to download what was previously the chromeec submodule. If the system is configured to build the ChromeEC by enabling CONFIG_EC_GOOGLE_CHROMEEC_FIRMWARE_BUILTIN, it happens automatically. The system can also be told to download the ChromeEC codebase by setting the DOWNLOAD_CHROMEEC variable on the make command line.
Signed-off-by: Martin Roth gaumless@gmail.com Change-Id: I1f23b9f98a7ab31ae3ea1cb5aac136ead50769d6 --- M .gitignore A 3rdparty/Makefile.mk M Makefile M Makefile.mk 4 files changed, 30 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/26/81026/1
diff --git a/.gitignore b/.gitignore index e813493..81fb11b 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ generated/
site-local +3rdparty/chromeec
*.# *.a diff --git a/3rdparty/Makefile.mk b/3rdparty/Makefile.mk new file mode 100644 index 0000000..b762de3 --- /dev/null +++ b/3rdparty/Makefile.mk @@ -0,0 +1,26 @@ +## SPDX-License-Identifier: GPL-2.0-only + +# Download the ChromeEC repository +ifneq ($(DOWNLOAD_CHROMEEC)$(CONFIG_EC_GOOGLE_CHROMEEC_FIRMWARE_BUILTIN),) + +CHROMEEC_DIR := $(top)/3rdparty/chromeec + +ifeq ($(CONFIG_CHROMEEC_COMMIT),) + CONFIG_CHROMEEC_COMMIT := e486b388a7 +endif + +ifeq ($(wildcard $(CHROMEEC_DIR)),) + $(info Cloning ChromeEC repo) + CHROMEEC_GIT_TASK := $(shell git clone https://review.coreboot.org/chrome-ec.git $(CHROMEEC_DIR) 2>&1) + CHROMEEC_GIT_TASK += $(shell cd $(CHROMEEC_DIR) && git checkout $(CONFIG_CHROMEEC_COMMIT) 2>&1) +else + CHROMEEC_GIT_TASK := $(shell cd $(CHROMEEC_DIR) && git fetch 2>&1) +endif +$(info $(CHROMEEC_GIT_TASK)) + +endif # ($(CONFIG_EC_GOOGLE_CHROMEEC_FIRMWARE_BUILTIN),y) + +distclean-3rdparty: + rm -rf "$(CHROMEEC_DIR)" + +.PHONY: distclean-3rdparty diff --git a/Makefile b/Makefile index 412d6a6..fea0d67 100644 --- a/Makefile +++ b/Makefile @@ -165,6 +165,7 @@ -include $(TOPLEVEL)/site-local/Makefile.mk -include $(TOPLEVEL)/site-local/Makefile.inc include $(TOPLEVEL)/tests/Makefile.mk +include $(TOPLEVEL)/3rdparty/Makefile.mk printall real-all: @echo "Error: Trying to build, but NOCOMPILE is set." >&2 @echo " Please file a bug with the following information:" @@ -534,7 +535,7 @@ $(MAKE) -C util/$(tool) distclean MFLAGS= MAKEFLAGS= ; \ rm -f /util/$(tool)/junit.xml;)
-distclean: clean clean-ctags clean-cscope distclean-payloads distclean-utils +distclean: clean clean-ctags clean-cscope distclean-payloads distclean-utils distclean-3rdparty rm -f .config .config.old ..config.tmp* .kconfig.d .tmpconfig* .ccwrap .xcompile rm -rf coreboot-builds coreboot-builds-chromeos rm -f abuild*.xml junit.xml* util/lint/junit.xml diff --git a/Makefile.mk b/Makefile.mk index f7b98c7..fbfacc31 100644 --- a/Makefile.mk +++ b/Makefile.mk @@ -111,6 +111,7 @@ subdirs-y += src/mainboard/$(MAINBOARDDIR) subdirs-y += src/security subdirs-y += payloads payloads/external +subdirs-y += 3rdparty subdirs-$(CONFIG_SBOM) += src/sbom
subdirs-y += site-local