Vijay Venkatraman | 43a7f0c | 2016-12-20 17:50:21 +0000 | [diff] [blame] | 1 | |
Justin Yun | 2bfe0a1 | 2020-01-20 18:57:01 +0900 | [diff] [blame] | 2 | #Set LOCAL_USE_VNDK for modules going into product, vendor or odm partition, except for host modules |
Vijay Venkatraman | 43a7f0c | 2016-12-20 17:50:21 +0000 | [diff] [blame] | 3 | #If LOCAL_SDK_VERSION is set, thats a more restrictive set, so they dont need LOCAL_USE_VNDK |
| 4 | ifndef LOCAL_IS_HOST_MODULE |
| 5 | ifndef LOCAL_SDK_VERSION |
Justin Yun | dd54017 | 2020-01-20 07:39:41 +0000 | [diff] [blame] | 6 | ifneq (,$(filter true,$(LOCAL_VENDOR_MODULE) $(LOCAL_ODM_MODULE) $(LOCAL_OEM_MODULE) $(LOCAL_PROPRIETARY_MODULE))) |
Vijay Venkatraman | 43a7f0c | 2016-12-20 17:50:21 +0000 | [diff] [blame] | 7 | LOCAL_USE_VNDK:=true |
Justin Yun | 69f7191 | 2021-03-08 19:31:37 +0900 | [diff] [blame] | 8 | LOCAL_USE_VNDK_VENDOR:=true |
Jiyong Park | 003ea36 | 2017-11-15 18:22:14 +0900 | [diff] [blame] | 9 | # Note: no need to check LOCAL_MODULE_PATH* since LOCAL_[VENDOR|ODM|OEM]_MODULE is already |
| 10 | # set correctly before this is included. |
Vijay Venkatraman | 43a7f0c | 2016-12-20 17:50:21 +0000 | [diff] [blame] | 11 | endif |
Justin Yun | 2bfe0a1 | 2020-01-20 18:57:01 +0900 | [diff] [blame] | 12 | ifdef PRODUCT_PRODUCT_VNDK_VERSION |
| 13 | # Product modules also use VNDK when PRODUCT_PRODUCT_VNDK_VERSION is defined. |
| 14 | ifeq (true,$(LOCAL_PRODUCT_MODULE)) |
| 15 | LOCAL_USE_VNDK:=true |
| 16 | LOCAL_USE_VNDK_PRODUCT:=true |
| 17 | endif |
| 18 | endif |
Vijay Venkatraman | 43a7f0c | 2016-12-20 17:50:21 +0000 | [diff] [blame] | 19 | endif |
| 20 | endif |
| 21 | |
Dan Willemsen | bab0fa6 | 2016-11-18 14:05:39 -0800 | [diff] [blame] | 22 | # Verify LOCAL_USE_VNDK usage, and set LOCAL_SDK_VERSION if necessary |
| 23 | |
| 24 | ifdef LOCAL_IS_HOST_MODULE |
| 25 | ifdef LOCAL_USE_VNDK |
| 26 | $(shell echo $(LOCAL_MODULE_MAKEFILE): $(LOCAL_MODULE): Do not use LOCAL_USE_VNDK with host modules >&2) |
| 27 | $(error done) |
| 28 | endif |
| 29 | endif |
| 30 | ifdef LOCAL_USE_VNDK |
| 31 | ifneq ($(LOCAL_USE_VNDK),true) |
| 32 | $(shell echo '$(LOCAL_MODULE_MAKEFILE): $(LOCAL_MODULE): LOCAL_USE_VNDK must be "true" or empty, not "$(LOCAL_USE_VNDK)"' >&2) |
| 33 | $(error done) |
| 34 | endif |
| 35 | |
| 36 | ifdef LOCAL_SDK_VERSION |
| 37 | $(shell echo $(LOCAL_MODULE_MAKEFILE): $(LOCAL_MODULE): LOCAL_USE_VNDK must not be used with LOCAL_SDK_VERSION >&2) |
| 38 | $(error done) |
| 39 | endif |
| 40 | |
| 41 | # If we're not using the VNDK, drop all restrictions |
| 42 | ifndef BOARD_VNDK_VERSION |
| 43 | LOCAL_USE_VNDK:= |
Justin Yun | 69f7191 | 2021-03-08 19:31:37 +0900 | [diff] [blame] | 44 | LOCAL_USE_VNDK_VENDOR:= |
Justin Yun | 2bfe0a1 | 2020-01-20 18:57:01 +0900 | [diff] [blame] | 45 | LOCAL_USE_VNDK_PRODUCT:= |
Dan Willemsen | bab0fa6 | 2016-11-18 14:05:39 -0800 | [diff] [blame] | 46 | endif |
Dan Willemsen | bab0fa6 | 2016-11-18 14:05:39 -0800 | [diff] [blame] | 47 | endif |
| 48 | |