diff options
-rw-r--r-- | core/definitions.mk | 13 | ||||
-rw-r--r-- | core/main.mk | 10 | ||||
-rw-r--r-- | core/tasks/vendor_module_check.mk | 22 |
3 files changed, 21 insertions, 24 deletions
diff --git a/core/definitions.mk b/core/definitions.mk index 9943d5ff8..f82bfa59c 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -1999,6 +1999,19 @@ define set-inherited-package-variables-internal ,) endef +########################################################### +## Expand a module name list with REQUIRED modules +########################################################### +# $(1): The variable name that holds the initial module name list. +# the variable will be modified to hold the expanded results. +# $(2): The initial module name list. +# Returns empty string (maybe with some whitespaces). +define expand-required-modules +$(eval _erm_new_modules := $(sort $(filter-out $($(1)),\ + $(foreach m,$(2),$(ALL_MODULES.$(m).REQUIRED)))))\ +$(if $(_erm_new_modules),$(eval $(1) += $(_erm_new_modules))\ + $(call expand-required-modules,$(1),$(_erm_new_modules))) +endef ########################################################### ## Other includes diff --git a/core/main.mk b/core/main.mk index c22c96761..fa56b8392 100644 --- a/core/main.mk +++ b/core/main.mk @@ -546,13 +546,9 @@ ifdef FULL_BUILD # The base list of modules to build for this product is specified # by the appropriate product definition file, which was included # by product_config.make. - user_PACKAGES := $(call module-installed-files, \ - $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES)) - ifeq (0,1) - $(info user packages for $(TARGET_DEVICE) ($(INTERNAL_PRODUCT)):) - $(foreach p,$(user_PACKAGES),$(info : $(p))) - $(error done) - endif + user_PACKAGES := $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES) + $(call expand-required-modules,user_PACKAGES,$(user_PACKAGES)) + user_PACKAGES := $(call module-installed-files, $(user_PACKAGES)) else # We're not doing a full build, and are probably only including # a subset of the module makefiles. Don't try to build any modules diff --git a/core/tasks/vendor_module_check.mk b/core/tasks/vendor_module_check.mk index 65c4258d6..d26a0453a 100644 --- a/core/tasks/vendor_module_check.mk +++ b/core/tasks/vendor_module_check.mk @@ -30,21 +30,8 @@ _vendor_owner_whitelist := \ ifneq (,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_RESTRICT_VENDOR_FILES)) -_check_modules := $(sort $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES)) - -# expand with the required modules -# $(1) the module name set to expand -define _expand_required_modules -$(eval _erm_new_modules:=)\ -$(foreach m, $(1), $(eval r:=$(ALL_MODULES.$(m).REQUIRED))\ - $(if $(r), $(if $(filter $(_check_modules), $(r)),,\ - $(eval _check_modules := $(_check_modules) $(r))\ - $(eval _erm_new_modules := $(_erm_new_modules) $(r)))))\ -$(if $(_erm_new_modules), $(call _expand_required_modules, $(_erm_new_modules))) -endef - -$(call _expand_required_modules, $(_check_modules)) - +_vendor_check_modules := $(sort $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES)) +$(call expand-required-modules,_vendor_check_modules,$(_vendor_check_modules)) # Restrict owners ifneq (,$(filter true owner all, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_RESTRICT_VENDOR_FILES))) @@ -58,7 +45,7 @@ $(error Error: Product "$(TARGET_PRODUCT)" can not have PRODUCT_COPY_FILES from $(filter vendor/%, $(PRODUCT_COPY_FILES))) endif -$(foreach m, $(_check_modules), \ +$(foreach m, $(_vendor_check_modules), \ $(if $(filter vendor/%, $(ALL_MODULES.$(m).PATH)),\ $(if $(filter $(_vendor_owner_whitelist), $(ALL_MODULES.$(m).OWNER)),,\ $(error Error: vendor module "$(m)" in $(ALL_MODULES.$(m).PATH) with unknown owner \ @@ -70,7 +57,7 @@ endif # Restrict paths ifneq (,$(filter path all, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_RESTRICT_VENDOR_FILES))) -$(foreach m, $(_check_modules), \ +$(foreach m, $(_vendor_check_modules), \ $(if $(filter vendor/%, $(ALL_MODULES.$(m).PATH)),\ $(if $(filter $(TARGET_OUT_VENDOR)/%, $(ALL_MODULES.$(m).INSTALLED)),,\ $(error Error: vendor module "$(m)" in $(ALL_MODULES.$(m).PATH) \ @@ -79,4 +66,5 @@ $(foreach m, $(_check_modules), \ endif +_vendor_check_modules := endif |