blob: c0d4d76cf8b9df0392cc6aa4b527be4783f26717 [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 \
23 hashmap.c \
24 iosched_policy.c \
Josh Gao9e86f8e2015-11-17 14:17:38 -080025 load_file.c \
David Pursell756e1c82016-01-29 10:39:41 -080026 native_handle.c \
Josh Gao9e86f8e2015-11-17 14:17:38 -080027 open_memstream.c \
David Pursell756e1c82016-01-29 10:39:41 -080028 process_name.c \
29 record_stream.c \
30 sched_policy.c \
31 sockets.cpp \
Josh Gao9e86f8e2015-11-17 14:17:38 -080032 strdup16to8.c \
33 strdup8to16.c \
David Pursell756e1c82016-01-29 10:39:41 -080034 strlcpy.c \
Josh Gao9e86f8e2015-11-17 14:17:38 -080035 threads.c \
Josh Gaocab716f2015-11-17 14:28:33 -080036
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 Gao9e86f8e2015-11-17 14:17:38 -080040libcutils_nonwindows_sources := \
Jeff Sharkey0ee7d8c2013-09-20 17:58:54 -070041 fs.c \
Elliott Hughes0bff5bd2014-05-20 12:01:29 -070042 multiuser.c \
David Pursell0eb8e1b2016-01-14 17:18:27 -080043 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 Pursellb34e4a02016-02-01 09:42:09 -080049 sockets_unix.cpp \
Josh Gao1175d0f2015-11-24 09:12:21 -080050 str_parms.c \
Elliott Hughes0bff5bd2014-05-20 12:01:29 -070051
Josh Gao9e86f8e2015-11-17 14:17:38 -080052libcutils_nonwindows_host_sources := \
Richard Uhler7d451ab2015-03-20 16:59:40 -070053 ashmem-host.c \
David Pursell0eb8e1b2016-01-14 17:18:27 -080054 trace-host.c \
Mathieu Chartiere942d1f2014-06-03 18:12:29 -070055
David Pursell0eb8e1b2016-01-14 17:18:27 -080056libcutils_windows_host_sources := \
57 socket_inaddr_any_server_windows.c \
58 socket_network_client_windows.c \
David Pursellb34e4a02016-02-01 09:42:09 -080059 sockets_windows.cpp \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080060
Richard Uhleracb31ba2015-03-24 14:46:01 -070061# Shared and static library for host
David Pursell0eb8e1b2016-01-14 17:18:27 -080062# Note: when linking this library on Windows, you must also link to Winsock2
63# using "LOCAL_LDLIBS_windows := -lws2_32".
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080064# ========================================================
65LOCAL_MODULE := libcutils
Josh Gao9e86f8e2015-11-17 14:17:38 -080066LOCAL_SRC_FILES := $(libcutils_common_sources) dlmalloc_stubs.c
67LOCAL_SRC_FILES_darwin := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources)
68LOCAL_SRC_FILES_linux := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources)
David Pursell0eb8e1b2016-01-14 17:18:27 -080069LOCAL_SRC_FILES_windows := $(libcutils_windows_host_sources)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080070LOCAL_STATIC_LIBRARIES := liblog
Josh Gao1175d0f2015-11-24 09:12:21 -080071LOCAL_CFLAGS := -Werror -Wall -Wextra
Ian Rogers59ec7652014-06-05 14:32:49 -070072LOCAL_MULTILIB := both
Josh Gaocab716f2015-11-17 14:28:33 -080073LOCAL_MODULE_HOST_OS := darwin linux windows
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080074include $(BUILD_HOST_STATIC_LIBRARY)
75
Richard Uhleracb31ba2015-03-24 14:46:01 -070076include $(CLEAR_VARS)
77LOCAL_MODULE := libcutils
Josh Gao9e86f8e2015-11-17 14:17:38 -080078LOCAL_SRC_FILES := $(libcutils_common_sources) dlmalloc_stubs.c
79LOCAL_SRC_FILES_darwin := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources)
80LOCAL_SRC_FILES_linux := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources)
Richard Uhleracb31ba2015-03-24 14:46:01 -070081LOCAL_SHARED_LIBRARIES := liblog
Josh Gao1175d0f2015-11-24 09:12:21 -080082LOCAL_CFLAGS := -Werror -Wall -Wextra
Richard Uhleracb31ba2015-03-24 14:46:01 -070083LOCAL_MULTILIB := both
Richard Uhleracb31ba2015-03-24 14:46:01 -070084include $(BUILD_HOST_SHARED_LIBRARY)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080085
Jens Gulind3c8d5b2014-03-06 18:15:43 +010086
Andrew Hsieh99e7f7a2012-03-01 23:58:50 -080087
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080088# Shared and static library for target
89# ========================================================
David 'Digit' Turner7913bc02012-01-13 13:38:40 +010090
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080091include $(CLEAR_VARS)
92LOCAL_MODULE := libcutils
Josh Gao9e86f8e2015-11-17 14:17:38 -080093LOCAL_SRC_FILES := $(libcutils_common_sources) \
94 $(libcutils_nonwindows_sources) \
Jeff Brown053b8652012-06-06 16:25:03 -070095 android_reboot.c \
96 ashmem-dev.c \
97 debugger.c \
98 klog.c \
Jeff Brown053b8652012-06-06 16:25:03 -070099 partition_utils.c \
Nick Kralevichb39e3a82013-05-23 09:54:47 -0700100 properties.c \
Jeff Brown053b8652012-06-06 16:25:03 -0700101 qtaguid.c \
Richard Uhler7d451ab2015-03-20 16:59:40 -0700102 trace-dev.c \
Henrik Smiding86a16002014-05-16 13:26:08 +0200103 uevent.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800104
Elliott Hughesa492f372015-04-02 10:41:20 -0700105LOCAL_SRC_FILES_arm += arch-arm/memset32.S
106LOCAL_SRC_FILES_arm64 += arch-arm64/android_memset.S
Duane Sand1ef9ccd2015-04-16 18:10:37 -0700107
108LOCAL_SRC_FILES_mips += arch-mips/android_memset.c
109LOCAL_SRC_FILES_mips64 += arch-mips/android_memset.c
Duane Sand734f50c2014-06-28 18:55:26 -0700110
Henrik Smiding86a16002014-05-16 13:26:08 +0200111LOCAL_SRC_FILES_x86 += \
112 arch-x86/android_memset16.S \
113 arch-x86/android_memset32.S \
114
115LOCAL_SRC_FILES_x86_64 += \
Varvara Rainchik458d1252014-09-08 16:27:01 +0400116 arch-x86_64/android_memset16.S \
117 arch-x86_64/android_memset32.S \
Henrik Smiding86a16002014-05-16 13:26:08 +0200118
Colin Cross65dd88b2014-01-22 19:06:04 -0800119LOCAL_C_INCLUDES := $(libcutils_c_includes)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800120LOCAL_STATIC_LIBRARIES := liblog
Tim Murrayb769c8d2015-06-08 14:56:29 -0700121ifneq ($(ENABLE_CPUSETS),)
122LOCAL_CFLAGS += -DUSE_CPUSETS
123endif
Todd Kjosed607882015-10-26 16:22:11 -0700124ifneq ($(ENABLE_SCHEDBOOST),)
125LOCAL_CFLAGS += -DUSE_SCHEDBOOST
126endif
Elliott Hughes8fea1ed2015-07-24 18:48:31 -0700127LOCAL_CFLAGS += -Werror -Wall -Wextra -std=gnu90
Nick Kralevichfc82dd92015-08-26 11:32:31 -0700128LOCAL_CLANG := true
129LOCAL_SANITIZE := integer
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800130include $(BUILD_STATIC_LIBRARY)
131
132include $(CLEAR_VARS)
133LOCAL_MODULE := libcutils
Ying Wangc796ed92013-04-10 17:27:35 -0700134# TODO: remove liblog as whole static library, once we don't have prebuilt that requires
135# liblog symbols present in libcutils.
136LOCAL_WHOLE_STATIC_LIBRARIES := libcutils liblog
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800137LOCAL_SHARED_LIBRARIES := liblog
Tim Murrayb769c8d2015-06-08 14:56:29 -0700138ifneq ($(ENABLE_CPUSETS),)
139LOCAL_CFLAGS += -DUSE_CPUSETS
140endif
Todd Kjosed607882015-10-26 16:22:11 -0700141ifneq ($(ENABLE_SCHEDBOOST),)
142LOCAL_CFLAGS += -DUSE_SCHEDBOOST
143endif
Elliott Hughes8fea1ed2015-07-24 18:48:31 -0700144LOCAL_CFLAGS += -Werror -Wall -Wextra
David 'Digit' Turner7913bc02012-01-13 13:38:40 +0100145LOCAL_C_INCLUDES := $(libcutils_c_includes)
Nick Kralevichfc82dd92015-08-26 11:32:31 -0700146LOCAL_CLANG := true
147LOCAL_SANITIZE := integer
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800148include $(BUILD_SHARED_LIBRARY)
149
Duane Sandd4a80982012-10-12 14:25:19 -0700150include $(call all-makefiles-under,$(LOCAL_PATH))