blob: 93933e2cd545d9f7e4f10bd070e86594dc8fb377 [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 Agopian1d3faaf2009-04-10 14:24:31 -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 \
Andy McFaddencf63d5d2010-01-22 16:37:25 -080034 open_memstream.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080035 strdup16to8.c \
36 strdup8to16.c \
37 record_stream.c \
38 process_name.c \
39 properties.c \
San Mehat493dad92009-09-12 10:06:57 -070040 threads.c \
41 sched_policy.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080042
The Android Open Source Projectb1487e42009-03-18 22:20:28 -070043commonHostSources := \
44 ashmem-host.c
45
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080046# some files must not be compiled when building against Mingw
47# they correspond to features not used by our host development tools
48# which are also hard or even impossible to port to native Win32
Raphaelf3cdf372009-05-26 13:23:23 -070049WINDOWS_HOST_ONLY :=
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080050ifeq ($(HOST_OS),windows)
51 ifeq ($(strip $(USE_CYGWIN)),)
Raphaelf3cdf372009-05-26 13:23:23 -070052 WINDOWS_HOST_ONLY := 1
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080053 endif
54endif
55# USE_MINGW is defined when we build against Mingw on Linux
56ifneq ($(strip $(USE_MINGW)),)
Raphaelf3cdf372009-05-26 13:23:23 -070057 WINDOWS_HOST_ONLY := 1
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080058endif
59
Raphaelf3cdf372009-05-26 13:23:23 -070060ifeq ($(WINDOWS_HOST_ONLY),1)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080061 commonSources += \
62 uio.c
63else
64 commonSources += \
Raphaelf3cdf372009-05-26 13:23:23 -070065 abort_socket.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080066 mspace.c \
67 selector.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080068 tztime.c \
The Android Open Source Projectb1487e42009-03-18 22:20:28 -070069 zygote.c
70
71 commonHostSources += \
72 tzstrftime.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080073endif
74
75
76# Static library for host
77# ========================================================
78LOCAL_MODULE := libcutils
The Android Open Source Projectb1487e42009-03-18 22:20:28 -070079LOCAL_SRC_FILES := $(commonSources) $(commonHostSources)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080080LOCAL_LDLIBS := -lpthread
81LOCAL_STATIC_LIBRARIES := liblog
82include $(BUILD_HOST_STATIC_LIBRARY)
83
84
85ifeq ($(TARGET_SIMULATOR),true)
86
87# Shared library for simulator
88# ========================================================
89include $(CLEAR_VARS)
90LOCAL_MODULE := libcutils
The Android Open Source Projectb1487e42009-03-18 22:20:28 -070091LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) memory.c dlmalloc_stubs.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080092LOCAL_LDLIBS := -lpthread
93LOCAL_SHARED_LIBRARIES := liblog
94include $(BUILD_SHARED_LIBRARY)
95
96else #!sim
97
98# Shared and static library for target
99# ========================================================
100include $(CLEAR_VARS)
101LOCAL_MODULE := libcutils
102LOCAL_SRC_FILES := $(commonSources) ashmem-dev.c mq.c
103
104ifeq ($(TARGET_ARCH),arm)
105LOCAL_SRC_FILES += memset32.S atomic-android-arm.S
106else # !arm
Shin-ichiro KAWASAKIc6af9112009-08-04 19:14:22 +0900107ifeq ($(TARGET_ARCH),sh)
108LOCAL_SRC_FILES += memory.c atomic-android-sh.c
109else # !sh
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800110LOCAL_SRC_FILES += memory.c
Shin-ichiro KAWASAKIc6af9112009-08-04 19:14:22 +0900111endif # !sh
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800112endif # !arm
113
114LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
115LOCAL_STATIC_LIBRARIES := liblog
116include $(BUILD_STATIC_LIBRARY)
117
118include $(CLEAR_VARS)
119LOCAL_MODULE := libcutils
120LOCAL_WHOLE_STATIC_LIBRARIES := libcutils
121LOCAL_SHARED_LIBRARIES := liblog
122include $(BUILD_SHARED_LIBRARY)
123
124endif #!sim