blob: cb5fd02ef30b2d83ec2f4e5fad7e8263b9f382f8 [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
Yi Jin99c248f2017-08-25 18:11:58 -070075ifeq ($(BUILD_WITH_INCIDENTD_RC), true)
Joe Onorato1754d742016-11-21 17:51:35 -080076LOCAL_INIT_RC := incidentd.rc
Yi Jin99c248f2017-08-25 18:11:58 -070077endif
Joe Onorato1754d742016-11-21 17:51:35 -080078
79include $(BUILD_EXECUTABLE)
Yi Jin0a3406f2017-06-22 19:23:11 -070080
81# ============== #
82# incidentd_test #
83# ============== #
84
85include $(CLEAR_VARS)
86
87LOCAL_MODULE := incidentd_test
88LOCAL_COMPATIBILITY_SUITE := device-tests
89LOCAL_MODULE_TAGS := tests
90
91LOCAL_CFLAGS := -Werror -Wall -Wno-unused-variable -Wunused-parameter
92
93LOCAL_C_INCLUDES += $(LOCAL_PATH)/src
94
95LOCAL_SRC_FILES := \
Yi Jinc23fad22017-09-15 17:24:59 -070096 src/PrivacyBuffer.cpp \
Yi Jin0a3406f2017-06-22 19:23:11 -070097 src/FdBuffer.cpp \
Yi Jin99c248f2017-08-25 18:11:58 -070098 src/Privacy.cpp \
Yi Jin0a3406f2017-06-22 19:23:11 -070099 src/Reporter.cpp \
100 src/Section.cpp \
Yi Jin99c248f2017-08-25 18:11:58 -0700101 src/io_util.cpp \
Yi Jinadd11e92017-07-30 16:10:07 -0700102 src/report_directory.cpp \
Yi Jinf8601842017-08-15 22:01:41 -0700103 tests/section_list.cpp \
Yi Jinc23fad22017-09-15 17:24:59 -0700104 tests/PrivacyBuffer_test.cpp \
Yi Jin0a3406f2017-06-22 19:23:11 -0700105 tests/FdBuffer_test.cpp \
Yi Jinadd11e92017-07-30 16:10:07 -0700106 tests/Reporter_test.cpp \
Yi Jin0a3406f2017-06-22 19:23:11 -0700107 tests/Section_test.cpp \
108
109LOCAL_STATIC_LIBRARIES := \
110 libgmock \
111
112LOCAL_SHARED_LIBRARIES := \
113 libbase \
114 libbinder \
115 libcutils \
116 libincident \
117 liblog \
Yi Jinc23fad22017-09-15 17:24:59 -0700118 libprotoutil \
Yi Jin0a3406f2017-06-22 19:23:11 -0700119 libselinux \
120 libservices \
121 libutils \
122
123relative_path_prefix := nativetest64/incidentd_test
124testdata_files := $(call find-subdir-files, testdata/*)
125
126GEN := $(addprefix $(TARGET_OUT_DATA)/$(relative_path_prefix)/, $(testdata_files))
127$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
128$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
129$(GEN): $(TARGET_OUT_DATA)/$(relative_path_prefix)/testdata/% : $(LOCAL_PATH)/testdata/%
130 $(transform-generated-source)
131LOCAL_GENERATED_SOURCES += $(GEN)
132
133include $(BUILD_NATIVE_TEST)