blob: 6754a74a7fc4721f07ddcabb2ea35b6b45a71f99 [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 := \
20 array.c \
21 hashmap.c \
22 atomic.c \
Mathias Agopian3fc51ba2009-05-20 14:16:34 -070023 native_handle.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080024 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
The Android Open Source Projectb1487e42009-03-18 22:20:28 -070041commonHostSources := \
42 ashmem-host.c
43
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080044# some files must not be compiled when building against Mingw
45# they correspond to features not used by our host development tools
46# which are also hard or even impossible to port to native Win32
Raphaelf3cdf372009-05-26 13:23:23 -070047WINDOWS_HOST_ONLY :=
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080048ifeq ($(HOST_OS),windows)
49 ifeq ($(strip $(USE_CYGWIN)),)
Raphaelf3cdf372009-05-26 13:23:23 -070050 WINDOWS_HOST_ONLY := 1
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080051 endif
52endif
53# USE_MINGW is defined when we build against Mingw on Linux
54ifneq ($(strip $(USE_MINGW)),)
Raphaelf3cdf372009-05-26 13:23:23 -070055 WINDOWS_HOST_ONLY := 1
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080056endif
57
Raphaelf3cdf372009-05-26 13:23:23 -070058ifeq ($(WINDOWS_HOST_ONLY),1)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080059 commonSources += \
60 uio.c
61else
62 commonSources += \
Raphaelf3cdf372009-05-26 13:23:23 -070063 abort_socket.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080064 mspace.c \
65 selector.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080066 tztime.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080067 adb_networking.c \
The Android Open Source Projectb1487e42009-03-18 22:20:28 -070068 zygote.c
69
70 commonHostSources += \
71 tzstrftime.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080072endif
73
74
75# Static library for host
76# ========================================================
77LOCAL_MODULE := libcutils
The Android Open Source Projectb1487e42009-03-18 22:20:28 -070078LOCAL_SRC_FILES := $(commonSources) $(commonHostSources)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080079LOCAL_LDLIBS := -lpthread
80LOCAL_STATIC_LIBRARIES := liblog
81include $(BUILD_HOST_STATIC_LIBRARY)
82
83
84ifeq ($(TARGET_SIMULATOR),true)
85
86# Shared library for simulator
87# ========================================================
88include $(CLEAR_VARS)
89LOCAL_MODULE := libcutils
The Android Open Source Projectb1487e42009-03-18 22:20:28 -070090LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) memory.c dlmalloc_stubs.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080091LOCAL_LDLIBS := -lpthread
92LOCAL_SHARED_LIBRARIES := liblog
93include $(BUILD_SHARED_LIBRARY)
94
95else #!sim
96
97# Shared and static library for target
98# ========================================================
99include $(CLEAR_VARS)
100LOCAL_MODULE := libcutils
101LOCAL_SRC_FILES := $(commonSources) ashmem-dev.c mq.c
102
103ifeq ($(TARGET_ARCH),arm)
104LOCAL_SRC_FILES += memset32.S atomic-android-arm.S
105else # !arm
106LOCAL_SRC_FILES += memory.c
107endif # !arm
108
109LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
110LOCAL_STATIC_LIBRARIES := liblog
111include $(BUILD_STATIC_LIBRARY)
112
113include $(CLEAR_VARS)
114LOCAL_MODULE := libcutils
115LOCAL_WHOLE_STATIC_LIBRARIES := libcutils
116LOCAL_SHARED_LIBRARIES := liblog
117include $(BUILD_SHARED_LIBRARY)
118
119endif #!sim