blob: 46b8d0c6d02cf4d68ee6346a7ed61aa52ae656df [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 \
24 buffer.c \
25 socket_inaddr_any_server.c \
26 socket_local_client.c \
27 socket_local_server.c \
28 socket_loopback_client.c \
29 socket_loopback_server.c \
30 socket_network_client.c \
31 config_utils.c \
32 cpu_info.c \
33 load_file.c \
34 strdup16to8.c \
35 strdup8to16.c \
36 record_stream.c \
37 process_name.c \
38 properties.c \
39 threads.c
40
41# some files must not be compiled when building against Mingw
42# they correspond to features not used by our host development tools
43# which are also hard or even impossible to port to native Win32
44WITH_MINGW :=
45ifeq ($(HOST_OS),windows)
46 ifeq ($(strip $(USE_CYGWIN)),)
47 WITH_MINGW := 1
48 endif
49endif
50# USE_MINGW is defined when we build against Mingw on Linux
51ifneq ($(strip $(USE_MINGW)),)
52 WITH_MINGW := 1
53endif
54
55ifeq ($(WITH_MINGW),1)
56 commonSources += \
57 uio.c
58else
59 commonSources += \
60 mspace.c \
61 selector.c \
62 fdevent.c \
63 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
101LOCAL_SRC_FILES += memory.c
102endif # !arm
103
The Android Open Source Project4f6e8d72008-10-21 07:00:00 -0700104LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
105LOCAL_STATIC_LIBRARIES := liblog
106include $(BUILD_STATIC_LIBRARY)
107
108include $(CLEAR_VARS)
109LOCAL_MODULE := libcutils
110LOCAL_WHOLE_STATIC_LIBRARIES := libcutils
111LOCAL_SHARED_LIBRARIES := liblog
112include $(BUILD_SHARED_LIBRARY)
113
114endif #!sim