blob: ce9dc730eb6bf56fe6b9e198b23091a90f200877 [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 \
Steve Fungf085a1f2015-08-07 13:46:22 -070022 unclean_shutdown_collector.cc \
23 user_collector.cc
24
25crash_reporter_includes := external/gtest/include
26
27crash_reporter_test_src := crash_collector_test.cc \
28 crash_reporter_logs_test.cc \
29 kernel_collector_test.cc \
30 testrunner.cc \
Steve Fungf085a1f2015-08-07 13:46:22 -070031 unclean_shutdown_collector_test.cc \
32 user_collector_test.cc
33
34warn_collector_src := warn_collector.l
35
36# Crash reporter static library.
37# ========================================================
38include $(CLEAR_VARS)
39LOCAL_MODULE := libcrash
40LOCAL_CPP_EXTENSION := $(crash_reporter_cpp_extension)
41LOCAL_C_INCLUDES := $(crash_reporter_includes)
Steve Fungf085a1f2015-08-07 13:46:22 -070042LOCAL_SHARED_LIBRARIES := libchrome \
Todd Poynor83619352015-12-02 14:38:43 -080043 libbinder \
Alex Vakulenko26aef372015-10-27 11:46:37 -070044 libbrillo \
Steve Fungf085a1f2015-08-07 13:46:22 -070045 libcutils \
Steve Fungf085a1f2015-08-07 13:46:22 -070046 libmetrics \
47 libpcrecpp
Todd Poynor83619352015-12-02 14:38:43 -080048LOCAL_STATIC_LIBRARIES := libmetricscollectorservice
Steve Fungf085a1f2015-08-07 13:46:22 -070049LOCAL_SRC_FILES := $(crash_reporter_src)
50include $(BUILD_STATIC_LIBRARY)
51
52# Crash reporter client.
53# ========================================================
54include $(CLEAR_VARS)
55LOCAL_MODULE := crash_reporter
56LOCAL_CPP_EXTENSION := $(crash_reporter_cpp_extension)
57LOCAL_C_INCLUDES := $(crash_reporter_includes)
58LOCAL_REQUIRED_MODULES := core2md \
59 crash_reporter_logs.conf \
60 crash_sender \
Todd Poynor83619352015-12-02 14:38:43 -080061 crash_server
Jorge Lucangeli Obes96408df2015-09-28 12:51:54 -070062LOCAL_INIT_RC := crash_reporter.rc
Steve Fungf085a1f2015-08-07 13:46:22 -070063LOCAL_SHARED_LIBRARIES := libchrome \
Todd Poynor83619352015-12-02 14:38:43 -080064 libbinder \
Alex Vakulenko26aef372015-10-27 11:46:37 -070065 libbrillo \
Steve Fungf085a1f2015-08-07 13:46:22 -070066 libcutils \
Steve Fungf085a1f2015-08-07 13:46:22 -070067 libmetrics \
Todd Poynor83619352015-12-02 14:38:43 -080068 libpcrecpp \
69 libutils
Steve Fungf085a1f2015-08-07 13:46:22 -070070LOCAL_SRC_FILES := crash_reporter.cc
Todd Poynor83619352015-12-02 14:38:43 -080071LOCAL_STATIC_LIBRARIES := libcrash \
72 libmetricscollectorservice
Steve Fungf085a1f2015-08-07 13:46:22 -070073include $(BUILD_EXECUTABLE)
74
75# Crash sender script.
76# ========================================================
77include $(CLEAR_VARS)
78LOCAL_MODULE := crash_sender
79LOCAL_MODULE_CLASS := EXECUTABLES
80LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES)
Steve Fung4a1bc382015-09-14 02:56:07 -070081LOCAL_REQUIRED_MODULES := curl grep periodic_scheduler
Steve Fungf085a1f2015-08-07 13:46:22 -070082LOCAL_SRC_FILES := crash_sender
83include $(BUILD_PREBUILT)
84
85# Warn collector client.
86# ========================================================
87include $(CLEAR_VARS)
88LOCAL_MODULE := warn_collector
89LOCAL_CPP_EXTENSION := $(crash_reporter_cpp_extension)
90LOCAL_SHARED_LIBRARIES := libmetrics
91LOCAL_SRC_FILES := $(warn_collector_src)
92include $(BUILD_EXECUTABLE)
93
Steve Fung56833662015-10-16 02:17:53 -070094# /etc/os-release.d/crash_server configuration file.
95# ========================================================
96ifdef OSRELEASED_DIRECTORY
97include $(CLEAR_VARS)
98LOCAL_MODULE := crash_server
99LOCAL_MODULE_CLASS := ETC
100LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/$(OSRELEASED_DIRECTORY)
101include $(BUILD_SYSTEM)/base_rules.mk
102
Will Drewrye680f352015-11-04 18:48:30 -0800103# Optionally populate the BRILLO_CRASH_SERVER variable from a product
104# configuration file: brillo/crash_server.
105LOADED_BRILLO_CRASH_SERVER := $(call cfgtree-get-if-exists,brillo/crash_server)
106
Steve Fung56833662015-10-16 02:17:53 -0700107# If the crash server isn't set, use a blank value. crash_sender
108# will log it as a configuration error.
Will Drewrye680f352015-11-04 18:48:30 -0800109$(LOCAL_BUILT_MODULE): BRILLO_CRASH_SERVER ?= "$(LOADED_BRILLO_CRASH_SERVER)"
Steve Fung56833662015-10-16 02:17:53 -0700110$(LOCAL_BUILT_MODULE):
Mike Frysingercb31b1d2015-10-20 14:09:23 -0400111 $(hide)mkdir -p $(dir $@)
Steve Fung56833662015-10-16 02:17:53 -0700112 echo $(BRILLO_CRASH_SERVER) > $@
113endif
114
Steve Fungf085a1f2015-08-07 13:46:22 -0700115# Crash reporter logs conf file.
116# ========================================================
117include $(CLEAR_VARS)
118LOCAL_MODULE := crash_reporter_logs.conf
119LOCAL_MODULE_CLASS := ETC
120LOCAL_MODULE_PATH := $(PRODUCT_OUT)/system/etc
121LOCAL_SRC_FILES := crash_reporter_logs.conf
122include $(BUILD_PREBUILT)
123
Steve Fung0e8746d2015-08-20 17:07:50 -0700124# Periodic Scheduler.
125# ========================================================
126include $(CLEAR_VARS)
127LOCAL_MODULE := periodic_scheduler
128LOCAL_MODULE_CLASS := EXECUTABLES
129LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES)
130LOCAL_SRC_FILES := periodic_scheduler
131include $(BUILD_PREBUILT)
132
Steve Fungf085a1f2015-08-07 13:46:22 -0700133# Crash reporter tests.
134# ========================================================
135include $(CLEAR_VARS)
136LOCAL_MODULE := crash_reporter_tests
137LOCAL_CPP_EXTENSION := $(crash_reporter_cpp_extension)
Steve Fung333fc5c2016-01-20 01:15:20 -0800138ifdef BRILLO
Jorge Lucangeli Obes512d6772016-02-04 13:56:25 -0800139LOCAL_MODULE_TAGS := eng
Steve Fung333fc5c2016-01-20 01:15:20 -0800140endif
Steve Fungf085a1f2015-08-07 13:46:22 -0700141LOCAL_SHARED_LIBRARIES := libchrome \
Alex Vakulenko26aef372015-10-27 11:46:37 -0700142 libbrillo \
Steve Fung48180112015-09-30 16:27:56 -0700143 libcutils \
Steve Fungf085a1f2015-08-07 13:46:22 -0700144 libpcrecpp
145LOCAL_SRC_FILES := $(crash_reporter_test_src)
146LOCAL_STATIC_LIBRARIES := libcrash libgmock
147include $(BUILD_NATIVE_TEST)