blob: 73a98d5f88ded166d66937fc9318d6a91b6634bf [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:= \
Jeff Browne735f232011-11-14 18:29:15 -080021 BasicHashtable.cpp \
Jamie Gennis1a209932011-04-28 16:19:45 -070022 BlobCache.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080023 BufferedTextOutput.cpp \
24 CallStack.cpp \
25 Debug.cpp \
26 FileMap.cpp \
Mathias Agopiana580e682010-02-11 17:30:52 -080027 Flattenable.cpp \
Raph Levienb6ea1752012-10-25 23:11:13 -070028 JenkinsHash.cpp \
Jason Simmonsb86c8e42011-06-28 17:43:30 -070029 LinearTransform.cpp \
Jeff Brown6454f462012-08-10 20:44:39 -070030 Log.cpp \
Jeff Brown04cbbc12010-11-29 17:37:49 -080031 PropertyMap.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080032 RefBase.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080033 SharedBuffer.cpp \
34 Static.cpp \
35 StopWatch.cpp \
36 String8.cpp \
37 String16.cpp \
Mathias Agopian254406e2009-06-05 01:26:23 -070038 StringArray.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080039 SystemClock.cpp \
40 TextOutput.cpp \
41 Threads.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080042 Timers.cpp \
Jeff Brown647925d2010-11-10 16:03:06 -080043 Tokenizer.cpp \
Kenny Rootba0165b2010-11-09 14:37:23 -080044 Unicode.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080045 VectorImpl.cpp \
Jeff Brown27e6eaa2012-03-16 22:18:39 -070046 WorkQueue.cpp \
Colin Cross3abdea92012-03-22 18:46:44 -070047 ZipFileCRO.cpp \
48 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
Andrew Hsieha19d2c72012-03-13 00:55:34 -070052host_commonCflags := -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080053
54ifeq ($(HOST_OS),windows)
55ifeq ($(strip $(USE_CYGWIN),),)
56# Under MinGW, ctype.h doesn't need multi-byte support
Andrew Hsieha19d2c72012-03-13 00:55:34 -070057host_commonCflags += -DMB_CUR_MAX=1
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080058endif
59endif
60
Andrew Hsieha19d2c72012-03-13 00:55:34 -070061host_commonLdlibs :=
62
Iliyan Malchev26ad3452011-10-19 22:35:56 -070063ifeq ($(TARGET_OS),linux)
Andrew Hsieha19d2c72012-03-13 00:55:34 -070064host_commonLdlibs += -lrt -ldl
Iliyan Malchev26ad3452011-10-19 22:35:56 -070065endif
66
Andrew Hsieha19d2c72012-03-13 00:55:34 -070067
68# For the host
69# =====================================================
70include $(CLEAR_VARS)
71LOCAL_SRC_FILES:= $(commonSources)
Keun young Park4e371ce2012-03-26 14:44:24 -070072ifeq ($(HOST_OS), linux)
73LOCAL_SRC_FILES += Looper.cpp
74endif
Andrew Hsieha19d2c72012-03-13 00:55:34 -070075LOCAL_MODULE:= libutils
Colin Crosse29b5c32012-03-23 10:14:56 -070076LOCAL_STATIC_LIBRARIES := libz
77LOCAL_C_INCLUDES := \
78 external/zlib
Andrew Hsieha19d2c72012-03-13 00:55:34 -070079LOCAL_CFLAGS += $(host_commonCflags)
80LOCAL_LDLIBS += $(host_commonLdlibs)
81include $(BUILD_HOST_STATIC_LIBRARY)
82
83
84# For the host, 64-bit
85# =====================================================
86include $(CLEAR_VARS)
87LOCAL_SRC_FILES:= $(commonSources)
Keun young Park4e371ce2012-03-26 14:44:24 -070088ifeq ($(HOST_OS), linux)
89LOCAL_SRC_FILES += Looper.cpp
90endif
Andrew Hsieha19d2c72012-03-13 00:55:34 -070091LOCAL_MODULE:= lib64utils
Colin Crosse29b5c32012-03-23 10:14:56 -070092LOCAL_STATIC_LIBRARIES := libz
93LOCAL_C_INCLUDES := \
94 external/zlib
Andrew Hsieha19d2c72012-03-13 00:55:34 -070095LOCAL_CFLAGS += $(host_commonCflags) -m64
96LOCAL_LDLIBS += $(host_commonLdlibs)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080097include $(BUILD_HOST_STATIC_LIBRARY)
98
99
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800100# For the device
101# =====================================================
102include $(CLEAR_VARS)
103
104
105# we have the common sources, plus some device-specific stuff
106LOCAL_SRC_FILES:= \
107 $(commonSources) \
Jamie Gennis2ccfe1a2012-02-23 11:28:28 -0800108 Looper.cpp \
109 Trace.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800110
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800111ifeq ($(TARGET_OS),linux)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800112LOCAL_LDLIBS += -lrt -ldl
113endif
114
115LOCAL_C_INCLUDES += \
Colin Cross3abdea92012-03-22 18:46:44 -0700116 bionic/libc/private \
117 external/zlib
Mathias Agopian15554362009-07-12 23:11:20 -0700118
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800119LOCAL_LDLIBS += -lpthread
120
121LOCAL_SHARED_LIBRARIES := \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800122 liblog \
Mathias Agopian9c63a802011-09-28 17:33:11 -0700123 libcutils \
Jeff Brownea45b012011-10-19 20:32:43 -0700124 libdl \
Colin Cross3abdea92012-03-22 18:46:44 -0700125 libcorkscrew \
126 libz
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800127
128LOCAL_MODULE:= libutils
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800129include $(BUILD_SHARED_LIBRARY)
130
Jeff Brown7aba2312010-06-30 16:10:35 -0700131# 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