1#
2# Copyright (C) 2016 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17LOCAL_PATH := $(call my-dir)
18
19bootstat_c_includes := external/gtest/include
20
21bootstat_lib_src_files := \
22        boot_event_record_store.cpp \
23        event_log_list_builder.cpp \
24        histogram_logger.cpp \
25        uptime_parser.cpp \
26
27bootstat_src_files := \
28        bootstat.cpp \
29
30bootstat_test_src_files := \
31        boot_event_record_store_test.cpp \
32        event_log_list_builder_test.cpp \
33        testrunner.cpp \
34
35bootstat_shared_libs := \
36        libbase \
37        libcutils \
38        liblog \
39
40bootstat_cflags := \
41        -Wall \
42        -Wextra \
43        -Werror \
44
45# 524291 corresponds to sysui_histogram, from
46# frameworks/base/core/java/com/android/internal/logging/EventLogTags.logtags
47bootstat_cflags += -DHISTOGRAM_LOG_TAG=524291
48
49bootstat_debug_cflags := \
50        $(bootstat_cflags) \
51        -UNDEBUG \
52
53# bootstat static library
54# -----------------------------------------------------------------------------
55
56include $(CLEAR_VARS)
57
58LOCAL_MODULE := libbootstat
59LOCAL_CFLAGS := $(bootstat_cflags)
60LOCAL_C_INCLUDES := $(bootstat_c_includes)
61LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
62LOCAL_SRC_FILES := $(bootstat_lib_src_files)
63# Clang is required because of C++14
64LOCAL_CLANG := true
65
66include $(BUILD_STATIC_LIBRARY)
67
68# bootstat static library, debug
69# -----------------------------------------------------------------------------
70
71include $(CLEAR_VARS)
72
73LOCAL_MODULE := libbootstat_debug
74LOCAL_CFLAGS := $(bootstat_cflags)
75LOCAL_C_INCLUDES := $(bootstat_c_includes)
76LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
77LOCAL_SRC_FILES := $(bootstat_lib_src_files)
78# Clang is required because of C++14
79LOCAL_CLANG := true
80
81include $(BUILD_STATIC_LIBRARY)
82
83# bootstat host static library, debug
84# -----------------------------------------------------------------------------
85
86include $(CLEAR_VARS)
87
88LOCAL_MODULE := libbootstat_host_debug
89LOCAL_CFLAGS := $(bootstat_debug_cflags)
90LOCAL_C_INCLUDES := $(bootstat_c_includes)
91LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
92LOCAL_SRC_FILES := $(bootstat_lib_src_files)
93# Clang is required because of C++14
94LOCAL_CLANG := true
95
96include $(BUILD_HOST_STATIC_LIBRARY)
97
98# bootstat binary
99# -----------------------------------------------------------------------------
100
101include $(CLEAR_VARS)
102
103LOCAL_MODULE := bootstat
104LOCAL_CFLAGS := $(bootstat_cflags)
105LOCAL_C_INCLUDES := $(bootstat_c_includes)
106LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
107LOCAL_STATIC_LIBRARIES := libbootstat
108LOCAL_INIT_RC := bootstat.rc
109LOCAL_SRC_FILES := $(bootstat_src_files)
110# Clang is required because of C++14
111LOCAL_CLANG := true
112
113include $(BUILD_EXECUTABLE)
114
115# Native tests
116# -----------------------------------------------------------------------------
117
118include $(CLEAR_VARS)
119
120LOCAL_MODULE := bootstat_tests
121LOCAL_CFLAGS := $(bootstat_tests_cflags)
122LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
123LOCAL_STATIC_LIBRARIES := libbootstat_debug libgmock
124LOCAL_SRC_FILES := $(bootstat_test_src_files)
125# Clang is required because of C++14
126LOCAL_CLANG := true
127
128include $(BUILD_NATIVE_TEST)
129
130# Host native tests
131# -----------------------------------------------------------------------------
132
133include $(CLEAR_VARS)
134
135LOCAL_MODULE := bootstat_tests
136LOCAL_CFLAGS := $(bootstat_tests_cflags)
137LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
138LOCAL_STATIC_LIBRARIES := libbootstat_host_debug libgmock_host
139LOCAL_SRC_FILES := $(bootstat_test_src_files)
140# Clang is required because of C++14
141LOCAL_CLANG := true
142
143include $(BUILD_HOST_NATIVE_TEST)
144