blob: bdd680d21edfa146172bf98f60fdde72570eebd2 [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
James Hawkinsabd73e62016-01-19 15:10:38 -080019bootstat_lib_src_files := \
20 boot_event_record_store.cpp \
James Hawkinsc08e9962016-03-11 14:59:50 -080021 event_log_list_builder.cpp \
James Hawkins6f282992016-03-22 14:13:06 -070022 histogram_logger.cpp \
James Hawkinsc08e9962016-03-11 14:59:50 -080023 uptime_parser.cpp \
James Hawkinsabd73e62016-01-19 15:10:38 -080024
25bootstat_src_files := \
James Hawkinsc08e9962016-03-11 14:59:50 -080026 bootstat.cpp \
James Hawkinsabd73e62016-01-19 15:10:38 -080027
28bootstat_test_src_files := \
29 boot_event_record_store_test.cpp \
30 event_log_list_builder_test.cpp \
James Hawkinsc08e9962016-03-11 14:59:50 -080031 testrunner.cpp \
James Hawkinsabd73e62016-01-19 15:10:38 -080032
33bootstat_shared_libs := \
34 libbase \
James Hawkinsa4a1a4a2016-02-09 15:32:38 -080035 libcutils \
James Hawkinsc08e9962016-03-11 14:59:50 -080036 liblog \
James Hawkinsabd73e62016-01-19 15:10:38 -080037
38bootstat_cflags := \
39 -Wall \
40 -Wextra \
James Hawkinsc08e9962016-03-11 14:59:50 -080041 -Werror \
James Hawkinsabd73e62016-01-19 15:10:38 -080042
James Hawkinsabd73e62016-01-19 15:10:38 -080043# 524291 corresponds to sysui_histogram, from
44# frameworks/base/core/java/com/android/internal/logging/EventLogTags.logtags
45bootstat_cflags += -DHISTOGRAM_LOG_TAG=524291
46
James Hawkins6f282992016-03-22 14:13:06 -070047bootstat_debug_cflags := \
48 $(bootstat_cflags) \
49 -UNDEBUG \
James Hawkinsabd73e62016-01-19 15:10:38 -080050
51# bootstat static library
52# -----------------------------------------------------------------------------
53
54include $(CLEAR_VARS)
55
56LOCAL_MODULE := libbootstat
57LOCAL_CFLAGS := $(bootstat_cflags)
Dan Albert3df8c672016-04-26 13:28:23 -070058LOCAL_WHOLE_STATIC_LIBRARIES := libgtest_prod
James Hawkinsabd73e62016-01-19 15:10:38 -080059LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
60LOCAL_SRC_FILES := $(bootstat_lib_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -080061# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -080062LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -080063
64include $(BUILD_STATIC_LIBRARY)
65
66# bootstat static library, debug
67# -----------------------------------------------------------------------------
68
69include $(CLEAR_VARS)
70
71LOCAL_MODULE := libbootstat_debug
72LOCAL_CFLAGS := $(bootstat_cflags)
Dan Albert3df8c672016-04-26 13:28:23 -070073LOCAL_WHOLE_STATIC_LIBRARIES := libgtest_prod
James Hawkinsabd73e62016-01-19 15:10:38 -080074LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
75LOCAL_SRC_FILES := $(bootstat_lib_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -080076# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -080077LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -080078
79include $(BUILD_STATIC_LIBRARY)
80
81# bootstat host static library, debug
82# -----------------------------------------------------------------------------
83
84include $(CLEAR_VARS)
85
86LOCAL_MODULE := libbootstat_host_debug
87LOCAL_CFLAGS := $(bootstat_debug_cflags)
Dan Albert3df8c672016-04-26 13:28:23 -070088LOCAL_WHOLE_STATIC_LIBRARIES := libgtest_prod
James Hawkinsabd73e62016-01-19 15:10:38 -080089LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
90LOCAL_SRC_FILES := $(bootstat_lib_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -080091# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -080092LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -080093
94include $(BUILD_HOST_STATIC_LIBRARY)
95
96# bootstat binary
97# -----------------------------------------------------------------------------
98
99include $(CLEAR_VARS)
100
101LOCAL_MODULE := bootstat
102LOCAL_CFLAGS := $(bootstat_cflags)
Dan Albert3df8c672016-04-26 13:28:23 -0700103LOCAL_WHOLE_STATIC_LIBRARIES := libgtest_prod
James Hawkinsabd73e62016-01-19 15:10:38 -0800104LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
105LOCAL_STATIC_LIBRARIES := libbootstat
James Hawkins6bff6392016-01-21 15:16:36 -0800106LOCAL_INIT_RC := bootstat.rc
James Hawkinsabd73e62016-01-19 15:10:38 -0800107LOCAL_SRC_FILES := $(bootstat_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -0800108# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -0800109LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -0800110
111include $(BUILD_EXECUTABLE)
112
113# Native tests
114# -----------------------------------------------------------------------------
115
116include $(CLEAR_VARS)
117
118LOCAL_MODULE := bootstat_tests
119LOCAL_CFLAGS := $(bootstat_tests_cflags)
James Hawkinsabd73e62016-01-19 15:10:38 -0800120LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
121LOCAL_STATIC_LIBRARIES := libbootstat_debug libgmock
122LOCAL_SRC_FILES := $(bootstat_test_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -0800123# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -0800124LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -0800125
126include $(BUILD_NATIVE_TEST)
127
128# Host native tests
129# -----------------------------------------------------------------------------
130
131include $(CLEAR_VARS)
132
133LOCAL_MODULE := bootstat_tests
134LOCAL_CFLAGS := $(bootstat_tests_cflags)
James Hawkinsabd73e62016-01-19 15:10:38 -0800135LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
136LOCAL_STATIC_LIBRARIES := libbootstat_host_debug libgmock_host
137LOCAL_SRC_FILES := $(bootstat_test_src_files)
Ian Pedowitz5699ee82016-01-22 20:25:58 -0800138# Clang is required because of C++14
Rom Lemarchand7e04be02016-01-22 18:19:56 -0800139LOCAL_CLANG := true
James Hawkinsabd73e62016-01-19 15:10:38 -0800140
141include $(BUILD_HOST_NATIVE_TEST)