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 \ |
Dan Albert | 5c19040 | 2015-04-29 11:32:23 -0700 | [diff] [blame] | 21 | logging.cpp \ |
David Pursell | 706955f | 2016-01-21 08:40:59 -0800 | [diff] [blame] | 22 | parsenetaddress.cpp \ |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 23 | stringprintf.cpp \ |
Dan Albert | 0f1e544 | 2015-03-13 22:57:40 -0700 | [diff] [blame] | 24 | strings.cpp \ |
Alex Vallée | 47d67c9 | 2015-05-06 16:26:00 -0400 | [diff] [blame] | 25 | test_utils.cpp \ |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 26 | |
David Pursell | 5f787ed | 2016-01-27 08:52:53 -0800 | [diff] [blame] | 27 | libbase_linux_src_files := \ |
| 28 | errors_unix.cpp \ |
| 29 | |
| 30 | libbase_darwin_src_files := \ |
| 31 | errors_unix.cpp \ |
| 32 | |
Elliott Hughes | c1fd492 | 2015-11-11 18:02:29 +0000 | [diff] [blame] | 33 | libbase_windows_src_files := \ |
David Pursell | 5f787ed | 2016-01-27 08:52:53 -0800 | [diff] [blame] | 34 | errors_windows.cpp \ |
Elliott Hughes | c1fd492 | 2015-11-11 18:02:29 +0000 | [diff] [blame] | 35 | utf8.cpp \ |
| 36 | |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 37 | libbase_test_src_files := \ |
David Pursell | 5f787ed | 2016-01-27 08:52:53 -0800 | [diff] [blame] | 38 | errors_test.cpp \ |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 39 | file_test.cpp \ |
Dan Albert | 5c19040 | 2015-04-29 11:32:23 -0700 | [diff] [blame] | 40 | logging_test.cpp \ |
Elliott Hughes | afe151f | 2015-09-04 16:26:51 -0700 | [diff] [blame] | 41 | parseint_test.cpp \ |
David Pursell | 706955f | 2016-01-21 08:40:59 -0800 | [diff] [blame] | 42 | parsenetaddress_test.cpp \ |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 43 | stringprintf_test.cpp \ |
Dan Albert | 0f1e544 | 2015-03-13 22:57:40 -0700 | [diff] [blame] | 44 | strings_test.cpp \ |
Dan Albert | 58310b4 | 2015-03-13 23:06:01 -0700 | [diff] [blame] | 45 | test_main.cpp \ |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 46 | |
Elliott Hughes | c1fd492 | 2015-11-11 18:02:29 +0000 | [diff] [blame] | 47 | libbase_test_windows_src_files := \ |
| 48 | utf8_test.cpp \ |
| 49 | |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 50 | libbase_cppflags := \ |
| 51 | -Wall \ |
| 52 | -Wextra \ |
| 53 | -Werror \ |
| 54 | |
Josh Gao | 7df6b5f | 2015-11-12 11:54:47 -0800 | [diff] [blame] | 55 | libbase_linux_cppflags := \ |
| 56 | -Wexit-time-destructors \ |
| 57 | |
| 58 | libbase_darwin_cppflags := \ |
| 59 | -Wexit-time-destructors \ |
| 60 | |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 61 | # Device |
| 62 | # ------------------------------------------------------------------------------ |
| 63 | include $(CLEAR_VARS) |
| 64 | LOCAL_MODULE := libbase |
| 65 | LOCAL_CLANG := true |
David Pursell | 5f787ed | 2016-01-27 08:52:53 -0800 | [diff] [blame] | 66 | LOCAL_SRC_FILES := $(libbase_src_files) $(libbase_linux_src_files) |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 67 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
Josh Gao | 7df6b5f | 2015-11-12 11:54:47 -0800 | [diff] [blame] | 68 | LOCAL_CPPFLAGS := $(libbase_cppflags) $(libbase_linux_cppflags) |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 69 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Elliott Hughes | 5cf0dcd | 2016-02-04 08:24:55 -0800 | [diff] [blame] | 70 | LOCAL_STATIC_LIBRARIES := liblog |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 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 |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 87 | LOCAL_SRC_FILES := $(libbase_src_files) |
Elliott Hughes | c1fd492 | 2015-11-11 18:02:29 +0000 | [diff] [blame] | 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) |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 91 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
| 92 | LOCAL_CPPFLAGS := $(libbase_cppflags) |
Josh Gao | 7df6b5f | 2015-11-12 11:54:47 -0800 | [diff] [blame] | 93 | LOCAL_CPPFLAGS_darwin := $(libbase_darwin_cppflags) |
| 94 | LOCAL_CPPFLAGS_linux := $(libbase_linux_cppflags) |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 95 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Elliott Hughes | 5cf0dcd | 2016-02-04 08:24:55 -0800 | [diff] [blame] | 96 | LOCAL_STATIC_LIBRARIES := liblog |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 97 | LOCAL_MULTILIB := both |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 98 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 99 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 100 | |
| 101 | include $(CLEAR_VARS) |
| 102 | LOCAL_MODULE := libbase |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 103 | LOCAL_WHOLE_STATIC_LIBRARIES := libbase |
| 104 | LOCAL_SHARED_LIBRARIES := liblog |
| 105 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
| 106 | LOCAL_MULTILIB := both |
Stephen Hines | b0e4f08 | 2015-09-10 22:47:07 -0700 | [diff] [blame] | 107 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 108 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 109 | |
| 110 | # Tests |
| 111 | # ------------------------------------------------------------------------------ |
| 112 | include $(CLEAR_VARS) |
| 113 | LOCAL_MODULE := libbase_test |
| 114 | LOCAL_CLANG := true |
Dan Albert | 5c19040 | 2015-04-29 11:32:23 -0700 | [diff] [blame] | 115 | LOCAL_SRC_FILES := $(libbase_test_src_files) |
Elliott Hughes | c1fd492 | 2015-11-11 18:02:29 +0000 | [diff] [blame] | 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) |
Dan Albert | 58310b4 | 2015-03-13 23:06:01 -0700 | [diff] [blame] | 119 | LOCAL_C_INCLUDES := $(LOCAL_PATH) |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 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 |
Spencer Low | b2d4949 | 2015-09-11 20:01:29 -0700 | [diff] [blame] | 129 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 130 | LOCAL_SRC_FILES := $(libbase_test_src_files) |
Elliott Hughes | c1fd492 | 2015-11-11 18:02:29 +0000 | [diff] [blame] | 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) |
Dan Albert | 58310b4 | 2015-03-13 23:06:01 -0700 | [diff] [blame] | 134 | LOCAL_C_INCLUDES := $(LOCAL_PATH) |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 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) |