blob: 17fb2784893a22009497484bb349578ab7f6bc0c [file] [log] [blame]
Bertrand SIMONNETed6ca6f2015-07-28 15:46:36 -07001# 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
15LOCAL_PATH := $(call my-dir)
16
17metrics_cpp_extension := .cc
18libmetrics_sources := \
19 c_metrics_library.cc \
20 metrics_library.cc \
21 serialization/metric_sample.cc \
22 serialization/serialization_utils.cc
23
24metrics_client_sources := \
25 metrics_client.cc
26
27metrics_daemon_sources := \
28 metrics_daemon.cc \
29 metrics_daemon_main.cc \
30 persistent_integer.cc \
31 uploader/metrics_hashes.cc \
32 uploader/metrics_log_base.cc \
33 uploader/metrics_log.cc \
34 uploader/sender_http.cc \
35 uploader/system_profile_cache.cc \
36 uploader/upload_service.cc \
37 serialization/metric_sample.cc \
38 serialization/serialization_utils.cc
39
40metrics_CFLAGS := -Wall \
41 -D__BRILLO__ \
42 -Wno-char-subscripts \
43 -Wno-missing-field-initializers \
44 -Wno-unused-function \
45 -Wno-unused-parameter \
46 -Werror \
47 -fvisibility=default
48metrics_CPPFLAGS := -Wno-non-virtual-dtor \
49 -Wno-sign-promo \
50 -Wno-strict-aliasing \
51 -fvisibility=default
52metrics_includes := external/gtest/include \
53 $(LOCAL_PATH)/include
54metrics_shared_libraries := libchrome libchromeos
55
56# Shared library for metrics.
57# ========================================================
58include $(CLEAR_VARS)
59LOCAL_MODULE := libmetrics
60LOCAL_C_INCLUDES := $(metrics_includes)
61LOCAL_CFLAGS := $(metrics_CFLAGS)
62LOCAL_CPP_EXTENSION := $(metrics_cpp_extension)
63LOCAL_CPPFLAGS := $(metrics_CPPFLAGS)
64LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
65LOCAL_SHARED_LIBRARIES := $(metrics_shared_libraries)
66LOCAL_SRC_FILES := $(libmetrics_sources)
67include $(BUILD_SHARED_LIBRARY)
68
69# CLI client for metrics.
70# ========================================================
71include $(CLEAR_VARS)
72LOCAL_MODULE := metrics_client
73LOCAL_C_INCLUDES := $(metrics_includes)
74LOCAL_CFLAGS := $(metrics_CFLAGS)
75LOCAL_CPP_EXTENSION := $(metrics_cpp_extension)
76LOCAL_CPPFLAGS := $(metrics_CPPFLAGS)
77LOCAL_SHARED_LIBRARIES := $(metrics_shared_libraries) \
78 libmetrics
79LOCAL_SRC_FILES := $(metrics_client_sources)
80include $(BUILD_EXECUTABLE)
81
82# Protobuf library for metrics_daemon.
83# ========================================================
84include $(CLEAR_VARS)
85LOCAL_MODULE := metrics_daemon_protos
86LOCAL_MODULE_CLASS := STATIC_LIBRARIES
87generated_sources_dir := $(call local-generated-sources-dir)
88LOCAL_EXPORT_C_INCLUDE_DIRS += \
89 $(generated_sources_dir)/proto/system/core/metricsd
90LOCAL_SRC_FILES := $(call all-proto-files-under,uploader/proto)
91LOCAL_STATIC_LIBRARIES := libprotobuf-cpp-lite
92include $(BUILD_STATIC_LIBRARY)
93
94# metrics daemon.
95# ========================================================
96include $(CLEAR_VARS)
97LOCAL_MODULE := metrics_daemon
98LOCAL_C_INCLUDES := $(metrics_includes) \
99 external/libchromeos
100LOCAL_CFLAGS := $(metrics_CFLAGS)
101LOCAL_CPP_EXTENSION := $(metrics_cpp_extension)
102LOCAL_CPPFLAGS := $(metrics_CPPFLAGS)
103LOCAL_RTTI_FLAG := -frtti
104LOCAL_SHARED_LIBRARIES := $(metrics_shared_libraries) \
105 libmetrics \
106 libprotobuf-cpp-lite \
107 libchromeos-http \
108 libchromeos-dbus \
109 libdbus
110LOCAL_SRC_FILES := $(metrics_daemon_sources)
111LOCAL_STATIC_LIBRARIES := metrics_daemon_protos
112include $(BUILD_EXECUTABLE)