2 STABLE_COMMIT_ID
=c48613a71c1ee29295b184c51fe5dadf71b543c4
4 project_name
=depthcharge
5 project_dir
=$(CURDIR
)/depthcharge
6 project_git_repo
=$(DEPTHCHARGE_REPO
)
7 project_config_file
=$(project_dir
)/.config
8 output_dir
=$(project_dir
)/build
9 libpayload_dir
=$(abspath
$(CURDIR
)/..
/..
/libpayload
)
10 libpayload_install_dir
=$(output_dir
)/lp_
$(BOARD
)
11 coreboot_build_dir
=$(abspath
$(CURDIR
)/..
/..
/..
/build
)
13 VBOOT_SOURCE ?
= $(abspath
$(CURDIR
)/..
/..
/..
/3rdparty
/vboot
)
14 EC_HEADERS ?
= $(abspath
$(CURDIR
)/..
/..
/..
/3rdparty
/chromeec
/include)
16 TAG-
$(DEPTHCHARGE_MASTER
)=$(DEPTHCHARGE_BRANCH
)
17 TAG-
$(DEPTHCHARGE_STABLE
)=$(STABLE_COMMIT_ID
)
18 TAG-
$(DEPTHCHARGE_REVISION
)=$(DEPTHCHARGE_REVISION_ID
)
20 unexport KCONFIG_AUTOHEADER
21 unexport KCONFIG_AUTOCONFIG
22 unexport KCONFIG_DEPENDENCIES
23 unexport KCONFIG_SPLITCONFIG
24 unexport KCONFIG_TRISTATE
25 unexport KCONFIG_NEGATIVES
26 unexport src srck obj objk
28 BOARD
:=$(notdir $(CONFIG_MAINBOARD_DIR
))
30 ifeq ($(OVERRIDE_DEFCONFIG
),y
)
31 libpayload_config
=$(libpayload_dir
)/configs
/defconfig
32 DEPTHCHARGE_LIBPAYLOAD_MSG
="Depthcharge: Using default defconfig for libpayload"
34 libpayload_config
=$(libpayload_dir
)/configs
/config.
$(BOARD
)
35 DEPTHCHARGE_LIBPAYLOAD_MSG
="Depthcharge: Using $(libpayload_dir)/configs/config.$(BOARD)"
41 @echo
" Cloning $(project_name) from Git"
42 @git clone
$(project_git_repo
) $(project_name
)
46 git show
$(TAG-y
) >/dev
/null
2>&1; \
48 [ "$(TAG-y)" = "origin/main" ]; then \
49 echo
" Fetching new commits from the $(project_name) git repo"; \
52 # Check out the requested version of the tree
53 # Don't write a file for main branch so the latest remote version is always used
54 $(project_dir
)/.version_
$(TAG-y
): fetch
55 echo
" Checking out $(project_name) revision $(TAG-y)"
56 rm -f
$(project_dir
)/.version_
*
59 git branch
-D coreboot
2>/dev
/null
; \
60 git checkout
-b coreboot
$(TAG-y
)
61 ifneq ($(DEPTHCHARGE_MASTER
),y
)
62 touch
$(project_dir
)/.version_
$(TAG-y
)
65 $(libpayload_install_dir
): $(project_dir
)
66 test -f
$(libpayload_config
) || \
67 (echo
"Error: $(libpayload_config) is not present" && \
69 echo
$(DEPTHCHARGE_LIBPAYLOAD_MSG
)
70 cp
$(libpayload_config
) $(libpayload_dir
)/.config
71 (grep
-q
'^\s*CONFIG_LP_CHROMEOS=' $(libpayload_dir
)/.config
) || \
72 (echo
"CONFIG_LP_CHROMEOS=y" >> $(libpayload_dir
)/.config
)
73 $(MAKE
) -C
$(libpayload_dir
) olddefconfig
74 $(MAKE
) -C
$(libpayload_dir
)
75 $(MAKE
) -C
$(libpayload_dir
) install DESTDIR
=$(libpayload_install_dir
)
77 config
: $(project_dir
)/.version_
$(TAG-y
) $(libpayload_install_dir
)
78 echo
" CONFIG project_name $(TAG-y)"
79 export VERSION
=$$(cd depthcharge
&& \
80 git describe
--tags --long
--dirty
2>/dev
/null || \
82 cd
$(project_dir
) && \
83 $(MAKE
) BOARD
=$(BOARD
) \
84 LIBPAYLOAD_DIR
=$(libpayload_install_dir
)/libpayload \
85 VB_SOURCE
=$(VBOOT_SOURCE
) \
86 EC_HEADERS
=$(EC_HEADERS
) defconfig
89 echo
" MAKE $(project_name) $(TAG-y)"
90 cp
$(coreboot_build_dir
)/static_fw_config.h depthcharge
/src
/base
/
91 $(MAKE
) -C
$(project_dir
) depthcharge BOARD
=$(BOARD
) \
92 LIBPAYLOAD_DIR
=$(libpayload_install_dir
)/libpayload \
93 VB_SOURCE
=$(VBOOT_SOURCE
) \
94 EC_HEADERS
=$(EC_HEADERS
) \
95 PATH
="$(abspath ../../../build/util/cbfstool):$$PATH"
101 rm -rf
$(project_dir
)
104 echo
"$(project_git_repo) $(project_dir)"
106 .PHONY
: checkout config build
clean distclean clone fetch print-repo-info