blob: 537c9109311248886ae584bf99b696f1676f844b [file] [log] [blame]
Joe Onorato1754d742016-11-21 17:51:35 -08001# Copyright (C) 2016 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)
Yi Jin0a3406f2017-06-22 19:23:11 -070016
17# ========= #
18# incidentd #
19# ========= #
20
Joe Onorato1754d742016-11-21 17:51:35 -080021include $(CLEAR_VARS)
22
23LOCAL_MODULE := incidentd
24
25LOCAL_SRC_FILES := \
26 src/FdBuffer.cpp \
27 src/IncidentService.cpp \
28 src/Reporter.cpp \
29 src/Section.cpp \
30 src/main.cpp \
31 src/protobuf.cpp \
32 src/report_directory.cpp \
Yi Jin0a3406f2017-06-22 19:23:11 -070033 src/section_list.cpp \
Joe Onorato1754d742016-11-21 17:51:35 -080034
35LOCAL_CFLAGS += \
36 -Wall -Werror -Wno-missing-field-initializers -Wno-unused-variable -Wunused-parameter
37
38ifeq (debug,)
39 LOCAL_CFLAGS += \
40 -g -O0
41else
42 # optimize for size (protobuf glop can get big)
43 LOCAL_CFLAGS += \
44 -Os
45endif
46
47LOCAL_SHARED_LIBRARIES := \
48 libbase \
49 libbinder \
50 libcutils \
51 libincident \
52 liblog \
53 libselinux \
54 libservices \
55 libutils
56
57ifeq (BUILD_WITH_INCIDENTD_RC,true)
58LOCAL_INIT_RC := incidentd.rc
59endif
60
61include $(BUILD_EXECUTABLE)
Yi Jin0a3406f2017-06-22 19:23:11 -070062
63# ============== #
64# incidentd_test #
65# ============== #
66
67include $(CLEAR_VARS)
68
69LOCAL_MODULE := incidentd_test
70LOCAL_COMPATIBILITY_SUITE := device-tests
71LOCAL_MODULE_TAGS := tests
72
73LOCAL_CFLAGS := -Werror -Wall -Wno-unused-variable -Wunused-parameter
74
75LOCAL_C_INCLUDES += $(LOCAL_PATH)/src
76
77LOCAL_SRC_FILES := \
78 src/FdBuffer.cpp \
79 src/Reporter.cpp \
80 src/Section.cpp \
81 src/protobuf.cpp \
Yi Jinadd11e92017-07-30 16:10:07 -070082 src/report_directory.cpp \
83 src/section_list.cpp \
Yi Jin0a3406f2017-06-22 19:23:11 -070084 tests/FdBuffer_test.cpp \
Yi Jinadd11e92017-07-30 16:10:07 -070085 tests/Reporter_test.cpp \
Yi Jin0a3406f2017-06-22 19:23:11 -070086 tests/Section_test.cpp \
87
88LOCAL_STATIC_LIBRARIES := \
89 libgmock \
90
91LOCAL_SHARED_LIBRARIES := \
92 libbase \
93 libbinder \
94 libcutils \
95 libincident \
96 liblog \
97 libselinux \
98 libservices \
99 libutils \
100
101relative_path_prefix := nativetest64/incidentd_test
102testdata_files := $(call find-subdir-files, testdata/*)
103
104GEN := $(addprefix $(TARGET_OUT_DATA)/$(relative_path_prefix)/, $(testdata_files))
105$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
106$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
107$(GEN): $(TARGET_OUT_DATA)/$(relative_path_prefix)/testdata/% : $(LOCAL_PATH)/testdata/%
108 $(transform-generated-source)
109LOCAL_GENERATED_SOURCES += $(GEN)
110
111include $(BUILD_NATIVE_TEST)