blob: 3d027527f55176b691c235aeda5e5b1bf049e9b3 [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 Hawkinsc08e9962016-03-11 14:59:50 -080023 event_log_list_builder.cpp \
24 uptime_parser.cpp \
James Hawkinsabd73e62016-01-19 15:10:38 -080025
26bootstat_src_files := \
James Hawkinsc08e9962016-03-11 14:59:50 -080027 bootstat.cpp \
James Hawkinsabd73e62016-01-19 15:10:38 -080028
29bootstat_test_src_files := \
30 boot_event_record_store_test.cpp \
31 event_log_list_builder_test.cpp \
James Hawkinsc08e9962016-03-11 14:59:50 -080032 testrunner.cpp \
James Hawkinsabd73e62016-01-19 15:10:38 -080033
34bootstat_shared_libs := \
35 libbase \
James Hawkinsa4a1a4a2016-02-09 15:32:38 -080036 libcutils \
James Hawkinsc08e9962016-03-11 14:59:50 -080037 liblog \
James Hawkinsabd73e62016-01-19 15:10:38 -080038
39bootstat_cflags := \
40 -Wall \
41 -Wextra \
James Hawkinsc08e9962016-03-11 14:59:50 -080042 -Werror \
James Hawkinsabd73e62016-01-19 15:10:38 -080043
44bootstat_cppflags := \
James Hawkinsc08e9962016-03-11 14:59:50 -080045 -Wno-non-virtual-dtor \
James Hawkinsabd73e62016-01-19 15:10:38 -080046
47bootstat_debug_cflags := \
48 $(bootstat_cflags) \
James Hawkinsc08e9962016-03-11 14:59:50 -080049 -UNDEBUG \
James Hawkinsabd73e62016-01-19 15:10:38 -080050
51# 524291 corresponds to sysui_histogram, from
52# frameworks/base/core/java/com/android/internal/logging/EventLogTags.logtags
53bootstat_cflags += -DHISTOGRAM_LOG_TAG=524291
54
55
56# bootstat static library
57# -----------------------------------------------------------------------------
58
59include $(CLEAR_VARS)
60
61LOCAL_MODULE := libbootstat
62LOCAL_CFLAGS := $(bootstat_cflags)
63LOCAL_CPPFLAGS := $(bootstat_cppflags)
64LOCAL_C_INCLUDES := $(bootstat_c_includes)
65LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
66LOCAL_SRC_FILES := $(bootstat_lib_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -080067# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -080068LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -080069
70include $(BUILD_STATIC_LIBRARY)
71
72# bootstat static library, debug
73# -----------------------------------------------------------------------------
74
75include $(CLEAR_VARS)
76
77LOCAL_MODULE := libbootstat_debug
78LOCAL_CFLAGS := $(bootstat_cflags)
79LOCAL_CPPFLAGS := $(bootstat_debug_cppflags)
80LOCAL_C_INCLUDES := $(bootstat_c_includes)
81LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
82LOCAL_SRC_FILES := $(bootstat_lib_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -080083# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -080084LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -080085
86include $(BUILD_STATIC_LIBRARY)
87
88# bootstat host static library, debug
89# -----------------------------------------------------------------------------
90
91include $(CLEAR_VARS)
92
93LOCAL_MODULE := libbootstat_host_debug
94LOCAL_CFLAGS := $(bootstat_debug_cflags)
95LOCAL_CPPFLAGS := $(bootstat_cppflags)
96LOCAL_C_INCLUDES := $(bootstat_c_includes)
97LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
98LOCAL_SRC_FILES := $(bootstat_lib_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -080099# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -0800100LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -0800101
102include $(BUILD_HOST_STATIC_LIBRARY)
103
104# bootstat binary
105# -----------------------------------------------------------------------------
106
107include $(CLEAR_VARS)
108
109LOCAL_MODULE := bootstat
110LOCAL_CFLAGS := $(bootstat_cflags)
111LOCAL_CPPFLAGS := $(bootstat_cppflags)
112LOCAL_C_INCLUDES := $(bootstat_c_includes)
113LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
114LOCAL_STATIC_LIBRARIES := libbootstat
James Hawkins6bff6392016-01-21 15:16:36 -0800115LOCAL_INIT_RC := bootstat.rc
James Hawkinsabd73e62016-01-19 15:10:38 -0800116LOCAL_SRC_FILES := $(bootstat_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -0800117# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -0800118LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -0800119
120include $(BUILD_EXECUTABLE)
121
122# Native tests
123# -----------------------------------------------------------------------------
124
125include $(CLEAR_VARS)
126
127LOCAL_MODULE := bootstat_tests
128LOCAL_CFLAGS := $(bootstat_tests_cflags)
129LOCAL_CPPFLAGS := $(bootstat_cppflags)
130LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
131LOCAL_STATIC_LIBRARIES := libbootstat_debug libgmock
132LOCAL_SRC_FILES := $(bootstat_test_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -0800133# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -0800134LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -0800135
136include $(BUILD_NATIVE_TEST)
137
138# Host native tests
139# -----------------------------------------------------------------------------
140
141include $(CLEAR_VARS)
142
143LOCAL_MODULE := bootstat_tests
144LOCAL_CFLAGS := $(bootstat_tests_cflags)
145LOCAL_CPPFLAGS := $(bootstat_cppflags)
146LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
147LOCAL_STATIC_LIBRARIES := libbootstat_host_debug libgmock_host
148LOCAL_SRC_FILES := $(bootstat_test_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -0800149# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -0800150LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -0800151
152include $(BUILD_HOST_NATIVE_TEST)