blob: befbc59114782b692f055354af0bd825be278ee4 [file] [log] [blame]
Vijay Venkatraman43a7f0c2016-12-20 17:50:21 +00001
Justin Yun2bfe0a12020-01-20 18:57:01 +09002#Set LOCAL_USE_VNDK for modules going into product, vendor or odm partition, except for host modules
Vijay Venkatraman43a7f0c2016-12-20 17:50:21 +00003#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
Justin Yundd540172020-01-20 07:39:41 +00006 ifneq (,$(filter true,$(LOCAL_VENDOR_MODULE) $(LOCAL_ODM_MODULE) $(LOCAL_OEM_MODULE) $(LOCAL_PROPRIETARY_MODULE)))
Vijay Venkatraman43a7f0c2016-12-20 17:50:21 +00007 LOCAL_USE_VNDK:=true
Justin Yun69f71912021-03-08 19:31:37 +09008 LOCAL_USE_VNDK_VENDOR:=true
Jiyong Park003ea362017-11-15 18:22:14 +09009 # Note: no need to check LOCAL_MODULE_PATH* since LOCAL_[VENDOR|ODM|OEM]_MODULE is already
10 # set correctly before this is included.
Vijay Venkatraman43a7f0c2016-12-20 17:50:21 +000011 endif
Justin Yun2bfe0a12020-01-20 18:57:01 +090012 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 Venkatraman43a7f0c2016-12-20 17:50:21 +000019endif
20endif
21
Dan Willemsenbab0fa62016-11-18 14:05:39 -080022# 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:=
Justin Yun69f71912021-03-08 19:31:37 +090044 LOCAL_USE_VNDK_VENDOR:=
Justin Yun2bfe0a12020-01-20 18:57:01 +090045 LOCAL_USE_VNDK_PRODUCT:=
Dan Willemsenbab0fa62016-11-18 14:05:39 -080046 endif
Dan Willemsenbab0fa62016-11-18 14:05:39 -080047endif
48