diff options
| -rw-r--r-- | core/main.mk | 12 | ||||
| -rw-r--r-- | core/product.mk | 7 |
2 files changed, 18 insertions, 1 deletions
diff --git a/core/main.mk b/core/main.mk index 5142adc759..83d42af9c7 100644 --- a/core/main.mk +++ b/core/main.mk @@ -281,7 +281,17 @@ subdir_makefiles := $(SOONG_OUT_DIR)/installs-$(TARGET_PRODUCT)$(COVERAGE_SUFFIX # Android.mk files are only used on Linux builds, Mac only supports Android.bp ifeq ($(HOST_OS),linux) - subdir_makefiles += $(file <$(OUT_DIR)/.module_paths/Android.mk.list) + ifeq ($(PRODUCT_IGNORE_ALL_ANDROIDMK),true) + allowed_androidmk_files := + ifdef PRODUCT_ANDROIDMK_ALLOWLIST_FILE + -include $(PRODUCT_ANDROIDMK_ALLOWLIST_FILE) + endif + allowed_androidmk_files += $(PRODUCT_ALLOWED_ANDROIDMK_FILES) + subdir_makefiles += $(filter $(allowed_androidmk_files),$(file <$(OUT_DIR)/.module_paths/Android.mk.list)) + allowed_androidmk_files := + else + subdir_makefiles += $(file <$(OUT_DIR)/.module_paths/Android.mk.list) + endif endif subdir_makefiles += $(SOONG_OUT_DIR)/late-$(TARGET_PRODUCT)$(COVERAGE_SUFFIX).mk diff --git a/core/product.mk b/core/product.mk index 7cf4ec26d8..9c567c3e19 100644 --- a/core/product.mk +++ b/core/product.mk @@ -492,6 +492,13 @@ _product_single_value_vars += PRODUCT_SOONG_DEFINED_SYSTEM_IMAGE # should be included in the system_linker_config. _product_list_vars += PRODUCT_EXTRA_STUB_LIBRARIES +# If set to true, all Android.mk files will be ignored. +_product_single_value_vars += PRODUCT_IGNORE_ALL_ANDROIDMK +# When PRODUCT_IGNORE_ALL_ANDROIDMK is set to true, this variable will be used to allow some Android.mk files. +_product_list_vars += PRODUCT_ALLOWED_ANDROIDMK_FILES +# When PRODUCT_IGNORE_ALL_ANDROIDMK is set to true, path of file that contains a list of allowed Android.mk files +_product_single_value_vars += PRODUCT_ANDROIDMK_ALLOWLIST_FILE + .KATI_READONLY := _product_single_value_vars _product_list_vars _product_var_list :=$= $(_product_single_value_vars) $(_product_list_vars) |