blob: 2f04d0dab658cce288efe4f9a537ceaa449e97b0 [file] [log] [blame]
Yongqin Liud1d42e82014-05-07 12:41:24 +08001# 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
7my_symlink := $(addprefix $(TARGET_OUT)/bin/, $(LOCAL_MODULE))
Narayan Kamath4fb81222014-05-14 18:26:48 +01008# Create link to the one used depending on the target
9# configuration. Note that we require the TARGET_IS_64_BIT
10# check because 32 bit targets may not define TARGET_PREFER_32_BIT_APPS
11# et al. since those variables make no sense in that context.
12ifeq ($(TARGET_IS_64_BIT),true)
Yongqin Liud1d42e82014-05-07 12:41:24 +080013ifneq ($(TARGET_PREFER_32_BIT_APPS),true)
14 $(my_symlink): PRIVATE_SRC_BINARY_NAME := $(LOCAL_MODULE_STEM_64)
15else
16 $(my_symlink): PRIVATE_SRC_BINARY_NAME := $(LOCAL_MODULE_STEM_32)
17endif
Narayan Kamath4fb81222014-05-14 18:26:48 +010018else
19 $(my_symlink): PRIVATE_SRC_BINARY_NAME := $(LOCAL_MODULE_STEM_32)
20endif
21
Yongqin Liud1d42e82014-05-07 12:41:24 +080022
23$(my_symlink): $(LOCAL_INSTALLED_MODULE) $(LOCAL_MODULE_MAKEFILE)
24 @echo "Symlink: $@ -> $(PRIVATE_SRC_BINARY_NAME)"
25 @mkdir -p $(dir $@)
26 @rm -rf $@
27 $(hide) ln -sf $(PRIVATE_SRC_BINARY_NAME) $@
28
29# We need this so that the installed files could be picked up based on the
30# local module name
31ALL_MODULES.$(LOCAL_MODULE).INSTALLED += $(my_symlink)
32
33my_symlink :=