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 := \ |
| 43 | -Wno-non-virtual-dtor |
| 44 | |
| 45 | bootstat_debug_cflags := \ |
| 46 | $(bootstat_cflags) \ |
| 47 | -UNDEBUG |
| 48 | |
| 49 | # 524291 corresponds to sysui_histogram, from |
| 50 | # frameworks/base/core/java/com/android/internal/logging/EventLogTags.logtags |
| 51 | bootstat_cflags += -DHISTOGRAM_LOG_TAG=524291 |
| 52 | |
| 53 | |
| 54 | # bootstat static library |
| 55 | # ----------------------------------------------------------------------------- |
| 56 | |
| 57 | include $(CLEAR_VARS) |
| 58 | |
| 59 | LOCAL_MODULE := libbootstat |
| 60 | LOCAL_CFLAGS := $(bootstat_cflags) |
| 61 | LOCAL_CPPFLAGS := $(bootstat_cppflags) |
| 62 | LOCAL_C_INCLUDES := $(bootstat_c_includes) |
| 63 | LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs) |
| 64 | LOCAL_SRC_FILES := $(bootstat_lib_src_files) |
| 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) |
| 75 | LOCAL_CPPFLAGS := $(bootstat_debug_cppflags) |
| 76 | LOCAL_C_INCLUDES := $(bootstat_c_includes) |
| 77 | LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs) |
| 78 | LOCAL_SRC_FILES := $(bootstat_lib_src_files) |
| 79 | |
| 80 | include $(BUILD_STATIC_LIBRARY) |
| 81 | |
| 82 | # bootstat host static library, debug |
| 83 | # ----------------------------------------------------------------------------- |
| 84 | |
| 85 | include $(CLEAR_VARS) |
| 86 | |
| 87 | LOCAL_MODULE := libbootstat_host_debug |
| 88 | LOCAL_CFLAGS := $(bootstat_debug_cflags) |
| 89 | LOCAL_CPPFLAGS := $(bootstat_cppflags) |
| 90 | LOCAL_C_INCLUDES := $(bootstat_c_includes) |
| 91 | LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs) |
| 92 | LOCAL_SRC_FILES := $(bootstat_lib_src_files) |
| 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) |
| 103 | LOCAL_CPPFLAGS := $(bootstat_cppflags) |
| 104 | LOCAL_C_INCLUDES := $(bootstat_c_includes) |
| 105 | LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs) |
| 106 | LOCAL_STATIC_LIBRARIES := libbootstat |
| 107 | LOCAL_SRC_FILES := $(bootstat_src_files) |
| 108 | |
| 109 | include $(BUILD_EXECUTABLE) |
| 110 | |
| 111 | # Native tests |
| 112 | # ----------------------------------------------------------------------------- |
| 113 | |
| 114 | include $(CLEAR_VARS) |
| 115 | |
| 116 | LOCAL_MODULE := bootstat_tests |
| 117 | LOCAL_CFLAGS := $(bootstat_tests_cflags) |
| 118 | LOCAL_CPPFLAGS := $(bootstat_cppflags) |
| 119 | LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs) |
| 120 | LOCAL_STATIC_LIBRARIES := libbootstat_debug libgmock |
| 121 | LOCAL_SRC_FILES := $(bootstat_test_src_files) |
| 122 | |
| 123 | include $(BUILD_NATIVE_TEST) |
| 124 | |
| 125 | # Host native tests |
| 126 | # ----------------------------------------------------------------------------- |
| 127 | |
| 128 | include $(CLEAR_VARS) |
| 129 | |
| 130 | LOCAL_MODULE := bootstat_tests |
| 131 | LOCAL_CFLAGS := $(bootstat_tests_cflags) |
| 132 | LOCAL_CPPFLAGS := $(bootstat_cppflags) |
| 133 | LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs) |
| 134 | LOCAL_STATIC_LIBRARIES := libbootstat_host_debug libgmock_host |
| 135 | LOCAL_SRC_FILES := $(bootstat_test_src_files) |
| 136 | |
| 137 | include $(BUILD_HOST_NATIVE_TEST) |