Steve Fung | f085a1f | 2015-08-07 13:46:22 -0700 | [diff] [blame] | 1 | # Copyright (C) 2015 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | LOCAL_PATH := $(call my-dir) |
| 16 | |
| 17 | ifeq ($(HOST_OS),linux) |
| 18 | |
| 19 | crash_reporter_cpp_extension := .cc |
| 20 | |
| 21 | crash_reporter_src := crash_collector.cc \ |
| 22 | kernel_collector.cc \ |
| 23 | kernel_warning_collector.cc \ |
| 24 | udev_collector.cc \ |
| 25 | unclean_shutdown_collector.cc \ |
| 26 | user_collector.cc |
| 27 | |
| 28 | crash_reporter_includes := external/gtest/include |
| 29 | |
| 30 | crash_reporter_test_src := crash_collector_test.cc \ |
| 31 | crash_reporter_logs_test.cc \ |
| 32 | kernel_collector_test.cc \ |
| 33 | testrunner.cc \ |
| 34 | udev_collector_test.cc \ |
| 35 | unclean_shutdown_collector_test.cc \ |
| 36 | user_collector_test.cc |
| 37 | |
| 38 | warn_collector_src := warn_collector.l |
| 39 | |
| 40 | # Crash reporter static library. |
| 41 | # ======================================================== |
| 42 | include $(CLEAR_VARS) |
| 43 | LOCAL_MODULE := libcrash |
| 44 | LOCAL_CPP_EXTENSION := $(crash_reporter_cpp_extension) |
| 45 | LOCAL_C_INCLUDES := $(crash_reporter_includes) |
| 46 | LOCAL_RTTI_FLAG := -frtti |
| 47 | LOCAL_SHARED_LIBRARIES := libchrome \ |
| 48 | libchromeos \ |
| 49 | libcutils \ |
| 50 | libdbus \ |
| 51 | libmetrics \ |
| 52 | libpcrecpp |
| 53 | LOCAL_SRC_FILES := $(crash_reporter_src) |
| 54 | include $(BUILD_STATIC_LIBRARY) |
| 55 | |
| 56 | # Crash reporter client. |
| 57 | # ======================================================== |
| 58 | include $(CLEAR_VARS) |
| 59 | LOCAL_MODULE := crash_reporter |
| 60 | LOCAL_CPP_EXTENSION := $(crash_reporter_cpp_extension) |
| 61 | LOCAL_C_INCLUDES := $(crash_reporter_includes) |
| 62 | LOCAL_REQUIRED_MODULES := core2md \ |
| 63 | crash_reporter_logs.conf \ |
| 64 | crash_sender \ |
| 65 | dbus-send \ |
| 66 | init.crash_reporter.rc |
| 67 | LOCAL_RTTI_FLAG := -frtti |
| 68 | LOCAL_SHARED_LIBRARIES := libchrome \ |
| 69 | libchromeos \ |
| 70 | libcutils \ |
| 71 | libdbus \ |
| 72 | libmetrics \ |
| 73 | libpcrecpp |
| 74 | LOCAL_SRC_FILES := crash_reporter.cc |
| 75 | LOCAL_STATIC_LIBRARIES := libcrash |
| 76 | include $(BUILD_EXECUTABLE) |
| 77 | |
| 78 | # Crash sender script. |
| 79 | # ======================================================== |
| 80 | include $(CLEAR_VARS) |
| 81 | LOCAL_MODULE := crash_sender |
| 82 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 83 | LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES) |
| 84 | LOCAL_SRC_FILES := crash_sender |
| 85 | include $(BUILD_PREBUILT) |
| 86 | |
| 87 | # Warn collector client. |
| 88 | # ======================================================== |
| 89 | include $(CLEAR_VARS) |
| 90 | LOCAL_MODULE := warn_collector |
| 91 | LOCAL_CPP_EXTENSION := $(crash_reporter_cpp_extension) |
| 92 | LOCAL_SHARED_LIBRARIES := libmetrics |
| 93 | LOCAL_SRC_FILES := $(warn_collector_src) |
| 94 | include $(BUILD_EXECUTABLE) |
| 95 | |
| 96 | # Crash reporter init script. |
| 97 | # ======================================================== |
| 98 | ifdef TARGET_COPY_OUT_INITRCD |
| 99 | include $(CLEAR_VARS) |
| 100 | LOCAL_MODULE := init.crash_reporter.rc |
| 101 | LOCAL_MODULE_CLASS := ETC |
| 102 | LOCAL_MODULE_PATH := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_INITRCD) |
| 103 | LOCAL_SRC_FILES := init.crash_reporter.rc |
| 104 | include $(BUILD_PREBUILT) |
| 105 | endif |
| 106 | |
| 107 | # Crash reporter logs conf file. |
| 108 | # ======================================================== |
| 109 | include $(CLEAR_VARS) |
| 110 | LOCAL_MODULE := crash_reporter_logs.conf |
| 111 | LOCAL_MODULE_CLASS := ETC |
| 112 | LOCAL_MODULE_PATH := $(PRODUCT_OUT)/system/etc |
| 113 | LOCAL_SRC_FILES := crash_reporter_logs.conf |
| 114 | include $(BUILD_PREBUILT) |
| 115 | |
| 116 | # Crash reporter tests. |
| 117 | # ======================================================== |
| 118 | include $(CLEAR_VARS) |
| 119 | LOCAL_MODULE := crash_reporter_tests |
| 120 | LOCAL_CPP_EXTENSION := $(crash_reporter_cpp_extension) |
| 121 | LOCAL_SHARED_LIBRARIES := libchrome \ |
| 122 | libchromeos \ |
| 123 | libdbus \ |
| 124 | libpcrecpp |
| 125 | LOCAL_SRC_FILES := $(crash_reporter_test_src) |
| 126 | LOCAL_STATIC_LIBRARIES := libcrash libgmock |
| 127 | include $(BUILD_NATIVE_TEST) |
| 128 | |
| 129 | endif # HOST_OS == linux |