vendor_module_check.mk revision 74aba61404f0c1ea8693d2959d81d8b5b1bdf5d4
1# 2# Copyright (C) 2011 The Android Open Source Project 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# 16 17# Restrict the vendor module owners here. 18_vendor_owner_whitelist := \ 19 asus \ 20 audience \ 21 broadcom \ 22 csr \ 23 elan \ 24 google \ 25 imgtec \ 26 invensense \ 27 nvidia \ 28 nxp \ 29 samsung \ 30 samsung_arm \ 31 ti \ 32 trusted_logic \ 33 widevine 34 35 36ifneq (,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_RESTRICT_VENDOR_FILES)) 37 38_vendor_check_modules := $(sort $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES)) 39$(call expand-required-modules,_vendor_check_modules,$(_vendor_check_modules)) 40 41# Restrict owners 42ifneq (,$(filter true owner all, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_RESTRICT_VENDOR_FILES))) 43 44ifneq (,$(filter vendor/%, $(PRODUCT_PACKAGE_OVERLAYS) $(DEVICE_PACKAGE_OVERLAYS))) 45$(error Error: Product "$(TARGET_PRODUCT)" can not have overlay in vendor tree: \ 46 $(filter vendor/%, $(PRODUCT_PACKAGE_OVERLAYS) $(DEVICE_PACKAGE_OVERLAYS))) 47endif 48ifneq (,$(filter vendor/%, $(PRODUCT_COPY_FILES))) 49$(error Error: Product "$(TARGET_PRODUCT)" can not have PRODUCT_COPY_FILES from vendor tree: \ 50 $(filter vendor/%, $(PRODUCT_COPY_FILES))) 51endif 52 53$(foreach m, $(_vendor_check_modules), \ 54 $(if $(filter vendor/%, $(ALL_MODULES.$(m).PATH)),\ 55 $(if $(filter $(_vendor_owner_whitelist), $(ALL_MODULES.$(m).OWNER)),,\ 56 $(error Error: vendor module "$(m)" in $(ALL_MODULES.$(m).PATH) with unknown owner \ 57 "$(ALL_MODULES.$(m).OWNER)" in product "$(TARGET_PRODUCT)")))) 58 59endif 60 61 62# Restrict paths 63ifneq (,$(filter path all, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_RESTRICT_VENDOR_FILES))) 64 65$(foreach m, $(_vendor_check_modules), \ 66 $(if $(filter vendor/%, $(ALL_MODULES.$(m).PATH)),\ 67 $(if $(filter $(TARGET_OUT_VENDOR)/%, $(ALL_MODULES.$(m).INSTALLED)),,\ 68 $(error Error: vendor module "$(m)" in $(ALL_MODULES.$(m).PATH) \ 69 in product "$(TARGET_PRODUCT)" being installed to \ 70 $(ALL_MODULES.$(m).INSTALLED) which is not in the vendor tree)))) 71 72endif 73 74_vendor_check_modules := 75endif 76