blob: 9b9814e3b80d96a54cf835db93482303aa6f833d [file] [log] [blame]
Nicolas Geoffrayffefd332014-11-25 12:52:26 +00001# 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
Yongqin Liud1d42e82014-05-07 12:41:24 +08004#
Nicolas Geoffrayffefd332014-11-25 12:52:26 +00005# Note: now only limited to the binaries that will be installed under system/bin directory
Yongqin Liud1d42e82014-05-07 12:41:24 +08006
Narayan Kamath4fb81222014-05-14 18:26:48 +01007# Create link to the one used depending on the target
8# configuration. Note that we require the TARGET_IS_64_BIT
9# check because 32 bit targets may not define TARGET_PREFER_32_BIT_APPS
10# et al. since those variables make no sense in that context.
Ian Rogerscf331d92014-06-25 00:04:30 -070011ifneq ($(LOCAL_IS_HOST_MODULE),true)
Nicolas Geoffrayffefd332014-11-25 12:52:26 +000012 my_symlink := $(addprefix $(TARGET_OUT)/bin/, $(LOCAL_MODULE))
Colin Cross744d33b2016-07-14 16:02:57 -070013 my_src_binary_name :=
Ian Rogerscf331d92014-06-25 00:04:30 -070014 ifeq ($(TARGET_IS_64_BIT),true)
Brian Carlstrom191e5982014-06-28 13:49:26 -070015 ifeq ($(TARGET_SUPPORTS_64_BIT_APPS)|$(TARGET_SUPPORTS_32_BIT_APPS),true|true)
16 # We support both 32 and 64 bit apps, so we will have to
17 # base our decision on whether the target prefers one or the
18 # other.
Narayan Kamath123854d2014-08-14 15:28:48 +010019 ifeq ($(TARGET_PREFER_32_BIT_APPS),true)
Colin Cross744d33b2016-07-14 16:02:57 -070020 my_src_binary_name := $(LOCAL_MODULE_STEM_32)
Brian Carlstrom191e5982014-06-28 13:49:26 -070021 else
Colin Cross744d33b2016-07-14 16:02:57 -070022 my_src_binary_name := $(LOCAL_MODULE_STEM_64)
Brian Carlstrom191e5982014-06-28 13:49:26 -070023 endif
24 else ifeq ($(TARGET_SUPPORTS_64_BIT_APPS),true)
25 # We support only 64 bit apps.
Colin Cross744d33b2016-07-14 16:02:57 -070026 my_src_binary_name := $(LOCAL_MODULE_STEM_64)
Ian Rogerscf331d92014-06-25 00:04:30 -070027 else
Brian Carlstrom191e5982014-06-28 13:49:26 -070028 # We support only 32 bit apps.
Colin Cross744d33b2016-07-14 16:02:57 -070029 my_src_binary_name := $(LOCAL_MODULE_STEM_32)
Ian Rogerscf331d92014-06-25 00:04:30 -070030 endif
Narayan Kamath79bc52a2014-06-17 16:36:08 +010031 else
Colin Cross744d33b2016-07-14 16:02:57 -070032 my_src_binary_name := $(LOCAL_MODULE_STEM_32)
Narayan Kamath79bc52a2014-06-17 16:36:08 +010033 endif
Yongqin Liud1d42e82014-05-07 12:41:24 +080034else
Nicolas Geoffrayffefd332014-11-25 12:52:26 +000035 my_symlink := $(addprefix $(HOST_OUT)/bin/, $(LOCAL_MODULE))
Colin Cross70e0ac62016-09-02 13:20:52 -070036 my_src_binary_name := $(LOCAL_MODULE_STEM_64)
Yongqin Liud1d42e82014-05-07 12:41:24 +080037endif
Yongqin Liud1d42e82014-05-07 12:41:24 +080038
Colin Cross744d33b2016-07-14 16:02:57 -070039$(call symlink-file,$(my_module_path)/$(my_src_binary_name),$(my_src_binary_name),$(my_symlink))
Yongqin Liud1d42e82014-05-07 12:41:24 +080040
Nicolas Geoffrayffefd332014-11-25 12:52:26 +000041# We need this so that the installed files could be picked up based on the
42# local module name
43ALL_MODULES.$(LOCAL_MODULE).INSTALLED += $(my_symlink)
44
45# Create the symlink when you run mm/mmm or "make <module_name>"
46$(LOCAL_MODULE) : $(my_symlink)
47
Yongqin Liud1d42e82014-05-07 12:41:24 +080048my_symlink :=