blob: 6b98af4bde56cdab8c520eb753ffb3310777386a [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
17ifeq ($(HOST_OS),linux)
18
19crash_reporter_cpp_extension := .cc
20
21crash_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
28crash_reporter_includes := external/gtest/include
29
30crash_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
38warn_collector_src := warn_collector.l
39
40# Crash reporter static library.
41# ========================================================
42include $(CLEAR_VARS)
43LOCAL_MODULE := libcrash
44LOCAL_CPP_EXTENSION := $(crash_reporter_cpp_extension)
45LOCAL_C_INCLUDES := $(crash_reporter_includes)
46LOCAL_RTTI_FLAG := -frtti
47LOCAL_SHARED_LIBRARIES := libchrome \
48 libchromeos \
49 libcutils \
50 libdbus \
51 libmetrics \
52 libpcrecpp
53LOCAL_SRC_FILES := $(crash_reporter_src)
54include $(BUILD_STATIC_LIBRARY)
55
56# Crash reporter client.
57# ========================================================
58include $(CLEAR_VARS)
59LOCAL_MODULE := crash_reporter
60LOCAL_CPP_EXTENSION := $(crash_reporter_cpp_extension)
61LOCAL_C_INCLUDES := $(crash_reporter_includes)
62LOCAL_REQUIRED_MODULES := core2md \
63 crash_reporter_logs.conf \
64 crash_sender \
65 dbus-send \
66 init.crash_reporter.rc
67LOCAL_RTTI_FLAG := -frtti
68LOCAL_SHARED_LIBRARIES := libchrome \
69 libchromeos \
70 libcutils \
71 libdbus \
72 libmetrics \
73 libpcrecpp
74LOCAL_SRC_FILES := crash_reporter.cc
75LOCAL_STATIC_LIBRARIES := libcrash
76include $(BUILD_EXECUTABLE)
77
78# Crash sender script.
79# ========================================================
80include $(CLEAR_VARS)
81LOCAL_MODULE := crash_sender
82LOCAL_MODULE_CLASS := EXECUTABLES
83LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES)
84LOCAL_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
96# Crash reporter init script.
97# ========================================================
98ifdef TARGET_COPY_OUT_INITRCD
99include $(CLEAR_VARS)
100LOCAL_MODULE := init.crash_reporter.rc
101LOCAL_MODULE_CLASS := ETC
102LOCAL_MODULE_PATH := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_INITRCD)
103LOCAL_SRC_FILES := init.crash_reporter.rc
104include $(BUILD_PREBUILT)
105endif
106
107# Crash reporter logs conf file.
108# ========================================================
109include $(CLEAR_VARS)
110LOCAL_MODULE := crash_reporter_logs.conf
111LOCAL_MODULE_CLASS := ETC
112LOCAL_MODULE_PATH := $(PRODUCT_OUT)/system/etc
113LOCAL_SRC_FILES := crash_reporter_logs.conf
114include $(BUILD_PREBUILT)
115
116# Crash reporter tests.
117# ========================================================
118include $(CLEAR_VARS)
119LOCAL_MODULE := crash_reporter_tests
120LOCAL_CPP_EXTENSION := $(crash_reporter_cpp_extension)
121LOCAL_SHARED_LIBRARIES := libchrome \
122 libchromeos \
123 libdbus \
124 libpcrecpp
125LOCAL_SRC_FILES := $(crash_reporter_test_src)
126LOCAL_STATIC_LIBRARIES := libcrash libgmock
127include $(BUILD_NATIVE_TEST)
128
129endif # HOST_OS == linux