Dan Willemsen | 3bf15e7 | 2016-07-25 16:03:53 -0700 | [diff] [blame] | 1 | $(call record-module-type,HOST_EXECUTABLE) |
Dan Willemsen | ed635cf | 2015-09-04 15:08:08 -0700 | [diff] [blame] | 2 | LOCAL_IS_HOST_MODULE := true |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 3 | my_prefix := HOST_ |
Dan Willemsen | 057aaea | 2015-08-14 12:59:50 -0700 | [diff] [blame] | 4 | LOCAL_HOST_PREFIX := |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 5 | include $(BUILD_SYSTEM)/multilib.mk |
| 6 | |
Ying Wang | 6e85f8b | 2014-06-10 16:21:50 -0700 | [diff] [blame] | 7 | ifndef LOCAL_MODULE_HOST_ARCH |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 8 | ifndef my_module_multilib |
| 9 | # By default we only build host module for the first arch. |
| 10 | my_module_multilib := first |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 11 | endif |
Ying Wang | 966c1e0 | 2014-05-20 14:43:51 -0700 | [diff] [blame] | 12 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 13 | |
Tim Murray | 595d0db | 2014-09-03 15:01:46 -0700 | [diff] [blame] | 14 | ifeq ($(LOCAL_NO_FPIE),) |
| 15 | LOCAL_LDFLAGS += $(HOST_FPIE_FLAGS) |
| 16 | endif |
| 17 | |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 18 | ifeq ($(my_module_multilib),both) |
Dan Willemsen | 7fe992c | 2016-03-02 13:54:51 -0800 | [diff] [blame] | 19 | ifneq ($(LOCAL_MODULE_CLASS),NATIVE_TESTS) |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 20 | ifeq ($(LOCAL_MODULE_PATH_32)$(LOCAL_MODULE_STEM_32),) |
| 21 | $(error $(LOCAL_PATH): LOCAL_MODULE_STEM_32 or LOCAL_MODULE_PATH_32 is required for LOCAL_MULTILIB := both for module $(LOCAL_MODULE)) |
Ying Wang | 63d94fa | 2012-12-13 18:23:01 -0800 | [diff] [blame] | 22 | endif |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 23 | ifeq ($(LOCAL_MODULE_PATH_64)$(LOCAL_MODULE_STEM_64),) |
| 24 | $(error $(LOCAL_PATH): LOCAL_MODULE_STEM_64 or LOCAL_MODULE_PATH_64 is required for LOCAL_MULTILIB := both for module $(LOCAL_MODULE)) |
| 25 | endif |
Dan Willemsen | 7fe992c | 2016-03-02 13:54:51 -0800 | [diff] [blame] | 26 | endif |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 27 | else #!LOCAL_MULTILIB == both |
| 28 | LOCAL_NO_2ND_ARCH_MODULE_SUFFIX := true |
Ying Wang | 63d94fa | 2012-12-13 18:23:01 -0800 | [diff] [blame] | 29 | endif |
| 30 | |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 31 | LOCAL_2ND_ARCH_VAR_PREFIX := |
| 32 | include $(BUILD_SYSTEM)/module_arch_supported.mk |
Ying Wang | 63d94fa | 2012-12-13 18:23:01 -0800 | [diff] [blame] | 33 | |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 34 | ifeq ($(my_module_arch_supported),true) |
| 35 | include $(BUILD_SYSTEM)/host_executable_internal.mk |
| 36 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 37 | |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 38 | ifdef HOST_2ND_ARCH |
| 39 | LOCAL_2ND_ARCH_VAR_PREFIX := $(HOST_2ND_ARCH_VAR_PREFIX) |
| 40 | include $(BUILD_SYSTEM)/module_arch_supported.mk |
| 41 | ifeq ($(my_module_arch_supported),true) |
| 42 | # Build for HOST_2ND_ARCH |
| 43 | OVERRIDE_BUILT_MODULE_PATH := |
| 44 | LOCAL_BUILT_MODULE := |
| 45 | LOCAL_INSTALLED_MODULE := |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 46 | LOCAL_INTERMEDIATE_TARGETS := |
Ying Wang | 63d94fa | 2012-12-13 18:23:01 -0800 | [diff] [blame] | 47 | |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 48 | include $(BUILD_SYSTEM)/host_executable_internal.mk |
| 49 | endif |
| 50 | LOCAL_2ND_ARCH_VAR_PREFIX := |
| 51 | endif # HOST_2ND_ARCH |
| 52 | |
Dan Willemsen | 057aaea | 2015-08-14 12:59:50 -0700 | [diff] [blame] | 53 | ifdef HOST_CROSS_OS |
| 54 | my_prefix := HOST_CROSS_ |
| 55 | LOCAL_HOST_PREFIX := $(my_prefix) |
| 56 | include $(BUILD_SYSTEM)/module_arch_supported.mk |
| 57 | ifeq ($(my_module_arch_supported),true) |
| 58 | # Build for Windows |
| 59 | OVERRIDE_BUILT_MODULE_PATH := |
| 60 | # we don't want others using the cross compiled version |
| 61 | saved_LOCAL_BUILT_MODULE := $(LOCAL_BUILT_MODULE) |
| 62 | saved_LOCAL_INSTALLED_MODULE := $(LOCAL_INSTALLED_MODULE) |
Dan Willemsen | 9ecbf83 | 2016-02-05 16:20:19 -0800 | [diff] [blame] | 63 | saved_LOCAL_LDFLAGS := $(LOCAL_LDFLAGS) |
Dan Willemsen | 057aaea | 2015-08-14 12:59:50 -0700 | [diff] [blame] | 64 | LOCAL_BUILT_MODULE := |
| 65 | LOCAL_INSTALLED_MODULE := |
| 66 | LOCAL_INTERMEDIATE_TARGETS := |
| 67 | |
| 68 | ifeq ($(LOCAL_NO_FPIE),) |
| 69 | LOCAL_LDFLAGS += $(HOST_CROSS_FPIE_FLAGS) |
| 70 | endif |
| 71 | |
| 72 | include $(BUILD_SYSTEM)/host_executable_internal.mk |
Dan Willemsen | 9ecbf83 | 2016-02-05 16:20:19 -0800 | [diff] [blame] | 73 | LOCAL_LDFLAGS := $(saved_LOCAL_LDFLAGS) |
Dan Willemsen | 057aaea | 2015-08-14 12:59:50 -0700 | [diff] [blame] | 74 | LOCAL_BUILT_MODULE := $(saved_LOCAL_BUILT_MODULE) |
| 75 | LOCAL_INSTALLED_MODULE := $(saved_LOCAL_INSTALLED_MODULE) |
| 76 | endif |
Dan Willemsen | 9ecbf83 | 2016-02-05 16:20:19 -0800 | [diff] [blame] | 77 | |
| 78 | ifdef HOST_CROSS_2ND_ARCH |
| 79 | LOCAL_2ND_ARCH_VAR_PREFIX := $(HOST_CROSS_2ND_ARCH_VAR_PREFIX) |
| 80 | include $(BUILD_SYSTEM)/module_arch_supported.mk |
| 81 | ifeq ($(my_module_arch_supported),true) |
| 82 | OVERRIDE_BUILT_MODULE_PATH := |
| 83 | # we don't want others using the cross compiled version |
| 84 | saved_LOCAL_BUILT_MODULE := $(LOCAL_BUILT_MODULE) |
| 85 | saved_LOCAL_INSTALLED_MODULE := $(LOCAL_INSTALLED_MODULE) |
| 86 | saved_LOCAL_LDFLAGS := $(LOCAL_LDFLAGS) |
| 87 | LOCAL_BUILT_MODULE := |
| 88 | LOCAL_INSTALLED_MODULE := |
| 89 | LOCAL_INTERMEDIATE_TARGETS := |
| 90 | |
| 91 | ifeq ($(LOCAL_NO_FPIE),) |
| 92 | LOCAL_LDFLAGS += $(HOST_CROSS_FPIE_FLAGS) |
| 93 | endif |
| 94 | |
| 95 | include $(BUILD_SYSTEM)/host_executable_internal.mk |
| 96 | LOCAL_LDFLAGS := $(saved_LOCAL_LDFLAGS) |
| 97 | LOCAL_BUILT_MODULE := $(saved_LOCAL_BUILT_MODULE) |
| 98 | LOCAL_INSTALLED_MODULE := $(saved_LOCAL_INSTALLED_MODULE) |
| 99 | endif |
| 100 | LOCAL_2ND_ARCH_VAR_PREFIX := |
| 101 | endif |
Dan Willemsen | 057aaea | 2015-08-14 12:59:50 -0700 | [diff] [blame] | 102 | LOCAL_HOST_PREFIX := |
| 103 | endif |
| 104 | |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 105 | LOCAL_NO_2ND_ARCH_MODULE_SUFFIX := |
| 106 | my_module_arch_supported := |