blob: 25b056b4159067aba3506180dcbc78e4a212cf04 [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 := \
20 hashmap.c \
21 atomic.c.arm \
22 native_handle.c \
23 config_utils.c \
24 load_file.c \
25 strlcpy.c \
26 open_memstream.c \
27 strdup16to8.c \
28 strdup8to16.c \
29 record_stream.c \
30 process_name.c \
31 threads.c \
32 sched_policy.c \
33 iosched_policy.c \
Josh Gao9e86f8e2015-11-17 14:17:38 -080034 fs_config.c
Josh Gaocab716f2015-11-17 14:28:33 -080035
36# some files must not be compiled when building against Mingw
37# they correspond to features not used by our host development tools
38# which are also hard or even impossible to port to native Win32
Josh Gao9e86f8e2015-11-17 14:17:38 -080039libcutils_nonwindows_sources := \
Jeff Sharkey0ee7d8c2013-09-20 17:58:54 -070040 fs.c \
Elliott Hughes0bff5bd2014-05-20 12:01:29 -070041 multiuser.c \
David Pursell0eb8e1b2016-01-14 17:18:27 -080042 socket_inaddr_any_server_unix.c \
43 socket_local_client_unix.c \
44 socket_local_server_unix.c \
45 socket_loopback_client_unix.c \
46 socket_loopback_server_unix.c \
47 socket_network_client_unix.c \
48 sockets_unix.c \
Josh Gao1175d0f2015-11-24 09:12:21 -080049 str_parms.c \
Elliott Hughes0bff5bd2014-05-20 12:01:29 -070050
Josh Gao9e86f8e2015-11-17 14:17:38 -080051libcutils_nonwindows_host_sources := \
Richard Uhler7d451ab2015-03-20 16:59:40 -070052 ashmem-host.c \
David Pursell0eb8e1b2016-01-14 17:18:27 -080053 trace-host.c \
Mathieu Chartiere942d1f2014-06-03 18:12:29 -070054
David Pursell0eb8e1b2016-01-14 17:18:27 -080055libcutils_windows_host_sources := \
56 socket_inaddr_any_server_windows.c \
57 socket_network_client_windows.c \
58 sockets_windows.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080059
Richard Uhleracb31ba2015-03-24 14:46:01 -070060# Shared and static library for host
David Pursell0eb8e1b2016-01-14 17:18:27 -080061# Note: when linking this library on Windows, you must also link to Winsock2
62# using "LOCAL_LDLIBS_windows := -lws2_32".
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080063# ========================================================
64LOCAL_MODULE := libcutils
Josh Gao9e86f8e2015-11-17 14:17:38 -080065LOCAL_SRC_FILES := $(libcutils_common_sources) dlmalloc_stubs.c
66LOCAL_SRC_FILES_darwin := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources)
67LOCAL_SRC_FILES_linux := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources)
David Pursell0eb8e1b2016-01-14 17:18:27 -080068LOCAL_SRC_FILES_windows := $(libcutils_windows_host_sources)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080069LOCAL_STATIC_LIBRARIES := liblog
Josh Gao1175d0f2015-11-24 09:12:21 -080070LOCAL_CFLAGS := -Werror -Wall -Wextra
Ian Rogers59ec7652014-06-05 14:32:49 -070071LOCAL_MULTILIB := both
Josh Gaocab716f2015-11-17 14:28:33 -080072LOCAL_MODULE_HOST_OS := darwin linux windows
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080073include $(BUILD_HOST_STATIC_LIBRARY)
74
Richard Uhleracb31ba2015-03-24 14:46:01 -070075include $(CLEAR_VARS)
76LOCAL_MODULE := libcutils
Josh Gao9e86f8e2015-11-17 14:17:38 -080077LOCAL_SRC_FILES := $(libcutils_common_sources) dlmalloc_stubs.c
78LOCAL_SRC_FILES_darwin := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources)
79LOCAL_SRC_FILES_linux := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources)
Richard Uhleracb31ba2015-03-24 14:46:01 -070080LOCAL_SHARED_LIBRARIES := liblog
Josh Gao1175d0f2015-11-24 09:12:21 -080081LOCAL_CFLAGS := -Werror -Wall -Wextra
Richard Uhleracb31ba2015-03-24 14:46:01 -070082LOCAL_MULTILIB := both
Richard Uhleracb31ba2015-03-24 14:46:01 -070083include $(BUILD_HOST_SHARED_LIBRARY)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080084
Jens Gulind3c8d5b2014-03-06 18:15:43 +010085
Andrew Hsieh99e7f7a2012-03-01 23:58:50 -080086
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080087# Shared and static library for target
88# ========================================================
David 'Digit' Turner7913bc02012-01-13 13:38:40 +010089
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080090include $(CLEAR_VARS)
91LOCAL_MODULE := libcutils
Josh Gao9e86f8e2015-11-17 14:17:38 -080092LOCAL_SRC_FILES := $(libcutils_common_sources) \
93 $(libcutils_nonwindows_sources) \
Jeff Brown053b8652012-06-06 16:25:03 -070094 android_reboot.c \
95 ashmem-dev.c \
96 debugger.c \
97 klog.c \
Jeff Brown053b8652012-06-06 16:25:03 -070098 partition_utils.c \
Nick Kralevichb39e3a82013-05-23 09:54:47 -070099 properties.c \
Jeff Brown053b8652012-06-06 16:25:03 -0700100 qtaguid.c \
Richard Uhler7d451ab2015-03-20 16:59:40 -0700101 trace-dev.c \
Henrik Smiding86a16002014-05-16 13:26:08 +0200102 uevent.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800103
Elliott Hughesa492f372015-04-02 10:41:20 -0700104LOCAL_SRC_FILES_arm += arch-arm/memset32.S
105LOCAL_SRC_FILES_arm64 += arch-arm64/android_memset.S
Duane Sand1ef9ccd2015-04-16 18:10:37 -0700106
107LOCAL_SRC_FILES_mips += arch-mips/android_memset.c
108LOCAL_SRC_FILES_mips64 += arch-mips/android_memset.c
Duane Sand734f50c2014-06-28 18:55:26 -0700109
Henrik Smiding86a16002014-05-16 13:26:08 +0200110LOCAL_SRC_FILES_x86 += \
111 arch-x86/android_memset16.S \
112 arch-x86/android_memset32.S \
113
114LOCAL_SRC_FILES_x86_64 += \
Varvara Rainchik458d1252014-09-08 16:27:01 +0400115 arch-x86_64/android_memset16.S \
116 arch-x86_64/android_memset32.S \
Henrik Smiding86a16002014-05-16 13:26:08 +0200117
Colin Cross65dd88b2014-01-22 19:06:04 -0800118LOCAL_C_INCLUDES := $(libcutils_c_includes)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800119LOCAL_STATIC_LIBRARIES := liblog
Tim Murrayb769c8d2015-06-08 14:56:29 -0700120ifneq ($(ENABLE_CPUSETS),)
121LOCAL_CFLAGS += -DUSE_CPUSETS
122endif
Elliott Hughes8fea1ed2015-07-24 18:48:31 -0700123LOCAL_CFLAGS += -Werror -Wall -Wextra -std=gnu90
Nick Kralevichfc82dd92015-08-26 11:32:31 -0700124LOCAL_CLANG := true
125LOCAL_SANITIZE := integer
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800126include $(BUILD_STATIC_LIBRARY)
127
128include $(CLEAR_VARS)
129LOCAL_MODULE := libcutils
Ying Wangc796ed92013-04-10 17:27:35 -0700130# TODO: remove liblog as whole static library, once we don't have prebuilt that requires
131# liblog symbols present in libcutils.
132LOCAL_WHOLE_STATIC_LIBRARIES := libcutils liblog
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800133LOCAL_SHARED_LIBRARIES := liblog
Tim Murrayb769c8d2015-06-08 14:56:29 -0700134ifneq ($(ENABLE_CPUSETS),)
135LOCAL_CFLAGS += -DUSE_CPUSETS
136endif
Elliott Hughes8fea1ed2015-07-24 18:48:31 -0700137LOCAL_CFLAGS += -Werror -Wall -Wextra
David 'Digit' Turner7913bc02012-01-13 13:38:40 +0100138LOCAL_C_INCLUDES := $(libcutils_c_includes)
Nick Kralevichfc82dd92015-08-26 11:32:31 -0700139LOCAL_CLANG := true
140LOCAL_SANITIZE := integer
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800141include $(BUILD_SHARED_LIBRARY)
142
Duane Sandd4a80982012-10-12 14:25:19 -0700143include $(call all-makefiles-under,$(LOCAL_PATH))