Cliff Huang has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/83225?usp=email )
Change subject: payloads/depthcharge: support depthcharge build with local changes ......................................................................
payloads/depthcharge: support depthcharge build with local changes
Allow building with local changes. Add dependency and target for generated static_fw_config.h. This ensures this file is geneerated prior to building depthcharge. Fix 'git fetch' for the repo other than origin/main.
TEST=deptcharge should build with local changes
Signed-off-by: Cliff Huang cliff.huang@intel.com Change-Id: I95c1f71ae149537a2191734a62f416b7b6f41fc6 --- M Makefile.mk M payloads/external/Makefile.mk M payloads/external/depthcharge/Makefile 3 files changed, 15 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/25/83225/1
diff --git a/Makefile.mk b/Makefile.mk index 301a3bc..d2025ba 100644 --- a/Makefile.mk +++ b/Makefile.mk @@ -708,7 +708,7 @@ DEVICETREE_FWCONFIG_H := $(obj)/static_fw_config.h SCONFIG_OPTIONS += --output_f=$(DEVICETREE_FWCONFIG_H)
-$(DEVICETREE_STATIC_C): $(DEVICETREE_FILE) $(OVERRIDE_DEVICETREE_FILE) $(CHIPSET_DEVICETREE_FILE) $(objutil)/sconfig/sconfig +$(DEVICETREE_STATIC_C) $(DEVICETREE_FWCONFIG_H): $(DEVICETREE_FILE) $(OVERRIDE_DEVICETREE_FILE) $(CHIPSET_DEVICETREE_FILE) $(objutil)/sconfig/sconfig @printf " SCONFIG $(subst $(src)/,,$(<))\n" mkdir -p $(dir $(DEVICETREE_STATIC_C)) $(objutil)/sconfig/sconfig $(SCONFIG_OPTIONS) diff --git a/payloads/external/Makefile.mk b/payloads/external/Makefile.mk index 4a17791..4c94e62 100644 --- a/payloads/external/Makefile.mk +++ b/payloads/external/Makefile.mk @@ -142,7 +142,7 @@
# Depthcharge
-payloads/external/depthcharge/depthcharge/build/depthcharge.elf depthcharge: $(DOTCONFIG) $(CBFSTOOL) +payloads/external/depthcharge/depthcharge/build/depthcharge.elf depthcharge: $(DOTCONFIG) $(CBFSTOOL) $(DEVICETREE_FWCONFIG_H) $(MAKE) -C payloads/external/depthcharge \ BOARD=$(BOARD) \ MFLAGS= MAKEFLAGS= \ diff --git a/payloads/external/depthcharge/Makefile b/payloads/external/depthcharge/Makefile index af303da..7107a59 100644 --- a/payloads/external/depthcharge/Makefile +++ b/payloads/external/depthcharge/Makefile @@ -45,19 +45,27 @@ @cd $(project_dir); \ git show $(TAG-y) >/dev/null 2>&1; \ if [ $$? -ne 0 ] || \ - [ "$(TAG-y)" = "origin/main" ]; then \ + [ "$(TAG-y)" = $(DEPTHCHARGE_BRANCH) ]; then \ echo " Fetching new commits from the $(project_name) git repo"; \ git fetch; fi
# Check out the requested version of the tree -# Don't write a file for main branch so the latest remote version is always used +# Don't write a file for main branch so the latest remote version is always used. +# If repo has local changes, The latest code of remote main branch won't be +# checked out and the existing code is used to build. $(project_dir)/.version_$(TAG-y): fetch echo " Checking out $(project_name) revision $(TAG-y)" rm -f $(project_dir)/.version_* cd $(project_dir); \ - git checkout main; \ - git branch -D coreboot 2>/dev/null; \ - git checkout -b coreboot $(TAG-y) + git diff-index --quiet HEAD -- ; \ + if [ $$? -eq 0 ] ; then \ + echo " Checking out branch"; \ + git checkout main ; \ + git branch -D coreboot 2>/dev/null ; \ + git checkout -b coreboot $(TAG-y); \ + else \ + echo " Contain local changes. Skip checking out latest code from $(TAG-y)"; \ + fi ifneq ($(DEPTHCHARGE_MASTER),y) touch $(project_dir)/.version_$(TAG-y) endif