| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 1 | # | 
 | 2 | # Copyright (C) 2008 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 | LOCAL_PATH := $(my-dir) | 
 | 17 | include $(CLEAR_VARS) | 
 | 18 |  | 
| Josh Gao | 9e86f8e | 2015-11-17 14:17:38 -0800 | [diff] [blame] | 19 | libcutils_common_sources := \ | 
| Josh Gao | 9e86f8e | 2015-11-17 14:17:38 -0800 | [diff] [blame] | 20 |         atomic.c.arm \ | 
| Josh Gao | 9e86f8e | 2015-11-17 14:17:38 -0800 | [diff] [blame] | 21 |         config_utils.c \ | 
| David Pursell | 756e1c8 | 2016-01-29 10:39:41 -0800 | [diff] [blame] | 22 |         fs_config.c \ | 
 | 23 |         hashmap.c \ | 
 | 24 |         iosched_policy.c \ | 
| Josh Gao | 9e86f8e | 2015-11-17 14:17:38 -0800 | [diff] [blame] | 25 |         load_file.c \ | 
| David Pursell | 756e1c8 | 2016-01-29 10:39:41 -0800 | [diff] [blame] | 26 |         native_handle.c \ | 
| Josh Gao | 9e86f8e | 2015-11-17 14:17:38 -0800 | [diff] [blame] | 27 |         open_memstream.c \ | 
| David Pursell | 756e1c8 | 2016-01-29 10:39:41 -0800 | [diff] [blame] | 28 |         process_name.c \ | 
 | 29 |         record_stream.c \ | 
 | 30 |         sched_policy.c \ | 
 | 31 |         sockets.cpp \ | 
| Josh Gao | 9e86f8e | 2015-11-17 14:17:38 -0800 | [diff] [blame] | 32 |         strdup16to8.c \ | 
 | 33 |         strdup8to16.c \ | 
| David Pursell | 756e1c8 | 2016-01-29 10:39:41 -0800 | [diff] [blame] | 34 |         strlcpy.c \ | 
| Josh Gao | 9e86f8e | 2015-11-17 14:17:38 -0800 | [diff] [blame] | 35 |         threads.c \ | 
| Josh Gao | cab716f | 2015-11-17 14:28:33 -0800 | [diff] [blame] | 36 |  | 
 | 37 | # some files must not be compiled when building against Mingw | 
 | 38 | # they correspond to features not used by our host development tools | 
 | 39 | # which are also hard or even impossible to port to native Win32 | 
| Josh Gao | 9e86f8e | 2015-11-17 14:17:38 -0800 | [diff] [blame] | 40 | libcutils_nonwindows_sources := \ | 
| Jeff Sharkey | 0ee7d8c | 2013-09-20 17:58:54 -0700 | [diff] [blame] | 41 |         fs.c \ | 
| Elliott Hughes | 0bff5bd | 2014-05-20 12:01:29 -0700 | [diff] [blame] | 42 |         multiuser.c \ | 
| David Pursell | 0eb8e1b | 2016-01-14 17:18:27 -0800 | [diff] [blame] | 43 |         socket_inaddr_any_server_unix.c \ | 
 | 44 |         socket_local_client_unix.c \ | 
 | 45 |         socket_local_server_unix.c \ | 
 | 46 |         socket_loopback_client_unix.c \ | 
 | 47 |         socket_loopback_server_unix.c \ | 
 | 48 |         socket_network_client_unix.c \ | 
| David Pursell | b34e4a0 | 2016-02-01 09:42:09 -0800 | [diff] [blame] | 49 |         sockets_unix.cpp \ | 
| Josh Gao | 1175d0f | 2015-11-24 09:12:21 -0800 | [diff] [blame] | 50 |         str_parms.c \ | 
| Elliott Hughes | 0bff5bd | 2014-05-20 12:01:29 -0700 | [diff] [blame] | 51 |  | 
| Josh Gao | 9e86f8e | 2015-11-17 14:17:38 -0800 | [diff] [blame] | 52 | libcutils_nonwindows_host_sources := \ | 
| Richard Uhler | 7d451ab | 2015-03-20 16:59:40 -0700 | [diff] [blame] | 53 |         ashmem-host.c \ | 
| David Pursell | 0eb8e1b | 2016-01-14 17:18:27 -0800 | [diff] [blame] | 54 |         trace-host.c \ | 
| Mathieu Chartier | e942d1f | 2014-06-03 18:12:29 -0700 | [diff] [blame] | 55 |  | 
| David Pursell | 0eb8e1b | 2016-01-14 17:18:27 -0800 | [diff] [blame] | 56 | libcutils_windows_host_sources := \ | 
 | 57 |         socket_inaddr_any_server_windows.c \ | 
 | 58 |         socket_network_client_windows.c \ | 
| David Pursell | b34e4a0 | 2016-02-01 09:42:09 -0800 | [diff] [blame] | 59 |         sockets_windows.cpp \ | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 60 |  | 
| Richard Uhler | acb31ba | 2015-03-24 14:46:01 -0700 | [diff] [blame] | 61 | # Shared and static library for host | 
| David Pursell | 0eb8e1b | 2016-01-14 17:18:27 -0800 | [diff] [blame] | 62 | # Note: when linking this library on Windows, you must also link to Winsock2 | 
 | 63 | # using "LOCAL_LDLIBS_windows := -lws2_32". | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 64 | # ======================================================== | 
 | 65 | LOCAL_MODULE := libcutils | 
| Josh Gao | 9e86f8e | 2015-11-17 14:17:38 -0800 | [diff] [blame] | 66 | LOCAL_SRC_FILES := $(libcutils_common_sources) dlmalloc_stubs.c | 
 | 67 | LOCAL_SRC_FILES_darwin := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources) | 
 | 68 | LOCAL_SRC_FILES_linux := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources) | 
| David Pursell | 0eb8e1b | 2016-01-14 17:18:27 -0800 | [diff] [blame] | 69 | LOCAL_SRC_FILES_windows := $(libcutils_windows_host_sources) | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 70 | LOCAL_STATIC_LIBRARIES := liblog | 
| Josh Gao | 1175d0f | 2015-11-24 09:12:21 -0800 | [diff] [blame] | 71 | LOCAL_CFLAGS := -Werror -Wall -Wextra | 
| Ian Rogers | 59ec765 | 2014-06-05 14:32:49 -0700 | [diff] [blame] | 72 | LOCAL_MULTILIB := both | 
| Josh Gao | cab716f | 2015-11-17 14:28:33 -0800 | [diff] [blame] | 73 | LOCAL_MODULE_HOST_OS := darwin linux windows | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 74 | include $(BUILD_HOST_STATIC_LIBRARY) | 
 | 75 |  | 
| Richard Uhler | acb31ba | 2015-03-24 14:46:01 -0700 | [diff] [blame] | 76 | include $(CLEAR_VARS) | 
 | 77 | LOCAL_MODULE := libcutils | 
| Josh Gao | 9e86f8e | 2015-11-17 14:17:38 -0800 | [diff] [blame] | 78 | LOCAL_SRC_FILES := $(libcutils_common_sources) dlmalloc_stubs.c | 
 | 79 | LOCAL_SRC_FILES_darwin := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources) | 
 | 80 | LOCAL_SRC_FILES_linux := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources) | 
| Richard Uhler | acb31ba | 2015-03-24 14:46:01 -0700 | [diff] [blame] | 81 | LOCAL_SHARED_LIBRARIES := liblog | 
| Josh Gao | 1175d0f | 2015-11-24 09:12:21 -0800 | [diff] [blame] | 82 | LOCAL_CFLAGS := -Werror -Wall -Wextra | 
| Richard Uhler | acb31ba | 2015-03-24 14:46:01 -0700 | [diff] [blame] | 83 | LOCAL_MULTILIB := both | 
| Richard Uhler | acb31ba | 2015-03-24 14:46:01 -0700 | [diff] [blame] | 84 | include $(BUILD_HOST_SHARED_LIBRARY) | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 85 |  | 
| Jens Gulin | d3c8d5b | 2014-03-06 18:15:43 +0100 | [diff] [blame] | 86 |  | 
| Andrew Hsieh | 99e7f7a | 2012-03-01 23:58:50 -0800 | [diff] [blame] | 87 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 88 | # Shared and static library for target | 
 | 89 | # ======================================================== | 
| David 'Digit' Turner | 7913bc0 | 2012-01-13 13:38:40 +0100 | [diff] [blame] | 90 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 91 | include $(CLEAR_VARS) | 
 | 92 | LOCAL_MODULE := libcutils | 
| Josh Gao | 9e86f8e | 2015-11-17 14:17:38 -0800 | [diff] [blame] | 93 | LOCAL_SRC_FILES := $(libcutils_common_sources) \ | 
 | 94 |         $(libcutils_nonwindows_sources) \ | 
| Jeff Brown | 053b865 | 2012-06-06 16:25:03 -0700 | [diff] [blame] | 95 |         android_reboot.c \ | 
 | 96 |         ashmem-dev.c \ | 
 | 97 |         debugger.c \ | 
 | 98 |         klog.c \ | 
| Jeff Brown | 053b865 | 2012-06-06 16:25:03 -0700 | [diff] [blame] | 99 |         partition_utils.c \ | 
| Nick Kralevich | b39e3a8 | 2013-05-23 09:54:47 -0700 | [diff] [blame] | 100 |         properties.c \ | 
| Jeff Brown | 053b865 | 2012-06-06 16:25:03 -0700 | [diff] [blame] | 101 |         qtaguid.c \ | 
| Richard Uhler | 7d451ab | 2015-03-20 16:59:40 -0700 | [diff] [blame] | 102 |         trace-dev.c \ | 
| Henrik Smiding | 86a1600 | 2014-05-16 13:26:08 +0200 | [diff] [blame] | 103 |         uevent.c \ | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 104 |  | 
| Elliott Hughes | a492f37 | 2015-04-02 10:41:20 -0700 | [diff] [blame] | 105 | LOCAL_SRC_FILES_arm += arch-arm/memset32.S | 
 | 106 | LOCAL_SRC_FILES_arm64 += arch-arm64/android_memset.S | 
| Duane Sand | 1ef9ccd | 2015-04-16 18:10:37 -0700 | [diff] [blame] | 107 |  | 
 | 108 | LOCAL_SRC_FILES_mips += arch-mips/android_memset.c | 
 | 109 | LOCAL_SRC_FILES_mips64 += arch-mips/android_memset.c | 
| Duane Sand | 734f50c | 2014-06-28 18:55:26 -0700 | [diff] [blame] | 110 |  | 
| Henrik Smiding | 86a1600 | 2014-05-16 13:26:08 +0200 | [diff] [blame] | 111 | LOCAL_SRC_FILES_x86 += \ | 
 | 112 |         arch-x86/android_memset16.S \ | 
 | 113 |         arch-x86/android_memset32.S \ | 
 | 114 |  | 
 | 115 | LOCAL_SRC_FILES_x86_64 += \ | 
| Varvara Rainchik | 458d125 | 2014-09-08 16:27:01 +0400 | [diff] [blame] | 116 |         arch-x86_64/android_memset16.S \ | 
 | 117 |         arch-x86_64/android_memset32.S \ | 
| Henrik Smiding | 86a1600 | 2014-05-16 13:26:08 +0200 | [diff] [blame] | 118 |  | 
| Colin Cross | 65dd88b | 2014-01-22 19:06:04 -0800 | [diff] [blame] | 119 | LOCAL_C_INCLUDES := $(libcutils_c_includes) | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 120 | LOCAL_STATIC_LIBRARIES := liblog | 
| Tim Murray | b769c8d | 2015-06-08 14:56:29 -0700 | [diff] [blame] | 121 | ifneq ($(ENABLE_CPUSETS),) | 
 | 122 | LOCAL_CFLAGS += -DUSE_CPUSETS | 
 | 123 | endif | 
| Todd Kjos | ed60788 | 2015-10-26 16:22:11 -0700 | [diff] [blame] | 124 | ifneq ($(ENABLE_SCHEDBOOST),) | 
 | 125 | LOCAL_CFLAGS += -DUSE_SCHEDBOOST | 
 | 126 | endif | 
| Elliott Hughes | 8fea1ed | 2015-07-24 18:48:31 -0700 | [diff] [blame] | 127 | LOCAL_CFLAGS += -Werror -Wall -Wextra -std=gnu90 | 
| Nick Kralevich | fc82dd9 | 2015-08-26 11:32:31 -0700 | [diff] [blame] | 128 | LOCAL_CLANG := true | 
 | 129 | LOCAL_SANITIZE := integer | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 130 | include $(BUILD_STATIC_LIBRARY) | 
 | 131 |  | 
 | 132 | include $(CLEAR_VARS) | 
 | 133 | LOCAL_MODULE := libcutils | 
| Ying Wang | c796ed9 | 2013-04-10 17:27:35 -0700 | [diff] [blame] | 134 | # TODO: remove liblog as whole static library, once we don't have prebuilt that requires | 
 | 135 | # liblog symbols present in libcutils. | 
 | 136 | LOCAL_WHOLE_STATIC_LIBRARIES := libcutils liblog | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 137 | LOCAL_SHARED_LIBRARIES := liblog | 
| Tim Murray | b769c8d | 2015-06-08 14:56:29 -0700 | [diff] [blame] | 138 | ifneq ($(ENABLE_CPUSETS),) | 
 | 139 | LOCAL_CFLAGS += -DUSE_CPUSETS | 
 | 140 | endif | 
| Todd Kjos | ed60788 | 2015-10-26 16:22:11 -0700 | [diff] [blame] | 141 | ifneq ($(ENABLE_SCHEDBOOST),) | 
 | 142 | LOCAL_CFLAGS += -DUSE_SCHEDBOOST | 
 | 143 | endif | 
| Elliott Hughes | 8fea1ed | 2015-07-24 18:48:31 -0700 | [diff] [blame] | 144 | LOCAL_CFLAGS += -Werror -Wall -Wextra | 
| David 'Digit' Turner | 7913bc0 | 2012-01-13 13:38:40 +0100 | [diff] [blame] | 145 | LOCAL_C_INCLUDES := $(libcutils_c_includes) | 
| Nick Kralevich | fc82dd9 | 2015-08-26 11:32:31 -0700 | [diff] [blame] | 146 | LOCAL_CLANG := true | 
 | 147 | LOCAL_SANITIZE := integer | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 148 | include $(BUILD_SHARED_LIBRARY) | 
 | 149 |  | 
| Duane Sand | d4a8098 | 2012-10-12 14:25:19 -0700 | [diff] [blame] | 150 | include $(call all-makefiles-under,$(LOCAL_PATH)) |