blob: 3ca544f04ce39e0223ab5f600b61b8cc007b9c52 [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
19commonSources := \
Josh Gaocab716f2015-11-17 14:28:33 -080020 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 \
34 str_parms.c \
35 fs_config.c
36
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
40nonWindowsSources := \
Jeff Sharkey0ee7d8c2013-09-20 17:58:54 -070041 fs.c \
Elliott Hughes0bff5bd2014-05-20 12:01:29 -070042 multiuser.c \
Mathieu Chartier0b9674f2014-06-03 15:28:26 -070043 socket_inaddr_any_server.c \
44 socket_local_client.c \
45 socket_local_server.c \
46 socket_loopback_client.c \
47 socket_loopback_server.c \
48 socket_network_client.c \
49 sockets.c \
Elliott Hughes0bff5bd2014-05-20 12:01:29 -070050
Josh Gaocab716f2015-11-17 14:28:33 -080051nonWindowsHostSources := \
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 Gaocab716f2015-11-17 14:28:33 -080059LOCAL_SRC_FILES := $(commonSources) dlmalloc_stubs.c
60LOCAL_SRC_FILES_darwin := $(nonWindowsSources) $(nonWindowsHostSources)
61LOCAL_SRC_FILES_linux := $(nonWindowsSources) $(nonWindowsHostSources)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080062LOCAL_STATIC_LIBRARIES := liblog
Josh Gaocab716f2015-11-17 14:28:33 -080063LOCAL_CFLAGS_darwin := -Werror -Wall -Wextra
64LOCAL_CFLAGS_linux := -Werror -Wall -Wextra
Ian Rogers59ec7652014-06-05 14:32:49 -070065LOCAL_MULTILIB := both
Josh Gaocab716f2015-11-17 14:28:33 -080066LOCAL_MODULE_HOST_OS := darwin linux windows
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080067include $(BUILD_HOST_STATIC_LIBRARY)
68
Richard Uhleracb31ba2015-03-24 14:46:01 -070069include $(CLEAR_VARS)
70LOCAL_MODULE := libcutils
Josh Gaocab716f2015-11-17 14:28:33 -080071LOCAL_SRC_FILES := $(commonSources) dlmalloc_stubs.c
72LOCAL_SRC_FILES_darwin := $(nonWindowsSources) $(nonWindowsHostSources)
73LOCAL_SRC_FILES_linux := $(nonWindowsSources) $(nonWindowsHostSources)
Richard Uhleracb31ba2015-03-24 14:46:01 -070074LOCAL_SHARED_LIBRARIES := liblog
Josh Gaocab716f2015-11-17 14:28:33 -080075LOCAL_CFLAGS_darwin := -Werror -Wall -Wextra
76LOCAL_CFLAGS_linux := -Werror -Wall -Wextra
Richard Uhleracb31ba2015-03-24 14:46:01 -070077LOCAL_MULTILIB := both
Richard Uhleracb31ba2015-03-24 14:46:01 -070078include $(BUILD_HOST_SHARED_LIBRARY)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080079
Jens Gulind3c8d5b2014-03-06 18:15:43 +010080
Andrew Hsieh99e7f7a2012-03-01 23:58:50 -080081
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080082# Shared and static library for target
83# ========================================================
David 'Digit' Turner7913bc02012-01-13 13:38:40 +010084
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080085include $(CLEAR_VARS)
86LOCAL_MODULE := libcutils
Jeff Brown053b8652012-06-06 16:25:03 -070087LOCAL_SRC_FILES := $(commonSources) \
Josh Gaocab716f2015-11-17 14:28:33 -080088 $(nonWindowsSources) \
Jeff Brown053b8652012-06-06 16:25:03 -070089 android_reboot.c \
90 ashmem-dev.c \
91 debugger.c \
92 klog.c \
Jeff Brown053b8652012-06-06 16:25:03 -070093 partition_utils.c \
Nick Kralevichb39e3a82013-05-23 09:54:47 -070094 properties.c \
Jeff Brown053b8652012-06-06 16:25:03 -070095 qtaguid.c \
Richard Uhler7d451ab2015-03-20 16:59:40 -070096 trace-dev.c \
Henrik Smiding86a16002014-05-16 13:26:08 +020097 uevent.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080098
Elliott Hughesa492f372015-04-02 10:41:20 -070099LOCAL_SRC_FILES_arm += arch-arm/memset32.S
100LOCAL_SRC_FILES_arm64 += arch-arm64/android_memset.S
Duane Sand1ef9ccd2015-04-16 18:10:37 -0700101
102LOCAL_SRC_FILES_mips += arch-mips/android_memset.c
103LOCAL_SRC_FILES_mips64 += arch-mips/android_memset.c
Duane Sand734f50c2014-06-28 18:55:26 -0700104
Henrik Smiding86a16002014-05-16 13:26:08 +0200105LOCAL_SRC_FILES_x86 += \
106 arch-x86/android_memset16.S \
107 arch-x86/android_memset32.S \
108
109LOCAL_SRC_FILES_x86_64 += \
Varvara Rainchik458d1252014-09-08 16:27:01 +0400110 arch-x86_64/android_memset16.S \
111 arch-x86_64/android_memset32.S \
Henrik Smiding86a16002014-05-16 13:26:08 +0200112
Colin Cross65dd88b2014-01-22 19:06:04 -0800113LOCAL_C_INCLUDES := $(libcutils_c_includes)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800114LOCAL_STATIC_LIBRARIES := liblog
Tim Murrayb769c8d2015-06-08 14:56:29 -0700115ifneq ($(ENABLE_CPUSETS),)
116LOCAL_CFLAGS += -DUSE_CPUSETS
117endif
Elliott Hughes8fea1ed2015-07-24 18:48:31 -0700118LOCAL_CFLAGS += -Werror -Wall -Wextra -std=gnu90
Nick Kralevichfc82dd92015-08-26 11:32:31 -0700119LOCAL_CLANG := true
120LOCAL_SANITIZE := integer
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800121include $(BUILD_STATIC_LIBRARY)
122
123include $(CLEAR_VARS)
124LOCAL_MODULE := libcutils
Ying Wangc796ed92013-04-10 17:27:35 -0700125# TODO: remove liblog as whole static library, once we don't have prebuilt that requires
126# liblog symbols present in libcutils.
127LOCAL_WHOLE_STATIC_LIBRARIES := libcutils liblog
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800128LOCAL_SHARED_LIBRARIES := liblog
Tim Murrayb769c8d2015-06-08 14:56:29 -0700129ifneq ($(ENABLE_CPUSETS),)
130LOCAL_CFLAGS += -DUSE_CPUSETS
131endif
Elliott Hughes8fea1ed2015-07-24 18:48:31 -0700132LOCAL_CFLAGS += -Werror -Wall -Wextra
David 'Digit' Turner7913bc02012-01-13 13:38:40 +0100133LOCAL_C_INCLUDES := $(libcutils_c_includes)
Nick Kralevichfc82dd92015-08-26 11:32:31 -0700134LOCAL_CLANG := true
135LOCAL_SANITIZE := integer
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800136include $(BUILD_SHARED_LIBRARY)
137
Duane Sandd4a80982012-10-12 14:25:19 -0700138include $(call all-makefiles-under,$(LOCAL_PATH))