blob: dd0810861a314450fd659155ea0530ad9cb4e319 [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 \
Mathieu Chartier0b9674f2014-06-03 15:28:26 -070042 socket_inaddr_any_server.c \
43 socket_local_client.c \
44 socket_local_server.c \
45 socket_loopback_client.c \
46 socket_loopback_server.c \
47 socket_network_client.c \
48 sockets.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 \
53 trace-host.c
Mathieu Chartiere942d1f2014-06-03 18:12:29 -070054
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080055
Richard Uhleracb31ba2015-03-24 14:46:01 -070056# Shared and static library for host
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080057# ========================================================
58LOCAL_MODULE := libcutils
Josh Gao9e86f8e2015-11-17 14:17:38 -080059LOCAL_SRC_FILES := $(libcutils_common_sources) dlmalloc_stubs.c
60LOCAL_SRC_FILES_darwin := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources)
61LOCAL_SRC_FILES_linux := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080062LOCAL_STATIC_LIBRARIES := liblog
Josh Gao1175d0f2015-11-24 09:12:21 -080063LOCAL_CFLAGS := -Werror -Wall -Wextra
Ian Rogers59ec7652014-06-05 14:32:49 -070064LOCAL_MULTILIB := both
Josh Gaocab716f2015-11-17 14:28:33 -080065LOCAL_MODULE_HOST_OS := darwin linux windows
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080066include $(BUILD_HOST_STATIC_LIBRARY)
67
Richard Uhleracb31ba2015-03-24 14:46:01 -070068include $(CLEAR_VARS)
69LOCAL_MODULE := libcutils
Josh Gao9e86f8e2015-11-17 14:17:38 -080070LOCAL_SRC_FILES := $(libcutils_common_sources) dlmalloc_stubs.c
71LOCAL_SRC_FILES_darwin := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources)
72LOCAL_SRC_FILES_linux := $(libcutils_nonwindows_sources) $(libcutils_nonwindows_host_sources)
Richard Uhleracb31ba2015-03-24 14:46:01 -070073LOCAL_SHARED_LIBRARIES := liblog
Josh Gao1175d0f2015-11-24 09:12:21 -080074LOCAL_CFLAGS := -Werror -Wall -Wextra
Richard Uhleracb31ba2015-03-24 14:46:01 -070075LOCAL_MULTILIB := both
Richard Uhleracb31ba2015-03-24 14:46:01 -070076include $(BUILD_HOST_SHARED_LIBRARY)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080077
Jens Gulind3c8d5b2014-03-06 18:15:43 +010078
Andrew Hsieh99e7f7a2012-03-01 23:58:50 -080079
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080080# Shared and static library for target
81# ========================================================
David 'Digit' Turner7913bc02012-01-13 13:38:40 +010082
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080083include $(CLEAR_VARS)
84LOCAL_MODULE := libcutils
Josh Gao9e86f8e2015-11-17 14:17:38 -080085LOCAL_SRC_FILES := $(libcutils_common_sources) \
86 $(libcutils_nonwindows_sources) \
Jeff Brown053b8652012-06-06 16:25:03 -070087 android_reboot.c \
88 ashmem-dev.c \
89 debugger.c \
90 klog.c \
Jeff Brown053b8652012-06-06 16:25:03 -070091 partition_utils.c \
Nick Kralevichb39e3a82013-05-23 09:54:47 -070092 properties.c \
Jeff Brown053b8652012-06-06 16:25:03 -070093 qtaguid.c \
Richard Uhler7d451ab2015-03-20 16:59:40 -070094 trace-dev.c \
Henrik Smiding86a16002014-05-16 13:26:08 +020095 uevent.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080096
Elliott Hughesa492f372015-04-02 10:41:20 -070097LOCAL_SRC_FILES_arm += arch-arm/memset32.S
98LOCAL_SRC_FILES_arm64 += arch-arm64/android_memset.S
Duane Sand1ef9ccd2015-04-16 18:10:37 -070099
100LOCAL_SRC_FILES_mips += arch-mips/android_memset.c
101LOCAL_SRC_FILES_mips64 += arch-mips/android_memset.c
Duane Sand734f50c2014-06-28 18:55:26 -0700102
Henrik Smiding86a16002014-05-16 13:26:08 +0200103LOCAL_SRC_FILES_x86 += \
104 arch-x86/android_memset16.S \
105 arch-x86/android_memset32.S \
106
107LOCAL_SRC_FILES_x86_64 += \
Varvara Rainchik458d1252014-09-08 16:27:01 +0400108 arch-x86_64/android_memset16.S \
109 arch-x86_64/android_memset32.S \
Henrik Smiding86a16002014-05-16 13:26:08 +0200110
Colin Cross65dd88b2014-01-22 19:06:04 -0800111LOCAL_C_INCLUDES := $(libcutils_c_includes)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800112LOCAL_STATIC_LIBRARIES := liblog
Tim Murrayb769c8d2015-06-08 14:56:29 -0700113ifneq ($(ENABLE_CPUSETS),)
114LOCAL_CFLAGS += -DUSE_CPUSETS
115endif
Elliott Hughes8fea1ed2015-07-24 18:48:31 -0700116LOCAL_CFLAGS += -Werror -Wall -Wextra -std=gnu90
Nick Kralevichfc82dd92015-08-26 11:32:31 -0700117LOCAL_CLANG := true
118LOCAL_SANITIZE := integer
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800119include $(BUILD_STATIC_LIBRARY)
120
121include $(CLEAR_VARS)
122LOCAL_MODULE := libcutils
Ying Wangc796ed92013-04-10 17:27:35 -0700123# TODO: remove liblog as whole static library, once we don't have prebuilt that requires
124# liblog symbols present in libcutils.
125LOCAL_WHOLE_STATIC_LIBRARIES := libcutils liblog
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800126LOCAL_SHARED_LIBRARIES := liblog
Tim Murrayb769c8d2015-06-08 14:56:29 -0700127ifneq ($(ENABLE_CPUSETS),)
128LOCAL_CFLAGS += -DUSE_CPUSETS
129endif
Elliott Hughes8fea1ed2015-07-24 18:48:31 -0700130LOCAL_CFLAGS += -Werror -Wall -Wextra
David 'Digit' Turner7913bc02012-01-13 13:38:40 +0100131LOCAL_C_INCLUDES := $(libcutils_c_includes)
Nick Kralevichfc82dd92015-08-26 11:32:31 -0700132LOCAL_CLANG := true
133LOCAL_SANITIZE := integer
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800134include $(BUILD_SHARED_LIBRARY)
135
Duane Sandd4a80982012-10-12 14:25:19 -0700136include $(call all-makefiles-under,$(LOCAL_PATH))