blob: 24cf5048fa7044d97ae966ed47c0c2739c777e7e [file] [log] [blame]
The Android Open Source Project9066cfe2009-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 \
Jeff Brown9d61edc2011-11-14 18:29:15 -080024 BasicHashtable.cpp \
Jamie Gennis9539d9f2011-04-28 16:19:45 -070025 BlobCache.cpp \
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080026 BufferedTextOutput.cpp \
27 CallStack.cpp \
28 Debug.cpp \
29 FileMap.cpp \
Mathias Agopianc86727f2010-02-11 17:30:52 -080030 Flattenable.cpp \
Jason Simmonsaa119652011-06-28 17:43:30 -070031 LinearTransform.cpp \
Kenny Root7cee34a2010-06-01 10:34:29 -070032 ObbFile.cpp \
Jeff Brown47e6b1b2010-11-29 17:37:49 -080033 PropertyMap.cpp \
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080034 RefBase.cpp \
35 ResourceTypes.cpp \
36 SharedBuffer.cpp \
37 Static.cpp \
38 StopWatch.cpp \
Christopher Tateb100cbf2010-07-26 11:24:18 -070039 StreamingZipInflater.cpp \
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080040 String8.cpp \
41 String16.cpp \
Mathias Agopian8ed6beb2009-06-05 01:26:23 -070042 StringArray.cpp \
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080043 SystemClock.cpp \
44 TextOutput.cpp \
45 Threads.cpp \
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080046 Timers.cpp \
Jeff Brown6b53e8d2010-11-10 16:03:06 -080047 Tokenizer.cpp \
Kenny Root300ba682010-11-09 14:37:23 -080048 Unicode.cpp \
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080049 VectorImpl.cpp \
Jeff Brownd890cbf2010-06-13 20:21:19 -070050 ZipFileCRO.cpp \
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080051 ZipFileRO.cpp \
52 ZipUtils.cpp \
Mathias Agopiane583a4e2009-06-05 15:11:23 -070053 misc.cpp
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080054
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080055
56# For the host
57# =====================================================
58
59include $(CLEAR_VARS)
60
Mathias Agopian55e3d602009-06-05 14:56:35 -070061LOCAL_SRC_FILES:= $(commonSources)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080062
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080063LOCAL_MODULE:= libutils
64
65LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
66LOCAL_C_INCLUDES += external/zlib
67
68ifeq ($(HOST_OS),windows)
69ifeq ($(strip $(USE_CYGWIN),),)
70# Under MinGW, ctype.h doesn't need multi-byte support
71LOCAL_CFLAGS += -DMB_CUR_MAX=1
72endif
73endif
74
Iliyan Malchev64ef6b42011-10-19 22:35:56 -070075ifeq ($(TARGET_OS),linux)
76LOCAL_LDLIBS += -lrt -ldl
77endif
78
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080079include $(BUILD_HOST_STATIC_LIBRARY)
80
81
82
83# For the device
84# =====================================================
85include $(CLEAR_VARS)
86
87
88# we have the common sources, plus some device-specific stuff
89LOCAL_SRC_FILES:= \
90 $(commonSources) \
Jeff Brownd890cbf2010-06-13 20:21:19 -070091 BackupData.cpp \
92 BackupHelpers.cpp \
Jeff Brown4fe6c3e2010-09-13 23:17:30 -070093 Looper.cpp
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080094
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080095ifeq ($(TARGET_OS),linux)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080096LOCAL_LDLIBS += -lrt -ldl
97endif
98
99LOCAL_C_INCLUDES += \
100 external/zlib \
Glenn Kasten06a86442011-07-11 15:59:22 -0700101 external/icu4c/common \
102 bionic/libc/private
Mathias Agopianb1c4ca52009-07-12 23:11:20 -0700103
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800104LOCAL_LDLIBS += -lpthread
105
106LOCAL_SHARED_LIBRARIES := \
107 libz \
108 liblog \
Mathias Agopianacde31e2011-09-28 17:33:11 -0700109 libcutils \
Jeff Brown044966a2011-10-19 20:32:43 -0700110 libdl \
111 libcorkscrew
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800112
113LOCAL_MODULE:= libutils
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800114include $(BUILD_SHARED_LIBRARY)
115
Dan Egnor08b3d2e2010-05-06 00:55:09 -0700116ifeq ($(TARGET_OS),linux)
117include $(CLEAR_VARS)
Glenn Kasten06a86442011-07-11 15:59:22 -0700118LOCAL_C_INCLUDES += \
119 external/zlib \
120 external/icu4c/common \
121 bionic/libc/private
Dan Egnor08b3d2e2010-05-06 00:55:09 -0700122LOCAL_LDLIBS := -lrt -ldl -lpthread
123LOCAL_MODULE := libutils
124LOCAL_SRC_FILES := $(commonSources) BackupData.cpp BackupHelpers.cpp
125include $(BUILD_STATIC_LIBRARY)
126endif
Jeff Brownfd035822010-06-30 16:10:35 -0700127
128
129# Include subdirectory makefiles
130# ============================================================
131
132# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
133# team really wants is to build the stuff defined by this makefile.
134ifeq (,$(ONE_SHOT_MAKEFILE))
135include $(call first-makefiles-under,$(LOCAL_PATH))
Christopher Tateb100cbf2010-07-26 11:24:18 -0700136endif