Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 1 | # Copyright (C) 2017 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) |
| 16 | |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 17 | # ================ |
| 18 | # proto static lib |
| 19 | # ================ |
| 20 | include $(CLEAR_VARS) |
| 21 | |
| 22 | LOCAL_MODULE := statsd_proto |
| 23 | LOCAL_MODULE_TAGS := optional |
| 24 | |
| 25 | LOCAL_SRC_FILES := $(call all-proto-files-under, src) |
| 26 | |
| 27 | LOCAL_PROTOC_FLAGS := |
David Chen | 0656b7a | 2017-09-13 15:53:39 -0700 | [diff] [blame] | 28 | LOCAL_PROTOC_OPTIMIZE_TYPE := lite-static |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 29 | |
| 30 | include $(BUILD_STATIC_LIBRARY) |
| 31 | |
| 32 | STATSD_PROTO_INCLUDES := $(local-generated-sources-dir)/src/$(LOCAL_PATH) |
| 33 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 34 | # ========= |
| 35 | # statsd |
| 36 | # ========= |
| 37 | |
| 38 | include $(CLEAR_VARS) |
| 39 | |
| 40 | LOCAL_MODULE := statsd |
| 41 | |
| 42 | LOCAL_SRC_FILES := \ |
Bookatz | 486d1cf | 2017-09-01 13:10:41 -0700 | [diff] [blame] | 43 | ../../core/java/android/os/IStatsCompanionService.aidl \ |
Bookatz | b487b55 | 2017-09-18 11:26:01 -0700 | [diff] [blame] | 44 | ../../core/java/android/os/IStatsManager.aidl \ |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 45 | src/StatsService.cpp \ |
Bookatz | 486d1cf | 2017-09-01 13:10:41 -0700 | [diff] [blame] | 46 | src/AnomalyMonitor.cpp \ |
Bookatz | c68a9d2 | 2017-09-27 14:09:55 -0700 | [diff] [blame] | 47 | src/StatsPuller.cpp \ |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 48 | src/LogEntryPrinter.cpp \ |
| 49 | src/LogReader.cpp \ |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 50 | src/main.cpp \ |
| 51 | src/DropboxWriter.cpp \ |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 52 | src/parse_util.cpp \ |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 53 | src/StatsLogProcessor.cpp \ |
| 54 | src/stats_log.proto \ |
| 55 | src/statsd_config.proto \ |
Yao Chen | 482d272 | 2017-09-12 13:25:43 -0700 | [diff] [blame] | 56 | src/DropboxReader.cpp \ |
David Chen | dd89694 | 2017-09-26 11:44:40 -0700 | [diff] [blame] | 57 | src/matchers/LogEntryMatcherManager.cpp \ |
Yao Chen | 44cf27c | 2017-09-14 22:32:50 -0700 | [diff] [blame] | 58 | src/metrics/CountMetricProducer.cpp \ |
| 59 | src/metrics/ConditionTracker.cpp \ |
| 60 | src/metrics/MetricsManager.cpp \ |
Yao Chen | 482d272 | 2017-09-12 13:25:43 -0700 | [diff] [blame] | 61 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 62 | |
| 63 | LOCAL_CFLAGS += \ |
| 64 | -Wall \ |
| 65 | -Werror \ |
| 66 | -Wno-missing-field-initializers \ |
| 67 | -Wno-unused-variable \ |
| 68 | -Wno-unused-function \ |
| 69 | -Wno-unused-parameter |
| 70 | |
| 71 | ifeq (debug,) |
| 72 | LOCAL_CFLAGS += \ |
| 73 | -g -O0 |
| 74 | else |
| 75 | # optimize for size (protobuf glop can get big) |
| 76 | LOCAL_CFLAGS += \ |
| 77 | -Os |
| 78 | endif |
| 79 | |
| 80 | LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/../../core/java |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 81 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/src \ |
| 82 | STATSD_PROTO_INCLUDES |
| 83 | |
| 84 | LOCAL_STATIC_LIBRARIES := statsd_proto |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 85 | |
| 86 | LOCAL_SHARED_LIBRARIES := \ |
| 87 | libbase \ |
| 88 | libbinder \ |
| 89 | libcutils \ |
| 90 | libincident \ |
| 91 | liblog \ |
| 92 | libselinux \ |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 93 | libutils \ |
| 94 | libservices \ |
Yao Chen | 482d272 | 2017-09-12 13:25:43 -0700 | [diff] [blame] | 95 | libandroidfw \ |
David Chen | 0656b7a | 2017-09-13 15:53:39 -0700 | [diff] [blame] | 96 | libprotobuf-cpp-lite \ |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 97 | |
| 98 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 99 | |
| 100 | #LOCAL_INIT_RC := statsd.rc |
| 101 | |
| 102 | include $(BUILD_EXECUTABLE) |
| 103 | |
| 104 | # ============== |
| 105 | # statsd_test |
| 106 | # ============== |
| 107 | |
| 108 | include $(CLEAR_VARS) |
| 109 | |
| 110 | LOCAL_MODULE := statsd_test |
| 111 | LOCAL_COMPATIBILITY_SUITE := device-tests |
| 112 | LOCAL_MODULE_TAGS := tests |
| 113 | |
David Chen | dd89694 | 2017-09-26 11:44:40 -0700 | [diff] [blame] | 114 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/src \ |
| 115 | STATSD_PROTO_INCLUDES |
| 116 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 117 | LOCAL_CFLAGS += \ |
| 118 | -Wall \ |
| 119 | -Werror \ |
| 120 | -Wno-missing-field-initializers \ |
| 121 | -Wno-unused-variable \ |
| 122 | -Wno-unused-function \ |
| 123 | -Wno-unused-parameter |
| 124 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 125 | LOCAL_SRC_FILES := \ |
David Chen | dd89694 | 2017-09-26 11:44:40 -0700 | [diff] [blame] | 126 | src/stats_log.proto \ |
| 127 | src/statsd_config.proto \ |
Bookatz | b487b55 | 2017-09-18 11:26:01 -0700 | [diff] [blame] | 128 | ../../core/java/android/os/IStatsCompanionService.aidl \ |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 129 | ../../core/java/android/os/IStatsManager.aidl \ |
| 130 | src/StatsService.cpp \ |
Bookatz | 0e95909 | 2017-09-07 17:39:37 -0700 | [diff] [blame] | 131 | tests/indexed_priority_queue_test.cpp \ |
David Chen | dd89694 | 2017-09-26 11:44:40 -0700 | [diff] [blame] | 132 | src/parse_util.cpp \ |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 133 | src/LogEntryPrinter.cpp \ |
| 134 | src/LogReader.cpp \ |
David Chen | dd89694 | 2017-09-26 11:44:40 -0700 | [diff] [blame] | 135 | src/matchers/LogEntryMatcherManager.cpp \ |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 136 | tests/LogReader_test.cpp \ |
David Chen | dd89694 | 2017-09-26 11:44:40 -0700 | [diff] [blame] | 137 | tests/LogEntryMatcher_test.cpp \ |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 138 | |
| 139 | LOCAL_STATIC_LIBRARIES := \ |
| 140 | libgmock \ |
David Chen | dd89694 | 2017-09-26 11:44:40 -0700 | [diff] [blame] | 141 | statsd_proto \ |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 142 | |
| 143 | LOCAL_SHARED_LIBRARIES := \ |
| 144 | libbase \ |
| 145 | libbinder \ |
| 146 | libcutils \ |
| 147 | liblog \ |
| 148 | libselinux \ |
David Chen | 0656b7a | 2017-09-13 15:53:39 -0700 | [diff] [blame] | 149 | libutils \ |
| 150 | libprotobuf-cpp-lite \ |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 151 | |
| 152 | include $(BUILD_NATIVE_TEST) |