2009-03-04 04:28:42 +01:00
|
|
|
###########################################################
|
|
|
|
## Standard rules for copying files that are prebuilt
|
|
|
|
##
|
|
|
|
## Additional inputs from base_rules.make:
|
|
|
|
## None.
|
2009-08-06 22:02:19 +02:00
|
|
|
##
|
2009-03-04 04:28:42 +01:00
|
|
|
###########################################################
|
2016-07-26 01:03:53 +02:00
|
|
|
$(call record-module-type,PREBUILT)
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2011-09-15 21:00:52 +02:00
|
|
|
ifdef LOCAL_IS_HOST_MODULE
|
2014-04-17 19:03:35 +02:00
|
|
|
my_prefix := HOST_
|
2015-08-14 21:59:50 +02:00
|
|
|
LOCAL_HOST_PREFIX :=
|
2014-04-17 19:03:35 +02:00
|
|
|
else
|
|
|
|
my_prefix := TARGET_
|
2016-03-17 03:53:19 +01:00
|
|
|
|
|
|
|
ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
|
2016-05-31 22:59:38 +02:00
|
|
|
# Only support prebuilt shared and static libraries for translated arch
|
|
|
|
ifeq ($(filter SHARED_LIBRARIES STATIC_LIBRARIES,$(LOCAL_MODULE_CLASS)),)
|
|
|
|
LOCAL_MULTILIB := first
|
|
|
|
endif
|
2016-03-17 03:53:19 +01:00
|
|
|
endif
|
2014-04-17 19:03:35 +02:00
|
|
|
endif
|
2014-03-21 20:29:32 +01:00
|
|
|
|
|
|
|
include $(BUILD_SYSTEM)/multilib.mk
|
|
|
|
|
2014-05-16 19:38:43 +02:00
|
|
|
my_skip_non_preferred_arch :=
|
2014-03-21 20:29:32 +01:00
|
|
|
|
|
|
|
# check if first arch is supported
|
2014-10-22 03:34:30 +02:00
|
|
|
LOCAL_2ND_ARCH_VAR_PREFIX :=
|
2014-02-14 00:04:18 +01:00
|
|
|
include $(BUILD_SYSTEM)/module_arch_supported.mk
|
|
|
|
ifeq ($(my_module_arch_supported),true)
|
2014-03-21 20:29:32 +01:00
|
|
|
# first arch is supported
|
2014-02-14 00:04:18 +01:00
|
|
|
include $(BUILD_SYSTEM)/prebuilt_internal.mk
|
2014-05-16 19:38:43 +02:00
|
|
|
ifneq ($(my_module_multilib),both)
|
|
|
|
my_skip_non_preferred_arch := true
|
|
|
|
endif # $(my_module_multilib)
|
2014-12-02 00:56:19 +01:00
|
|
|
# For apps, we don't want to set up the prebuilt apk rule twice even if "LOCAL_MULTILIB := both".
|
|
|
|
ifeq (APPS,$(LOCAL_MODULE_CLASS))
|
|
|
|
my_skip_non_preferred_arch := true
|
|
|
|
endif
|
2014-05-16 19:38:43 +02:00
|
|
|
endif # $(my_module_arch_supported)
|
|
|
|
|
|
|
|
ifndef my_skip_non_preferred_arch
|
|
|
|
ifneq (,$($(my_prefix)2ND_ARCH))
|
2014-02-14 00:04:18 +01:00
|
|
|
# check if secondary arch is supported
|
2014-04-17 19:03:35 +02:00
|
|
|
LOCAL_2ND_ARCH_VAR_PREFIX := $($(my_prefix)2ND_ARCH_VAR_PREFIX)
|
2014-02-14 00:04:18 +01:00
|
|
|
include $(BUILD_SYSTEM)/module_arch_supported.mk
|
|
|
|
ifeq ($(my_module_arch_supported),true)
|
|
|
|
# secondary arch is supported
|
2014-05-16 19:38:43 +02:00
|
|
|
OVERRIDE_BUILT_MODULE_PATH :=
|
|
|
|
LOCAL_BUILT_MODULE :=
|
|
|
|
LOCAL_INSTALLED_MODULE :=
|
|
|
|
LOCAL_INTERMEDIATE_TARGETS :=
|
2014-02-14 00:04:18 +01:00
|
|
|
include $(BUILD_SYSTEM)/prebuilt_internal.mk
|
2014-05-16 19:38:43 +02:00
|
|
|
endif # $(my_module_arch_supported)
|
|
|
|
endif # $($(my_prefix)2ND_ARCH)
|
|
|
|
endif # $(my_skip_non_preferred_arch) not true
|
2014-01-24 22:34:51 +01:00
|
|
|
|
|
|
|
LOCAL_2ND_ARCH_VAR_PREFIX :=
|
2014-02-14 00:04:18 +01:00
|
|
|
|
2015-08-14 21:59:50 +02:00
|
|
|
ifdef LOCAL_IS_HOST_MODULE
|
|
|
|
ifdef HOST_CROSS_OS
|
Add NATIVE_TESTS class, move host native tests
Host native tests have been getting installed into
out/host/linux-x86/bin/..., but this pollutes the bin directory with a
lot of poorly named tests. Also, to support 32-bit and 64-bit tests, we
need to have different names with different suffixes. This causes
problems when tests expect to be named something specific (like gtest).
It's also convenient to store test data next to the test itself.
So with this change, native tests will be installed in
out/host/linux-x86/nativetest[64]/$(LOCAL_MODULE)/$(LOCAL_MODULE_STEM)
just like target tests get installed into /data/nativetest[64].
Implement this using a new NATIVE_TESTS class, which is like
EXECUTABLES, but sets up the install path differently, and configures
the rpath to load shared libraries with the proper relative path.
LOCAL_MODULE_RELATIVE_PATH can be used to control the directory name, it
will default to $(LOCAL_MODULE). This way multiple related tests can be
grouped together.
Target native tests also use NATIVE_TESTS now, but nothing should change
other than LOCAL_MODULE_RELATIVE_PATH can be used.
Change-Id: I535e42b1a6b21c5b8d6a580aa2f944d2be35e27d
2016-03-02 22:54:51 +01:00
|
|
|
ifneq (,$(filter EXECUTABLES STATIC_LIBRARIES SHARED_LIBRARIES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)))
|
2015-08-14 21:59:50 +02:00
|
|
|
my_prefix := HOST_CROSS_
|
|
|
|
LOCAL_HOST_PREFIX := $(my_prefix)
|
|
|
|
include $(BUILD_SYSTEM)/module_arch_supported.mk
|
|
|
|
ifeq ($(my_module_arch_supported),true)
|
|
|
|
# host cross compilation is supported
|
|
|
|
OVERRIDE_BUILT_MODULE_PATH :=
|
|
|
|
LOCAL_BUILT_MODULE :=
|
|
|
|
LOCAL_INSTALLED_MODULE :=
|
|
|
|
LOCAL_INTERMEDIATE_TARGETS :=
|
|
|
|
include $(BUILD_SYSTEM)/prebuilt_internal.mk
|
|
|
|
endif
|
|
|
|
LOCAL_HOST_PREFIX :=
|
|
|
|
endif
|
2016-02-09 23:55:13 +01:00
|
|
|
|
|
|
|
ifdef HOST_CROSS_2ND_ARCH
|
|
|
|
my_prefix := HOST_CROSS_
|
|
|
|
LOCAL_2ND_ARCH_VAR_PREFIX := $($(my_prefix)2ND_ARCH_VAR_PREFIX)
|
|
|
|
LOCAL_HOST_PREFIX := $(my_prefix)
|
|
|
|
include $(BUILD_SYSTEM)/module_arch_supported.mk
|
|
|
|
ifeq ($(my_module_arch_supported),true)
|
|
|
|
OVERRIDE_BUILT_MODULE_PATH :=
|
|
|
|
LOCAL_BUILT_MODULE :=
|
|
|
|
LOCAL_INSTALLED_MODULE :=
|
|
|
|
LOCAL_INTERMEDIATE_TARGETS :=
|
|
|
|
include $(BUILD_SYSTEM)/prebuilt_internal.mk
|
|
|
|
endif
|
|
|
|
LOCAL_HOST_PREFIX :=
|
|
|
|
LOCAL_2ND_ARCH_VAR_PREFIX :=
|
|
|
|
endif
|
2015-08-14 21:59:50 +02:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2014-02-14 00:04:18 +01:00
|
|
|
my_module_arch_supported :=
|