blob: 30f4a49ed535eb8fa42f505d9a9512e758d5f140 [file] [log] [blame]
The Android Open Source Project4f6e8d72008-10-21 07:00:00 -07001#
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 := \
Nick Pelly260f48a2009-05-19 19:22:42 -070020 abort_socket.c \
The Android Open Source Project4f6e8d72008-10-21 07:00:00 -070021 array.c \
22 hashmap.c \
23 atomic.c \
Mathias Agopian8f137822009-05-20 14:16:34 -070024 native_handle.c \
The Android Open Source Project4f6e8d72008-10-21 07:00:00 -070025 buffer.c \
26 socket_inaddr_any_server.c \
27 socket_local_client.c \
28 socket_local_server.c \
29 socket_loopback_client.c \
30 socket_loopback_server.c \
31 socket_network_client.c \
32 config_utils.c \
33 cpu_info.c \
34 load_file.c \
35 strdup16to8.c \
36 strdup8to16.c \
37 record_stream.c \
38 process_name.c \
39 properties.c \
40 threads.c
41
42# some files must not be compiled when building against Mingw
43# they correspond to features not used by our host development tools
44# which are also hard or even impossible to port to native Win32
45WITH_MINGW :=
46ifeq ($(HOST_OS),windows)
47 ifeq ($(strip $(USE_CYGWIN)),)
48 WITH_MINGW := 1
49 endif
50endif
51# USE_MINGW is defined when we build against Mingw on Linux
52ifneq ($(strip $(USE_MINGW)),)
53 WITH_MINGW := 1
54endif
55
56ifeq ($(WITH_MINGW),1)
57 commonSources += \
58 uio.c
59else
60 commonSources += \
61 mspace.c \
62 selector.c \
The Android Open Source Project4f6e8d72008-10-21 07:00:00 -070063 tztime.c \
The Android Open Source Project35237d12008-12-17 18:08:08 -080064 tzstrftime.c \
The Android Open Source Project4f6e8d72008-10-21 07:00:00 -070065 adb_networking.c \
66 zygote.c
67endif
68
69
70# Static library for host
71# ========================================================
72LOCAL_MODULE := libcutils
73LOCAL_SRC_FILES := $(commonSources) ashmem-host.c
74LOCAL_LDLIBS := -lpthread
75LOCAL_STATIC_LIBRARIES := liblog
76include $(BUILD_HOST_STATIC_LIBRARY)
77
78
79ifeq ($(TARGET_SIMULATOR),true)
80
81# Shared library for simulator
82# ========================================================
83include $(CLEAR_VARS)
84LOCAL_MODULE := libcutils
85LOCAL_SRC_FILES := $(commonSources) memory.c dlmalloc_stubs.c ashmem-host.c
86LOCAL_LDLIBS := -lpthread
87LOCAL_SHARED_LIBRARIES := liblog
88include $(BUILD_SHARED_LIBRARY)
89
90else #!sim
91
92# Shared and static library for target
93# ========================================================
94include $(CLEAR_VARS)
95LOCAL_MODULE := libcutils
The Android Open Source Project35237d12008-12-17 18:08:08 -080096LOCAL_SRC_FILES := $(commonSources) ashmem-dev.c mq.c
97
98ifeq ($(TARGET_ARCH),arm)
99LOCAL_SRC_FILES += memset32.S atomic-android-arm.S
100else # !arm
Shin-ichiro KAWASAKIc6af9112009-08-04 19:14:22 +0900101ifeq ($(TARGET_ARCH),sh)
102LOCAL_SRC_FILES += memory.c atomic-android-sh.c
103else # !sh
The Android Open Source Project35237d12008-12-17 18:08:08 -0800104LOCAL_SRC_FILES += memory.c
Shin-ichiro KAWASAKIc6af9112009-08-04 19:14:22 +0900105endif # !sh
The Android Open Source Project35237d12008-12-17 18:08:08 -0800106endif # !arm
107
The Android Open Source Project4f6e8d72008-10-21 07:00:00 -0700108LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
109LOCAL_STATIC_LIBRARIES := liblog
110include $(BUILD_STATIC_LIBRARY)
111
112include $(CLEAR_VARS)
113LOCAL_MODULE := libcutils
114LOCAL_WHOLE_STATIC_LIBRARIES := libcutils
115LOCAL_SHARED_LIBRARIES := liblog
116include $(BUILD_SHARED_LIBRARY)
117
118endif #!sim