blob: 0c6e5a1cf9b83650cd42c8c70b468604bdbdfba7 [file] [log] [blame]
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -08001#
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#
16LOCAL_PATH := $(my-dir)
17include $(CLEAR_VARS)
18
Josh Gao9e86f8e2015-11-17 14:17:38 -080019libcutils_common_sources := \
Josh Gao9e86f8e2015-11-17 14:17:38 -080020 atomic.c.arm \
Josh Gao9e86f8e2015-11-17 14:17:38 -080021 config_utils.c \
David Pursell756e1c82016-01-29 10:39:41 -080022 fs_config.c \
Mohamad Ayyash8c788582016-04-07 22:13:43 -070023 canned_fs_config.c \
David Pursell756e1c82016-01-29 10:39:41 -080024 hashmap.c \
25 iosched_policy.c \
Josh Gao9e86f8e2015-11-17 14:17:38 -080026 load_file.c \
David Pursell756e1c82016-01-29 10:39:41 -080027 native_handle.c \
Josh Gao9e86f8e2015-11-17 14:17:38 -080028 open_memstream.c \
David Pursell756e1c82016-01-29 10:39:41 -080029 process_name.c \
30 record_stream.c \
31 sched_policy.c \
32 sockets.cpp \
Josh Gao9e86f8e2015-11-17 14:17:38 -080033 strdup16to8.c \
34 strdup8to16.c \
David Pursell756e1c82016-01-29 10:39:41 -080035 strlcpy.c \
Josh Gao9e86f8e2015-11-17 14:17:38 -080036 threads.c \
Josh Gaocab716f2015-11-17 14:28:33 -080037
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
Josh Gao9e86f8e2015-11-17 14:17:38 -080041libcutils_nonwindows_sources := \
Jeff Sharkey0ee7d8c2013-09-20 17:58:54 -070042 fs.c \
Elliott Hughes0bff5bd2014-05-20 12:01:29 -070043 multiuser.c \
David Pursell0eb8e1b2016-01-14 17:18:27 -080044 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 \
David Pursellb34e4a02016-02-01 09:42:09 -080050 sockets_unix.cpp \
Josh Gao1175d0f2015-11-24 09:12:21 -080051 str_parms.c \
Elliott Hughes0bff5bd2014-05-20 12:01:29 -070052
Josh Gao9e86f8e2015-11-17 14:17:38 -080053libcutils_nonwindows_host_sources := \
Richard Uhler7d451ab2015-03-20 16:59:40 -070054 ashmem-host.c \
David Pursell0eb8e1b2016-01-14 17:18:27 -080055 trace-host.c \
Mathieu Chartiere942d1f2014-06-03 18:12:29 -070056
David Pursell0eb8e1b2016-01-14 17:18:27 -080057libcutils_windows_host_sources := \
58 socket_inaddr_any_server_windows.c \
59 socket_network_client_windows.c \
David Pursellb34e4a02016-02-01 09:42:09 -080060 sockets_windows.cpp \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080061
Richard Uhleracb31ba2015-03-24 14:46:01 -070062# Shared and static library for host
David Pursell0eb8e1b2016-01-14 17:18:27 -080063# Note: when linking this library on Windows, you must also link to Winsock2
64# using "LOCAL_LDLIBS_windows := -lws2_32".
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080065# ========================================================
66LOCAL_MODULE := libcutils
Josh Gao9e86f8e2015-11-17 14:17:38 -080067LOCAL_SRC_FILES := $(libcutils_common_sources) dlmalloc_stubs.c
68LOCAL_SRC_FILES_darwin := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources)
69LOCAL_SRC_FILES_linux := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources)
David Pursell0eb8e1b2016-01-14 17:18:27 -080070LOCAL_SRC_FILES_windows := $(libcutils_windows_host_sources)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080071LOCAL_STATIC_LIBRARIES := liblog
Josh Gao1175d0f2015-11-24 09:12:21 -080072LOCAL_CFLAGS := -Werror -Wall -Wextra
Ian Rogers59ec7652014-06-05 14:32:49 -070073LOCAL_MULTILIB := both
Josh Gaocab716f2015-11-17 14:28:33 -080074LOCAL_MODULE_HOST_OS := darwin linux windows
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080075include $(BUILD_HOST_STATIC_LIBRARY)
76
Richard Uhleracb31ba2015-03-24 14:46:01 -070077include $(CLEAR_VARS)
78LOCAL_MODULE := libcutils
Josh Gao9e86f8e2015-11-17 14:17:38 -080079LOCAL_SRC_FILES := $(libcutils_common_sources) dlmalloc_stubs.c
80LOCAL_SRC_FILES_darwin := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources)
81LOCAL_SRC_FILES_linux := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources)
Richard Uhleracb31ba2015-03-24 14:46:01 -070082LOCAL_SHARED_LIBRARIES := liblog
Josh Gao1175d0f2015-11-24 09:12:21 -080083LOCAL_CFLAGS := -Werror -Wall -Wextra
Richard Uhleracb31ba2015-03-24 14:46:01 -070084LOCAL_MULTILIB := both
Richard Uhleracb31ba2015-03-24 14:46:01 -070085include $(BUILD_HOST_SHARED_LIBRARY)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080086
Jens Gulind3c8d5b2014-03-06 18:15:43 +010087
Andrew Hsieh99e7f7a2012-03-01 23:58:50 -080088
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080089# Shared and static library for target
90# ========================================================
David 'Digit' Turner7913bc02012-01-13 13:38:40 +010091
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080092include $(CLEAR_VARS)
93LOCAL_MODULE := libcutils
Josh Gao9e86f8e2015-11-17 14:17:38 -080094LOCAL_SRC_FILES := $(libcutils_common_sources) \
95 $(libcutils_nonwindows_sources) \
Jeff Brown053b8652012-06-06 16:25:03 -070096 android_reboot.c \
97 ashmem-dev.c \
98 debugger.c \
99 klog.c \
Jeff Brown053b8652012-06-06 16:25:03 -0700100 partition_utils.c \
Nick Kralevichb39e3a82013-05-23 09:54:47 -0700101 properties.c \
Jeff Brown053b8652012-06-06 16:25:03 -0700102 qtaguid.c \
Richard Uhler7d451ab2015-03-20 16:59:40 -0700103 trace-dev.c \
Henrik Smiding86a16002014-05-16 13:26:08 +0200104 uevent.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800105
Elliott Hughesa492f372015-04-02 10:41:20 -0700106LOCAL_SRC_FILES_arm += arch-arm/memset32.S
107LOCAL_SRC_FILES_arm64 += arch-arm64/android_memset.S
Duane Sand1ef9ccd2015-04-16 18:10:37 -0700108
109LOCAL_SRC_FILES_mips += arch-mips/android_memset.c
110LOCAL_SRC_FILES_mips64 += arch-mips/android_memset.c
Duane Sand734f50c2014-06-28 18:55:26 -0700111
Henrik Smiding86a16002014-05-16 13:26:08 +0200112LOCAL_SRC_FILES_x86 += \
113 arch-x86/android_memset16.S \
114 arch-x86/android_memset32.S \
115
116LOCAL_SRC_FILES_x86_64 += \
Varvara Rainchik458d1252014-09-08 16:27:01 +0400117 arch-x86_64/android_memset16.S \
118 arch-x86_64/android_memset32.S \
Henrik Smiding86a16002014-05-16 13:26:08 +0200119
Colin Cross65dd88b2014-01-22 19:06:04 -0800120LOCAL_C_INCLUDES := $(libcutils_c_includes)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800121LOCAL_STATIC_LIBRARIES := liblog
Tim Murrayb769c8d2015-06-08 14:56:29 -0700122ifneq ($(ENABLE_CPUSETS),)
123LOCAL_CFLAGS += -DUSE_CPUSETS
124endif
Todd Kjosed607882015-10-26 16:22:11 -0700125ifneq ($(ENABLE_SCHEDBOOST),)
126LOCAL_CFLAGS += -DUSE_SCHEDBOOST
127endif
Elliott Hughes8fea1ed2015-07-24 18:48:31 -0700128LOCAL_CFLAGS += -Werror -Wall -Wextra -std=gnu90
Nick Kralevichfc82dd92015-08-26 11:32:31 -0700129LOCAL_CLANG := true
130LOCAL_SANITIZE := integer
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800131include $(BUILD_STATIC_LIBRARY)
132
133include $(CLEAR_VARS)
134LOCAL_MODULE := libcutils
Ying Wangc796ed92013-04-10 17:27:35 -0700135# TODO: remove liblog as whole static library, once we don't have prebuilt that requires
136# liblog symbols present in libcutils.
137LOCAL_WHOLE_STATIC_LIBRARIES := libcutils liblog
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800138LOCAL_SHARED_LIBRARIES := liblog
Tim Murrayb769c8d2015-06-08 14:56:29 -0700139ifneq ($(ENABLE_CPUSETS),)
140LOCAL_CFLAGS += -DUSE_CPUSETS
141endif
Todd Kjosed607882015-10-26 16:22:11 -0700142ifneq ($(ENABLE_SCHEDBOOST),)
143LOCAL_CFLAGS += -DUSE_SCHEDBOOST
144endif
Elliott Hughes8fea1ed2015-07-24 18:48:31 -0700145LOCAL_CFLAGS += -Werror -Wall -Wextra
David 'Digit' Turner7913bc02012-01-13 13:38:40 +0100146LOCAL_C_INCLUDES := $(libcutils_c_includes)
Nick Kralevichfc82dd92015-08-26 11:32:31 -0700147LOCAL_CLANG := true
148LOCAL_SANITIZE := integer
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800149include $(BUILD_SHARED_LIBRARY)
150
Duane Sandd4a80982012-10-12 14:25:19 -0700151include $(call all-makefiles-under,$(LOCAL_PATH))