blob: f9fb780388bc3de029c3766f81c95c5e8bfcc5f2 [file] [log] [blame]
The Android Open Source Projectcbb10112009-03-03 19:31:44 -08001# 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 \
Joe Onoratoaaead202009-05-05 11:50:51 -0700119 Unicode.cpp \
120 file_backup_helper.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800121
122ifeq ($(TARGET_SIMULATOR),true)
123LOCAL_SRC_FILES += $(hostSources)
124endif
125
126ifeq ($(TARGET_OS),linux)
127# Use the futex based mutex and condition variable
128# implementation from android-arm because it's shared mem safe
129LOCAL_SRC_FILES += futex_synchro.c
130LOCAL_LDLIBS += -lrt -ldl
131endif
132
133LOCAL_C_INCLUDES += \
134 external/zlib \
135 external/icu4c/common
136LOCAL_LDLIBS += -lpthread
137
138LOCAL_SHARED_LIBRARIES := \
139 libz \
140 liblog \
141 libcutils
142
143ifneq ($(TARGET_SIMULATOR),true)
144ifeq ($(TARGET_OS)-$(TARGET_ARCH),linux-x86)
145# This is needed on x86 to bring in dl_iterate_phdr for CallStack.cpp
146LOCAL_SHARED_LIBRARIES += \
147 libdl
148endif # linux-x86
149endif # sim
150
151LOCAL_MODULE:= libutils
152
153#LOCAL_CFLAGS+=
154#LOCAL_LDFLAGS:=
155
156include $(BUILD_SHARED_LIBRARY)
157