Android.mk revision dd7bc3319deb2b77c5d07a51b7d6cd7e11b5beb0
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	buffer.c \
24	socket_inaddr_any_server.c \
25	socket_local_client.c \
26	socket_local_server.c \
27	socket_loopback_client.c \
28	socket_loopback_server.c \
29	socket_network_client.c \
30	config_utils.c \
31	cpu_info.c \
32	load_file.c \
33	strdup16to8.c \
34	strdup8to16.c \
35	record_stream.c \
36	process_name.c \
37	properties.c \
38	threads.c
39
40# some files must not be compiled when building against Mingw
41# they correspond to features not used by our host development tools
42# which are also hard or even impossible to port to native Win32
43WITH_MINGW :=
44ifeq ($(HOST_OS),windows)
45    ifeq ($(strip $(USE_CYGWIN)),)
46        WITH_MINGW := 1
47    endif
48endif
49# USE_MINGW is defined when we build against Mingw on Linux
50ifneq ($(strip $(USE_MINGW)),)
51    WITH_MINGW := 1
52endif
53
54ifeq ($(WITH_MINGW),1)
55    commonSources += \
56        uio.c
57else
58    commonSources += \
59        mspace.c \
60        selector.c \
61        fdevent.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