2023-05-10 21:09:04 +02:00
|
|
|
# 2023-05-10
|
|
|
|
STABLE_COMMIT_ID=c48613a71c1ee29295b184c51fe5dadf71b543c4
|
2015-07-15 19:24:18 +02:00
|
|
|
|
|
|
|
project_name=depthcharge
|
|
|
|
project_dir=$(CURDIR)/depthcharge
|
|
|
|
project_git_repo=https://chromium.googlesource.com/chromiumos/platform/depthcharge
|
|
|
|
project_config_file=$(project_dir)/.config
|
|
|
|
output_dir=$(project_dir)/build
|
|
|
|
libpayload_dir=$(abspath $(CURDIR)/../../libpayload)
|
|
|
|
libpayload_install_dir=$(output_dir)/lp_$(BOARD)
|
2021-04-16 02:16:47 +02:00
|
|
|
coreboot_build_dir=$(abspath $(CURDIR)/../../../build)
|
2016-07-24 12:14:38 +02:00
|
|
|
|
|
|
|
VBOOT_SOURCE ?= $(abspath $(CURDIR)/../../../3rdparty/vboot)
|
2020-03-30 23:41:52 +02:00
|
|
|
EC_HEADERS ?= $(abspath $(CURDIR)/../../../3rdparty/chromeec/include)
|
2015-07-15 19:24:18 +02:00
|
|
|
|
2021-03-05 11:33:36 +01:00
|
|
|
TAG-$(DEPTHCHARGE_MASTER)=origin/main
|
2015-07-15 19:24:18 +02:00
|
|
|
TAG-$(DEPTHCHARGE_STABLE)=$(STABLE_COMMIT_ID)
|
2016-12-23 00:16:48 +01:00
|
|
|
TAG-$(DEPTHCHARGE_REVISION)=$(DEPTHCHARGE_REVISION_ID)
|
2015-07-15 19:24:18 +02:00
|
|
|
|
|
|
|
unexport KCONFIG_AUTOHEADER
|
|
|
|
unexport KCONFIG_AUTOCONFIG
|
|
|
|
unexport KCONFIG_DEPENDENCIES
|
|
|
|
unexport KCONFIG_SPLITCONFIG
|
|
|
|
unexport KCONFIG_TRISTATE
|
|
|
|
unexport KCONFIG_NEGATIVES
|
|
|
|
unexport src srck obj objk
|
|
|
|
|
|
|
|
BOARD:=$(notdir $(CONFIG_MAINBOARD_DIR))
|
|
|
|
|
2016-12-23 02:25:29 +01:00
|
|
|
ifeq ($(OVERRIDE_DEFCONFIG),y)
|
|
|
|
libpayload_config=$(libpayload_dir)/configs/defconfig
|
2017-07-20 17:10:53 +02:00
|
|
|
DEPTHCHARGE_LIBPAYLOAD_MSG="Depthcharge: Using default defconfig for libpayload"
|
2016-12-23 02:25:29 +01:00
|
|
|
else
|
|
|
|
libpayload_config=$(libpayload_dir)/configs/config.$(BOARD)
|
2017-07-20 17:10:53 +02:00
|
|
|
DEPTHCHARGE_LIBPAYLOAD_MSG="Depthcharge: Using $(libpayload_dir)/configs/config.$(BOARD)"
|
2016-12-23 02:25:29 +01:00
|
|
|
endif
|
|
|
|
|
2015-07-15 19:24:18 +02:00
|
|
|
all: build
|
|
|
|
|
|
|
|
$(project_dir):
|
2017-07-20 17:10:53 +02:00
|
|
|
@echo " Cloning $(project_name) from Git"
|
|
|
|
@git clone $(project_git_repo) $(project_name)
|
2015-07-15 19:24:18 +02:00
|
|
|
|
|
|
|
fetch: $(project_dir)
|
2017-07-20 17:10:53 +02:00
|
|
|
@cd $(project_dir); \
|
|
|
|
git show $(TAG-y) >/dev/null 2>&1; \
|
|
|
|
if [ $$? -ne 0 ] || \
|
2021-03-05 11:33:36 +01:00
|
|
|
[ "$(TAG-y)" = "origin/main" ]; then \
|
2015-07-15 19:24:18 +02:00
|
|
|
echo " Fetching new commits from the $(project_name) git repo"; \
|
|
|
|
git fetch; fi
|
|
|
|
|
2017-07-20 17:10:53 +02:00
|
|
|
# Check out the requested version of the tree
|
2021-03-05 11:33:36 +01:00
|
|
|
# Don't write a file for main branch so the latest remote version is always used
|
2020-07-13 15:08:22 +02:00
|
|
|
$(project_dir)/.version_$(TAG-y): fetch
|
2015-07-15 19:24:18 +02:00
|
|
|
echo " Checking out $(project_name) revision $(TAG-y)"
|
2017-07-20 17:10:53 +02:00
|
|
|
rm -f $(project_dir)/.version_*
|
|
|
|
cd $(project_dir); \
|
2021-03-05 11:33:36 +01:00
|
|
|
git checkout main; \
|
2017-07-20 17:10:53 +02:00
|
|
|
git branch -D coreboot 2>/dev/null; \
|
|
|
|
git checkout -b coreboot $(TAG-y)
|
|
|
|
ifneq ($(DEPTHCHARGE_MASTER),y)
|
|
|
|
touch $(project_dir)/.version_$(TAG-y)
|
|
|
|
endif
|
2015-07-15 19:24:18 +02:00
|
|
|
|
|
|
|
$(libpayload_install_dir): $(project_dir)
|
2017-07-20 17:10:53 +02:00
|
|
|
test -f $(libpayload_config) || \
|
2016-12-23 02:25:29 +01:00
|
|
|
(echo "Error: $(libpayload_config) is not present" && \
|
2015-07-15 19:24:18 +02:00
|
|
|
false)
|
2017-07-20 17:10:53 +02:00
|
|
|
echo $(DEPTHCHARGE_LIBPAYLOAD_MSG)
|
2016-12-23 02:25:29 +01:00
|
|
|
cp $(libpayload_config) $(libpayload_dir)/.config
|
2022-03-31 01:45:20 +02:00
|
|
|
(grep -q '^\s*CONFIG_LP_CHROMEOS=' $(libpayload_dir)/.config) || \
|
|
|
|
(echo "CONFIG_LP_CHROMEOS=y" >> $(libpayload_dir)/.config)
|
2015-07-15 19:24:18 +02:00
|
|
|
$(MAKE) -C $(libpayload_dir) olddefconfig
|
|
|
|
$(MAKE) -C $(libpayload_dir)
|
|
|
|
$(MAKE) -C $(libpayload_dir) install DESTDIR=$(libpayload_install_dir)
|
|
|
|
|
2017-07-20 17:10:53 +02:00
|
|
|
config: $(project_dir)/.version_$(TAG-y) $(libpayload_install_dir)
|
2015-07-15 19:24:18 +02:00
|
|
|
echo " CONFIG project_name $(TAG-y)"
|
|
|
|
export VERSION=$$(cd depthcharge && \
|
|
|
|
git describe --tags --long --dirty 2>/dev/null || \
|
|
|
|
echo "unknown") ; \
|
2017-07-20 17:10:53 +02:00
|
|
|
cd $(project_dir) && \
|
|
|
|
$(MAKE) BOARD=$(BOARD) \
|
|
|
|
LIBPAYLOAD_DIR=$(libpayload_install_dir)/libpayload \
|
2020-03-30 23:41:52 +02:00
|
|
|
VB_SOURCE=$(VBOOT_SOURCE) \
|
|
|
|
EC_HEADERS=$(EC_HEADERS) defconfig
|
2015-07-15 19:24:18 +02:00
|
|
|
|
|
|
|
build: config
|
|
|
|
echo " MAKE $(project_name) $(TAG-y)"
|
2021-04-16 02:16:47 +02:00
|
|
|
cp $(coreboot_build_dir)/static_fw_config.h depthcharge/src/base/
|
2017-07-20 17:10:53 +02:00
|
|
|
$(MAKE) -C $(project_dir) depthcharge BOARD=$(BOARD) \
|
|
|
|
LIBPAYLOAD_DIR=$(libpayload_install_dir)/libpayload \
|
|
|
|
VB_SOURCE=$(VBOOT_SOURCE) \
|
2020-03-30 23:41:52 +02:00
|
|
|
EC_HEADERS=$(EC_HEADERS) \
|
2017-07-20 17:10:53 +02:00
|
|
|
PATH="$(abspath ../../../build/util/cbfstool):$$PATH"
|
2015-07-15 19:24:18 +02:00
|
|
|
|
|
|
|
clean:
|
2017-07-25 16:21:50 +02:00
|
|
|
rm -rf $(output_dir)
|
2015-07-15 19:24:18 +02:00
|
|
|
|
|
|
|
distclean:
|
|
|
|
rm -rf $(project_dir)
|
|
|
|
|
2016-03-16 19:42:05 +01:00
|
|
|
print-repo-info:
|
|
|
|
echo "$(project_git_repo) $(project_dir)"
|
|
|
|
|
|
|
|
.PHONY: checkout config build clean distclean clone fetch print-repo-info
|