blob: 11d3e4911761d4f080c89b4bf91c32b545021080 [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 := \
Yi Jinc23fad22017-09-15 17:24:59 -070026 src/PrivacyBuffer.cpp \
Joe Onorato1754d742016-11-21 17:51:35 -080027 src/FdBuffer.cpp \
28 src/IncidentService.cpp \
Yi Jin99c248f2017-08-25 18:11:58 -070029 src/Privacy.cpp \
Joe Onorato1754d742016-11-21 17:51:35 -080030 src/Reporter.cpp \
31 src/Section.cpp \
Yi Jin99c248f2017-08-25 18:11:58 -070032 src/io_util.cpp \
Joe Onorato1754d742016-11-21 17:51:35 -080033 src/main.cpp \
Yi Jinf8601842017-08-15 22:01:41 -070034 src/report_directory.cpp
Joe Onorato1754d742016-11-21 17:51:35 -080035
36LOCAL_CFLAGS += \
37 -Wall -Werror -Wno-missing-field-initializers -Wno-unused-variable -Wunused-parameter
38
39ifeq (debug,)
40 LOCAL_CFLAGS += \
41 -g -O0
42else
43 # optimize for size (protobuf glop can get big)
44 LOCAL_CFLAGS += \
45 -Os
46endif
47
Yi Jinf8601842017-08-15 22:01:41 -070048LOCAL_C_INCLUDES += $(LOCAL_PATH)/src
49
Joe Onorato1754d742016-11-21 17:51:35 -080050LOCAL_SHARED_LIBRARIES := \
51 libbase \
52 libbinder \
53 libcutils \
54 libincident \
55 liblog \
Yi Jinc23fad22017-09-15 17:24:59 -070056 libprotoutil \
Joe Onorato1754d742016-11-21 17:51:35 -080057 libselinux \
58 libservices \
59 libutils
60
Yi Jinf8601842017-08-15 22:01:41 -070061LOCAL_MODULE_CLASS := EXECUTABLES
62gen_src_dir := $(local-generated-sources-dir)
63
64GEN := $(gen_src_dir)/src/section_list.cpp
65$(GEN): $(HOST_OUT_EXECUTABLES)/incident-section-gen
66$(GEN): PRIVATE_CUSTOM_TOOL = \
67 $(HOST_OUT_EXECUTABLES)/incident-section-gen incidentd > $@
68$(GEN): $(HOST_OUT_EXECUTABLES)/incident-section-gen
69 $(transform-generated-source)
70LOCAL_GENERATED_SOURCES += $(GEN)
71
72gen_src_dir:=
73GEN:=
74
Joe Onorato1754d742016-11-21 17:51:35 -080075LOCAL_INIT_RC := incidentd.rc
Joe Onorato1754d742016-11-21 17:51:35 -080076
77include $(BUILD_EXECUTABLE)
Yi Jin0a3406f2017-06-22 19:23:11 -070078
79# ============== #
80# incidentd_test #
81# ============== #
82
83include $(CLEAR_VARS)
84
85LOCAL_MODULE := incidentd_test
86LOCAL_COMPATIBILITY_SUITE := device-tests
87LOCAL_MODULE_TAGS := tests
88
89LOCAL_CFLAGS := -Werror -Wall -Wno-unused-variable -Wunused-parameter
90
91LOCAL_C_INCLUDES += $(LOCAL_PATH)/src
92
93LOCAL_SRC_FILES := \
Yi Jinc23fad22017-09-15 17:24:59 -070094 src/PrivacyBuffer.cpp \
Yi Jin0a3406f2017-06-22 19:23:11 -070095 src/FdBuffer.cpp \
Yi Jin99c248f2017-08-25 18:11:58 -070096 src/Privacy.cpp \
Yi Jin0a3406f2017-06-22 19:23:11 -070097 src/Reporter.cpp \
98 src/Section.cpp \
Yi Jin99c248f2017-08-25 18:11:58 -070099 src/io_util.cpp \
Yi Jinadd11e92017-07-30 16:10:07 -0700100 src/report_directory.cpp \
Yi Jinf8601842017-08-15 22:01:41 -0700101 tests/section_list.cpp \
Yi Jinc23fad22017-09-15 17:24:59 -0700102 tests/PrivacyBuffer_test.cpp \
Yi Jin0a3406f2017-06-22 19:23:11 -0700103 tests/FdBuffer_test.cpp \
Yi Jinadd11e92017-07-30 16:10:07 -0700104 tests/Reporter_test.cpp \
Yi Jin0a3406f2017-06-22 19:23:11 -0700105 tests/Section_test.cpp \
106
107LOCAL_STATIC_LIBRARIES := \
108 libgmock \
109
110LOCAL_SHARED_LIBRARIES := \
111 libbase \
112 libbinder \
113 libcutils \
114 libincident \
115 liblog \
Yi Jinc23fad22017-09-15 17:24:59 -0700116 libprotoutil \
Yi Jin0a3406f2017-06-22 19:23:11 -0700117 libselinux \
118 libservices \
119 libutils \
120
Yi Jin5e4ce2c2017-11-13 21:06:26 -0800121LOCAL_TEST_DATA := $(call find-test-data-in-subdirs, $(LOCAL_PATH), *, testdata)
Yi Jin0a3406f2017-06-22 19:23:11 -0700122
123include $(BUILD_NATIVE_TEST)