Android.mk revision 8f13782e7b4a705484d7f97f07513781b82be0dc
1#
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 \
23        native_handle.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        tztime.c \
63        tzstrftime.c \
64        adb_networking.c \
65	zygote.c
66endif
67
68
69# Static library for host
70# ========================================================
71LOCAL_MODULE := libcutils
72LOCAL_SRC_FILES := $(commonSources) ashmem-host.c
73LOCAL_LDLIBS := -lpthread
74LOCAL_STATIC_LIBRARIES := liblog
75include $(BUILD_HOST_STATIC_LIBRARY)
76
77
78ifeq ($(TARGET_SIMULATOR),true)
79
80# Shared library for simulator
81# ========================================================
82include $(CLEAR_VARS)
83LOCAL_MODULE := libcutils
84LOCAL_SRC_FILES := $(commonSources) memory.c dlmalloc_stubs.c ashmem-host.c
85LOCAL_LDLIBS := -lpthread
86LOCAL_SHARED_LIBRARIES := liblog
87include $(BUILD_SHARED_LIBRARY)
88
89else #!sim
90
91# Shared and static library for target
92# ========================================================
93include $(CLEAR_VARS)
94LOCAL_MODULE := libcutils
95LOCAL_SRC_FILES := $(commonSources) ashmem-dev.c mq.c
96
97ifeq ($(TARGET_ARCH),arm)
98LOCAL_SRC_FILES += memset32.S atomic-android-arm.S
99else  # !arm
100LOCAL_SRC_FILES += memory.c
101endif # !arm
102
103LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
104LOCAL_STATIC_LIBRARIES := liblog
105include $(BUILD_STATIC_LIBRARY)
106
107include $(CLEAR_VARS)
108LOCAL_MODULE := libcutils
109LOCAL_WHOLE_STATIC_LIBRARIES := libcutils
110LOCAL_SHARED_LIBRARIES := liblog
111include $(BUILD_SHARED_LIBRARY)
112
113endif #!sim
114