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