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