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