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 | |
Steve Fung | f085a1f | 2015-08-07 13:46:22 -0700 | [diff] [blame] | 17 | crash_reporter_cpp_extension := .cc |
| 18 | |
| 19 | crash_reporter_src := crash_collector.cc \ |
| 20 | kernel_collector.cc \ |
| 21 | kernel_warning_collector.cc \ |
| 22 | udev_collector.cc \ |
| 23 | unclean_shutdown_collector.cc \ |
| 24 | user_collector.cc |
| 25 | |
| 26 | crash_reporter_includes := external/gtest/include |
| 27 | |
| 28 | crash_reporter_test_src := crash_collector_test.cc \ |
| 29 | crash_reporter_logs_test.cc \ |
| 30 | kernel_collector_test.cc \ |
| 31 | testrunner.cc \ |
| 32 | udev_collector_test.cc \ |
| 33 | unclean_shutdown_collector_test.cc \ |
| 34 | user_collector_test.cc |
| 35 | |
| 36 | warn_collector_src := warn_collector.l |
| 37 | |
| 38 | # Crash reporter static library. |
| 39 | # ======================================================== |
| 40 | include $(CLEAR_VARS) |
| 41 | LOCAL_MODULE := libcrash |
| 42 | LOCAL_CPP_EXTENSION := $(crash_reporter_cpp_extension) |
| 43 | LOCAL_C_INCLUDES := $(crash_reporter_includes) |
| 44 | LOCAL_RTTI_FLAG := -frtti |
| 45 | LOCAL_SHARED_LIBRARIES := libchrome \ |
| 46 | libchromeos \ |
| 47 | libcutils \ |
| 48 | libdbus \ |
| 49 | libmetrics \ |
| 50 | libpcrecpp |
| 51 | LOCAL_SRC_FILES := $(crash_reporter_src) |
| 52 | include $(BUILD_STATIC_LIBRARY) |
| 53 | |
| 54 | # Crash reporter client. |
| 55 | # ======================================================== |
| 56 | include $(CLEAR_VARS) |
| 57 | LOCAL_MODULE := crash_reporter |
| 58 | LOCAL_CPP_EXTENSION := $(crash_reporter_cpp_extension) |
| 59 | LOCAL_C_INCLUDES := $(crash_reporter_includes) |
| 60 | LOCAL_REQUIRED_MODULES := core2md \ |
| 61 | crash_reporter_logs.conf \ |
| 62 | crash_sender \ |
Steve Fung | 5683366 | 2015-10-16 02:17:53 -0700 | [diff] [blame^] | 63 | crash_server \ |
Jorge Lucangeli Obes | 96408df | 2015-09-28 12:51:54 -0700 | [diff] [blame] | 64 | dbus-send |
| 65 | LOCAL_INIT_RC := crash_reporter.rc |
Steve Fung | f085a1f | 2015-08-07 13:46:22 -0700 | [diff] [blame] | 66 | LOCAL_RTTI_FLAG := -frtti |
| 67 | LOCAL_SHARED_LIBRARIES := libchrome \ |
| 68 | libchromeos \ |
| 69 | libcutils \ |
| 70 | libdbus \ |
| 71 | libmetrics \ |
| 72 | libpcrecpp |
| 73 | LOCAL_SRC_FILES := crash_reporter.cc |
| 74 | LOCAL_STATIC_LIBRARIES := libcrash |
| 75 | include $(BUILD_EXECUTABLE) |
| 76 | |
| 77 | # Crash sender script. |
| 78 | # ======================================================== |
| 79 | include $(CLEAR_VARS) |
| 80 | LOCAL_MODULE := crash_sender |
| 81 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 82 | LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES) |
Steve Fung | 4a1bc38 | 2015-09-14 02:56:07 -0700 | [diff] [blame] | 83 | LOCAL_REQUIRED_MODULES := curl grep periodic_scheduler |
Steve Fung | f085a1f | 2015-08-07 13:46:22 -0700 | [diff] [blame] | 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 | |
Steve Fung | 5683366 | 2015-10-16 02:17:53 -0700 | [diff] [blame^] | 96 | # /etc/os-release.d/crash_server configuration file. |
| 97 | # ======================================================== |
| 98 | ifdef OSRELEASED_DIRECTORY |
| 99 | include $(CLEAR_VARS) |
| 100 | LOCAL_MODULE := crash_server |
| 101 | LOCAL_MODULE_CLASS := ETC |
| 102 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY) |
| 103 | include $(BUILD_SYSTEM)/base_rules.mk |
| 104 | |
| 105 | # If the crash server isn't set, use a blank value. crash_sender |
| 106 | # will log it as a configuration error. |
| 107 | $(LOCAL_BUILT_MODULE): BRILLO_CRASH_SERVER ?= "" |
| 108 | $(LOCAL_BUILT_MODULE): |
| 109 | echo $(BRILLO_CRASH_SERVER) > $@ |
| 110 | endif |
| 111 | |
Steve Fung | f085a1f | 2015-08-07 13:46:22 -0700 | [diff] [blame] | 112 | # Crash reporter logs conf file. |
| 113 | # ======================================================== |
| 114 | include $(CLEAR_VARS) |
| 115 | LOCAL_MODULE := crash_reporter_logs.conf |
| 116 | LOCAL_MODULE_CLASS := ETC |
| 117 | LOCAL_MODULE_PATH := $(PRODUCT_OUT)/system/etc |
| 118 | LOCAL_SRC_FILES := crash_reporter_logs.conf |
| 119 | include $(BUILD_PREBUILT) |
| 120 | |
Steve Fung | 0e8746d | 2015-08-20 17:07:50 -0700 | [diff] [blame] | 121 | # Periodic Scheduler. |
| 122 | # ======================================================== |
| 123 | include $(CLEAR_VARS) |
| 124 | LOCAL_MODULE := periodic_scheduler |
| 125 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 126 | LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES) |
| 127 | LOCAL_SRC_FILES := periodic_scheduler |
| 128 | include $(BUILD_PREBUILT) |
| 129 | |
Steve Fung | f085a1f | 2015-08-07 13:46:22 -0700 | [diff] [blame] | 130 | # Crash reporter tests. |
| 131 | # ======================================================== |
| 132 | include $(CLEAR_VARS) |
| 133 | LOCAL_MODULE := crash_reporter_tests |
| 134 | LOCAL_CPP_EXTENSION := $(crash_reporter_cpp_extension) |
| 135 | LOCAL_SHARED_LIBRARIES := libchrome \ |
| 136 | libchromeos \ |
Steve Fung | 4818011 | 2015-09-30 16:27:56 -0700 | [diff] [blame] | 137 | libcutils \ |
Steve Fung | f085a1f | 2015-08-07 13:46:22 -0700 | [diff] [blame] | 138 | libdbus \ |
| 139 | libpcrecpp |
| 140 | LOCAL_SRC_FILES := $(crash_reporter_test_src) |
| 141 | LOCAL_STATIC_LIBRARIES := libcrash libgmock |
| 142 | include $(BUILD_NATIVE_TEST) |