blob: afecdcb0ce0494a8cc0a13d79739721e6d17c716 [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 \
Mathias Agopiana580e682010-02-11 17:30:52 -080028 Flattenable.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080029 RefBase.cpp \
30 ResourceTypes.cpp \
31 SharedBuffer.cpp \
32 Static.cpp \
33 StopWatch.cpp \
34 String8.cpp \
35 String16.cpp \
Mathias Agopian254406e2009-06-05 01:26:23 -070036 StringArray.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080037 SystemClock.cpp \
38 TextOutput.cpp \
39 Threads.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080040 Timers.cpp \
41 VectorImpl.cpp \
42 ZipFileCRO.cpp \
43 ZipFileRO.cpp \
44 ZipUtils.cpp \
Mathias Agopian14d978d2009-06-05 15:11:23 -070045 misc.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080046
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080047
48# For the host
49# =====================================================
50
51include $(CLEAR_VARS)
52
Mathias Agopian09e2b142009-06-05 14:56:35 -070053LOCAL_SRC_FILES:= $(commonSources)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080054
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080055LOCAL_MODULE:= libutils
56
57LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
58LOCAL_C_INCLUDES += external/zlib
59
60ifeq ($(HOST_OS),windows)
61ifeq ($(strip $(USE_CYGWIN),),)
62# Under MinGW, ctype.h doesn't need multi-byte support
63LOCAL_CFLAGS += -DMB_CUR_MAX=1
64endif
65endif
66
67include $(BUILD_HOST_STATIC_LIBRARY)
68
69
70
71# For the device
72# =====================================================
73include $(CLEAR_VARS)
74
75
76# we have the common sources, plus some device-specific stuff
77LOCAL_SRC_FILES:= \
78 $(commonSources) \
Mathias Agopian7c889142009-06-04 13:53:57 -070079 BackupData.cpp \
80 BackupHelpers.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080081
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080082ifeq ($(TARGET_OS),linux)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080083LOCAL_LDLIBS += -lrt -ldl
84endif
85
86LOCAL_C_INCLUDES += \
87 external/zlib \
88 external/icu4c/common
Mathias Agopian15554362009-07-12 23:11:20 -070089
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080090LOCAL_LDLIBS += -lpthread
91
92LOCAL_SHARED_LIBRARIES := \
93 libz \
94 liblog \
95 libcutils
96
97ifneq ($(TARGET_SIMULATOR),true)
98ifeq ($(TARGET_OS)-$(TARGET_ARCH),linux-x86)
99# This is needed on x86 to bring in dl_iterate_phdr for CallStack.cpp
Mathias Agopian15554362009-07-12 23:11:20 -0700100LOCAL_SHARED_LIBRARIES += libdl
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800101endif # linux-x86
102endif # sim
103
104LOCAL_MODULE:= libutils
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800105include $(BUILD_SHARED_LIBRARY)
106
Dan Egnor88753ae2010-05-06 00:55:09 -0700107ifneq ($(TARGET_SIMULATOR),true)
108ifeq ($(TARGET_OS),linux)
109include $(CLEAR_VARS)
110LOCAL_C_INCLUDES += external/zlib external/icu4c/common
111LOCAL_LDLIBS := -lrt -ldl -lpthread
112LOCAL_MODULE := libutils
113LOCAL_SRC_FILES := $(commonSources) BackupData.cpp BackupHelpers.cpp
114include $(BUILD_STATIC_LIBRARY)
115endif
116endif