blob: 198e3615bdca71213fdd14b51ae738cc721b0cfd [file] [log] [blame]
Vijay Venkatraman43a7f0c2016-12-20 17:50:21 +00001
Bowgo Tsaid624fa62017-11-14 23:42:30 +08002#Set LOCAL_USE_VNDK for modules going into 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
Yifan Hong3ca68182017-06-20 15:06:39 -07006 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
Jiyong Park003ea362017-11-15 18:22:14 +09008 # Note: no need to check LOCAL_MODULE_PATH* since LOCAL_[VENDOR|ODM|OEM]_MODULE is already
9 # set correctly before this is included.
Vijay Venkatraman43a7f0c2016-12-20 17:50:21 +000010 endif
11endif
12endif
13
Dan Willemsenbab0fa62016-11-18 14:05:39 -080014# Verify LOCAL_USE_VNDK usage, and set LOCAL_SDK_VERSION if necessary
15
16ifdef LOCAL_IS_HOST_MODULE
17 ifdef LOCAL_USE_VNDK
18 $(shell echo $(LOCAL_MODULE_MAKEFILE): $(LOCAL_MODULE): Do not use LOCAL_USE_VNDK with host modules >&2)
19 $(error done)
20 endif
21endif
22ifdef LOCAL_USE_VNDK
23 ifneq ($(LOCAL_USE_VNDK),true)
24 $(shell echo '$(LOCAL_MODULE_MAKEFILE): $(LOCAL_MODULE): LOCAL_USE_VNDK must be "true" or empty, not "$(LOCAL_USE_VNDK)"' >&2)
25 $(error done)
26 endif
27
28 ifdef LOCAL_SDK_VERSION
29 $(shell echo $(LOCAL_MODULE_MAKEFILE): $(LOCAL_MODULE): LOCAL_USE_VNDK must not be used with LOCAL_SDK_VERSION >&2)
30 $(error done)
31 endif
32
33 # If we're not using the VNDK, drop all restrictions
34 ifndef BOARD_VNDK_VERSION
35 LOCAL_USE_VNDK:=
36 endif
37endif
38