blob: bbb903dd104768b3f1d5ad6a1d5a51eb08573d36 [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 \
35 liblog
36
37bootstat_cflags := \
38 -Wall \
39 -Wextra \
40 -Werror
41
42bootstat_cppflags := \
Ian Pedowitz5699ee82016-01-22 20:25:58 -080043 -Wno-non-virtual-dtor
James Hawkinsabd73e62016-01-19 15:10:38 -080044
45bootstat_debug_cflags := \
46 $(bootstat_cflags) \
47 -UNDEBUG
48
49# 524291 corresponds to sysui_histogram, from
50# frameworks/base/core/java/com/android/internal/logging/EventLogTags.logtags
51bootstat_cflags += -DHISTOGRAM_LOG_TAG=524291
52
53
54# bootstat static library
55# -----------------------------------------------------------------------------
56
57include $(CLEAR_VARS)
58
59LOCAL_MODULE := libbootstat
60LOCAL_CFLAGS := $(bootstat_cflags)
61LOCAL_CPPFLAGS := $(bootstat_cppflags)
62LOCAL_C_INCLUDES := $(bootstat_c_includes)
63LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
64LOCAL_SRC_FILES := $(bootstat_lib_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -080065# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -080066LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -080067
68include $(BUILD_STATIC_LIBRARY)
69
70# bootstat static library, debug
71# -----------------------------------------------------------------------------
72
73include $(CLEAR_VARS)
74
75LOCAL_MODULE := libbootstat_debug
76LOCAL_CFLAGS := $(bootstat_cflags)
77LOCAL_CPPFLAGS := $(bootstat_debug_cppflags)
78LOCAL_C_INCLUDES := $(bootstat_c_includes)
79LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
80LOCAL_SRC_FILES := $(bootstat_lib_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -080081# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -080082LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -080083
84include $(BUILD_STATIC_LIBRARY)
85
86# bootstat host static library, debug
87# -----------------------------------------------------------------------------
88
89include $(CLEAR_VARS)
90
91LOCAL_MODULE := libbootstat_host_debug
92LOCAL_CFLAGS := $(bootstat_debug_cflags)
93LOCAL_CPPFLAGS := $(bootstat_cppflags)
94LOCAL_C_INCLUDES := $(bootstat_c_includes)
95LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
96LOCAL_SRC_FILES := $(bootstat_lib_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -080097# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -080098LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -080099
100include $(BUILD_HOST_STATIC_LIBRARY)
101
102# bootstat binary
103# -----------------------------------------------------------------------------
104
105include $(CLEAR_VARS)
106
107LOCAL_MODULE := bootstat
108LOCAL_CFLAGS := $(bootstat_cflags)
109LOCAL_CPPFLAGS := $(bootstat_cppflags)
110LOCAL_C_INCLUDES := $(bootstat_c_includes)
111LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
112LOCAL_STATIC_LIBRARIES := libbootstat
James Hawkins6bff6392016-01-21 15:16:36 -0800113LOCAL_INIT_RC := bootstat.rc
James Hawkinsabd73e62016-01-19 15:10:38 -0800114LOCAL_SRC_FILES := $(bootstat_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -0800115# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -0800116LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -0800117
118include $(BUILD_EXECUTABLE)
119
120# Native tests
121# -----------------------------------------------------------------------------
122
123include $(CLEAR_VARS)
124
125LOCAL_MODULE := bootstat_tests
126LOCAL_CFLAGS := $(bootstat_tests_cflags)
127LOCAL_CPPFLAGS := $(bootstat_cppflags)
128LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
129LOCAL_STATIC_LIBRARIES := libbootstat_debug libgmock
130LOCAL_SRC_FILES := $(bootstat_test_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -0800131# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -0800132LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -0800133
134include $(BUILD_NATIVE_TEST)
135
136# Host native tests
137# -----------------------------------------------------------------------------
138
139include $(CLEAR_VARS)
140
141LOCAL_MODULE := bootstat_tests
142LOCAL_CFLAGS := $(bootstat_tests_cflags)
143LOCAL_CPPFLAGS := $(bootstat_cppflags)
144LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
145LOCAL_STATIC_LIBRARIES := libbootstat_host_debug libgmock_host
146LOCAL_SRC_FILES := $(bootstat_test_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -0800147# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -0800148LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -0800149
150include $(BUILD_HOST_NATIVE_TEST)