1
2#Set LOCAL_USE_VNDK for modules going into product, vendor or odm partition, except for host modules
3#If LOCAL_SDK_VERSION is set, thats a more restrictive set, so they dont need LOCAL_USE_VNDK
4ifndef LOCAL_IS_HOST_MODULE
5ifndef LOCAL_SDK_VERSION
6  ifneq (,$(filter true,$(LOCAL_VENDOR_MODULE) $(LOCAL_ODM_MODULE) $(LOCAL_OEM_MODULE) $(LOCAL_PROPRIETARY_MODULE)))
7    LOCAL_USE_VNDK:=true
8    LOCAL_USE_VNDK_VENDOR:=true
9    # Note: no need to check LOCAL_MODULE_PATH* since LOCAL_[VENDOR|ODM|OEM]_MODULE is already
10    # set correctly before this is included.
11  endif
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
19endif
20endif
21
22# Verify LOCAL_USE_VNDK usage, and set LOCAL_SDK_VERSION if necessary
23
24ifdef 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
29endif
30ifdef 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:=
44    LOCAL_USE_VNDK_VENDOR:=
45    LOCAL_USE_VNDK_PRODUCT:=
46  endif
47endif
48
49