Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 1 | # 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 | |
| 15 | LOCAL_PATH:= $(call my-dir) |
Yi Jin | 0a3406f | 2017-06-22 19:23:11 -0700 | [diff] [blame] | 16 | |
| 17 | # ========= # |
| 18 | # incidentd # |
| 19 | # ========= # |
| 20 | |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 21 | include $(CLEAR_VARS) |
| 22 | |
| 23 | LOCAL_MODULE := incidentd |
| 24 | |
| 25 | LOCAL_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 Jin | f860184 | 2017-08-15 22:01:41 -0700 | [diff] [blame] | 32 | src/report_directory.cpp |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 33 | |
| 34 | LOCAL_CFLAGS += \ |
| 35 | -Wall -Werror -Wno-missing-field-initializers -Wno-unused-variable -Wunused-parameter |
| 36 | |
| 37 | ifeq (debug,) |
| 38 | LOCAL_CFLAGS += \ |
| 39 | -g -O0 |
| 40 | else |
| 41 | # optimize for size (protobuf glop can get big) |
| 42 | LOCAL_CFLAGS += \ |
| 43 | -Os |
| 44 | endif |
| 45 | |
Yi Jin | f860184 | 2017-08-15 22:01:41 -0700 | [diff] [blame] | 46 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/src |
| 47 | |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 48 | LOCAL_SHARED_LIBRARIES := \ |
| 49 | libbase \ |
| 50 | libbinder \ |
| 51 | libcutils \ |
| 52 | libincident \ |
| 53 | liblog \ |
| 54 | libselinux \ |
| 55 | libservices \ |
| 56 | libutils |
| 57 | |
Yi Jin | f860184 | 2017-08-15 22:01:41 -0700 | [diff] [blame] | 58 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 59 | gen_src_dir := $(local-generated-sources-dir) |
| 60 | |
| 61 | GEN := $(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) |
| 67 | LOCAL_GENERATED_SOURCES += $(GEN) |
| 68 | |
| 69 | gen_src_dir:= |
| 70 | GEN:= |
| 71 | |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 72 | LOCAL_INIT_RC := incidentd.rc |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 73 | |
| 74 | include $(BUILD_EXECUTABLE) |
Yi Jin | 0a3406f | 2017-06-22 19:23:11 -0700 | [diff] [blame] | 75 | |
| 76 | # ============== # |
| 77 | # incidentd_test # |
| 78 | # ============== # |
| 79 | |
| 80 | include $(CLEAR_VARS) |
| 81 | |
| 82 | LOCAL_MODULE := incidentd_test |
| 83 | LOCAL_COMPATIBILITY_SUITE := device-tests |
| 84 | LOCAL_MODULE_TAGS := tests |
| 85 | |
| 86 | LOCAL_CFLAGS := -Werror -Wall -Wno-unused-variable -Wunused-parameter |
| 87 | |
| 88 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/src |
| 89 | |
| 90 | LOCAL_SRC_FILES := \ |
| 91 | src/FdBuffer.cpp \ |
| 92 | src/Reporter.cpp \ |
| 93 | src/Section.cpp \ |
| 94 | src/protobuf.cpp \ |
Yi Jin | add11e9 | 2017-07-30 16:10:07 -0700 | [diff] [blame] | 95 | src/report_directory.cpp \ |
Yi Jin | f860184 | 2017-08-15 22:01:41 -0700 | [diff] [blame] | 96 | tests/section_list.cpp \ |
Yi Jin | 0a3406f | 2017-06-22 19:23:11 -0700 | [diff] [blame] | 97 | tests/FdBuffer_test.cpp \ |
Yi Jin | add11e9 | 2017-07-30 16:10:07 -0700 | [diff] [blame] | 98 | tests/Reporter_test.cpp \ |
Yi Jin | 0a3406f | 2017-06-22 19:23:11 -0700 | [diff] [blame] | 99 | tests/Section_test.cpp \ |
| 100 | |
| 101 | LOCAL_STATIC_LIBRARIES := \ |
| 102 | libgmock \ |
| 103 | |
| 104 | LOCAL_SHARED_LIBRARIES := \ |
| 105 | libbase \ |
| 106 | libbinder \ |
| 107 | libcutils \ |
| 108 | libincident \ |
| 109 | liblog \ |
| 110 | libselinux \ |
| 111 | libservices \ |
| 112 | libutils \ |
| 113 | |
| 114 | relative_path_prefix := nativetest64/incidentd_test |
| 115 | testdata_files := $(call find-subdir-files, testdata/*) |
| 116 | |
| 117 | GEN := $(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) |
| 122 | LOCAL_GENERATED_SOURCES += $(GEN) |
| 123 | |
| 124 | include $(BUILD_NATIVE_TEST) |