aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSasha Smundak <asmundak@google.com>2021-09-28 20:01:50 -0700
committerSasha Smundak <asmundak@google.com>2021-10-15 15:39:28 -0700
commitc0fde810bae2bb2f4b286a7a2bd7aeb826ad9951 (patch)
treecadb3dbb69e22a8924e7c2522a279945b2b1d0f2
parentc5d5bb424f504d9558495692a776742b53024908 (diff)
downloadbuild-c0fde810bae2bb2f4b286a7a2bd7aeb826ad9951.tar.gz
Provide is-vendor-board-qcom macro.
`is-vendor-board-qcom` supplants `is-vendor-board-platform` as the latter's second operand is always `QCOM`. To check that BOARD is a QCOM one, write: ``` ifneq (,$(call is-vendor-board-qcom,BOARD)) ``` Using `is-vendor-board-qcom` before its implied operands `TARGET_BOARD_PLATFORM` and `QCOM_BOARD_PLATFORMS` are set is an error. Bug: 201477826 Test: treehugger Change-Id: Ie7063c46b7eda092438a59f3682486dd39af3d0b
-rw-r--r--core/product_config.mk7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/product_config.mk b/core/product_config.mk
index 200c3ab6b2..33b15d3825 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -110,6 +110,13 @@ define is-board-platform-in-list2
$(filter $(1),$(TARGET_BOARD_PLATFORM))
endef
+# Return empty unless the board is QCOM
+define is-vendor-board-qcom
+$(if $(strip $(TARGET_BOARD_PLATFORM) $(QCOM_BOARD_PLATFORMS)),\
+ $(filter $(TARGET_BOARD_PLATFORM),$(QCOM_BOARD_PLATFORMS)),\
+ $(error both TARGET_BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) and QCOM_BOARD_PLATFORMS=$(QCOM_BOARD_PLATFORMS)))
+endef
+
# ---------------------------------------------------------------
# Check for obsolete PRODUCT- and APP- goals
ifeq ($(CALLED_FROM_SETUP),true)