Android.mk revision edbf3b6af777b721cd2a1ef461947e51e88241e1
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	Binder.cpp \
107	BpBinder.cpp \
108	IInterface.cpp \
109	IMemory.cpp \
110	IPCThreadState.cpp \
111	MemoryDealer.cpp \
112    MemoryBase.cpp \
113    MemoryHeapBase.cpp \
114    MemoryHeapPmem.cpp \
115	Parcel.cpp \
116	ProcessState.cpp \
117	IPermissionController.cpp \
118	IServiceManager.cpp \
119	Unicode.cpp
120
121ifeq ($(TARGET_SIMULATOR),true)
122LOCAL_SRC_FILES += $(hostSources)
123endif
124
125ifeq ($(TARGET_OS),linux)
126# Use the futex based mutex and condition variable
127# implementation from android-arm because it's shared mem safe
128LOCAL_SRC_FILES += futex_synchro.c
129LOCAL_LDLIBS += -lrt -ldl
130endif
131
132LOCAL_C_INCLUDES += \
133		external/zlib \
134		external/icu4c/common
135LOCAL_LDLIBS += -lpthread
136
137LOCAL_SHARED_LIBRARIES := \
138	libz \
139	liblog \
140	libcutils
141
142ifneq ($(TARGET_SIMULATOR),true)
143ifeq ($(TARGET_OS)-$(TARGET_ARCH),linux-x86)
144# This is needed on x86 to bring in dl_iterate_phdr for CallStack.cpp
145LOCAL_SHARED_LIBRARIES += \
146	libdl
147endif # linux-x86
148endif # sim
149
150LOCAL_MODULE:= libutils
151
152#LOCAL_CFLAGS+=
153#LOCAL_LDFLAGS:=
154
155include $(BUILD_SHARED_LIBRARY)
156
157