blob: 11dfcbc8284458ce152428f3cfc53276e6e0a04f [file] [log] [blame]
Steve Fungf085a1f2015-08-07 13:46:22 -07001# 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
15LOCAL_PATH := $(call my-dir)
16
Steve Fungf085a1f2015-08-07 13:46:22 -070017crash_reporter_cpp_extension := .cc
18
19crash_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
26crash_reporter_includes := external/gtest/include
27
28crash_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
36warn_collector_src := warn_collector.l
37
38# Crash reporter static library.
39# ========================================================
40include $(CLEAR_VARS)
41LOCAL_MODULE := libcrash
42LOCAL_CPP_EXTENSION := $(crash_reporter_cpp_extension)
43LOCAL_C_INCLUDES := $(crash_reporter_includes)
44LOCAL_RTTI_FLAG := -frtti
45LOCAL_SHARED_LIBRARIES := libchrome \
46 libchromeos \
47 libcutils \
48 libdbus \
49 libmetrics \
50 libpcrecpp
51LOCAL_SRC_FILES := $(crash_reporter_src)
52include $(BUILD_STATIC_LIBRARY)
53
54# Crash reporter client.
55# ========================================================
56include $(CLEAR_VARS)
57LOCAL_MODULE := crash_reporter
58LOCAL_CPP_EXTENSION := $(crash_reporter_cpp_extension)
59LOCAL_C_INCLUDES := $(crash_reporter_includes)
60LOCAL_REQUIRED_MODULES := core2md \
61 crash_reporter_logs.conf \
62 crash_sender \
Steve Fung56833662015-10-16 02:17:53 -070063 crash_server \
Jorge Lucangeli Obes96408df2015-09-28 12:51:54 -070064 dbus-send
65LOCAL_INIT_RC := crash_reporter.rc
Steve Fungf085a1f2015-08-07 13:46:22 -070066LOCAL_RTTI_FLAG := -frtti
67LOCAL_SHARED_LIBRARIES := libchrome \
68 libchromeos \
69 libcutils \
70 libdbus \
71 libmetrics \
72 libpcrecpp
73LOCAL_SRC_FILES := crash_reporter.cc
74LOCAL_STATIC_LIBRARIES := libcrash
75include $(BUILD_EXECUTABLE)
76
77# Crash sender script.
78# ========================================================
79include $(CLEAR_VARS)
80LOCAL_MODULE := crash_sender
81LOCAL_MODULE_CLASS := EXECUTABLES
82LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES)
Steve Fung4a1bc382015-09-14 02:56:07 -070083LOCAL_REQUIRED_MODULES := curl grep periodic_scheduler
Steve Fungf085a1f2015-08-07 13:46:22 -070084LOCAL_SRC_FILES := crash_sender
85include $(BUILD_PREBUILT)
86
87# Warn collector client.
88# ========================================================
89include $(CLEAR_VARS)
90LOCAL_MODULE := warn_collector
91LOCAL_CPP_EXTENSION := $(crash_reporter_cpp_extension)
92LOCAL_SHARED_LIBRARIES := libmetrics
93LOCAL_SRC_FILES := $(warn_collector_src)
94include $(BUILD_EXECUTABLE)
95
Steve Fung56833662015-10-16 02:17:53 -070096# /etc/os-release.d/crash_server configuration file.
97# ========================================================
98ifdef OSRELEASED_DIRECTORY
99include $(CLEAR_VARS)
100LOCAL_MODULE := crash_server
101LOCAL_MODULE_CLASS := ETC
102LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY)
103include $(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) > $@
110endif
111
Steve Fungf085a1f2015-08-07 13:46:22 -0700112# Crash reporter logs conf file.
113# ========================================================
114include $(CLEAR_VARS)
115LOCAL_MODULE := crash_reporter_logs.conf
116LOCAL_MODULE_CLASS := ETC
117LOCAL_MODULE_PATH := $(PRODUCT_OUT)/system/etc
118LOCAL_SRC_FILES := crash_reporter_logs.conf
119include $(BUILD_PREBUILT)
120
Steve Fung0e8746d2015-08-20 17:07:50 -0700121# Periodic Scheduler.
122# ========================================================
123include $(CLEAR_VARS)
124LOCAL_MODULE := periodic_scheduler
125LOCAL_MODULE_CLASS := EXECUTABLES
126LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES)
127LOCAL_SRC_FILES := periodic_scheduler
128include $(BUILD_PREBUILT)
129
Steve Fungf085a1f2015-08-07 13:46:22 -0700130# Crash reporter tests.
131# ========================================================
132include $(CLEAR_VARS)
133LOCAL_MODULE := crash_reporter_tests
134LOCAL_CPP_EXTENSION := $(crash_reporter_cpp_extension)
135LOCAL_SHARED_LIBRARIES := libchrome \
136 libchromeos \
Steve Fung48180112015-09-30 16:27:56 -0700137 libcutils \
Steve Fungf085a1f2015-08-07 13:46:22 -0700138 libdbus \
139 libpcrecpp
140LOCAL_SRC_FILES := $(crash_reporter_test_src)
141LOCAL_STATIC_LIBRARIES := libcrash libgmock
142include $(BUILD_NATIVE_TEST)