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