Dan Albert | aac6b7c | 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 | dc15ffd | 2015-04-29 11:32:23 -0700 | [diff] [blame] | 21 | logging.cpp \ |
Dan Albert | aac6b7c | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 22 | stringprintf.cpp \ |
Dan Albert | 00716d7 | 2015-03-13 22:57:40 -0700 | [diff] [blame] | 23 | strings.cpp \ |
Alex Vallée | d0ac74c | 2015-05-06 16:26:00 -0400 | [diff] [blame] | 24 | test_utils.cpp \ |
Dan Albert | aac6b7c | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 25 | |
| 26 | libbase_test_src_files := \ |
| 27 | file_test.cpp \ |
Dan Albert | dc15ffd | 2015-04-29 11:32:23 -0700 | [diff] [blame] | 28 | logging_test.cpp \ |
Elliott Hughes | 7dd8e20 | 2015-09-04 16:26:51 -0700 | [diff] [blame] | 29 | parseint_test.cpp \ |
Dan Albert | aac6b7c | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 30 | stringprintf_test.cpp \ |
Dan Albert | 00716d7 | 2015-03-13 22:57:40 -0700 | [diff] [blame] | 31 | strings_test.cpp \ |
Dan Albert | e3ea058 | 2015-03-13 23:06:01 -0700 | [diff] [blame] | 32 | test_main.cpp \ |
Dan Albert | aac6b7c | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 33 | |
| 34 | libbase_cppflags := \ |
| 35 | -Wall \ |
| 36 | -Wextra \ |
| 37 | -Werror \ |
| 38 | |
| 39 | # Device |
| 40 | # ------------------------------------------------------------------------------ |
| 41 | include $(CLEAR_VARS) |
| 42 | LOCAL_MODULE := libbase |
| 43 | LOCAL_CLANG := true |
Dan Albert | dc15ffd | 2015-04-29 11:32:23 -0700 | [diff] [blame] | 44 | LOCAL_SRC_FILES := $(libbase_src_files) |
Dan Albert | aac6b7c | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 45 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
| 46 | LOCAL_CPPFLAGS := $(libbase_cppflags) |
| 47 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Dan Albert | 4a6d4db | 2015-03-20 13:46:28 -0700 | [diff] [blame] | 48 | LOCAL_STATIC_LIBRARIES := libcutils |
Dan Albert | aac6b7c | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 49 | LOCAL_MULTILIB := both |
| 50 | include $(BUILD_STATIC_LIBRARY) |
| 51 | |
| 52 | include $(CLEAR_VARS) |
| 53 | LOCAL_MODULE := libbase |
| 54 | LOCAL_CLANG := true |
| 55 | LOCAL_WHOLE_STATIC_LIBRARIES := libbase |
| 56 | LOCAL_SHARED_LIBRARIES := liblog |
| 57 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Dan Albert | 4a6d4db | 2015-03-20 13:46:28 -0700 | [diff] [blame] | 58 | LOCAL_SHARED_LIBRARIES := libcutils |
Dan Albert | aac6b7c | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 59 | LOCAL_MULTILIB := both |
| 60 | include $(BUILD_SHARED_LIBRARY) |
| 61 | |
| 62 | # Host |
| 63 | # ------------------------------------------------------------------------------ |
| 64 | include $(CLEAR_VARS) |
| 65 | LOCAL_MODULE := libbase |
Dan Albert | aac6b7c | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 66 | LOCAL_SRC_FILES := $(libbase_src_files) |
| 67 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
| 68 | LOCAL_CPPFLAGS := $(libbase_cppflags) |
| 69 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Dan Albert | 4a6d4db | 2015-03-20 13:46:28 -0700 | [diff] [blame] | 70 | LOCAL_STATIC_LIBRARIES := libcutils |
Dan Albert | aac6b7c | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 71 | LOCAL_MULTILIB := both |
Dan Willemsen | e2b85e1 | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 72 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Dan Albert | aac6b7c | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 73 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 74 | |
| 75 | include $(CLEAR_VARS) |
| 76 | LOCAL_MODULE := libbase |
Dan Albert | aac6b7c | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 77 | LOCAL_WHOLE_STATIC_LIBRARIES := libbase |
| 78 | LOCAL_SHARED_LIBRARIES := liblog |
| 79 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Dan Albert | 4a6d4db | 2015-03-20 13:46:28 -0700 | [diff] [blame] | 80 | LOCAL_STATIC_LIBRARIES := libcutils |
Dan Albert | aac6b7c | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 81 | LOCAL_MULTILIB := both |
Stephen Hines | 0ec46e8 | 2015-09-10 22:47:07 -0700 | [diff] [blame] | 82 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Dan Albert | aac6b7c | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 83 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 84 | |
| 85 | # Tests |
| 86 | # ------------------------------------------------------------------------------ |
| 87 | include $(CLEAR_VARS) |
| 88 | LOCAL_MODULE := libbase_test |
| 89 | LOCAL_CLANG := true |
Dan Albert | dc15ffd | 2015-04-29 11:32:23 -0700 | [diff] [blame] | 90 | LOCAL_SRC_FILES := $(libbase_test_src_files) |
Dan Albert | e3ea058 | 2015-03-13 23:06:01 -0700 | [diff] [blame] | 91 | LOCAL_C_INCLUDES := $(LOCAL_PATH) |
Dan Albert | aac6b7c | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 92 | LOCAL_CPPFLAGS := $(libbase_cppflags) |
| 93 | LOCAL_SHARED_LIBRARIES := libbase |
| 94 | LOCAL_MULTILIB := both |
| 95 | LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 |
| 96 | LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 |
| 97 | include $(BUILD_NATIVE_TEST) |
| 98 | |
| 99 | include $(CLEAR_VARS) |
| 100 | LOCAL_MODULE := libbase_test |
Spencer Low | d646097 | 2015-09-11 20:01:29 -0700 | [diff] [blame] | 101 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Dan Albert | aac6b7c | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 102 | LOCAL_SRC_FILES := $(libbase_test_src_files) |
Dan Albert | e3ea058 | 2015-03-13 23:06:01 -0700 | [diff] [blame] | 103 | LOCAL_C_INCLUDES := $(LOCAL_PATH) |
Dan Albert | aac6b7c | 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) |