summaryrefslogtreecommitdiff
path: root/util/build.mk
diff options
context:
space:
mode:
authorCraig Hesling <hesling@chromium.org>2020-12-29 17:46:28 -0800
committerCommit Bot <commit-bot@chromium.org>2021-02-03 03:56:06 +0000
commit092a0eb3b9300d8f896a974fb6faaffac28a1610 (patch)
treef9e36dba00449a25c05268dfe262813ac762bc40 /util/build.mk
parent4d1edeef0b4533f6a4a9814cf335998c5c03bf95 (diff)
downloadchrome-ec-092a0eb3b9300d8f896a974fb6faaffac28a1610.tar.gz
make/util: Modularize util make var building
The key objectives are to * allow util targets to be added from outside of util/build.mk (for adding tools per board, like ectool_servo) * allow for easier conditioning of tool inclusion (for auto adding tools based on characteristic, like CHIP_NPCX) * reduce the number of tools being built (we can remove irrelevant tools for some boards, like removing stm32mon for npcx boards or iteflash for stm32 boards) We have tons of boards in EC now. This takes a significant amount of time to build, so we should be a bit more careful when adding utils for all boards. This and subsequent changes sets the precedent for selectivity. This shifts the initialization/control to the board and baseboard's build.mk and allows the util/build.mk to add items to these variables. Ideally, we would use multiple variables to aggregate the utils selection from the three sources (baseboard/build.mk, board/build.mk, and util/build.mk), but I don't think the addition complexity is currently warranted. BRANCH=none BUG=b:176500425 TEST=# Check all output artifacts from before and after this CL. make clobber make buildall STATIC_VERSION=1 -j mv build build-orig # Apply the change make clobber make buildall STATIC_VERSION=1 -j diff <(find build-orig | sed 's/build-orig//' | sort) <(find build | sed 's/build//' | sort) # Nothing should be different Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I23153850eda10fc1c88d386b9f3cd8296df9c6f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2606511 Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'util/build.mk')
-rw-r--r--util/build.mk28
1 files changed, 13 insertions, 15 deletions
diff --git a/util/build.mk b/util/build.mk
index ee8050142f..e868e32eff 100644
--- a/util/build.mk
+++ b/util/build.mk
@@ -6,20 +6,18 @@
# Host tools build
#
-host-util-bin=ectool lbplay stm32mon ec_sb_firmware_update lbcc \
+# See Makefile for description.
+host-util-bin-y += ectool lbplay stm32mon ec_sb_firmware_update lbcc \
ec_parse_panicinfo cbi-util iteflash
-build-util-art+=util/export_taskinfo.so
-ifeq ($(CHIP),npcx)
-build-util-bin=ecst
-endif
-host-util-bin+=uartupdatetool
+build-util-art-y += util/export_taskinfo.so
+
+build-util-bin-$(CHIP_NPCX) += ecst
+build-util-bin-$(BOARD_NOCTURNE_FP) += ectool_servo
+
+host-util-bin-y += uartupdatetool
uartupdatetool-objs=uut/main.o uut/cmd.o uut/opr.o uut/l_com_port.o \
uut/lib_crc.o
$(out)/util/uartupdatetool: HOST_CFLAGS+=-Iutil/
-# Build on a limited subset of boards to save build time
-ifeq ($(BOARD),nocturne_fp)
-build-util-bin+=ectool_servo
-endif
# If the util/ directory in the private repo is symlinked into util/private,
# we want to build host-side tools from it, too.
@@ -43,8 +41,8 @@ ec_parse_panicinfo-objs=ec_parse_panicinfo.o ec_panicinfo.o
# USB type-C Vendor Information File generation
ifeq ($(CONFIG_USB_POWER_DELIVERY),y)
-build-util-bin+=genvif
-build-util-art+=$(BOARD)_vif.xml
+build-util-bin-y+=genvif
+build-util-art-y+=$(BOARD)_vif.xml
# usb_pd_policy.c can be in baseboard, or board, or both.
genvif-pd-srcs=$(sort $(wildcard $(BASEDIR)/usb_pd_policy.c \
@@ -69,14 +67,14 @@ $(out)/common/usb_common.o: common/usb_common.c
endif # CONFIG_USB_POWER_DELIVERY
ifneq ($(CONFIG_BOOTBLOCK),)
-build-util-bin += gen_emmc_transfer_data
+build-util-bin-y += gen_emmc_transfer_data
# Bootblock is only packed in RO image.
$(out)/util/gen_emmc_transfer_data: BUILD_LDFLAGS += -DSECTION_IS_RO=$(EMPTY)
endif # CONFIG_BOOTBLOCK
ifneq ($(CONFIG_IPI),)
-build-util-bin += gen_ipi_table
+build-util-bin-y += gen_ipi_table
$(out)/util/gen_ipi_table: board/$(BOARD)/board.h
$(out)/ipi_table_gen.inc: $(out)/util/gen_ipi_table
@@ -84,7 +82,7 @@ $(out)/ipi_table_gen.inc: $(out)/util/gen_ipi_table
endif
ifneq ($(CONFIG_TOUCHPAD_HASH_FW),)
-build-util-bin += gen_touchpad_hash
+build-util-bin-y += gen_touchpad_hash
# Assume RW section (touchpad FW must be identical for both RO+RW)
$(out)/util/gen_touchpad_hash: BUILD_LDFLAGS += -DSECTION_IS_RW=$(EMPTY)