blob: fea0bef64b1b46d41f136c4b19bb5d4ce44a425c [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
Elliott Hughes9b824d52020-04-17 15:46:55 -07008# configuration.
Ian Rogerscf331d92014-06-25 00:04:30 -07009ifneq ($(LOCAL_IS_HOST_MODULE),true)
Nicolas Geoffrayffefd332014-11-25 12:52:26 +000010 my_symlink := $(addprefix $(TARGET_OUT)/bin/, $(LOCAL_MODULE))
Colin Cross744d33b2016-07-14 16:02:57 -070011 my_src_binary_name :=
Ian Rogerscf331d92014-06-25 00:04:30 -070012 ifeq ($(TARGET_IS_64_BIT),true)
Brian Carlstrom191e5982014-06-28 13:49:26 -070013 ifeq ($(TARGET_SUPPORTS_64_BIT_APPS)|$(TARGET_SUPPORTS_32_BIT_APPS),true|true)
Elliott Hughes9b824d52020-04-17 15:46:55 -070014 my_src_binary_name := $(LOCAL_MODULE_STEM_64)
Brian Carlstrom191e5982014-06-28 13:49:26 -070015 else ifeq ($(TARGET_SUPPORTS_64_BIT_APPS),true)
16 # We support only 64 bit apps.
Colin Cross744d33b2016-07-14 16:02:57 -070017 my_src_binary_name := $(LOCAL_MODULE_STEM_64)
Ian Rogerscf331d92014-06-25 00:04:30 -070018 else
Brian Carlstrom191e5982014-06-28 13:49:26 -070019 # We support only 32 bit apps.
Colin Cross744d33b2016-07-14 16:02:57 -070020 my_src_binary_name := $(LOCAL_MODULE_STEM_32)
Ian Rogerscf331d92014-06-25 00:04:30 -070021 endif
Narayan Kamath79bc52a2014-06-17 16:36:08 +010022 else
Colin Cross744d33b2016-07-14 16:02:57 -070023 my_src_binary_name := $(LOCAL_MODULE_STEM_32)
Narayan Kamath79bc52a2014-06-17 16:36:08 +010024 endif
Yongqin Liud1d42e82014-05-07 12:41:24 +080025else
Nicolas Geoffrayffefd332014-11-25 12:52:26 +000026 my_symlink := $(addprefix $(HOST_OUT)/bin/, $(LOCAL_MODULE))
Colin Cross70e0ac62016-09-02 13:20:52 -070027 my_src_binary_name := $(LOCAL_MODULE_STEM_64)
Yongqin Liud1d42e82014-05-07 12:41:24 +080028endif
Yongqin Liud1d42e82014-05-07 12:41:24 +080029
Colin Cross744d33b2016-07-14 16:02:57 -070030$(call symlink-file,$(my_module_path)/$(my_src_binary_name),$(my_src_binary_name),$(my_symlink))
Yongqin Liud1d42e82014-05-07 12:41:24 +080031
Nicolas Geoffrayffefd332014-11-25 12:52:26 +000032# We need this so that the installed files could be picked up based on the
33# local module name
Yo Chiang58142472020-05-08 15:38:46 +080034ALL_MODULES.$(my_register_name).INSTALLED += $(my_symlink)
Nicolas Geoffrayffefd332014-11-25 12:52:26 +000035
36# Create the symlink when you run mm/mmm or "make <module_name>"
37$(LOCAL_MODULE) : $(my_symlink)
38
Yongqin Liud1d42e82014-05-07 12:41:24 +080039my_symlink :=