blob: 6cd34ab6f10b66a8a9d921b74b3fbd24295066e2 [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)
Steve Fung4a1bc382015-09-14 02:56:07 -070084LOCAL_REQUIRED_MODULES := curl grep periodic_scheduler
Steve Fungf085a1f2015-08-07 13:46:22 -070085LOCAL_SRC_FILES := crash_sender
86include $(BUILD_PREBUILT)
87
88# Warn collector client.
89# ========================================================
90include $(CLEAR_VARS)
91LOCAL_MODULE := warn_collector
92LOCAL_CPP_EXTENSION := $(crash_reporter_cpp_extension)
93LOCAL_SHARED_LIBRARIES := libmetrics
94LOCAL_SRC_FILES := $(warn_collector_src)
95include $(BUILD_EXECUTABLE)
96
97# Crash reporter init script.
98# ========================================================
99ifdef TARGET_COPY_OUT_INITRCD
100include $(CLEAR_VARS)
101LOCAL_MODULE := init.crash_reporter.rc
102LOCAL_MODULE_CLASS := ETC
103LOCAL_MODULE_PATH := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_INITRCD)
104LOCAL_SRC_FILES := init.crash_reporter.rc
105include $(BUILD_PREBUILT)
106endif
107
108# Crash reporter logs conf file.
109# ========================================================
110include $(CLEAR_VARS)
111LOCAL_MODULE := crash_reporter_logs.conf
112LOCAL_MODULE_CLASS := ETC
113LOCAL_MODULE_PATH := $(PRODUCT_OUT)/system/etc
114LOCAL_SRC_FILES := crash_reporter_logs.conf
115include $(BUILD_PREBUILT)
116
Steve Fung0e8746d2015-08-20 17:07:50 -0700117# Periodic Scheduler.
118# ========================================================
119include $(CLEAR_VARS)
120LOCAL_MODULE := periodic_scheduler
121LOCAL_MODULE_CLASS := EXECUTABLES
122LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES)
123LOCAL_SRC_FILES := periodic_scheduler
124include $(BUILD_PREBUILT)
125
Steve Fungf085a1f2015-08-07 13:46:22 -0700126# Crash reporter tests.
127# ========================================================
128include $(CLEAR_VARS)
129LOCAL_MODULE := crash_reporter_tests
130LOCAL_CPP_EXTENSION := $(crash_reporter_cpp_extension)
131LOCAL_SHARED_LIBRARIES := libchrome \
132 libchromeos \
133 libdbus \
134 libpcrecpp
135LOCAL_SRC_FILES := $(crash_reporter_test_src)
136LOCAL_STATIC_LIBRARIES := libcrash libgmock
137include $(BUILD_NATIVE_TEST)
138
139endif # HOST_OS == linux