blob: 8bd833b50752aaaa7a72ac022aa0acee7bcc0bac [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 \
Jeff Brown04cbbc12010-11-29 17:37:49 -080031 PropertyMap.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080032 RefBase.cpp \
33 ResourceTypes.cpp \
34 SharedBuffer.cpp \
35 Static.cpp \
36 StopWatch.cpp \
Christopher Tatec28f2142010-07-26 11:24:18 -070037 StreamingZipInflater.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080038 String8.cpp \
39 String16.cpp \
Mathias Agopian254406e2009-06-05 01:26:23 -070040 StringArray.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080041 SystemClock.cpp \
42 TextOutput.cpp \
43 Threads.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080044 Timers.cpp \
Jeff Brown647925d2010-11-10 16:03:06 -080045 Tokenizer.cpp \
Kenny Rootba0165b2010-11-09 14:37:23 -080046 Unicode.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080047 VectorImpl.cpp \
Jeff Brownea5c46b2010-06-13 20:21:19 -070048 ZipFileCRO.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080049 ZipFileRO.cpp \
50 ZipUtils.cpp \
Mathias Agopian14d978d2009-06-05 15:11:23 -070051 misc.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080052
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080053
54# For the host
55# =====================================================
56
57include $(CLEAR_VARS)
58
Mathias Agopian09e2b142009-06-05 14:56:35 -070059LOCAL_SRC_FILES:= $(commonSources)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080060
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080061LOCAL_MODULE:= libutils
62
63LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
64LOCAL_C_INCLUDES += external/zlib
65
66ifeq ($(HOST_OS),windows)
67ifeq ($(strip $(USE_CYGWIN),),)
68# Under MinGW, ctype.h doesn't need multi-byte support
69LOCAL_CFLAGS += -DMB_CUR_MAX=1
70endif
71endif
72
Kenny Root1d2aeb62010-06-01 10:34:29 -070073ifeq ($(HOST_OS),darwin)
74# MacOS doesn't have lseek64. However, off_t is 64-bit anyway.
75LOCAL_CFLAGS += -DOFF_T_IS_64_BIT
76endif
77
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080078include $(BUILD_HOST_STATIC_LIBRARY)
79
80
81
82# For the device
83# =====================================================
84include $(CLEAR_VARS)
85
86
87# we have the common sources, plus some device-specific stuff
88LOCAL_SRC_FILES:= \
89 $(commonSources) \
Jeff Brownea5c46b2010-06-13 20:21:19 -070090 BackupData.cpp \
91 BackupHelpers.cpp \
Jeff Brown7901eb22010-09-13 23:17:30 -070092 Looper.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080093
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080094ifeq ($(TARGET_OS),linux)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080095LOCAL_LDLIBS += -lrt -ldl
96endif
97
98LOCAL_C_INCLUDES += \
99 external/zlib \
100 external/icu4c/common
Mathias Agopian15554362009-07-12 23:11:20 -0700101
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800102LOCAL_LDLIBS += -lpthread
103
104LOCAL_SHARED_LIBRARIES := \
105 libz \
106 liblog \
107 libcutils
108
109ifneq ($(TARGET_SIMULATOR),true)
110ifeq ($(TARGET_OS)-$(TARGET_ARCH),linux-x86)
111# This is needed on x86 to bring in dl_iterate_phdr for CallStack.cpp
Mathias Agopian15554362009-07-12 23:11:20 -0700112LOCAL_SHARED_LIBRARIES += libdl
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800113endif # linux-x86
114endif # sim
115
116LOCAL_MODULE:= libutils
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800117include $(BUILD_SHARED_LIBRARY)
118
Dan Egnor88753ae2010-05-06 00:55:09 -0700119ifneq ($(TARGET_SIMULATOR),true)
120ifeq ($(TARGET_OS),linux)
121include $(CLEAR_VARS)
122LOCAL_C_INCLUDES += external/zlib external/icu4c/common
123LOCAL_LDLIBS := -lrt -ldl -lpthread
124LOCAL_MODULE := libutils
125LOCAL_SRC_FILES := $(commonSources) BackupData.cpp BackupHelpers.cpp
126include $(BUILD_STATIC_LIBRARY)
127endif
128endif
Jeff Brown7aba2312010-06-30 16:10:35 -0700129
130
131# Include subdirectory makefiles
132# ============================================================
133
134# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
135# team really wants is to build the stuff defined by this makefile.
136ifeq (,$(ONE_SHOT_MAKEFILE))
137include $(call first-makefiles-under,$(LOCAL_PATH))
Christopher Tatec28f2142010-07-26 11:24:18 -0700138endif