blob: 7d4524aa56204f1964e31ba4587a5e518d81059f [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 \
Jeff Brown66db6892010-04-22 18:58:52 -070029 Pool.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080030 RefBase.cpp \
31 ResourceTypes.cpp \
32 SharedBuffer.cpp \
33 Static.cpp \
34 StopWatch.cpp \
35 String8.cpp \
36 String16.cpp \
Mathias Agopian254406e2009-06-05 01:26:23 -070037 StringArray.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080038 SystemClock.cpp \
39 TextOutput.cpp \
40 Threads.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080041 Timers.cpp \
42 VectorImpl.cpp \
Jeff Brownea5c46b2010-06-13 20:21:19 -070043 ZipFileCRO.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080044 ZipFileRO.cpp \
45 ZipUtils.cpp \
Mathias Agopian14d978d2009-06-05 15:11:23 -070046 misc.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080047
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080048
49# For the host
50# =====================================================
51
52include $(CLEAR_VARS)
53
Mathias Agopian09e2b142009-06-05 14:56:35 -070054LOCAL_SRC_FILES:= $(commonSources)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080055
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080056LOCAL_MODULE:= libutils
57
58LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
59LOCAL_C_INCLUDES += external/zlib
60
61ifeq ($(HOST_OS),windows)
62ifeq ($(strip $(USE_CYGWIN),),)
63# Under MinGW, ctype.h doesn't need multi-byte support
64LOCAL_CFLAGS += -DMB_CUR_MAX=1
65endif
66endif
67
68include $(BUILD_HOST_STATIC_LIBRARY)
69
70
71
72# For the device
73# =====================================================
74include $(CLEAR_VARS)
75
76
77# we have the common sources, plus some device-specific stuff
78LOCAL_SRC_FILES:= \
79 $(commonSources) \
Jeff Brownea5c46b2010-06-13 20:21:19 -070080 BackupData.cpp \
81 BackupHelpers.cpp \
82 PollLoop.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080083
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080084ifeq ($(TARGET_OS),linux)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080085LOCAL_LDLIBS += -lrt -ldl
86endif
87
88LOCAL_C_INCLUDES += \
89 external/zlib \
90 external/icu4c/common
Mathias Agopian15554362009-07-12 23:11:20 -070091
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080092LOCAL_LDLIBS += -lpthread
93
94LOCAL_SHARED_LIBRARIES := \
95 libz \
96 liblog \
97 libcutils
98
99ifneq ($(TARGET_SIMULATOR),true)
100ifeq ($(TARGET_OS)-$(TARGET_ARCH),linux-x86)
101# This is needed on x86 to bring in dl_iterate_phdr for CallStack.cpp
Mathias Agopian15554362009-07-12 23:11:20 -0700102LOCAL_SHARED_LIBRARIES += libdl
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800103endif # linux-x86
104endif # sim
105
106LOCAL_MODULE:= libutils
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800107include $(BUILD_SHARED_LIBRARY)
108
Dan Egnor88753ae2010-05-06 00:55:09 -0700109ifneq ($(TARGET_SIMULATOR),true)
110ifeq ($(TARGET_OS),linux)
111include $(CLEAR_VARS)
112LOCAL_C_INCLUDES += external/zlib external/icu4c/common
113LOCAL_LDLIBS := -lrt -ldl -lpthread
114LOCAL_MODULE := libutils
115LOCAL_SRC_FILES := $(commonSources) BackupData.cpp BackupHelpers.cpp
116include $(BUILD_STATIC_LIBRARY)
117endif
118endif