Home | History | Annotate | Download | only in core
      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. 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.
     11 ifneq ($(LOCAL_IS_HOST_MODULE),true)
     12   my_symlink := $(addprefix $(TARGET_OUT)/bin/, $(LOCAL_MODULE))
     13   my_src_binary_name :=
     14   ifeq ($(TARGET_IS_64_BIT),true)
     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.
     19       ifeq ($(TARGET_PREFER_32_BIT_APPS),true)
     20         my_src_binary_name := $(LOCAL_MODULE_STEM_32)
     21       else
     22         my_src_binary_name := $(LOCAL_MODULE_STEM_64)
     23       endif
     24     else ifeq ($(TARGET_SUPPORTS_64_BIT_APPS),true)
     25       # We support only 64 bit apps.
     26       my_src_binary_name := $(LOCAL_MODULE_STEM_64)
     27     else
     28       # We support only 32 bit apps.
     29       my_src_binary_name := $(LOCAL_MODULE_STEM_32)
     30     endif
     31   else
     32     my_src_binary_name := $(LOCAL_MODULE_STEM_32)
     33   endif
     34 else
     35   my_symlink := $(addprefix $(HOST_OUT)/bin/, $(LOCAL_MODULE))
     36   my_src_binary_name := $(LOCAL_MODULE_STEM_64)
     37 endif
     38 
     39 $(call symlink-file,$(my_module_path)/$(my_src_binary_name),$(my_src_binary_name),$(my_symlink))
     40 
     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 
     48 my_symlink :=
     49