| Nicolas Geoffray | ffefd33 | 2014-11-25 12:52:26 +0000 | [diff] [blame] | 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 | 
| Yongqin Liu | d1d42e8 | 2014-05-07 12:41:24 +0800 | [diff] [blame] | 4 | # | 
| Nicolas Geoffray | ffefd33 | 2014-11-25 12:52:26 +0000 | [diff] [blame] | 5 | # Note: now only limited to the binaries that will be installed under system/bin directory | 
| Yongqin Liu | d1d42e8 | 2014-05-07 12:41:24 +0800 | [diff] [blame] | 6 |  | 
| Narayan Kamath | 4fb8122 | 2014-05-14 18:26:48 +0100 | [diff] [blame] | 7 | # 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 Rogers | cf331d9 | 2014-06-25 00:04:30 -0700 | [diff] [blame] | 11 | ifneq ($(LOCAL_IS_HOST_MODULE),true) | 
| Nicolas Geoffray | ffefd33 | 2014-11-25 12:52:26 +0000 | [diff] [blame] | 12 | my_symlink := $(addprefix $(TARGET_OUT)/bin/, $(LOCAL_MODULE)) | 
| Colin Cross | 744d33b | 2016-07-14 16:02:57 -0700 | [diff] [blame] | 13 | my_src_binary_name := | 
| Ian Rogers | cf331d9 | 2014-06-25 00:04:30 -0700 | [diff] [blame] | 14 | ifeq ($(TARGET_IS_64_BIT),true) | 
| Brian Carlstrom | 191e598 | 2014-06-28 13:49:26 -0700 | [diff] [blame] | 15 | 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 Kamath | 123854d | 2014-08-14 15:28:48 +0100 | [diff] [blame] | 19 | ifeq ($(TARGET_PREFER_32_BIT_APPS),true) | 
| Colin Cross | 744d33b | 2016-07-14 16:02:57 -0700 | [diff] [blame] | 20 | my_src_binary_name := $(LOCAL_MODULE_STEM_32) | 
| Brian Carlstrom | 191e598 | 2014-06-28 13:49:26 -0700 | [diff] [blame] | 21 | else | 
| Colin Cross | 744d33b | 2016-07-14 16:02:57 -0700 | [diff] [blame] | 22 | my_src_binary_name := $(LOCAL_MODULE_STEM_64) | 
| Brian Carlstrom | 191e598 | 2014-06-28 13:49:26 -0700 | [diff] [blame] | 23 | endif | 
|  | 24 | else ifeq ($(TARGET_SUPPORTS_64_BIT_APPS),true) | 
|  | 25 | # We support only 64 bit apps. | 
| Colin Cross | 744d33b | 2016-07-14 16:02:57 -0700 | [diff] [blame] | 26 | my_src_binary_name := $(LOCAL_MODULE_STEM_64) | 
| Ian Rogers | cf331d9 | 2014-06-25 00:04:30 -0700 | [diff] [blame] | 27 | else | 
| Brian Carlstrom | 191e598 | 2014-06-28 13:49:26 -0700 | [diff] [blame] | 28 | # We support only 32 bit apps. | 
| Colin Cross | 744d33b | 2016-07-14 16:02:57 -0700 | [diff] [blame] | 29 | my_src_binary_name := $(LOCAL_MODULE_STEM_32) | 
| Ian Rogers | cf331d9 | 2014-06-25 00:04:30 -0700 | [diff] [blame] | 30 | endif | 
| Narayan Kamath | 79bc52a | 2014-06-17 16:36:08 +0100 | [diff] [blame] | 31 | else | 
| Colin Cross | 744d33b | 2016-07-14 16:02:57 -0700 | [diff] [blame] | 32 | my_src_binary_name := $(LOCAL_MODULE_STEM_32) | 
| Narayan Kamath | 79bc52a | 2014-06-17 16:36:08 +0100 | [diff] [blame] | 33 | endif | 
| Yongqin Liu | d1d42e8 | 2014-05-07 12:41:24 +0800 | [diff] [blame] | 34 | else | 
| Nicolas Geoffray | ffefd33 | 2014-11-25 12:52:26 +0000 | [diff] [blame] | 35 | my_symlink := $(addprefix $(HOST_OUT)/bin/, $(LOCAL_MODULE)) | 
| Colin Cross | 70e0ac6 | 2016-09-02 13:20:52 -0700 | [diff] [blame] | 36 | my_src_binary_name := $(LOCAL_MODULE_STEM_64) | 
| Yongqin Liu | d1d42e8 | 2014-05-07 12:41:24 +0800 | [diff] [blame] | 37 | endif | 
| Yongqin Liu | d1d42e8 | 2014-05-07 12:41:24 +0800 | [diff] [blame] | 38 |  | 
| Colin Cross | 744d33b | 2016-07-14 16:02:57 -0700 | [diff] [blame] | 39 | $(call symlink-file,$(my_module_path)/$(my_src_binary_name),$(my_src_binary_name),$(my_symlink)) | 
| Yongqin Liu | d1d42e8 | 2014-05-07 12:41:24 +0800 | [diff] [blame] | 40 |  | 
| Nicolas Geoffray | ffefd33 | 2014-11-25 12:52:26 +0000 | [diff] [blame] | 41 | # We need this so that the installed files could be picked up based on the | 
|  | 42 | # local module name | 
|  | 43 | ALL_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 Liu | d1d42e8 | 2014-05-07 12:41:24 +0800 | [diff] [blame] | 48 | my_symlink := |