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