• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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    # Note: no need to check LOCAL_MODULE_PATH* since LOCAL_[VENDOR|ODM|OEM]_MODULE is already
9    # set correctly before this is included.
10  endif
11  ifdef PRODUCT_PRODUCT_VNDK_VERSION
12    # Product modules also use VNDK when PRODUCT_PRODUCT_VNDK_VERSION is defined.
13    ifeq (true,$(LOCAL_PRODUCT_MODULE))
14      LOCAL_USE_VNDK:=true
15      LOCAL_USE_VNDK_PRODUCT:=true
16    endif
17  endif
18endif
19endif
20
21# Verify LOCAL_USE_VNDK usage, and set LOCAL_SDK_VERSION if necessary
22
23ifdef LOCAL_IS_HOST_MODULE
24  ifdef LOCAL_USE_VNDK
25    $(shell echo $(LOCAL_MODULE_MAKEFILE): $(LOCAL_MODULE): Do not use LOCAL_USE_VNDK with host modules >&2)
26    $(error done)
27  endif
28endif
29ifdef LOCAL_USE_VNDK
30  ifneq ($(LOCAL_USE_VNDK),true)
31    $(shell echo '$(LOCAL_MODULE_MAKEFILE): $(LOCAL_MODULE): LOCAL_USE_VNDK must be "true" or empty, not "$(LOCAL_USE_VNDK)"' >&2)
32    $(error done)
33  endif
34
35  ifdef LOCAL_SDK_VERSION
36    $(shell echo $(LOCAL_MODULE_MAKEFILE): $(LOCAL_MODULE): LOCAL_USE_VNDK must not be used with LOCAL_SDK_VERSION >&2)
37    $(error done)
38  endif
39
40  # If we're not using the VNDK, drop all restrictions
41  ifndef BOARD_VNDK_VERSION
42    LOCAL_USE_VNDK:=
43    LOCAL_USE_VNDK_PRODUCT:=
44  endif
45endif
46
47