James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 1 | # |
| 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 | |
| 17 | LOCAL_PATH := $(call my-dir) |
| 18 | |
| 19 | bootstat_c_includes := external/gtest/include |
| 20 | |
| 21 | bootstat_lib_src_files := \ |
| 22 | boot_event_record_store.cpp \ |
James Hawkins | c08e996 | 2016-03-11 14:59:50 -0800 | [diff] [blame] | 23 | event_log_list_builder.cpp \ |
| 24 | uptime_parser.cpp \ |
James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 25 | |
| 26 | bootstat_src_files := \ |
James Hawkins | c08e996 | 2016-03-11 14:59:50 -0800 | [diff] [blame] | 27 | bootstat.cpp \ |
James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 28 | |
| 29 | bootstat_test_src_files := \ |
| 30 | boot_event_record_store_test.cpp \ |
| 31 | event_log_list_builder_test.cpp \ |
James Hawkins | c08e996 | 2016-03-11 14:59:50 -0800 | [diff] [blame] | 32 | testrunner.cpp \ |
James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 33 | |
| 34 | bootstat_shared_libs := \ |
| 35 | libbase \ |
James Hawkins | a4a1a4a | 2016-02-09 15:32:38 -0800 | [diff] [blame] | 36 | libcutils \ |
James Hawkins | c08e996 | 2016-03-11 14:59:50 -0800 | [diff] [blame] | 37 | liblog \ |
James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 38 | |
| 39 | bootstat_cflags := \ |
| 40 | -Wall \ |
| 41 | -Wextra \ |
James Hawkins | c08e996 | 2016-03-11 14:59:50 -0800 | [diff] [blame] | 42 | -Werror \ |
James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 43 | |
| 44 | bootstat_cppflags := \ |
James Hawkins | c08e996 | 2016-03-11 14:59:50 -0800 | [diff] [blame] | 45 | -Wno-non-virtual-dtor \ |
James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 46 | |
| 47 | bootstat_debug_cflags := \ |
| 48 | $(bootstat_cflags) \ |
James Hawkins | c08e996 | 2016-03-11 14:59:50 -0800 | [diff] [blame] | 49 | -UNDEBUG \ |
James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 50 | |
| 51 | # 524291 corresponds to sysui_histogram, from |
| 52 | # frameworks/base/core/java/com/android/internal/logging/EventLogTags.logtags |
| 53 | bootstat_cflags += -DHISTOGRAM_LOG_TAG=524291 |
| 54 | |
| 55 | |
| 56 | # bootstat static library |
| 57 | # ----------------------------------------------------------------------------- |
| 58 | |
| 59 | include $(CLEAR_VARS) |
| 60 | |
| 61 | LOCAL_MODULE := libbootstat |
| 62 | LOCAL_CFLAGS := $(bootstat_cflags) |
| 63 | LOCAL_CPPFLAGS := $(bootstat_cppflags) |
| 64 | LOCAL_C_INCLUDES := $(bootstat_c_includes) |
| 65 | LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs) |
| 66 | LOCAL_SRC_FILES := $(bootstat_lib_src_files) |
Ian Pedowitz | 5699ee8 | 2016-01-22 20:25:58 -0800 | [diff] [blame] | 67 | # Clang is required because of C++14 |
Rom Lemarchand | 7e04be0 | 2016-01-22 18:19:56 -0800 | [diff] [blame] | 68 | LOCAL_CLANG := true |
James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 69 | |
| 70 | include $(BUILD_STATIC_LIBRARY) |
| 71 | |
| 72 | # bootstat static library, debug |
| 73 | # ----------------------------------------------------------------------------- |
| 74 | |
| 75 | include $(CLEAR_VARS) |
| 76 | |
| 77 | LOCAL_MODULE := libbootstat_debug |
| 78 | LOCAL_CFLAGS := $(bootstat_cflags) |
| 79 | LOCAL_CPPFLAGS := $(bootstat_debug_cppflags) |
| 80 | LOCAL_C_INCLUDES := $(bootstat_c_includes) |
| 81 | LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs) |
| 82 | LOCAL_SRC_FILES := $(bootstat_lib_src_files) |
Ian Pedowitz | 5699ee8 | 2016-01-22 20:25:58 -0800 | [diff] [blame] | 83 | # Clang is required because of C++14 |
Rom Lemarchand | 7e04be0 | 2016-01-22 18:19:56 -0800 | [diff] [blame] | 84 | LOCAL_CLANG := true |
James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 85 | |
| 86 | include $(BUILD_STATIC_LIBRARY) |
| 87 | |
| 88 | # bootstat host static library, debug |
| 89 | # ----------------------------------------------------------------------------- |
| 90 | |
| 91 | include $(CLEAR_VARS) |
| 92 | |
| 93 | LOCAL_MODULE := libbootstat_host_debug |
| 94 | LOCAL_CFLAGS := $(bootstat_debug_cflags) |
| 95 | LOCAL_CPPFLAGS := $(bootstat_cppflags) |
| 96 | LOCAL_C_INCLUDES := $(bootstat_c_includes) |
| 97 | LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs) |
| 98 | LOCAL_SRC_FILES := $(bootstat_lib_src_files) |
Ian Pedowitz | 5699ee8 | 2016-01-22 20:25:58 -0800 | [diff] [blame] | 99 | # Clang is required because of C++14 |
Rom Lemarchand | 7e04be0 | 2016-01-22 18:19:56 -0800 | [diff] [blame] | 100 | LOCAL_CLANG := true |
James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 101 | |
| 102 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 103 | |
| 104 | # bootstat binary |
| 105 | # ----------------------------------------------------------------------------- |
| 106 | |
| 107 | include $(CLEAR_VARS) |
| 108 | |
| 109 | LOCAL_MODULE := bootstat |
| 110 | LOCAL_CFLAGS := $(bootstat_cflags) |
| 111 | LOCAL_CPPFLAGS := $(bootstat_cppflags) |
| 112 | LOCAL_C_INCLUDES := $(bootstat_c_includes) |
| 113 | LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs) |
| 114 | LOCAL_STATIC_LIBRARIES := libbootstat |
James Hawkins | 6bff639 | 2016-01-21 15:16:36 -0800 | [diff] [blame] | 115 | LOCAL_INIT_RC := bootstat.rc |
James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 116 | LOCAL_SRC_FILES := $(bootstat_src_files) |
Ian Pedowitz | 5699ee8 | 2016-01-22 20:25:58 -0800 | [diff] [blame] | 117 | # Clang is required because of C++14 |
Rom Lemarchand | 7e04be0 | 2016-01-22 18:19:56 -0800 | [diff] [blame] | 118 | LOCAL_CLANG := true |
James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 119 | |
| 120 | include $(BUILD_EXECUTABLE) |
| 121 | |
| 122 | # Native tests |
| 123 | # ----------------------------------------------------------------------------- |
| 124 | |
| 125 | include $(CLEAR_VARS) |
| 126 | |
| 127 | LOCAL_MODULE := bootstat_tests |
| 128 | LOCAL_CFLAGS := $(bootstat_tests_cflags) |
| 129 | LOCAL_CPPFLAGS := $(bootstat_cppflags) |
| 130 | LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs) |
| 131 | LOCAL_STATIC_LIBRARIES := libbootstat_debug libgmock |
| 132 | LOCAL_SRC_FILES := $(bootstat_test_src_files) |
Ian Pedowitz | 5699ee8 | 2016-01-22 20:25:58 -0800 | [diff] [blame] | 133 | # Clang is required because of C++14 |
Rom Lemarchand | 7e04be0 | 2016-01-22 18:19:56 -0800 | [diff] [blame] | 134 | LOCAL_CLANG := true |
James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 135 | |
| 136 | include $(BUILD_NATIVE_TEST) |
| 137 | |
| 138 | # Host native tests |
| 139 | # ----------------------------------------------------------------------------- |
| 140 | |
| 141 | include $(CLEAR_VARS) |
| 142 | |
| 143 | LOCAL_MODULE := bootstat_tests |
| 144 | LOCAL_CFLAGS := $(bootstat_tests_cflags) |
| 145 | LOCAL_CPPFLAGS := $(bootstat_cppflags) |
| 146 | LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs) |
| 147 | LOCAL_STATIC_LIBRARIES := libbootstat_host_debug libgmock_host |
| 148 | LOCAL_SRC_FILES := $(bootstat_test_src_files) |
Ian Pedowitz | 5699ee8 | 2016-01-22 20:25:58 -0800 | [diff] [blame] | 149 | # Clang is required because of C++14 |
Rom Lemarchand | 7e04be0 | 2016-01-22 18:19:56 -0800 | [diff] [blame] | 150 | LOCAL_CLANG := true |
James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 151 | |
| 152 | include $(BUILD_HOST_NATIVE_TEST) |