1# 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
7# Create link to the one used depending on the target
8# configuration.
9ifneq ($(LOCAL_IS_HOST_MODULE),true)
10  my_symlink := $(addprefix $(TARGET_OUT)/bin/, $(LOCAL_MODULE))
11  my_src_binary_name :=
12  ifeq ($(TARGET_IS_64_BIT),true)
13    ifeq ($(TARGET_SUPPORTS_64_BIT_APPS)|$(TARGET_SUPPORTS_32_BIT_APPS),true|true)
14      my_src_binary_name := $(LOCAL_MODULE_STEM_64)
15    else ifeq ($(TARGET_SUPPORTS_64_BIT_APPS),true)
16      # We support only 64 bit apps.
17      my_src_binary_name := $(LOCAL_MODULE_STEM_64)
18    else
19      # We support only 32 bit apps.
20      my_src_binary_name := $(LOCAL_MODULE_STEM_32)
21    endif
22  else
23    my_src_binary_name := $(LOCAL_MODULE_STEM_32)
24  endif
25else
26  my_symlink := $(addprefix $(HOST_OUT)/bin/, $(LOCAL_MODULE))
27  my_src_binary_name := $(LOCAL_MODULE_STEM_64)
28endif
29
30$(call symlink-file,$(my_module_path)/$(my_src_binary_name),$(my_src_binary_name),$(my_symlink))
31
32# We need this so that the installed files could be picked up based on the
33# local module name
34ALL_MODULES.$(my_register_name).INSTALLED += $(my_symlink)
35
36# Create the symlink when you run mm/mmm or "make <module_name>"
37$(LOCAL_MODULE) : $(my_symlink)
38
39my_symlink :=
40