| 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 \ | 
| James Hawkins | a4a1a4a | 2016-02-09 15:32:38 -0800 | [diff] [blame] | 35 |         libcutils \ | 
| James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 36 |         liblog | 
 | 37 |  | 
 | 38 | bootstat_cflags := \ | 
 | 39 |         -Wall \ | 
 | 40 |         -Wextra \ | 
 | 41 |         -Werror | 
 | 42 |  | 
 | 43 | bootstat_cppflags := \ | 
| Ian Pedowitz | 5699ee8 | 2016-01-22 20:25:58 -0800 | [diff] [blame] | 44 |         -Wno-non-virtual-dtor | 
| James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 45 |  | 
 | 46 | bootstat_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 | 
 | 52 | bootstat_cflags += -DHISTOGRAM_LOG_TAG=524291 | 
 | 53 |  | 
 | 54 |  | 
 | 55 | # bootstat static library | 
 | 56 | # ----------------------------------------------------------------------------- | 
 | 57 |  | 
 | 58 | include $(CLEAR_VARS) | 
 | 59 |  | 
 | 60 | LOCAL_MODULE := libbootstat | 
 | 61 | LOCAL_CFLAGS := $(bootstat_cflags) | 
 | 62 | LOCAL_CPPFLAGS := $(bootstat_cppflags) | 
 | 63 | LOCAL_C_INCLUDES := $(bootstat_c_includes) | 
 | 64 | LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs) | 
 | 65 | LOCAL_SRC_FILES := $(bootstat_lib_src_files) | 
| Ian Pedowitz | 5699ee8 | 2016-01-22 20:25:58 -0800 | [diff] [blame] | 66 | # Clang is required because of C++14 | 
| Rom Lemarchand | 7e04be0 | 2016-01-22 18:19:56 -0800 | [diff] [blame] | 67 | LOCAL_CLANG := true | 
| James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 68 |  | 
 | 69 | include $(BUILD_STATIC_LIBRARY) | 
 | 70 |  | 
 | 71 | # bootstat static library, debug | 
 | 72 | # ----------------------------------------------------------------------------- | 
 | 73 |  | 
 | 74 | include $(CLEAR_VARS) | 
 | 75 |  | 
 | 76 | LOCAL_MODULE := libbootstat_debug | 
 | 77 | LOCAL_CFLAGS := $(bootstat_cflags) | 
 | 78 | LOCAL_CPPFLAGS := $(bootstat_debug_cppflags) | 
 | 79 | LOCAL_C_INCLUDES := $(bootstat_c_includes) | 
 | 80 | LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs) | 
 | 81 | LOCAL_SRC_FILES := $(bootstat_lib_src_files) | 
| Ian Pedowitz | 5699ee8 | 2016-01-22 20:25:58 -0800 | [diff] [blame] | 82 | # Clang is required because of C++14 | 
| Rom Lemarchand | 7e04be0 | 2016-01-22 18:19:56 -0800 | [diff] [blame] | 83 | LOCAL_CLANG := true | 
| James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 84 |  | 
 | 85 | include $(BUILD_STATIC_LIBRARY) | 
 | 86 |  | 
 | 87 | # bootstat host static library, debug | 
 | 88 | # ----------------------------------------------------------------------------- | 
 | 89 |  | 
 | 90 | include $(CLEAR_VARS) | 
 | 91 |  | 
 | 92 | LOCAL_MODULE := libbootstat_host_debug | 
 | 93 | LOCAL_CFLAGS := $(bootstat_debug_cflags) | 
 | 94 | LOCAL_CPPFLAGS := $(bootstat_cppflags) | 
 | 95 | LOCAL_C_INCLUDES := $(bootstat_c_includes) | 
 | 96 | LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs) | 
 | 97 | LOCAL_SRC_FILES := $(bootstat_lib_src_files) | 
| Ian Pedowitz | 5699ee8 | 2016-01-22 20:25:58 -0800 | [diff] [blame] | 98 | # Clang is required because of C++14 | 
| 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 | 
| James Hawkins | 6bff639 | 2016-01-21 15:16:36 -0800 | [diff] [blame] | 114 | LOCAL_INIT_RC := bootstat.rc | 
| James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 115 | LOCAL_SRC_FILES := $(bootstat_src_files) | 
| Ian Pedowitz | 5699ee8 | 2016-01-22 20:25:58 -0800 | [diff] [blame] | 116 | # Clang is required because of C++14 | 
| Rom Lemarchand | 7e04be0 | 2016-01-22 18:19:56 -0800 | [diff] [blame] | 117 | LOCAL_CLANG := true | 
| James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 118 |  | 
 | 119 | include $(BUILD_EXECUTABLE) | 
 | 120 |  | 
 | 121 | # Native tests | 
 | 122 | # ----------------------------------------------------------------------------- | 
 | 123 |  | 
 | 124 | include $(CLEAR_VARS) | 
 | 125 |  | 
 | 126 | LOCAL_MODULE := bootstat_tests | 
 | 127 | LOCAL_CFLAGS := $(bootstat_tests_cflags) | 
 | 128 | LOCAL_CPPFLAGS := $(bootstat_cppflags) | 
 | 129 | LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs) | 
 | 130 | LOCAL_STATIC_LIBRARIES := libbootstat_debug libgmock | 
 | 131 | LOCAL_SRC_FILES := $(bootstat_test_src_files) | 
| Ian Pedowitz | 5699ee8 | 2016-01-22 20:25:58 -0800 | [diff] [blame] | 132 | # Clang is required because of C++14 | 
| Rom Lemarchand | 7e04be0 | 2016-01-22 18:19:56 -0800 | [diff] [blame] | 133 | LOCAL_CLANG := true | 
| James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 134 |  | 
 | 135 | include $(BUILD_NATIVE_TEST) | 
 | 136 |  | 
 | 137 | # Host native tests | 
 | 138 | # ----------------------------------------------------------------------------- | 
 | 139 |  | 
 | 140 | include $(CLEAR_VARS) | 
 | 141 |  | 
 | 142 | LOCAL_MODULE := bootstat_tests | 
 | 143 | LOCAL_CFLAGS := $(bootstat_tests_cflags) | 
 | 144 | LOCAL_CPPFLAGS := $(bootstat_cppflags) | 
 | 145 | LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs) | 
 | 146 | LOCAL_STATIC_LIBRARIES := libbootstat_host_debug libgmock_host | 
 | 147 | LOCAL_SRC_FILES := $(bootstat_test_src_files) | 
| Ian Pedowitz | 5699ee8 | 2016-01-22 20:25:58 -0800 | [diff] [blame] | 148 | # Clang is required because of C++14 | 
| Rom Lemarchand | 7e04be0 | 2016-01-22 18:19:56 -0800 | [diff] [blame] | 149 | LOCAL_CLANG := true | 
| James Hawkins | abd73e6 | 2016-01-19 15:10:38 -0800 | [diff] [blame] | 150 |  | 
 | 151 | include $(BUILD_HOST_NATIVE_TEST) |