blob: fa49e402081268c709ed620e7df93c23b7208985 [file] [log] [blame]
Yongqin Liud1d42e82014-05-07 12:41:24 +08001# include this makefile to create the LOCAL_MODULE symlink to the primary version binary.
2# but this requires the primary version name specified via LOCAL_MODULE_STEM_32 or LOCAL_MODULE_STEM_64,
3# and different with the LOCAL_MODULE value
4#
5# Note: now only limited to the binaries that will be installed under system/bin directory
6
7my_symlink := $(addprefix $(TARGET_OUT)/bin/, $(LOCAL_MODULE))
Narayan Kamath4fb81222014-05-14 18:26:48 +01008# Create link to the one used depending on the target
9# configuration. Note that we require the TARGET_IS_64_BIT
10# check because 32 bit targets may not define TARGET_PREFER_32_BIT_APPS
11# et al. since those variables make no sense in that context.
12ifeq ($(TARGET_IS_64_BIT),true)
Narayan Kamath79bc52a2014-06-17 16:36:08 +010013ifeq ($(TARGET_SUPPORTS_64_BIT_APPS)|$(TARGET_SUPPORTS_32_BIT_APPS),true|true)
14 # We support both 32 and 64 bit apps, so we will have to
15 # base our decision on whether the target prefers one or the
16 # other.
17 ifneq ($(TARGET_PREFER_32_BIT_APPS),true)
18 $(my_symlink): PRIVATE_SRC_BINARY_NAME := $(LOCAL_MODULE_STEM_32)
19 else
20 $(my_symlink): PRIVATE_SRC_BINARY_NAME := $(LOCAL_MODULE_STEM_64)
21 endif
22else ifeq ($(TARGET_SUPPORTS_64_BIT_APPS),true)
23 # We support only 64 bit apps.
Yongqin Liud1d42e82014-05-07 12:41:24 +080024 $(my_symlink): PRIVATE_SRC_BINARY_NAME := $(LOCAL_MODULE_STEM_64)
25else
Narayan Kamath79bc52a2014-06-17 16:36:08 +010026 # We support only 32 bit apps.
Yongqin Liud1d42e82014-05-07 12:41:24 +080027 $(my_symlink): PRIVATE_SRC_BINARY_NAME := $(LOCAL_MODULE_STEM_32)
28endif
Narayan Kamath4fb81222014-05-14 18:26:48 +010029else
30 $(my_symlink): PRIVATE_SRC_BINARY_NAME := $(LOCAL_MODULE_STEM_32)
31endif
32
Yongqin Liud1d42e82014-05-07 12:41:24 +080033
34$(my_symlink): $(LOCAL_INSTALLED_MODULE) $(LOCAL_MODULE_MAKEFILE)
35 @echo "Symlink: $@ -> $(PRIVATE_SRC_BINARY_NAME)"
36 @mkdir -p $(dir $@)
37 @rm -rf $@
38 $(hide) ln -sf $(PRIVATE_SRC_BINARY_NAME) $@
39
40# We need this so that the installed files could be picked up based on the
41# local module name
42ALL_MODULES.$(LOCAL_MODULE).INSTALLED += $(my_symlink)
43
44my_symlink :=