Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 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 | |
| 17 | include $(CLEAR_VARS) |
| 18 | |
| 19 | LOCAL_MODULE := $(module) |
| 20 | LOCAL_MODULE_TAGS := $(module_tag) |
Ian Rogers | 5af80aa | 2014-06-17 01:50:25 -0700 | [diff] [blame] | 21 | LOCAL_MULTILIB := $($(module)_multilib) |
Christopher Ferris | 2c43cff | 2015-03-26 19:18:36 -0700 | [diff] [blame] | 22 | ifeq ($(LOCAL_MULTILIB),both) |
Calin Juravle | 28042b5 | 2015-06-08 14:30:52 +0100 | [diff] [blame] | 23 | ifneq ($(build_target),$(filter $(build_target),SHARED_LIBRARY STATIC_LIBRARY)) |
Christopher Ferris | 2c43cff | 2015-03-26 19:18:36 -0700 | [diff] [blame] | 24 | LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 |
| 25 | LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 |
| 26 | endif |
| 27 | endif |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 28 | |
Yabin Cui | af8ac0c | 2015-09-24 17:46:27 -0700 | [diff] [blame] | 29 | ifeq ($(build_type),target) |
| 30 | include $(LLVM_DEVICE_BUILD_MK) |
| 31 | else |
| 32 | include $(LLVM_HOST_BUILD_MK) |
| 33 | endif |
| 34 | |
| 35 | LOCAL_ADDITIONAL_DEPENDENCIES += \ |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 36 | $(LOCAL_PATH)/Android.mk \ |
| 37 | $(LOCAL_PATH)/Android.build.mk \ |
| 38 | |
Yabin Cui | af8ac0c | 2015-09-24 17:46:27 -0700 | [diff] [blame] | 39 | LOCAL_CFLAGS += \ |
Christopher Ferris | 2c43cff | 2015-03-26 19:18:36 -0700 | [diff] [blame] | 40 | $(libbacktrace_common_cflags) \ |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 41 | $($(module)_cflags) \ |
| 42 | $($(module)_cflags_$(build_type)) \ |
| 43 | |
Stephen Hines | 035e9ba | 2015-03-31 09:39:20 -0700 | [diff] [blame] | 44 | LOCAL_CLANG_CFLAGS += \ |
| 45 | $(libbacktrace_common_clang_cflags) \ |
| 46 | |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 47 | LOCAL_CONLYFLAGS += \ |
Christopher Ferris | 2c43cff | 2015-03-26 19:18:36 -0700 | [diff] [blame] | 48 | $(libbacktrace_common_conlyflags) \ |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 49 | $($(module)_conlyflags) \ |
| 50 | $($(module)_conlyflags_$(build_type)) \ |
| 51 | |
| 52 | LOCAL_CPPFLAGS += \ |
Christopher Ferris | 2c43cff | 2015-03-26 19:18:36 -0700 | [diff] [blame] | 53 | $(libbacktrace_common_cppflags) \ |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 54 | $($(module)_cppflags) \ |
| 55 | $($(module)_cppflags_$(build_type)) \ |
| 56 | |
Yabin Cui | af8ac0c | 2015-09-24 17:46:27 -0700 | [diff] [blame] | 57 | LOCAL_C_INCLUDES += \ |
Christopher Ferris | 2c43cff | 2015-03-26 19:18:36 -0700 | [diff] [blame] | 58 | $(libbacktrace_common_c_includes) \ |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 59 | $($(module)_c_includes) \ |
| 60 | $($(module)_c_includes_$(build_type)) \ |
| 61 | |
| 62 | LOCAL_SRC_FILES := \ |
| 63 | $($(module)_src_files) \ |
| 64 | $($(module)_src_files_$(build_type)) \ |
| 65 | |
Yabin Cui | af8ac0c | 2015-09-24 17:46:27 -0700 | [diff] [blame] | 66 | LOCAL_STATIC_LIBRARIES += \ |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 67 | $($(module)_static_libraries) \ |
| 68 | $($(module)_static_libraries_$(build_type)) \ |
| 69 | |
Yabin Cui | af8ac0c | 2015-09-24 17:46:27 -0700 | [diff] [blame] | 70 | LOCAL_SHARED_LIBRARIES += \ |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 71 | $($(module)_shared_libraries) \ |
| 72 | $($(module)_shared_libraries_$(build_type)) \ |
| 73 | |
Yabin Cui | af8ac0c | 2015-09-24 17:46:27 -0700 | [diff] [blame] | 74 | LOCAL_LDLIBS += \ |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 75 | $($(module)_ldlibs) \ |
| 76 | $($(module)_ldlibs_$(build_type)) \ |
| 77 | |
Yabin Cui | 9e402bb | 2015-09-22 04:46:57 +0000 | [diff] [blame] | 78 | LOCAL_STRIP_MODULE := $($(module)_strip_module) |
| 79 | |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 80 | ifeq ($(build_type),target) |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 81 | include $(BUILD_$(build_target)) |
| 82 | endif |
| 83 | |
| 84 | ifeq ($(build_type),host) |
| 85 | # Only build if host builds are supported. |
| 86 | ifeq ($(build_host),true) |
Yabin Cui | 9e1dd67 | 2015-09-22 21:57:43 -0700 | [diff] [blame] | 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 |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 93 | include $(BUILD_HOST_$(build_target)) |
| 94 | endif |
| 95 | endif |