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 19 libcutils_common_sources := \ 20 atomic.c.arm \ 21 config_utils.c \ 22 fs_config.c \ 23 canned_fs_config.c \ 24 hashmap.c \ 25 iosched_policy.c \ 26 load_file.c \ 27 native_handle.c \ 28 open_memstream.c \ 29 process_name.c \ 30 record_stream.c \ 31 sched_policy.c \ 32 sockets.cpp \ 33 strdup16to8.c \ 34 strdup8to16.c \ 35 strlcpy.c \ 36 threads.c \ 37 38 # some files must not be compiled when building against Mingw 39 # they correspond to features not used by our host development tools 40 # which are also hard or even impossible to port to native Win32 41 libcutils_nonwindows_sources := \ 42 fs.c \ 43 multiuser.c \ 44 socket_inaddr_any_server_unix.c \ 45 socket_local_client_unix.c \ 46 socket_local_server_unix.c \ 47 socket_loopback_client_unix.c \ 48 socket_loopback_server_unix.c \ 49 socket_network_client_unix.c \ 50 sockets_unix.cpp \ 51 str_parms.c \ 52 53 libcutils_nonwindows_host_sources := \ 54 ashmem-host.c \ 55 trace-host.c \ 56 57 libcutils_windows_host_sources := \ 58 socket_inaddr_any_server_windows.c \ 59 socket_network_client_windows.c \ 60 sockets_windows.cpp \ 61 62 # Shared and static library for host 63 # Note: when linking this library on Windows, you must also link to Winsock2 64 # using "LOCAL_LDLIBS_windows := -lws2_32". 65 # ======================================================== 66 LOCAL_MODULE := libcutils 67 LOCAL_SRC_FILES := $(libcutils_common_sources) dlmalloc_stubs.c 68 LOCAL_SRC_FILES_darwin := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources) 69 LOCAL_SRC_FILES_linux := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources) 70 LOCAL_SRC_FILES_windows := $(libcutils_windows_host_sources) 71 LOCAL_STATIC_LIBRARIES := liblog 72 LOCAL_CFLAGS := -Werror -Wall -Wextra 73 LOCAL_MULTILIB := both 74 LOCAL_MODULE_HOST_OS := darwin linux windows 75 include $(BUILD_HOST_STATIC_LIBRARY) 76 77 include $(CLEAR_VARS) 78 LOCAL_MODULE := libcutils 79 LOCAL_SRC_FILES := $(libcutils_common_sources) dlmalloc_stubs.c 80 LOCAL_SRC_FILES_darwin := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources) 81 LOCAL_SRC_FILES_linux := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources) 82 LOCAL_SHARED_LIBRARIES := liblog 83 LOCAL_CFLAGS := -Werror -Wall -Wextra 84 LOCAL_MULTILIB := both 85 include $(BUILD_HOST_SHARED_LIBRARY) 86 87 88 89 # Shared and static library for target 90 # ======================================================== 91 92 include $(CLEAR_VARS) 93 LOCAL_MODULE := libcutils 94 LOCAL_SRC_FILES := $(libcutils_common_sources) \ 95 $(libcutils_nonwindows_sources) \ 96 android_reboot.c \ 97 ashmem-dev.c \ 98 debugger.c \ 99 klog.c \ 100 partition_utils.c \ 101 properties.c \ 102 qtaguid.c \ 103 trace-dev.c \ 104 uevent.c \ 105 106 LOCAL_SRC_FILES_arm += arch-arm/memset32.S 107 LOCAL_SRC_FILES_arm64 += arch-arm64/android_memset.S 108 109 LOCAL_SRC_FILES_mips += arch-mips/android_memset.c 110 LOCAL_SRC_FILES_mips64 += arch-mips/android_memset.c 111 112 LOCAL_SRC_FILES_x86 += \ 113 arch-x86/android_memset16.S \ 114 arch-x86/android_memset32.S \ 115 116 LOCAL_SRC_FILES_x86_64 += \ 117 arch-x86_64/android_memset16.S \ 118 arch-x86_64/android_memset32.S \ 119 120 LOCAL_C_INCLUDES := $(libcutils_c_includes) 121 LOCAL_STATIC_LIBRARIES := liblog 122 ifneq ($(ENABLE_CPUSETS),) 123 LOCAL_CFLAGS += -DUSE_CPUSETS 124 endif 125 ifneq ($(ENABLE_SCHEDBOOST),) 126 LOCAL_CFLAGS += -DUSE_SCHEDBOOST 127 endif 128 LOCAL_CFLAGS += -Werror -Wall -Wextra -std=gnu90 129 LOCAL_CLANG := true 130 LOCAL_SANITIZE := integer 131 include $(BUILD_STATIC_LIBRARY) 132 133 include $(CLEAR_VARS) 134 LOCAL_MODULE := libcutils 135 # TODO: remove liblog as whole static library, once we don't have prebuilt that requires 136 # liblog symbols present in libcutils. 137 LOCAL_WHOLE_STATIC_LIBRARIES := libcutils liblog 138 LOCAL_SHARED_LIBRARIES := liblog 139 ifneq ($(ENABLE_CPUSETS),) 140 LOCAL_CFLAGS += -DUSE_CPUSETS 141 endif 142 ifneq ($(ENABLE_SCHEDBOOST),) 143 LOCAL_CFLAGS += -DUSE_SCHEDBOOST 144 endif 145 LOCAL_CFLAGS += -Werror -Wall -Wextra 146 LOCAL_C_INCLUDES := $(libcutils_c_includes) 147 LOCAL_CLANG := true 148 LOCAL_SANITIZE := integer 149 include $(BUILD_SHARED_LIBRARY) 150 151 include $(call all-makefiles-under,$(LOCAL_PATH)) 152