OSDN Git Service

Update Security String to 2017-05-05 on nyc-dev
[android-x86/build.git] / core / package.mk
1 # We don't automatically set up rules to build packages for both
2 # TARGET_ARCH and TARGET_2ND_ARCH.
3 # To build it for TARGET_2ND_ARCH in a 64bit product, use "LOCAL_MULTILIB := 32".
4
5 my_prefix := TARGET_
6 include $(BUILD_SYSTEM)/multilib.mk
7
8 ifeq ($(TARGET_SUPPORTS_32_BIT_APPS)|$(TARGET_SUPPORTS_64_BIT_APPS),true|true)
9   # packages default to building for either architecture,
10   # the preferred if its supported, otherwise the non-preferred.
11 else ifeq ($(TARGET_SUPPORTS_64_BIT_APPS),true)
12   # only 64-bit apps supported
13   ifeq ($(filter $(my_module_multilib),64 both first),$(my_module_multilib))
14     # if my_module_multilib was 64, both, first, or unset, build for 64-bit
15     my_module_multilib := 64
16   else
17     # otherwise don't build this app
18     my_module_multilib := none
19   endif
20 else
21   # only 32-bit apps supported
22   ifeq ($(filter $(my_module_multilib),32 both),$(my_module_multilib))
23     # if my_module_multilib was 32, both, or unset, build for 32-bit
24     my_module_multilib := 32
25   else ifeq ($(my_module_multilib),first)
26     ifndef TARGET_IS_64_BIT
27       # if my_module_multilib was first and this is a 32-bit build, build for
28       # 32-bit
29       my_module_multilib := 32
30     else
31       # if my_module_multilib was first and this is a 64-bit build, don't build
32       # this app
33       my_module_multilib := none
34     endif
35   else
36     # my_module_mulitlib was 64 or none, don't build this app
37     my_module_multilib := none
38   endif
39 endif
40
41 LOCAL_NO_2ND_ARCH_MODULE_SUFFIX := true
42
43 # if TARGET_PREFER_32_BIT_APPS is set, try to build 32-bit first
44 ifdef TARGET_2ND_ARCH
45 ifeq ($(TARGET_PREFER_32_BIT_APPS),true)
46 LOCAL_2ND_ARCH_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX)
47 else
48 LOCAL_2ND_ARCH_VAR_PREFIX :=
49 endif
50 endif
51
52 # check if preferred arch is supported
53 include $(BUILD_SYSTEM)/module_arch_supported.mk
54 ifeq ($(my_module_arch_supported),true)
55 # first arch is supported
56 include $(BUILD_SYSTEM)/package_internal.mk
57 else ifneq (,$(TARGET_2ND_ARCH))
58 # check if the non-preferred arch is the primary or secondary
59 ifeq ($(TARGET_PREFER_32_BIT_APPS),true)
60 LOCAL_2ND_ARCH_VAR_PREFIX :=
61 else
62 LOCAL_2ND_ARCH_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX)
63 endif
64
65 # check if non-preferred arch is supported
66 include $(BUILD_SYSTEM)/module_arch_supported.mk
67 ifeq ($(my_module_arch_supported),true)
68 # secondary arch is supported
69 include $(BUILD_SYSTEM)/package_internal.mk
70 endif
71 endif # TARGET_2ND_ARCH
72
73 LOCAL_2ND_ARCH_VAR_PREFIX :=
74 LOCAL_NO_2ND_ARCH_MODULE_SUFFIX :=
75
76 my_module_arch_supported :=