blob: 835a7b94507b2d88621895dbd3de42b943031786 [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 \
Yi Jinf8601842017-08-15 22:01:41 -070032 src/report_directory.cpp
Joe Onorato1754d742016-11-21 17:51:35 -080033
34LOCAL_CFLAGS += \
35 -Wall -Werror -Wno-missing-field-initializers -Wno-unused-variable -Wunused-parameter
36
37ifeq (debug,)
38 LOCAL_CFLAGS += \
39 -g -O0
40else
41 # optimize for size (protobuf glop can get big)
42 LOCAL_CFLAGS += \
43 -Os
44endif
45
Yi Jinf8601842017-08-15 22:01:41 -070046LOCAL_C_INCLUDES += $(LOCAL_PATH)/src
47
Joe Onorato1754d742016-11-21 17:51:35 -080048LOCAL_SHARED_LIBRARIES := \
49 libbase \
50 libbinder \
51 libcutils \
52 libincident \
53 liblog \
54 libselinux \
55 libservices \
56 libutils
57
Yi Jinf8601842017-08-15 22:01:41 -070058LOCAL_MODULE_CLASS := EXECUTABLES
59gen_src_dir := $(local-generated-sources-dir)
60
61GEN := $(gen_src_dir)/src/section_list.cpp
62$(GEN): $(HOST_OUT_EXECUTABLES)/incident-section-gen
63$(GEN): PRIVATE_CUSTOM_TOOL = \
64 $(HOST_OUT_EXECUTABLES)/incident-section-gen incidentd > $@
65$(GEN): $(HOST_OUT_EXECUTABLES)/incident-section-gen
66 $(transform-generated-source)
67LOCAL_GENERATED_SOURCES += $(GEN)
68
69gen_src_dir:=
70GEN:=
71
Joe Onorato1754d742016-11-21 17:51:35 -080072LOCAL_INIT_RC := incidentd.rc
Joe Onorato1754d742016-11-21 17:51:35 -080073
74include $(BUILD_EXECUTABLE)
Yi Jin0a3406f2017-06-22 19:23:11 -070075
76# ============== #
77# incidentd_test #
78# ============== #
79
80include $(CLEAR_VARS)
81
82LOCAL_MODULE := incidentd_test
83LOCAL_COMPATIBILITY_SUITE := device-tests
84LOCAL_MODULE_TAGS := tests
85
86LOCAL_CFLAGS := -Werror -Wall -Wno-unused-variable -Wunused-parameter
87
88LOCAL_C_INCLUDES += $(LOCAL_PATH)/src
89
90LOCAL_SRC_FILES := \
91 src/FdBuffer.cpp \
92 src/Reporter.cpp \
93 src/Section.cpp \
94 src/protobuf.cpp \
Yi Jinadd11e92017-07-30 16:10:07 -070095 src/report_directory.cpp \
Yi Jinf8601842017-08-15 22:01:41 -070096 tests/section_list.cpp \
Yi Jin0a3406f2017-06-22 19:23:11 -070097 tests/FdBuffer_test.cpp \
Yi Jinadd11e92017-07-30 16:10:07 -070098 tests/Reporter_test.cpp \
Yi Jin0a3406f2017-06-22 19:23:11 -070099 tests/Section_test.cpp \
100
101LOCAL_STATIC_LIBRARIES := \
102 libgmock \
103
104LOCAL_SHARED_LIBRARIES := \
105 libbase \
106 libbinder \
107 libcutils \
108 libincident \
109 liblog \
110 libselinux \
111 libservices \
112 libutils \
113
114relative_path_prefix := nativetest64/incidentd_test
115testdata_files := $(call find-subdir-files, testdata/*)
116
117GEN := $(addprefix $(TARGET_OUT_DATA)/$(relative_path_prefix)/, $(testdata_files))
118$(GEN): PRIVATE_PATH := $(LOCAL_PATH)
119$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@
120$(GEN): $(TARGET_OUT_DATA)/$(relative_path_prefix)/testdata/% : $(LOCAL_PATH)/testdata/%
121 $(transform-generated-source)
122LOCAL_GENERATED_SOURCES += $(GEN)
123
124include $(BUILD_NATIVE_TEST)