Bertrand SIMONNET | ed6ca6f | 2015-07-28 15:46:36 -0700 | [diff] [blame] | 1 | # Copyright (C) 2015 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 | |
| 17 | metrics_cpp_extension := .cc |
| 18 | libmetrics_sources := \ |
| 19 | c_metrics_library.cc \ |
| 20 | metrics_library.cc \ |
| 21 | serialization/metric_sample.cc \ |
Samuel Tan | 1c4d8f1 | 2015-09-15 11:40:47 -0700 | [diff] [blame] | 22 | serialization/serialization_utils.cc \ |
| 23 | timer.cc |
Bertrand SIMONNET | ed6ca6f | 2015-07-28 15:46:36 -0700 | [diff] [blame] | 24 | |
| 25 | metrics_client_sources := \ |
| 26 | metrics_client.cc |
| 27 | |
Bertrand SIMONNET | 59890e2 | 2015-10-02 16:45:18 -0700 | [diff] [blame] | 28 | metrics_daemon_common := \ |
Bertrand SIMONNET | 7a96405 | 2015-09-29 11:07:24 -0700 | [diff] [blame] | 29 | collectors/averaged_statistics_collector.cc \ |
Bertrand SIMONNET | 5658dc5 | 2015-09-18 13:38:10 -0700 | [diff] [blame] | 30 | collectors/disk_usage_collector.cc \ |
Bertrand SIMONNET | ed6ca6f | 2015-07-28 15:46:36 -0700 | [diff] [blame] | 31 | metrics_daemon.cc \ |
Bertrand SIMONNET | ed6ca6f | 2015-07-28 15:46:36 -0700 | [diff] [blame] | 32 | persistent_integer.cc \ |
Bertrand SIMONNET | 1253186 | 2015-08-31 11:11:57 -0700 | [diff] [blame] | 33 | serialization/metric_sample.cc \ |
| 34 | serialization/serialization_utils.cc \ |
Bertrand SIMONNET | 1253186 | 2015-08-31 11:11:57 -0700 | [diff] [blame] | 35 | uploader/metrics_hashes.cc \ |
Bertrand SIMONNET | 1253186 | 2015-08-31 11:11:57 -0700 | [diff] [blame] | 36 | uploader/metrics_log_base.cc \ |
Bertrand SIMONNET | 1253186 | 2015-08-31 11:11:57 -0700 | [diff] [blame] | 37 | uploader/metrics_log.cc \ |
Bertrand SIMONNET | 1253186 | 2015-08-31 11:11:57 -0700 | [diff] [blame] | 38 | uploader/sender_http.cc \ |
| 39 | uploader/system_profile_cache.cc \ |
| 40 | uploader/upload_service.cc \ |
Bertrand SIMONNET | 59890e2 | 2015-10-02 16:45:18 -0700 | [diff] [blame] | 41 | |
| 42 | metrics_tests_sources := \ |
| 43 | collectors/averaged_statistics_collector_test.cc \ |
| 44 | metrics_daemon_test.cc \ |
| 45 | metrics_library_test.cc \ |
| 46 | persistent_integer_test.cc \ |
| 47 | serialization/serialization_utils_unittest.cc \ |
| 48 | timer_test.cc \ |
| 49 | uploader/metrics_hashes_unittest.cc \ |
| 50 | uploader/metrics_log_base_unittest.cc \ |
| 51 | uploader/mock/sender_mock.cc \ |
Bertrand SIMONNET | 1253186 | 2015-08-31 11:11:57 -0700 | [diff] [blame] | 52 | uploader/upload_service_test.cc \ |
| 53 | |
Bertrand SIMONNET | ed6ca6f | 2015-07-28 15:46:36 -0700 | [diff] [blame] | 54 | metrics_CFLAGS := -Wall \ |
Bertrand SIMONNET | ed6ca6f | 2015-07-28 15:46:36 -0700 | [diff] [blame] | 55 | -Wno-char-subscripts \ |
| 56 | -Wno-missing-field-initializers \ |
| 57 | -Wno-unused-function \ |
| 58 | -Wno-unused-parameter \ |
| 59 | -Werror \ |
| 60 | -fvisibility=default |
| 61 | metrics_CPPFLAGS := -Wno-non-virtual-dtor \ |
| 62 | -Wno-sign-promo \ |
| 63 | -Wno-strict-aliasing \ |
| 64 | -fvisibility=default |
| 65 | metrics_includes := external/gtest/include \ |
| 66 | $(LOCAL_PATH)/include |
Alex Vakulenko | 26aef37 | 2015-10-27 11:46:37 -0700 | [diff] [blame] | 67 | libmetrics_shared_libraries := libchrome libbrillo |
Bertrand SIMONNET | 59890e2 | 2015-10-02 16:45:18 -0700 | [diff] [blame] | 68 | metrics_daemon_shared_libraries := $(libmetrics_shared_libraries) \ |
Alex Vakulenko | 26aef37 | 2015-10-27 11:46:37 -0700 | [diff] [blame] | 69 | libbrillo-http \ |
| 70 | libbrillo-dbus \ |
Bertrand SIMONNET | 59890e2 | 2015-10-02 16:45:18 -0700 | [diff] [blame] | 71 | libchrome-dbus \ |
Bertrand SIMONNET | 59890e2 | 2015-10-02 16:45:18 -0700 | [diff] [blame] | 72 | libdbus \ |
| 73 | libmetrics \ |
| 74 | libprotobuf-cpp-lite \ |
| 75 | librootdev \ |
Bertrand SIMONNET | eb697ab | 2015-10-14 13:26:42 -0700 | [diff] [blame] | 76 | libupdate_engine_client \ |
Alex Vakulenko | 82b02de | 2015-10-09 20:07:47 -0700 | [diff] [blame] | 77 | libweaved \ |
Bertrand SIMONNET | ed6ca6f | 2015-07-28 15:46:36 -0700 | [diff] [blame] | 78 | |
| 79 | # Shared library for metrics. |
| 80 | # ======================================================== |
| 81 | include $(CLEAR_VARS) |
| 82 | LOCAL_MODULE := libmetrics |
| 83 | LOCAL_C_INCLUDES := $(metrics_includes) |
| 84 | LOCAL_CFLAGS := $(metrics_CFLAGS) |
Bertrand SIMONNET | ebbe35c | 2015-09-08 10:13:35 -0700 | [diff] [blame] | 85 | LOCAL_CLANG := true |
Bertrand SIMONNET | ed6ca6f | 2015-07-28 15:46:36 -0700 | [diff] [blame] | 86 | LOCAL_CPP_EXTENSION := $(metrics_cpp_extension) |
| 87 | LOCAL_CPPFLAGS := $(metrics_CPPFLAGS) |
Samuel Tan | 28a78b7 | 2015-09-23 14:39:35 -0700 | [diff] [blame] | 88 | LOCAL_RTTI_FLAG := -frtti |
Bertrand SIMONNET | ed6ca6f | 2015-07-28 15:46:36 -0700 | [diff] [blame] | 89 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Bertrand SIMONNET | 59890e2 | 2015-10-02 16:45:18 -0700 | [diff] [blame] | 90 | LOCAL_SHARED_LIBRARIES := $(libmetrics_shared_libraries) |
Bertrand SIMONNET | ed6ca6f | 2015-07-28 15:46:36 -0700 | [diff] [blame] | 91 | LOCAL_SRC_FILES := $(libmetrics_sources) |
| 92 | include $(BUILD_SHARED_LIBRARY) |
| 93 | |
| 94 | # CLI client for metrics. |
| 95 | # ======================================================== |
| 96 | include $(CLEAR_VARS) |
| 97 | LOCAL_MODULE := metrics_client |
| 98 | LOCAL_C_INCLUDES := $(metrics_includes) |
| 99 | LOCAL_CFLAGS := $(metrics_CFLAGS) |
Bertrand SIMONNET | ebbe35c | 2015-09-08 10:13:35 -0700 | [diff] [blame] | 100 | LOCAL_CLANG := true |
Bertrand SIMONNET | ed6ca6f | 2015-07-28 15:46:36 -0700 | [diff] [blame] | 101 | LOCAL_CPP_EXTENSION := $(metrics_cpp_extension) |
| 102 | LOCAL_CPPFLAGS := $(metrics_CPPFLAGS) |
Bertrand SIMONNET | 59890e2 | 2015-10-02 16:45:18 -0700 | [diff] [blame] | 103 | LOCAL_SHARED_LIBRARIES := $(libmetrics_shared_libraries) \ |
Bertrand SIMONNET | ed6ca6f | 2015-07-28 15:46:36 -0700 | [diff] [blame] | 104 | libmetrics |
| 105 | LOCAL_SRC_FILES := $(metrics_client_sources) |
| 106 | include $(BUILD_EXECUTABLE) |
| 107 | |
| 108 | # Protobuf library for metrics_daemon. |
| 109 | # ======================================================== |
| 110 | include $(CLEAR_VARS) |
| 111 | LOCAL_MODULE := metrics_daemon_protos |
| 112 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 113 | generated_sources_dir := $(call local-generated-sources-dir) |
| 114 | LOCAL_EXPORT_C_INCLUDE_DIRS += \ |
| 115 | $(generated_sources_dir)/proto/system/core/metricsd |
| 116 | LOCAL_SRC_FILES := $(call all-proto-files-under,uploader/proto) |
Bertrand SIMONNET | ed6ca6f | 2015-07-28 15:46:36 -0700 | [diff] [blame] | 117 | include $(BUILD_STATIC_LIBRARY) |
| 118 | |
| 119 | # metrics daemon. |
| 120 | # ======================================================== |
| 121 | include $(CLEAR_VARS) |
Jorge Lucangeli Obes | 9341286 | 2015-09-28 11:31:58 -0700 | [diff] [blame] | 122 | LOCAL_MODULE := metrics_daemon |
Alex Vakulenko | 26aef37 | 2015-10-27 11:46:37 -0700 | [diff] [blame] | 123 | LOCAL_C_INCLUDES := $(metrics_includes) |
Bertrand SIMONNET | ed6ca6f | 2015-07-28 15:46:36 -0700 | [diff] [blame] | 124 | LOCAL_CFLAGS := $(metrics_CFLAGS) |
| 125 | LOCAL_CPP_EXTENSION := $(metrics_cpp_extension) |
| 126 | LOCAL_CPPFLAGS := $(metrics_CPPFLAGS) |
Jorge Lucangeli Obes | 9341286 | 2015-09-28 11:31:58 -0700 | [diff] [blame] | 127 | LOCAL_INIT_RC := metrics_daemon.rc |
Bertrand SIMONNET | 59890e2 | 2015-10-02 16:45:18 -0700 | [diff] [blame] | 128 | LOCAL_REQUIRED_MODULES := \ |
| 129 | metrics.json \ |
| 130 | metrics.schema.json \ |
Bertrand SIMONNET | ebbe35c | 2015-09-08 10:13:35 -0700 | [diff] [blame] | 131 | |
Bertrand SIMONNET | 59890e2 | 2015-10-02 16:45:18 -0700 | [diff] [blame] | 132 | LOCAL_RTTI_FLAG := -frtti |
| 133 | LOCAL_SHARED_LIBRARIES := $(metrics_daemon_shared_libraries) |
Bertrand SIMONNET | ebbe35c | 2015-09-08 10:13:35 -0700 | [diff] [blame] | 134 | LOCAL_CLANG := true |
Bertrand SIMONNET | 59890e2 | 2015-10-02 16:45:18 -0700 | [diff] [blame] | 135 | LOCAL_SRC_FILES := $(metrics_daemon_common) \ |
| 136 | metrics_daemon_main.cc |
Bertrand SIMONNET | ed6ca6f | 2015-07-28 15:46:36 -0700 | [diff] [blame] | 137 | LOCAL_STATIC_LIBRARIES := metrics_daemon_protos |
| 138 | include $(BUILD_EXECUTABLE) |
Bertrand SIMONNET | 0a94a3b | 2015-08-11 11:45:05 -0700 | [diff] [blame] | 139 | |
Bertrand SIMONNET | 1253186 | 2015-08-31 11:11:57 -0700 | [diff] [blame] | 140 | # Unit tests for metrics. |
| 141 | # ======================================================== |
| 142 | include $(CLEAR_VARS) |
| 143 | LOCAL_MODULE := metrics_tests |
Bertrand SIMONNET | 7a96405 | 2015-09-29 11:07:24 -0700 | [diff] [blame] | 144 | LOCAL_CLANG := true |
Bertrand SIMONNET | 1253186 | 2015-08-31 11:11:57 -0700 | [diff] [blame] | 145 | LOCAL_CFLAGS := $(metrics_CFLAGS) |
| 146 | LOCAL_CPP_EXTENSION := $(metrics_cpp_extension) |
| 147 | LOCAL_CPPFLAGS := $(metrics_CPPFLAGS) -Wno-sign-compare |
| 148 | LOCAL_RTTI_FLAG := -frtti |
Bertrand SIMONNET | 59890e2 | 2015-10-02 16:45:18 -0700 | [diff] [blame] | 149 | LOCAL_SHARED_LIBRARIES := $(metrics_daemon_shared_libraries) |
| 150 | LOCAL_SRC_FILES := $(metrics_tests_sources) $(metrics_daemon_common) |
Bertrand SIMONNET | 1253186 | 2015-08-31 11:11:57 -0700 | [diff] [blame] | 151 | LOCAL_STATIC_LIBRARIES := libBionicGtestMain libgmock metrics_daemon_protos |
| 152 | |
| 153 | include $(BUILD_NATIVE_TEST) |
Bertrand SIMONNET | 59890e2 | 2015-10-02 16:45:18 -0700 | [diff] [blame] | 154 | |
| 155 | # Weave schema files |
| 156 | # ======================================================== |
| 157 | include $(CLEAR_VARS) |
| 158 | LOCAL_MODULE := metrics.json |
| 159 | LOCAL_MODULE_CLASS := ETC |
| 160 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/weaved/commands |
| 161 | LOCAL_SRC_FILES := etc/weaved/commands/$(LOCAL_MODULE) |
| 162 | include $(BUILD_PREBUILT) |
| 163 | |
| 164 | include $(CLEAR_VARS) |
| 165 | LOCAL_MODULE := metrics.schema.json |
| 166 | LOCAL_MODULE_CLASS := ETC |
| 167 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/weaved/states |
| 168 | LOCAL_SRC_FILES := etc/weaved/states/$(LOCAL_MODULE) |
| 169 | include $(BUILD_PREBUILT) |