blob: 9c01aea9288862e20db32569a8ea68d9c0b834d6 [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 \
Kenny Root1d2aeb62010-06-01 10:34:29 -070029 ObbFile.cpp \
Jeff Brown66db6892010-04-22 18:58:52 -070030 Pool.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080031 RefBase.cpp \
32 ResourceTypes.cpp \
33 SharedBuffer.cpp \
34 Static.cpp \
35 StopWatch.cpp \
Christopher Tatec28f2142010-07-26 11:24:18 -070036 StreamingZipInflater.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080037 String8.cpp \
38 String16.cpp \
Mathias Agopian254406e2009-06-05 01:26:23 -070039 StringArray.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080040 SystemClock.cpp \
41 TextOutput.cpp \
42 Threads.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080043 Timers.cpp \
Jeff Brown647925d2010-11-10 16:03:06 -080044 Tokenizer.cpp \
Kenny Rootba0165b2010-11-09 14:37:23 -080045 Unicode.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080046 VectorImpl.cpp \
Jeff Brownea5c46b2010-06-13 20:21:19 -070047 ZipFileCRO.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080048 ZipFileRO.cpp \
49 ZipUtils.cpp \
Mathias Agopian14d978d2009-06-05 15:11:23 -070050 misc.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080051
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080052
53# For the host
54# =====================================================
55
56include $(CLEAR_VARS)
57
Mathias Agopian09e2b142009-06-05 14:56:35 -070058LOCAL_SRC_FILES:= $(commonSources)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080059
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080060LOCAL_MODULE:= libutils
61
62LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
63LOCAL_C_INCLUDES += external/zlib
64
65ifeq ($(HOST_OS),windows)
66ifeq ($(strip $(USE_CYGWIN),),)
67# Under MinGW, ctype.h doesn't need multi-byte support
68LOCAL_CFLAGS += -DMB_CUR_MAX=1
69endif
70endif
71
Kenny Root1d2aeb62010-06-01 10:34:29 -070072ifeq ($(HOST_OS),darwin)
73# MacOS doesn't have lseek64. However, off_t is 64-bit anyway.
74LOCAL_CFLAGS += -DOFF_T_IS_64_BIT
75endif
76
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080077include $(BUILD_HOST_STATIC_LIBRARY)
78
79
80
81# For the device
82# =====================================================
83include $(CLEAR_VARS)
84
85
86# we have the common sources, plus some device-specific stuff
87LOCAL_SRC_FILES:= \
88 $(commonSources) \
Jeff Brownea5c46b2010-06-13 20:21:19 -070089 BackupData.cpp \
90 BackupHelpers.cpp \
Jeff Brown7901eb22010-09-13 23:17:30 -070091 Looper.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080092
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080093ifeq ($(TARGET_OS),linux)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080094LOCAL_LDLIBS += -lrt -ldl
95endif
96
97LOCAL_C_INCLUDES += \
98 external/zlib \
99 external/icu4c/common
Mathias Agopian15554362009-07-12 23:11:20 -0700100
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800101LOCAL_LDLIBS += -lpthread
102
103LOCAL_SHARED_LIBRARIES := \
104 libz \
105 liblog \
106 libcutils
107
108ifneq ($(TARGET_SIMULATOR),true)
109ifeq ($(TARGET_OS)-$(TARGET_ARCH),linux-x86)
110# This is needed on x86 to bring in dl_iterate_phdr for CallStack.cpp
Mathias Agopian15554362009-07-12 23:11:20 -0700111LOCAL_SHARED_LIBRARIES += libdl
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800112endif # linux-x86
113endif # sim
114
115LOCAL_MODULE:= libutils
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800116include $(BUILD_SHARED_LIBRARY)
117
Dan Egnor88753ae2010-05-06 00:55:09 -0700118ifneq ($(TARGET_SIMULATOR),true)
119ifeq ($(TARGET_OS),linux)
120include $(CLEAR_VARS)
121LOCAL_C_INCLUDES += external/zlib external/icu4c/common
122LOCAL_LDLIBS := -lrt -ldl -lpthread
123LOCAL_MODULE := libutils
124LOCAL_SRC_FILES := $(commonSources) BackupData.cpp BackupHelpers.cpp
125include $(BUILD_STATIC_LIBRARY)
126endif
127endif
Jeff Brown7aba2312010-06-30 16:10:35 -0700128
129
130# Include subdirectory makefiles
131# ============================================================
132
133# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
134# team really wants is to build the stuff defined by this makefile.
135ifeq (,$(ONE_SHOT_MAKEFILE))
136include $(call first-makefiles-under,$(LOCAL_PATH))
Christopher Tatec28f2142010-07-26 11:24:18 -0700137endif