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 \ |
| 23 | event_log_list_builder.cpp |
| 24 | |
| 25 | bootstat_src_files := \ |
| 26 | bootstat.cpp |
| 27 | |
| 28 | bootstat_test_src_files := \ |
| 29 | boot_event_record_store_test.cpp \ |
| 30 | event_log_list_builder_test.cpp \ |
| 31 | testrunner.cpp |
| 32 | |
| 33 | bootstat_shared_libs := \ |
| 34 | libbase \ |
| 35 | liblog |
| 36 | |
| 37 | bootstat_cflags := \ |
| 38 | -Wall \ |
| 39 | -Wextra \ |
| 40 | -Werror |
| 41 | |
| 42 | bootstat_cppflags := \ |
Rom Lemarchand | 7e04be0 | 2016-01-22 18:19:56 -0800 | [diff] [blame] | 43 | -Wno-non-virtual-dtor \ |
| 44 | -std=c++14 |
James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 45 | |
| 46 | bootstat_debug_cflags := \ |
| 47 | $(bootstat_cflags) \ |
| 48 | -UNDEBUG |
| 49 | |
Rom Lemarchand | 7e04be0 | 2016-01-22 18:19:56 -0800 | [diff] [blame] | 50 | bootstat_debug_cppflags := \ |
| 51 | -std=c++14 |
| 52 | |
James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 53 | # 524291 corresponds to sysui_histogram, from |
| 54 | # frameworks/base/core/java/com/android/internal/logging/EventLogTags.logtags |
| 55 | bootstat_cflags += -DHISTOGRAM_LOG_TAG=524291 |
| 56 | |
| 57 | |
| 58 | # bootstat static library |
| 59 | # ----------------------------------------------------------------------------- |
| 60 | |
| 61 | include $(CLEAR_VARS) |
| 62 | |
| 63 | LOCAL_MODULE := libbootstat |
| 64 | LOCAL_CFLAGS := $(bootstat_cflags) |
| 65 | LOCAL_CPPFLAGS := $(bootstat_cppflags) |
| 66 | LOCAL_C_INCLUDES := $(bootstat_c_includes) |
| 67 | LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs) |
| 68 | LOCAL_SRC_FILES := $(bootstat_lib_src_files) |
Rom Lemarchand | 7e04be0 | 2016-01-22 18:19:56 -0800 | [diff] [blame] | 69 | LOCAL_CLANG := true |
James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 70 | |
| 71 | include $(BUILD_STATIC_LIBRARY) |
| 72 | |
| 73 | # bootstat static library, debug |
| 74 | # ----------------------------------------------------------------------------- |
| 75 | |
| 76 | include $(CLEAR_VARS) |
| 77 | |
| 78 | LOCAL_MODULE := libbootstat_debug |
| 79 | LOCAL_CFLAGS := $(bootstat_cflags) |
| 80 | LOCAL_CPPFLAGS := $(bootstat_debug_cppflags) |
| 81 | LOCAL_C_INCLUDES := $(bootstat_c_includes) |
| 82 | LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs) |
| 83 | LOCAL_SRC_FILES := $(bootstat_lib_src_files) |
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) |
Rom Lemarchand | 7e04be0 | 2016-01-22 18:19:56 -0800 | [diff] [blame] | 99 | LOCAL_CLANG := true |
James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 100 | |
| 101 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 102 | |
| 103 | # bootstat binary |
| 104 | # ----------------------------------------------------------------------------- |
| 105 | |
| 106 | include $(CLEAR_VARS) |
| 107 | |
| 108 | LOCAL_MODULE := bootstat |
| 109 | LOCAL_CFLAGS := $(bootstat_cflags) |
| 110 | LOCAL_CPPFLAGS := $(bootstat_cppflags) |
| 111 | LOCAL_C_INCLUDES := $(bootstat_c_includes) |
| 112 | LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs) |
| 113 | LOCAL_STATIC_LIBRARIES := libbootstat |
| 114 | LOCAL_SRC_FILES := $(bootstat_src_files) |
Rom Lemarchand | 7e04be0 | 2016-01-22 18:19:56 -0800 | [diff] [blame] | 115 | LOCAL_CLANG := true |
James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 116 | |
| 117 | include $(BUILD_EXECUTABLE) |
| 118 | |
| 119 | # Native tests |
| 120 | # ----------------------------------------------------------------------------- |
| 121 | |
| 122 | include $(CLEAR_VARS) |
| 123 | |
| 124 | LOCAL_MODULE := bootstat_tests |
| 125 | LOCAL_CFLAGS := $(bootstat_tests_cflags) |
| 126 | LOCAL_CPPFLAGS := $(bootstat_cppflags) |
| 127 | LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs) |
| 128 | LOCAL_STATIC_LIBRARIES := libbootstat_debug libgmock |
| 129 | LOCAL_SRC_FILES := $(bootstat_test_src_files) |
Rom Lemarchand | 7e04be0 | 2016-01-22 18:19:56 -0800 | [diff] [blame] | 130 | LOCAL_CLANG := true |
James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 131 | |
| 132 | include $(BUILD_NATIVE_TEST) |
| 133 | |
| 134 | # Host native tests |
| 135 | # ----------------------------------------------------------------------------- |
| 136 | |
| 137 | include $(CLEAR_VARS) |
| 138 | |
| 139 | LOCAL_MODULE := bootstat_tests |
| 140 | LOCAL_CFLAGS := $(bootstat_tests_cflags) |
| 141 | LOCAL_CPPFLAGS := $(bootstat_cppflags) |
| 142 | LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs) |
| 143 | LOCAL_STATIC_LIBRARIES := libbootstat_host_debug libgmock_host |
| 144 | LOCAL_SRC_FILES := $(bootstat_test_src_files) |
Rom Lemarchand | 7e04be0 | 2016-01-22 18:19:56 -0800 | [diff] [blame] | 145 | LOCAL_CLANG := true |
James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 146 | |
| 147 | include $(BUILD_HOST_NATIVE_TEST) |