Christopher Ferris | fe6ff00 | 2014-01-30 01:04:29 -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) |
| 21 | |
| 22 | LOCAL_ADDITIONAL_DEPENDENCIES := \ |
| 23 | $(LOCAL_PATH)/Android.mk \ |
| 24 | $(LOCAL_PATH)/Android.build.mk \ |
| 25 | |
| 26 | LOCAL_CFLAGS := \ |
| 27 | $(common_cflags) \ |
Christopher Ferris | d1c383c | 2014-04-09 16:48:26 -0700 | [diff] [blame] | 28 | $(common_cflags_$(build_type)) \ |
Christopher Ferris | fe6ff00 | 2014-01-30 01:04:29 -0800 | [diff] [blame] | 29 | $($(module)_cflags) \ |
| 30 | $($(module)_cflags_$(build_type)) \ |
| 31 | |
| 32 | LOCAL_CONLYFLAGS += \ |
| 33 | $(common_conlyflags) \ |
Christopher Ferris | d1c383c | 2014-04-09 16:48:26 -0700 | [diff] [blame] | 34 | $(common_conlyflags_$(build_type)) \ |
Christopher Ferris | fe6ff00 | 2014-01-30 01:04:29 -0800 | [diff] [blame] | 35 | $($(module)_conlyflags) \ |
| 36 | $($(module)_conlyflags_$(build_type)) \ |
| 37 | |
| 38 | LOCAL_CPPFLAGS += \ |
| 39 | $(common_cppflags) \ |
| 40 | $($(module)_cppflags) \ |
| 41 | $($(module)_cppflags_$(build_type)) \ |
| 42 | |
| 43 | LOCAL_C_INCLUDES := \ |
| 44 | $(common_c_includes) \ |
| 45 | $($(module)_c_includes) \ |
| 46 | $($(module)_c_includes_$(build_type)) \ |
| 47 | |
| 48 | ifneq ($(build_type),host) |
| 49 | $(foreach arch,$(libunwind_arches), \ |
| 50 | $(eval LOCAL_C_INCLUDES_$(arch) := $(common_c_includes_$(arch)))) |
| 51 | else |
Ying Wang | 57c68a3 | 2014-02-21 15:53:33 -0800 | [diff] [blame] | 52 | $(eval LOCAL_C_INCLUDES += $(common_c_includes_$(my_host_arch))) |
Christopher Ferris | fe6ff00 | 2014-01-30 01:04:29 -0800 | [diff] [blame] | 53 | endif |
| 54 | |
| 55 | LOCAL_SRC_FILES := \ |
| 56 | $($(module)_src_files) \ |
| 57 | $($(module)_src_files_$(build_type)) \ |
| 58 | |
| 59 | ifneq ($(build_type),host) |
| 60 | $(foreach arch,$(libunwind_arches), \ |
| 61 | $(eval LOCAL_SRC_FILES_$(arch) := $($(module)_src_files_$(arch)))) |
| 62 | else |
Ying Wang | 57c68a3 | 2014-02-21 15:53:33 -0800 | [diff] [blame] | 63 | $(eval LOCAL_SRC_FILES += $($(module)_src_files_$(my_host_arch))) |
Christopher Ferris | fe6ff00 | 2014-01-30 01:04:29 -0800 | [diff] [blame] | 64 | endif |
| 65 | |
| 66 | LOCAL_STATIC_LIBRARIES := \ |
| 67 | $($(module)_static_libraries) \ |
| 68 | $($(module)_static_libraries_$(build_type)) \ |
| 69 | |
| 70 | LOCAL_SHARED_LIBRARIES := \ |
| 71 | $($(module)_shared_libraries) \ |
| 72 | $($(module)_shared_libraries_$(build_type)) \ |
| 73 | |
| 74 | LOCAL_LDLIBS := \ |
| 75 | $($(module)_ldlibs) \ |
| 76 | $($(module)_ldlibs_$(build_type)) \ |
| 77 | |
| 78 | # Translate arm64 to aarch64 in c includes and src files. |
| 79 | LOCAL_C_INCLUDES_arm64 := \ |
| 80 | $(subst tdep-arm64,tdep-aarch64,$(LOCAL_C_INCLUDES_arm64)) |
| 81 | |
| 82 | LOCAL_SRC_FILES_arm64 := \ |
| 83 | $(subst src/arm64,src/aarch64,$(LOCAL_SRC_FILES_arm64)) |
| 84 | |
| 85 | ifeq ($(build_type),target) |
| 86 | include $(BUILD_$(build_target)) |
| 87 | endif |
| 88 | |
| 89 | ifeq ($(build_type),host) |
| 90 | # Only build if host builds are supported. |
| 91 | ifeq ($(build_host),true) |
| 92 | include $(BUILD_HOST_$(build_target)) |
| 93 | endif |
| 94 | endif |