blob: 2467f3e6365b3e402a8d248592ba7484266fb279 [file] [log] [blame]
Christopher Ferris04b1e8c2014-01-30 01:13:33 -08001#
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)
Ian Rogers5af80aa2014-06-17 01:50:25 -070021LOCAL_MULTILIB := $($(module)_multilib)
Christopher Ferris2c43cff2015-03-26 19:18:36 -070022ifeq ($(LOCAL_MULTILIB),both)
Calin Juravle28042b52015-06-08 14:30:52 +010023ifneq ($(build_target),$(filter $(build_target),SHARED_LIBRARY STATIC_LIBRARY))
Christopher Ferris2c43cff2015-03-26 19:18:36 -070024 LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
25 LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
26endif
27endif
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080028
Yabin Cuiaf8ac0c2015-09-24 17:46:27 -070029ifeq ($(build_type),target)
30 include $(LLVM_DEVICE_BUILD_MK)
31else
32 include $(LLVM_HOST_BUILD_MK)
33endif
34
35LOCAL_ADDITIONAL_DEPENDENCIES += \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080036 $(LOCAL_PATH)/Android.mk \
37 $(LOCAL_PATH)/Android.build.mk \
38
Yabin Cuiaf8ac0c2015-09-24 17:46:27 -070039LOCAL_CFLAGS += \
Christopher Ferris2c43cff2015-03-26 19:18:36 -070040 $(libbacktrace_common_cflags) \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080041 $($(module)_cflags) \
42 $($(module)_cflags_$(build_type)) \
43
Stephen Hines035e9ba2015-03-31 09:39:20 -070044LOCAL_CLANG_CFLAGS += \
45 $(libbacktrace_common_clang_cflags) \
46
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080047LOCAL_CONLYFLAGS += \
Christopher Ferris2c43cff2015-03-26 19:18:36 -070048 $(libbacktrace_common_conlyflags) \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080049 $($(module)_conlyflags) \
50 $($(module)_conlyflags_$(build_type)) \
51
52LOCAL_CPPFLAGS += \
Christopher Ferris2c43cff2015-03-26 19:18:36 -070053 $(libbacktrace_common_cppflags) \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080054 $($(module)_cppflags) \
55 $($(module)_cppflags_$(build_type)) \
56
Yabin Cuiaf8ac0c2015-09-24 17:46:27 -070057LOCAL_C_INCLUDES += \
Christopher Ferris2c43cff2015-03-26 19:18:36 -070058 $(libbacktrace_common_c_includes) \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080059 $($(module)_c_includes) \
60 $($(module)_c_includes_$(build_type)) \
61
62LOCAL_SRC_FILES := \
63 $($(module)_src_files) \
64 $($(module)_src_files_$(build_type)) \
65
Yabin Cuiaf8ac0c2015-09-24 17:46:27 -070066LOCAL_STATIC_LIBRARIES += \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080067 $($(module)_static_libraries) \
68 $($(module)_static_libraries_$(build_type)) \
69
Yabin Cuiaf8ac0c2015-09-24 17:46:27 -070070LOCAL_SHARED_LIBRARIES += \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080071 $($(module)_shared_libraries) \
72 $($(module)_shared_libraries_$(build_type)) \
73
Yabin Cuiaf8ac0c2015-09-24 17:46:27 -070074LOCAL_LDLIBS += \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080075 $($(module)_ldlibs) \
76 $($(module)_ldlibs_$(build_type)) \
77
Yabin Cui9e402bb2015-09-22 04:46:57 +000078LOCAL_STRIP_MODULE := $($(module)_strip_module)
79
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080080ifeq ($(build_type),target)
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080081 include $(BUILD_$(build_target))
82endif
83
84ifeq ($(build_type),host)
85 # Only build if host builds are supported.
86 ifeq ($(build_host),true)
Yabin Cui9e1dd672015-09-22 21:57:43 -070087 # -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
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080093 include $(BUILD_HOST_$(build_target))
94 endif
95endif