blob: a5a59d8e3b1c7c436695287a46ec47f5b6070cb6 [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 \
Jason Simmonsb86c8e42011-06-28 17:43:30 -070028 LinearTransform.cpp \
Jeff Brown04cbbc12010-11-29 17:37:49 -080029 PropertyMap.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080030 RefBase.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080031 SharedBuffer.cpp \
32 Static.cpp \
33 StopWatch.cpp \
34 String8.cpp \
35 String16.cpp \
Mathias Agopian254406e2009-06-05 01:26:23 -070036 StringArray.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080037 SystemClock.cpp \
38 TextOutput.cpp \
39 Threads.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080040 Timers.cpp \
Jeff Brown647925d2010-11-10 16:03:06 -080041 Tokenizer.cpp \
Kenny Rootba0165b2010-11-09 14:37:23 -080042 Unicode.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080043 VectorImpl.cpp \
Jeff Brown27e6eaa2012-03-16 22:18:39 -070044 WorkQueue.cpp \
Colin Cross3abdea92012-03-22 18:46:44 -070045 ZipFileCRO.cpp \
46 ZipFileRO.cpp \
47 ZipUtils.cpp \
Mathias Agopian14d978d2009-06-05 15:11:23 -070048 misc.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080049
Andrew Hsieha19d2c72012-03-13 00:55:34 -070050host_commonCflags := -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080051
52ifeq ($(HOST_OS),windows)
53ifeq ($(strip $(USE_CYGWIN),),)
54# Under MinGW, ctype.h doesn't need multi-byte support
Andrew Hsieha19d2c72012-03-13 00:55:34 -070055host_commonCflags += -DMB_CUR_MAX=1
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080056endif
57endif
58
Andrew Hsieha19d2c72012-03-13 00:55:34 -070059host_commonLdlibs :=
60
Iliyan Malchev26ad3452011-10-19 22:35:56 -070061ifeq ($(TARGET_OS),linux)
Andrew Hsieha19d2c72012-03-13 00:55:34 -070062host_commonLdlibs += -lrt -ldl
Iliyan Malchev26ad3452011-10-19 22:35:56 -070063endif
64
Andrew Hsieha19d2c72012-03-13 00:55:34 -070065
66# For the host
67# =====================================================
68include $(CLEAR_VARS)
69LOCAL_SRC_FILES:= $(commonSources)
70LOCAL_MODULE:= libutils
71LOCAL_CFLAGS += $(host_commonCflags)
72LOCAL_LDLIBS += $(host_commonLdlibs)
73include $(BUILD_HOST_STATIC_LIBRARY)
74
75
76# For the host, 64-bit
77# =====================================================
78include $(CLEAR_VARS)
79LOCAL_SRC_FILES:= $(commonSources)
80LOCAL_MODULE:= lib64utils
81LOCAL_CFLAGS += $(host_commonCflags) -m64
82LOCAL_LDLIBS += $(host_commonLdlibs)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080083include $(BUILD_HOST_STATIC_LIBRARY)
84
85
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080086# For the device
87# =====================================================
88include $(CLEAR_VARS)
89
90
91# we have the common sources, plus some device-specific stuff
92LOCAL_SRC_FILES:= \
93 $(commonSources) \
Jamie Gennis2ccfe1a2012-02-23 11:28:28 -080094 Looper.cpp \
95 Trace.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080096
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080097ifeq ($(TARGET_OS),linux)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080098LOCAL_LDLIBS += -lrt -ldl
99endif
100
101LOCAL_C_INCLUDES += \
Colin Cross3abdea92012-03-22 18:46:44 -0700102 bionic/libc/private \
103 external/zlib
Mathias Agopian15554362009-07-12 23:11:20 -0700104
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800105LOCAL_LDLIBS += -lpthread
106
107LOCAL_SHARED_LIBRARIES := \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800108 liblog \
Mathias Agopian9c63a802011-09-28 17:33:11 -0700109 libcutils \
Jeff Brownea45b012011-10-19 20:32:43 -0700110 libdl \
Colin Cross3abdea92012-03-22 18:46:44 -0700111 libcorkscrew \
112 libz
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800113
114LOCAL_MODULE:= libutils
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800115include $(BUILD_SHARED_LIBRARY)
116
Jeff Brown7aba2312010-06-30 16:10:35 -0700117# Include subdirectory makefiles
118# ============================================================
119
120# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
121# team really wants is to build the stuff defined by this makefile.
122ifeq (,$(ONE_SHOT_MAKEFILE))
123include $(call first-makefiles-under,$(LOCAL_PATH))
Christopher Tatec28f2142010-07-26 11:24:18 -0700124endif