Android.mk revision 885342a0f2c834a6b680284047c47c9d04b32565
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
19ifeq ($(TARGET_CPU_SMP),true)
20    targetSmpFlag := -DANDROID_SMP=1
21else
22    targetSmpFlag := -DANDROID_SMP=0
23endif
24hostSmpFlag := -DANDROID_SMP=0
25
26commonSources := \
27	array.c \
28	hashmap.c \
29	atomic.c.arm \
30	native_handle.c \
31	buffer.c \
32	socket_inaddr_any_server.c \
33	socket_local_client.c \
34	socket_local_server.c \
35	socket_loopback_client.c \
36	socket_loopback_server.c \
37	socket_network_client.c \
38	sockets.c \
39	config_utils.c \
40	cpu_info.c \
41	load_file.c \
42	list.c \
43	open_memstream.c \
44	strdup16to8.c \
45	strdup8to16.c \
46	record_stream.c \
47	process_name.c \
48	properties.c \
49	qsort_r_compat.c \
50	threads.c \
51	sched_policy.c \
52	iosched_policy.c \
53	str_parms.c \
54	multiuser.c
55
56commonHostSources := \
57        ashmem-host.c
58
59# some files must not be compiled when building against Mingw
60# they correspond to features not used by our host development tools
61# which are also hard or even impossible to port to native Win32
62WINDOWS_HOST_ONLY :=
63ifeq ($(HOST_OS),windows)
64    ifeq ($(strip $(USE_CYGWIN)),)
65        WINDOWS_HOST_ONLY := 1
66    endif
67endif
68# USE_MINGW is defined when we build against Mingw on Linux
69ifneq ($(strip $(USE_MINGW)),)
70    WINDOWS_HOST_ONLY := 1
71endif
72
73ifeq ($(WINDOWS_HOST_ONLY),1)
74    commonSources += \
75        uio.c
76else
77    commonSources += \
78        abort_socket.c \
79        mspace.c \
80        selector.c \
81        tztime.c \
82        zygote.c
83
84    commonHostSources += \
85        tzstrftime.c
86endif
87
88
89# Static library for host
90# ========================================================
91LOCAL_MODULE := libcutils
92LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c
93LOCAL_LDLIBS := -lpthread
94LOCAL_STATIC_LIBRARIES := liblog
95LOCAL_CFLAGS += $(hostSmpFlag)
96include $(BUILD_HOST_STATIC_LIBRARY)
97
98
99# Static library for host, 64-bit
100# ========================================================
101include $(CLEAR_VARS)
102LOCAL_MODULE := lib64cutils
103LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c
104LOCAL_LDLIBS := -lpthread
105LOCAL_STATIC_LIBRARIES := lib64log
106LOCAL_CFLAGS += $(hostSmpFlag) -m64
107include $(BUILD_HOST_STATIC_LIBRARY)
108
109
110# Shared and static library for target
111# ========================================================
112
113# This is needed in LOCAL_C_INCLUDES to access the C library's private
114# header named <bionic_time.h>
115#
116libcutils_c_includes := bionic/libc/private
117
118include $(CLEAR_VARS)
119LOCAL_MODULE := libcutils
120LOCAL_SRC_FILES := $(commonSources) \
121        android_reboot.c \
122        ashmem-dev.c \
123        debugger.c \
124        klog.c \
125        mq.c \
126        partition_utils.c \
127        qtaguid.c \
128        uevent.c
129
130ifeq ($(TARGET_ARCH),arm)
131LOCAL_SRC_FILES += arch-arm/memset32.S
132else  # !arm
133ifeq ($(TARGET_ARCH),sh)
134LOCAL_SRC_FILES += memory.c atomic-android-sh.c
135else  # !sh
136ifeq ($(TARGET_ARCH_VARIANT),x86-atom)
137LOCAL_CFLAGS += -DHAVE_MEMSET16 -DHAVE_MEMSET32
138LOCAL_SRC_FILES += arch-x86/android_memset16.S arch-x86/android_memset32.S memory.c
139else # !x86-atom
140LOCAL_SRC_FILES += memory.c
141endif # !x86-atom
142endif # !sh
143endif # !arm
144
145LOCAL_C_INCLUDES := $(libcutils_c_includes) $(KERNEL_HEADERS)
146LOCAL_STATIC_LIBRARIES := liblog
147LOCAL_CFLAGS += $(targetSmpFlag)
148include $(BUILD_STATIC_LIBRARY)
149
150include $(CLEAR_VARS)
151LOCAL_MODULE := libcutils
152LOCAL_WHOLE_STATIC_LIBRARIES := libcutils
153LOCAL_SHARED_LIBRARIES := liblog
154LOCAL_CFLAGS += $(targetSmpFlag)
155LOCAL_C_INCLUDES := $(libcutils_c_includes)
156include $(BUILD_SHARED_LIBRARY)
157
158include $(CLEAR_VARS)
159LOCAL_MODULE := tst_str_parms
160LOCAL_CFLAGS += -DTEST_STR_PARMS
161LOCAL_SRC_FILES := str_parms.c hashmap.c memory.c
162LOCAL_SHARED_LIBRARIES := liblog
163LOCAL_MODULE_TAGS := optional
164include $(BUILD_EXECUTABLE)
165