• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Copyright (C) 2014 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17include $(CLEAR_VARS)
18
19LOCAL_MODULE := $(module)
20LOCAL_MODULE_TAGS := $(module_tag)
21LOCAL_MULTILIB := $($(module)_multilib)
22ifeq ($(LOCAL_MULTILIB),both)
23ifneq ($(build_target),$(filter $(build_target),SHARED_LIBRARY STATIC_LIBRARY))
24  LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
25  LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
26endif
27endif
28
29ifeq ($(build_type),target)
30  include $(LLVM_DEVICE_BUILD_MK)
31else
32  include $(LLVM_HOST_BUILD_MK)
33endif
34
35LOCAL_ADDITIONAL_DEPENDENCIES += \
36    $(LOCAL_PATH)/Android.mk \
37    $(LOCAL_PATH)/Android.build.mk \
38
39LOCAL_CFLAGS += \
40    $(libbacktrace_common_cflags) \
41    $($(module)_cflags) \
42    $($(module)_cflags_$(build_type)) \
43
44LOCAL_CLANG_CFLAGS += \
45    $(libbacktrace_common_clang_cflags) \
46
47LOCAL_CONLYFLAGS += \
48    $(libbacktrace_common_conlyflags) \
49    $($(module)_conlyflags) \
50    $($(module)_conlyflags_$(build_type)) \
51
52LOCAL_CPPFLAGS += \
53    $(libbacktrace_common_cppflags) \
54    $($(module)_cppflags) \
55    $($(module)_cppflags_$(build_type)) \
56
57LOCAL_C_INCLUDES += \
58    $(libbacktrace_common_c_includes) \
59    $($(module)_c_includes) \
60    $($(module)_c_includes_$(build_type)) \
61
62LOCAL_SRC_FILES := \
63    $($(module)_src_files) \
64    $($(module)_src_files_$(build_type)) \
65
66LOCAL_STATIC_LIBRARIES += \
67    $($(module)_static_libraries) \
68    $($(module)_static_libraries_$(build_type)) \
69
70LOCAL_SHARED_LIBRARIES += \
71    $($(module)_shared_libraries) \
72    $($(module)_shared_libraries_$(build_type)) \
73
74LOCAL_LDLIBS += \
75    $($(module)_ldlibs) \
76    $($(module)_ldlibs_$(build_type)) \
77
78LOCAL_STRIP_MODULE := $($(module)_strip_module)
79
80ifeq ($(build_type),target)
81  include $(BUILD_$(build_target))
82endif
83
84ifeq ($(build_type),host)
85  # Only build if host builds are supported.
86  ifeq ($(build_host),true)
87    # -fno-omit-frame-pointer should be set for host build. Because currently
88    # libunwind can't recognize .debug_frame using dwarf version 4, and it relies
89    # on stack frame pointer to do unwinding on x86.
90    # $(LLVM_HOST_BUILD_MK) overwrites -fno-omit-frame-pointer. so the below line
91    # must be after the include.
92    LOCAL_CFLAGS += -Wno-extern-c-compat -fno-omit-frame-pointer
93    include $(BUILD_HOST_$(build_target))
94  endif
95endif
96