Android.mk revision 861aa2f0c9136298380496bd78d6a18e69331c53
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	StringArray.cpp \
36	SystemClock.cpp \
37	TextOutput.cpp \
38	Threads.cpp \
39	Timers.cpp \
40	VectorImpl.cpp \
41    ZipFileCRO.cpp \
42	ZipFileRO.cpp \
43	ZipUtils.cpp \
44	misc.cpp \
45	LogSocket.cpp
46
47#
48# The cpp files listed here do not belong in the device
49# build.  Consult with the swetland before even thinking about
50# putting them in commonSources.
51#
52# They're used by the simulator runtime and by host-side tools like
53# aapt and the simulator front-end.
54#
55hostSources:= \
56	InetAddress.cpp \
57	Socket.cpp \
58	ZipEntry.cpp \
59	ZipFile.cpp
60
61# For the host
62# =====================================================
63
64include $(CLEAR_VARS)
65
66LOCAL_SRC_FILES:= $(commonSources) $(hostSources)
67
68ifeq ($(HOST_OS),linux)
69# Use the futex based mutex and condition variable
70# implementation from android-arm because it's shared mem safe
71	LOCAL_SRC_FILES += \
72		futex_synchro.c
73endif
74
75LOCAL_MODULE:= libutils
76
77LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
78LOCAL_C_INCLUDES += external/zlib
79
80ifeq ($(HOST_OS),windows)
81ifeq ($(strip $(USE_CYGWIN),),)
82# Under MinGW, ctype.h doesn't need multi-byte support
83LOCAL_CFLAGS += -DMB_CUR_MAX=1
84endif
85endif
86
87include $(BUILD_HOST_STATIC_LIBRARY)
88
89
90
91# For the device
92# =====================================================
93include $(CLEAR_VARS)
94
95
96# we have the common sources, plus some device-specific stuff
97LOCAL_SRC_FILES:= \
98	$(commonSources) \
99	Unicode.cpp \
100    BackupData.cpp \
101	BackupHelpers.cpp
102
103ifeq ($(TARGET_SIMULATOR),true)
104LOCAL_SRC_FILES += $(hostSources)
105endif
106
107ifeq ($(TARGET_OS),linux)
108# Use the futex based mutex and condition variable
109# implementation from android-arm because it's shared mem safe
110LOCAL_SRC_FILES += futex_synchro.c
111LOCAL_LDLIBS += -lrt -ldl
112endif
113
114LOCAL_C_INCLUDES += \
115		external/zlib \
116		external/icu4c/common
117LOCAL_LDLIBS += -lpthread
118
119LOCAL_SHARED_LIBRARIES := \
120	libz \
121	liblog \
122	libcutils
123
124ifneq ($(TARGET_SIMULATOR),true)
125ifeq ($(TARGET_OS)-$(TARGET_ARCH),linux-x86)
126# This is needed on x86 to bring in dl_iterate_phdr for CallStack.cpp
127LOCAL_SHARED_LIBRARIES += \
128	libdl
129endif # linux-x86
130endif # sim
131
132LOCAL_MODULE:= libutils
133
134#LOCAL_CFLAGS+=
135#LOCAL_LDFLAGS:=
136
137include $(BUILD_SHARED_LIBRARY)
138
139