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 | |
Elliott Hughes | c1fd492 | 2015-11-11 18:02:29 +0000 | [diff] [blame] | 27 | libbase_windows_src_files := \ |
| 28 | utf8.cpp \ |
| 29 | |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 30 | libbase_test_src_files := \ |
| 31 | file_test.cpp \ |
Dan Albert | 5c19040 | 2015-04-29 11:32:23 -0700 | [diff] [blame] | 32 | logging_test.cpp \ |
Elliott Hughes | afe151f | 2015-09-04 16:26:51 -0700 | [diff] [blame] | 33 | parseint_test.cpp \ |
David Pursell | 706955f | 2016-01-21 08:40:59 -0800 | [diff] [blame] | 34 | parsenetaddress_test.cpp \ |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 35 | stringprintf_test.cpp \ |
Dan Albert | 0f1e544 | 2015-03-13 22:57:40 -0700 | [diff] [blame] | 36 | strings_test.cpp \ |
Dan Albert | 58310b4 | 2015-03-13 23:06:01 -0700 | [diff] [blame] | 37 | test_main.cpp \ |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 38 | |
Elliott Hughes | c1fd492 | 2015-11-11 18:02:29 +0000 | [diff] [blame] | 39 | libbase_test_windows_src_files := \ |
| 40 | utf8_test.cpp \ |
| 41 | |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 42 | libbase_cppflags := \ |
| 43 | -Wall \ |
| 44 | -Wextra \ |
| 45 | -Werror \ |
| 46 | |
Josh Gao | 7df6b5f | 2015-11-12 11:54:47 -0800 | [diff] [blame] | 47 | libbase_linux_cppflags := \ |
| 48 | -Wexit-time-destructors \ |
| 49 | |
| 50 | libbase_darwin_cppflags := \ |
| 51 | -Wexit-time-destructors \ |
| 52 | |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 53 | # Device |
| 54 | # ------------------------------------------------------------------------------ |
| 55 | include $(CLEAR_VARS) |
| 56 | LOCAL_MODULE := libbase |
| 57 | LOCAL_CLANG := true |
Dan Albert | 5c19040 | 2015-04-29 11:32:23 -0700 | [diff] [blame] | 58 | LOCAL_SRC_FILES := $(libbase_src_files) |
Elliott Hughes | c1fd492 | 2015-11-11 18:02:29 +0000 | [diff] [blame] | 59 | LOCAL_SRC_FILES_darwin := $(libbase_darwin_src_files) |
| 60 | LOCAL_SRC_FILES_linux := $(libbase_linux_src_files) |
| 61 | LOCAL_SRC_FILES_windows := $(libbase_windows_src_files) |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 62 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
Josh Gao | 7df6b5f | 2015-11-12 11:54:47 -0800 | [diff] [blame] | 63 | LOCAL_CPPFLAGS := $(libbase_cppflags) $(libbase_linux_cppflags) |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 64 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Dan Albert | 7dfb61d | 2015-03-20 13:46:28 -0700 | [diff] [blame] | 65 | LOCAL_STATIC_LIBRARIES := libcutils |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 66 | LOCAL_MULTILIB := both |
| 67 | include $(BUILD_STATIC_LIBRARY) |
| 68 | |
| 69 | include $(CLEAR_VARS) |
| 70 | LOCAL_MODULE := libbase |
| 71 | LOCAL_CLANG := true |
| 72 | LOCAL_WHOLE_STATIC_LIBRARIES := libbase |
| 73 | LOCAL_SHARED_LIBRARIES := liblog |
| 74 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Dan Albert | 7dfb61d | 2015-03-20 13:46:28 -0700 | [diff] [blame] | 75 | LOCAL_SHARED_LIBRARIES := libcutils |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 76 | LOCAL_MULTILIB := both |
| 77 | include $(BUILD_SHARED_LIBRARY) |
| 78 | |
| 79 | # Host |
| 80 | # ------------------------------------------------------------------------------ |
| 81 | include $(CLEAR_VARS) |
| 82 | LOCAL_MODULE := libbase |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 83 | LOCAL_SRC_FILES := $(libbase_src_files) |
Elliott Hughes | c1fd492 | 2015-11-11 18:02:29 +0000 | [diff] [blame] | 84 | LOCAL_SRC_FILES_darwin := $(libbase_darwin_src_files) |
| 85 | LOCAL_SRC_FILES_linux := $(libbase_linux_src_files) |
| 86 | LOCAL_SRC_FILES_windows := $(libbase_windows_src_files) |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 87 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
| 88 | LOCAL_CPPFLAGS := $(libbase_cppflags) |
Josh Gao | 7df6b5f | 2015-11-12 11:54:47 -0800 | [diff] [blame] | 89 | LOCAL_CPPFLAGS_darwin := $(libbase_darwin_cppflags) |
| 90 | LOCAL_CPPFLAGS_linux := $(libbase_linux_cppflags) |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 91 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Dan Albert | 7dfb61d | 2015-03-20 13:46:28 -0700 | [diff] [blame] | 92 | LOCAL_STATIC_LIBRARIES := libcutils |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 93 | LOCAL_MULTILIB := both |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 94 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 95 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 96 | |
| 97 | include $(CLEAR_VARS) |
| 98 | LOCAL_MODULE := libbase |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 99 | LOCAL_WHOLE_STATIC_LIBRARIES := libbase |
| 100 | LOCAL_SHARED_LIBRARIES := liblog |
| 101 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Dan Albert | 7dfb61d | 2015-03-20 13:46:28 -0700 | [diff] [blame] | 102 | LOCAL_STATIC_LIBRARIES := libcutils |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 103 | LOCAL_MULTILIB := both |
Stephen Hines | b0e4f08 | 2015-09-10 22:47:07 -0700 | [diff] [blame] | 104 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 105 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 106 | |
| 107 | # Tests |
| 108 | # ------------------------------------------------------------------------------ |
| 109 | include $(CLEAR_VARS) |
| 110 | LOCAL_MODULE := libbase_test |
| 111 | LOCAL_CLANG := true |
Dan Albert | 5c19040 | 2015-04-29 11:32:23 -0700 | [diff] [blame] | 112 | LOCAL_SRC_FILES := $(libbase_test_src_files) |
Elliott Hughes | c1fd492 | 2015-11-11 18:02:29 +0000 | [diff] [blame] | 113 | LOCAL_SRC_FILES_darwin := $(libbase_test_darwin_src_files) |
| 114 | LOCAL_SRC_FILES_linux := $(libbase_test_linux_src_files) |
| 115 | LOCAL_SRC_FILES_windows := $(libbase_test_windows_src_files) |
Dan Albert | 58310b4 | 2015-03-13 23:06:01 -0700 | [diff] [blame] | 116 | LOCAL_C_INCLUDES := $(LOCAL_PATH) |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 117 | LOCAL_CPPFLAGS := $(libbase_cppflags) |
| 118 | LOCAL_SHARED_LIBRARIES := libbase |
| 119 | LOCAL_MULTILIB := both |
| 120 | LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 |
| 121 | LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 |
| 122 | include $(BUILD_NATIVE_TEST) |
| 123 | |
| 124 | include $(CLEAR_VARS) |
| 125 | LOCAL_MODULE := libbase_test |
Spencer Low | b2d4949 | 2015-09-11 20:01:29 -0700 | [diff] [blame] | 126 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 127 | LOCAL_SRC_FILES := $(libbase_test_src_files) |
Elliott Hughes | c1fd492 | 2015-11-11 18:02:29 +0000 | [diff] [blame] | 128 | LOCAL_SRC_FILES_darwin := $(libbase_test_darwin_src_files) |
| 129 | LOCAL_SRC_FILES_linux := $(libbase_test_linux_src_files) |
| 130 | LOCAL_SRC_FILES_windows := $(libbase_test_windows_src_files) |
Dan Albert | 58310b4 | 2015-03-13 23:06:01 -0700 | [diff] [blame] | 131 | LOCAL_C_INCLUDES := $(LOCAL_PATH) |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 132 | LOCAL_CPPFLAGS := $(libbase_cppflags) |
| 133 | LOCAL_SHARED_LIBRARIES := libbase |
| 134 | LOCAL_MULTILIB := both |
| 135 | LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 |
| 136 | LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 |
| 137 | include $(BUILD_HOST_NATIVE_TEST) |