Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 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 | stringprintf.cpp \ |
Dan Albert | 0f1e544 | 2015-03-13 22:57:40 -0700 | [diff] [blame] | 22 | strings.cpp \ |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 23 | |
| 24 | libbase_test_src_files := \ |
| 25 | file_test.cpp \ |
| 26 | stringprintf_test.cpp \ |
Dan Albert | 0f1e544 | 2015-03-13 22:57:40 -0700 | [diff] [blame] | 27 | strings_test.cpp \ |
Dan Albert | 58310b4 | 2015-03-13 23:06:01 -0700 | [diff] [blame] | 28 | test_main.cpp \ |
| 29 | test_utils.cpp \ |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 30 | |
| 31 | libbase_cppflags := \ |
| 32 | -Wall \ |
| 33 | -Wextra \ |
| 34 | -Werror \ |
| 35 | |
| 36 | # Device |
| 37 | # ------------------------------------------------------------------------------ |
| 38 | include $(CLEAR_VARS) |
| 39 | LOCAL_MODULE := libbase |
| 40 | LOCAL_CLANG := true |
Dan Albert | b2326bd | 2015-03-30 10:30:42 -0700 | [diff] [blame] | 41 | LOCAL_SRC_FILES := $(libbase_src_files) logging.cpp |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 42 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
| 43 | LOCAL_CPPFLAGS := $(libbase_cppflags) |
| 44 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Dan Albert | 7dfb61d | 2015-03-20 13:46:28 -0700 | [diff] [blame] | 45 | LOCAL_STATIC_LIBRARIES := libcutils |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 46 | LOCAL_MULTILIB := both |
| 47 | include $(BUILD_STATIC_LIBRARY) |
| 48 | |
| 49 | include $(CLEAR_VARS) |
| 50 | LOCAL_MODULE := libbase |
| 51 | LOCAL_CLANG := true |
| 52 | LOCAL_WHOLE_STATIC_LIBRARIES := libbase |
| 53 | LOCAL_SHARED_LIBRARIES := liblog |
| 54 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Dan Albert | 7dfb61d | 2015-03-20 13:46:28 -0700 | [diff] [blame] | 55 | LOCAL_SHARED_LIBRARIES := libcutils |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 56 | LOCAL_MULTILIB := both |
| 57 | include $(BUILD_SHARED_LIBRARY) |
| 58 | |
| 59 | # Host |
| 60 | # ------------------------------------------------------------------------------ |
| 61 | include $(CLEAR_VARS) |
| 62 | LOCAL_MODULE := libbase |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 63 | LOCAL_SRC_FILES := $(libbase_src_files) |
Dan Albert | b2326bd | 2015-03-30 10:30:42 -0700 | [diff] [blame] | 64 | ifneq ($(HOST_OS),windows) |
| 65 | LOCAL_SRC_FILES += logging.cpp |
| 66 | endif |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 67 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
| 68 | LOCAL_CPPFLAGS := $(libbase_cppflags) |
| 69 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Dan Albert | 7dfb61d | 2015-03-20 13:46:28 -0700 | [diff] [blame] | 70 | LOCAL_STATIC_LIBRARIES := libcutils |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 71 | LOCAL_MULTILIB := both |
| 72 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 73 | |
| 74 | include $(CLEAR_VARS) |
| 75 | LOCAL_MODULE := libbase |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 76 | LOCAL_WHOLE_STATIC_LIBRARIES := libbase |
| 77 | LOCAL_SHARED_LIBRARIES := liblog |
| 78 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Dan Albert | 7dfb61d | 2015-03-20 13:46:28 -0700 | [diff] [blame] | 79 | LOCAL_STATIC_LIBRARIES := libcutils |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 80 | LOCAL_MULTILIB := both |
| 81 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 82 | |
| 83 | # Tests |
| 84 | # ------------------------------------------------------------------------------ |
| 85 | include $(CLEAR_VARS) |
| 86 | LOCAL_MODULE := libbase_test |
| 87 | LOCAL_CLANG := true |
Dan Albert | b2326bd | 2015-03-30 10:30:42 -0700 | [diff] [blame] | 88 | LOCAL_SRC_FILES := $(libbase_test_src_files) logging_test.cpp |
Dan Albert | 58310b4 | 2015-03-13 23:06:01 -0700 | [diff] [blame] | 89 | LOCAL_C_INCLUDES := $(LOCAL_PATH) |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 90 | LOCAL_CPPFLAGS := $(libbase_cppflags) |
| 91 | LOCAL_SHARED_LIBRARIES := libbase |
| 92 | LOCAL_MULTILIB := both |
| 93 | LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 |
| 94 | LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 |
| 95 | include $(BUILD_NATIVE_TEST) |
| 96 | |
| 97 | include $(CLEAR_VARS) |
| 98 | LOCAL_MODULE := libbase_test |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 99 | LOCAL_SRC_FILES := $(libbase_test_src_files) |
Dan Albert | b2326bd | 2015-03-30 10:30:42 -0700 | [diff] [blame] | 100 | ifneq ($(HOST_OS),windows) |
| 101 | LOCAL_SRC_FILES += logging_test.cpp |
| 102 | endif |
Dan Albert | 58310b4 | 2015-03-13 23:06:01 -0700 | [diff] [blame] | 103 | LOCAL_C_INCLUDES := $(LOCAL_PATH) |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 104 | LOCAL_CPPFLAGS := $(libbase_cppflags) |
| 105 | LOCAL_SHARED_LIBRARIES := libbase |
| 106 | LOCAL_MULTILIB := both |
| 107 | LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 |
| 108 | LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 |
| 109 | include $(BUILD_HOST_NATIVE_TEST) |