Android.mk revision 208059f67ed2dd9fa025e07fcb6954d3cb61c79e
1# Copyright (C) 2008 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15LOCAL_PATH:= $(call my-dir)
16
17# libutils is a little unique: It's built twice, once for the host
18# and once for the device.
19
20commonSources:= \
21	Asset.cpp \
22	AssetDir.cpp \
23	AssetManager.cpp \
24	BufferedTextOutput.cpp \
25	CallStack.cpp \
26	Debug.cpp \
27	FileMap.cpp \
28	RefBase.cpp \
29	ResourceTypes.cpp \
30	SharedBuffer.cpp \
31	Static.cpp \
32	StopWatch.cpp \
33	String8.cpp \
34	String16.cpp \
35	SystemClock.cpp \
36	TextOutput.cpp \
37	Threads.cpp \
38	TimerProbe.cpp \
39	Timers.cpp \
40	VectorImpl.cpp \
41    ZipFileCRO.cpp \
42	ZipFileRO.cpp \
43	ZipUtils.cpp \
44	misc.cpp \
45	ported.cpp \
46	LogSocket.cpp
47
48#
49# The cpp files listed here do not belong in the device
50# build.  Consult with the swetland before even thinking about
51# putting them in commonSources.
52#
53# They're used by the simulator runtime and by host-side tools like
54# aapt and the simulator front-end.
55#
56hostSources:= \
57	InetAddress.cpp \
58	Pipe.cpp \
59	Socket.cpp \
60	ZipEntry.cpp \
61	ZipFile.cpp
62
63# For the host
64# =====================================================
65
66include $(CLEAR_VARS)
67
68LOCAL_SRC_FILES:= $(commonSources) $(hostSources)
69
70ifeq ($(HOST_OS),linux)
71# Use the futex based mutex and condition variable
72# implementation from android-arm because it's shared mem safe
73	LOCAL_SRC_FILES += \
74		futex_synchro.c \
75		executablepath_linux.cpp
76endif
77ifeq ($(HOST_OS),darwin)
78	LOCAL_SRC_FILES += \
79		executablepath_darwin.cpp
80endif
81
82LOCAL_MODULE:= libutils
83
84LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
85LOCAL_C_INCLUDES += external/zlib
86
87ifeq ($(HOST_OS),windows)
88ifeq ($(strip $(USE_CYGWIN),),)
89# Under MinGW, ctype.h doesn't need multi-byte support
90LOCAL_CFLAGS += -DMB_CUR_MAX=1
91endif
92endif
93
94include $(BUILD_HOST_STATIC_LIBRARY)
95
96
97
98# For the device
99# =====================================================
100include $(CLEAR_VARS)
101
102
103# we have the common sources, plus some device-specific stuff
104LOCAL_SRC_FILES:= \
105	$(commonSources) \
106	Unicode.cpp \
107    backup_data.cpp \
108	backup_helper_file.cpp
109
110ifeq ($(TARGET_SIMULATOR),true)
111LOCAL_SRC_FILES += $(hostSources)
112endif
113
114ifeq ($(TARGET_OS),linux)
115# Use the futex based mutex and condition variable
116# implementation from android-arm because it's shared mem safe
117LOCAL_SRC_FILES += futex_synchro.c
118LOCAL_LDLIBS += -lrt -ldl
119endif
120
121LOCAL_C_INCLUDES += \
122		external/zlib \
123		external/icu4c/common
124LOCAL_LDLIBS += -lpthread
125
126LOCAL_SHARED_LIBRARIES := \
127	libz \
128	liblog \
129	libcutils
130
131ifneq ($(TARGET_SIMULATOR),true)
132ifeq ($(TARGET_OS)-$(TARGET_ARCH),linux-x86)
133# This is needed on x86 to bring in dl_iterate_phdr for CallStack.cpp
134LOCAL_SHARED_LIBRARIES += \
135	libdl
136endif # linux-x86
137endif # sim
138
139LOCAL_MODULE:= libutils
140
141#LOCAL_CFLAGS+=
142#LOCAL_LDFLAGS:=
143
144include $(BUILD_SHARED_LIBRARY)
145
146