blob: c6349c1d693805168f5ee6912ad641206840f64b [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 \
23 event_log_list_builder.cpp
24
25bootstat_src_files := \
26 bootstat.cpp
27
28bootstat_test_src_files := \
29 boot_event_record_store_test.cpp \
30 event_log_list_builder_test.cpp \
31 testrunner.cpp
32
33bootstat_shared_libs := \
34 libbase \
James Hawkinsa4a1a4a2016-02-09 15:32:38 -080035 libcutils \
James Hawkinsabd73e62016-01-19 15:10:38 -080036 liblog
37
38bootstat_cflags := \
39 -Wall \
40 -Wextra \
41 -Werror
42
43bootstat_cppflags := \
Ian Pedowitz5699ee82016-01-22 20:25:58 -080044 -Wno-non-virtual-dtor
James Hawkinsabd73e62016-01-19 15:10:38 -080045
46bootstat_debug_cflags := \
47 $(bootstat_cflags) \
48 -UNDEBUG
49
50# 524291 corresponds to sysui_histogram, from
51# frameworks/base/core/java/com/android/internal/logging/EventLogTags.logtags
52bootstat_cflags += -DHISTOGRAM_LOG_TAG=524291
53
54
55# bootstat static library
56# -----------------------------------------------------------------------------
57
58include $(CLEAR_VARS)
59
60LOCAL_MODULE := libbootstat
61LOCAL_CFLAGS := $(bootstat_cflags)
62LOCAL_CPPFLAGS := $(bootstat_cppflags)
63LOCAL_C_INCLUDES := $(bootstat_c_includes)
64LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
65LOCAL_SRC_FILES := $(bootstat_lib_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -080066# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -080067LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -080068
69include $(BUILD_STATIC_LIBRARY)
70
71# bootstat static library, debug
72# -----------------------------------------------------------------------------
73
74include $(CLEAR_VARS)
75
76LOCAL_MODULE := libbootstat_debug
77LOCAL_CFLAGS := $(bootstat_cflags)
78LOCAL_CPPFLAGS := $(bootstat_debug_cppflags)
79LOCAL_C_INCLUDES := $(bootstat_c_includes)
80LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
81LOCAL_SRC_FILES := $(bootstat_lib_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -080082# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -080083LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -080084
85include $(BUILD_STATIC_LIBRARY)
86
87# bootstat host static library, debug
88# -----------------------------------------------------------------------------
89
90include $(CLEAR_VARS)
91
92LOCAL_MODULE := libbootstat_host_debug
93LOCAL_CFLAGS := $(bootstat_debug_cflags)
94LOCAL_CPPFLAGS := $(bootstat_cppflags)
95LOCAL_C_INCLUDES := $(bootstat_c_includes)
96LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
97LOCAL_SRC_FILES := $(bootstat_lib_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -080098# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -080099LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -0800100
101include $(BUILD_HOST_STATIC_LIBRARY)
102
103# bootstat binary
104# -----------------------------------------------------------------------------
105
106include $(CLEAR_VARS)
107
108LOCAL_MODULE := bootstat
109LOCAL_CFLAGS := $(bootstat_cflags)
110LOCAL_CPPFLAGS := $(bootstat_cppflags)
111LOCAL_C_INCLUDES := $(bootstat_c_includes)
112LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
113LOCAL_STATIC_LIBRARIES := libbootstat
James Hawkins6bff6392016-01-21 15:16:36 -0800114LOCAL_INIT_RC := bootstat.rc
James Hawkinsabd73e62016-01-19 15:10:38 -0800115LOCAL_SRC_FILES := $(bootstat_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -0800116# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -0800117LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -0800118
119include $(BUILD_EXECUTABLE)
120
121# Native tests
122# -----------------------------------------------------------------------------
123
124include $(CLEAR_VARS)
125
126LOCAL_MODULE := bootstat_tests
127LOCAL_CFLAGS := $(bootstat_tests_cflags)
128LOCAL_CPPFLAGS := $(bootstat_cppflags)
129LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
130LOCAL_STATIC_LIBRARIES := libbootstat_debug libgmock
131LOCAL_SRC_FILES := $(bootstat_test_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -0800132# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -0800133LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -0800134
135include $(BUILD_NATIVE_TEST)
136
137# Host native tests
138# -----------------------------------------------------------------------------
139
140include $(CLEAR_VARS)
141
142LOCAL_MODULE := bootstat_tests
143LOCAL_CFLAGS := $(bootstat_tests_cflags)
144LOCAL_CPPFLAGS := $(bootstat_cppflags)
145LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
146LOCAL_STATIC_LIBRARIES := libbootstat_host_debug libgmock_host
147LOCAL_SRC_FILES := $(bootstat_test_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -0800148# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -0800149LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -0800150
151include $(BUILD_HOST_NATIVE_TEST)