1 # 2 # Copyright (C) 2015 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 libbase_src_files := \ 20 file.cpp \ 21 logging.cpp \ 22 parsenetaddress.cpp \ 23 stringprintf.cpp \ 24 strings.cpp \ 25 test_utils.cpp \ 26 27 libbase_linux_src_files := \ 28 errors_unix.cpp \ 29 30 libbase_darwin_src_files := \ 31 errors_unix.cpp \ 32 33 libbase_windows_src_files := \ 34 errors_windows.cpp \ 35 utf8.cpp \ 36 37 libbase_test_src_files := \ 38 errors_test.cpp \ 39 file_test.cpp \ 40 logging_test.cpp \ 41 parseint_test.cpp \ 42 parsenetaddress_test.cpp \ 43 stringprintf_test.cpp \ 44 strings_test.cpp \ 45 test_main.cpp \ 46 47 libbase_test_windows_src_files := \ 48 utf8_test.cpp \ 49 50 libbase_cppflags := \ 51 -Wall \ 52 -Wextra \ 53 -Werror \ 54 55 libbase_linux_cppflags := \ 56 -Wexit-time-destructors \ 57 58 libbase_darwin_cppflags := \ 59 -Wexit-time-destructors \ 60 61 # Device 62 # ------------------------------------------------------------------------------ 63 include $(CLEAR_VARS) 64 LOCAL_MODULE := libbase 65 LOCAL_CLANG := true 66 LOCAL_SRC_FILES := $(libbase_src_files) $(libbase_linux_src_files) 67 LOCAL_C_INCLUDES := $(LOCAL_PATH)/include 68 LOCAL_CPPFLAGS := $(libbase_cppflags) $(libbase_linux_cppflags) 69 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include 70 LOCAL_STATIC_LIBRARIES := liblog 71 LOCAL_MULTILIB := both 72 include $(BUILD_STATIC_LIBRARY) 73 74 include $(CLEAR_VARS) 75 LOCAL_MODULE := libbase 76 LOCAL_CLANG := true 77 LOCAL_WHOLE_STATIC_LIBRARIES := libbase 78 LOCAL_SHARED_LIBRARIES := liblog 79 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include 80 LOCAL_MULTILIB := both 81 include $(BUILD_SHARED_LIBRARY) 82 83 # Host 84 # ------------------------------------------------------------------------------ 85 include $(CLEAR_VARS) 86 LOCAL_MODULE := libbase 87 LOCAL_SRC_FILES := $(libbase_src_files) 88 LOCAL_SRC_FILES_darwin := $(libbase_darwin_src_files) 89 LOCAL_SRC_FILES_linux := $(libbase_linux_src_files) 90 LOCAL_SRC_FILES_windows := $(libbase_windows_src_files) 91 LOCAL_C_INCLUDES := $(LOCAL_PATH)/include 92 LOCAL_CPPFLAGS := $(libbase_cppflags) 93 LOCAL_CPPFLAGS_darwin := $(libbase_darwin_cppflags) 94 LOCAL_CPPFLAGS_linux := $(libbase_linux_cppflags) 95 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include 96 LOCAL_STATIC_LIBRARIES := liblog 97 LOCAL_MULTILIB := both 98 LOCAL_MODULE_HOST_OS := darwin linux windows 99 include $(BUILD_HOST_STATIC_LIBRARY) 100 101 include $(CLEAR_VARS) 102 LOCAL_MODULE := libbase 103 LOCAL_WHOLE_STATIC_LIBRARIES := libbase 104 LOCAL_SHARED_LIBRARIES := liblog 105 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include 106 LOCAL_MULTILIB := both 107 LOCAL_MODULE_HOST_OS := darwin linux windows 108 include $(BUILD_HOST_SHARED_LIBRARY) 109 110 # Tests 111 # ------------------------------------------------------------------------------ 112 include $(CLEAR_VARS) 113 LOCAL_MODULE := libbase_test 114 LOCAL_CLANG := true 115 LOCAL_SRC_FILES := $(libbase_test_src_files) 116 LOCAL_SRC_FILES_darwin := $(libbase_test_darwin_src_files) 117 LOCAL_SRC_FILES_linux := $(libbase_test_linux_src_files) 118 LOCAL_SRC_FILES_windows := $(libbase_test_windows_src_files) 119 LOCAL_C_INCLUDES := $(LOCAL_PATH) 120 LOCAL_CPPFLAGS := $(libbase_cppflags) 121 LOCAL_SHARED_LIBRARIES := libbase 122 LOCAL_MULTILIB := both 123 LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 124 LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 125 include $(BUILD_NATIVE_TEST) 126 127 include $(CLEAR_VARS) 128 LOCAL_MODULE := libbase_test 129 LOCAL_MODULE_HOST_OS := darwin linux windows 130 LOCAL_SRC_FILES := $(libbase_test_src_files) 131 LOCAL_SRC_FILES_darwin := $(libbase_test_darwin_src_files) 132 LOCAL_SRC_FILES_linux := $(libbase_test_linux_src_files) 133 LOCAL_SRC_FILES_windows := $(libbase_test_windows_src_files) 134 LOCAL_C_INCLUDES := $(LOCAL_PATH) 135 LOCAL_CPPFLAGS := $(libbase_cppflags) 136 LOCAL_SHARED_LIBRARIES := libbase 137 LOCAL_MULTILIB := both 138 LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 139 LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 140 include $(BUILD_HOST_NATIVE_TEST) 141