blob: 630094102888e5a58f6d014f0978551653c5714d [file] [log] [blame]
James Hawkinsabd73e62016-01-19 15:10:38 -08001#
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 \
James Hawkinseef069a2016-03-11 14:59:50 -080023 event_log_list_builder.cpp \
James Hawkinse8e8cf32016-03-22 14:13:06 -070024 histogram_logger.cpp \
James Hawkinseef069a2016-03-11 14:59:50 -080025 uptime_parser.cpp \
James Hawkinsabd73e62016-01-19 15:10:38 -080026
27bootstat_src_files := \
James Hawkinseef069a2016-03-11 14:59:50 -080028 bootstat.cpp \
James Hawkinsabd73e62016-01-19 15:10:38 -080029
30bootstat_test_src_files := \
31 boot_event_record_store_test.cpp \
32 event_log_list_builder_test.cpp \
James Hawkinseef069a2016-03-11 14:59:50 -080033 testrunner.cpp \
James Hawkinsabd73e62016-01-19 15:10:38 -080034
35bootstat_shared_libs := \
36 libbase \
James Hawkins10f54be2016-02-09 15:32:38 -080037 libcutils \
James Hawkinseef069a2016-03-11 14:59:50 -080038 liblog \
James Hawkinsabd73e62016-01-19 15:10:38 -080039
40bootstat_cflags := \
41 -Wall \
42 -Wextra \
James Hawkinseef069a2016-03-11 14:59:50 -080043 -Werror \
James Hawkinsabd73e62016-01-19 15:10:38 -080044
James Hawkinsabd73e62016-01-19 15:10:38 -080045# 524291 corresponds to sysui_histogram, from
46# frameworks/base/core/java/com/android/internal/logging/EventLogTags.logtags
47bootstat_cflags += -DHISTOGRAM_LOG_TAG=524291
48
James Hawkinse8e8cf32016-03-22 14:13:06 -070049bootstat_debug_cflags := \
50 $(bootstat_cflags) \
51 -UNDEBUG \
James Hawkinsabd73e62016-01-19 15:10:38 -080052
53# bootstat static library
54# -----------------------------------------------------------------------------
55
56include $(CLEAR_VARS)
57
58LOCAL_MODULE := libbootstat
59LOCAL_CFLAGS := $(bootstat_cflags)
James Hawkinsabd73e62016-01-19 15:10:38 -080060LOCAL_C_INCLUDES := $(bootstat_c_includes)
61LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
62LOCAL_SRC_FILES := $(bootstat_lib_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -080063# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -080064LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -080065
66include $(BUILD_STATIC_LIBRARY)
67
68# bootstat static library, debug
69# -----------------------------------------------------------------------------
70
71include $(CLEAR_VARS)
72
73LOCAL_MODULE := libbootstat_debug
74LOCAL_CFLAGS := $(bootstat_cflags)
James Hawkinsabd73e62016-01-19 15:10:38 -080075LOCAL_C_INCLUDES := $(bootstat_c_includes)
76LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
77LOCAL_SRC_FILES := $(bootstat_lib_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -080078# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -080079LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -080080
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)
James Hawkinsabd73e62016-01-19 15:10:38 -080090LOCAL_C_INCLUDES := $(bootstat_c_includes)
91LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
92LOCAL_SRC_FILES := $(bootstat_lib_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -080093# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -080094LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -080095
96include $(BUILD_HOST_STATIC_LIBRARY)
97
98# bootstat binary
99# -----------------------------------------------------------------------------
100
101include $(CLEAR_VARS)
102
103LOCAL_MODULE := bootstat
104LOCAL_CFLAGS := $(bootstat_cflags)
James Hawkinsabd73e62016-01-19 15:10:38 -0800105LOCAL_C_INCLUDES := $(bootstat_c_includes)
106LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
107LOCAL_STATIC_LIBRARIES := libbootstat
James Hawkins6bff6392016-01-21 15:16:36 -0800108LOCAL_INIT_RC := bootstat.rc
James Hawkinsabd73e62016-01-19 15:10:38 -0800109LOCAL_SRC_FILES := $(bootstat_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -0800110# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -0800111LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -0800112
113include $(BUILD_EXECUTABLE)
114
115# Native tests
116# -----------------------------------------------------------------------------
117
118include $(CLEAR_VARS)
119
120LOCAL_MODULE := bootstat_tests
121LOCAL_CFLAGS := $(bootstat_tests_cflags)
James Hawkinsabd73e62016-01-19 15:10:38 -0800122LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
123LOCAL_STATIC_LIBRARIES := libbootstat_debug libgmock
124LOCAL_SRC_FILES := $(bootstat_test_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -0800125# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -0800126LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -0800127
128include $(BUILD_NATIVE_TEST)
129
130# Host native tests
131# -----------------------------------------------------------------------------
132
133include $(CLEAR_VARS)
134
135LOCAL_MODULE := bootstat_tests
136LOCAL_CFLAGS := $(bootstat_tests_cflags)
James Hawkinsabd73e62016-01-19 15:10:38 -0800137LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
138LOCAL_STATIC_LIBRARIES := libbootstat_host_debug libgmock_host
139LOCAL_SRC_FILES := $(bootstat_test_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -0800140# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -0800141LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -0800142
143include $(BUILD_HOST_NATIVE_TEST)