From dce3f920f221cb35916e152b09153db509514117 Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Mon, 11 Feb 2019 21:19:54 +0000 Subject: [PATCH] Move dump-products back to the config stage It's unnecessary to run all the make file parsing to dump product configs. Move the dumping to product_config.mk instead, but switch the output to $(warnings) as stdout is a bit sensitive during the config stage. Test: multiproduct_kati -only-config dump-products Change-Id: I8c7365c9f90ea2bf152b82dfb983bfb0cdcb1697 --- core/main.mk | 5 ----- core/product.mk | 6 +++--- core/product_config.mk | 4 ++++ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/core/main.mk b/core/main.mk index 71b6ed7249..14d2fe51ce 100644 --- a/core/main.mk +++ b/core/main.mk @@ -1590,11 +1590,6 @@ modules: @echo "$(call module-names-for-tag-list,$(ALL_MODULE_TAGS))" | \ tr -s ' ' '\n' | sort -u | $(COLUMN) -.PHONY: dump-products -dump-products: - $(dump-products) - @echo Successfully dumped products - .PHONY: dump-files dump-files: $(info product_FILES for $(TARGET_DEVICE) ($(INTERNAL_PRODUCT)):) diff --git a/core/product.mk b/core/product.mk index 0baa9f2e84..b58898e933 100644 --- a/core/product.mk +++ b/core/product.mk @@ -233,10 +233,10 @@ _product_var_list := \ PRODUCT_CHECK_ELF_FILES \ define dump-product -$(info ==== $(1) ====)\ +$(warning ==== $(1) ====)\ $(foreach v,$(_product_var_list),\ -$(info PRODUCTS.$(1).$(v) := $(PRODUCTS.$(1).$(v))))\ -$(info --------) +$(warning PRODUCTS.$(1).$(v) := $(PRODUCTS.$(1).$(v))))\ +$(warning --------) endef define dump-products diff --git a/core/product_config.mk b/core/product_config.mk index 01fbc0ac9d..dcca592f78 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -237,6 +237,10 @@ $(foreach makefile,$(ARTIFACT_PATH_REQUIREMENT_PRODUCTS),\ # Sanity check $(check-all-products) +ifneq ($(filter dump-products, $(MAKECMDGOALS)),) +$(dump-products) +endif + # Convert a short name like "sooner" into the path to the product # file defining that product. #