blob: 093189c5c05ad67cffe1b965441881c0e6be57b4 [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 \
Jamie Gennis1a209932011-04-28 16:19:45 -070024 BlobCache.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080025 BufferedTextOutput.cpp \
26 CallStack.cpp \
27 Debug.cpp \
28 FileMap.cpp \
Mathias Agopiana580e682010-02-11 17:30:52 -080029 Flattenable.cpp \
Kenny Root1d2aeb62010-06-01 10:34:29 -070030 ObbFile.cpp \
Jeff Brown66db6892010-04-22 18:58:52 -070031 Pool.cpp \
Jeff Brown04cbbc12010-11-29 17:37:49 -080032 PropertyMap.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080033 RefBase.cpp \
34 ResourceTypes.cpp \
35 SharedBuffer.cpp \
36 Static.cpp \
37 StopWatch.cpp \
Christopher Tatec28f2142010-07-26 11:24:18 -070038 StreamingZipInflater.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080039 String8.cpp \
40 String16.cpp \
Mathias Agopian254406e2009-06-05 01:26:23 -070041 StringArray.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080042 SystemClock.cpp \
43 TextOutput.cpp \
44 Threads.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080045 Timers.cpp \
Jeff Brown647925d2010-11-10 16:03:06 -080046 Tokenizer.cpp \
Kenny Rootba0165b2010-11-09 14:37:23 -080047 Unicode.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080048 VectorImpl.cpp \
Jeff Brownea5c46b2010-06-13 20:21:19 -070049 ZipFileCRO.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080050 ZipFileRO.cpp \
51 ZipUtils.cpp \
Mathias Agopian14d978d2009-06-05 15:11:23 -070052 misc.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080053
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080054
55# For the host
56# =====================================================
57
58include $(CLEAR_VARS)
59
Mathias Agopian09e2b142009-06-05 14:56:35 -070060LOCAL_SRC_FILES:= $(commonSources)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080061
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080062LOCAL_MODULE:= libutils
63
64LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
65LOCAL_C_INCLUDES += external/zlib
66
67ifeq ($(HOST_OS),windows)
68ifeq ($(strip $(USE_CYGWIN),),)
69# Under MinGW, ctype.h doesn't need multi-byte support
70LOCAL_CFLAGS += -DMB_CUR_MAX=1
71endif
72endif
73
74include $(BUILD_HOST_STATIC_LIBRARY)
75
76
77
78# For the device
79# =====================================================
80include $(CLEAR_VARS)
81
82
83# we have the common sources, plus some device-specific stuff
84LOCAL_SRC_FILES:= \
85 $(commonSources) \
Jeff Brownea5c46b2010-06-13 20:21:19 -070086 BackupData.cpp \
87 BackupHelpers.cpp \
Jeff Brown7901eb22010-09-13 23:17:30 -070088 Looper.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080089
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080090ifeq ($(TARGET_OS),linux)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080091LOCAL_LDLIBS += -lrt -ldl
92endif
93
94LOCAL_C_INCLUDES += \
95 external/zlib \
96 external/icu4c/common
Mathias Agopian15554362009-07-12 23:11:20 -070097
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080098LOCAL_LDLIBS += -lpthread
99
100LOCAL_SHARED_LIBRARIES := \
101 libz \
102 liblog \
103 libcutils
104
105ifneq ($(TARGET_SIMULATOR),true)
106ifeq ($(TARGET_OS)-$(TARGET_ARCH),linux-x86)
107# This is needed on x86 to bring in dl_iterate_phdr for CallStack.cpp
Mathias Agopian15554362009-07-12 23:11:20 -0700108LOCAL_SHARED_LIBRARIES += libdl
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800109endif # linux-x86
110endif # sim
111
112LOCAL_MODULE:= libutils
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800113include $(BUILD_SHARED_LIBRARY)
114
Dan Egnor88753ae2010-05-06 00:55:09 -0700115ifneq ($(TARGET_SIMULATOR),true)
116ifeq ($(TARGET_OS),linux)
117include $(CLEAR_VARS)
118LOCAL_C_INCLUDES += external/zlib external/icu4c/common
119LOCAL_LDLIBS := -lrt -ldl -lpthread
120LOCAL_MODULE := libutils
121LOCAL_SRC_FILES := $(commonSources) BackupData.cpp BackupHelpers.cpp
122include $(BUILD_STATIC_LIBRARY)
123endif
124endif
Jeff Brown7aba2312010-06-30 16:10:35 -0700125
126
127# Include subdirectory makefiles
128# ============================================================
129
130# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
131# team really wants is to build the stuff defined by this makefile.
132ifeq (,$(ONE_SHOT_MAKEFILE))
133include $(call first-makefiles-under,$(LOCAL_PATH))
Christopher Tatec28f2142010-07-26 11:24:18 -0700134endif