blob: cbfe7bdceea5f6a511b712dddca830601f3f0547 [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 \
Chris Craik551fcf42012-12-05 10:36:45 -080029 LinearAllocator.cpp \
Jason Simmonsb86c8e42011-06-28 17:43:30 -070030 LinearTransform.cpp \
Jeff Brown6454f462012-08-10 20:44:39 -070031 Log.cpp \
Jeff Brown04cbbc12010-11-29 17:37:49 -080032 PropertyMap.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080033 RefBase.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080034 SharedBuffer.cpp \
35 Static.cpp \
36 StopWatch.cpp \
37 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 Brown27e6eaa2012-03-16 22:18:39 -070047 WorkQueue.cpp \
Colin Cross3abdea92012-03-22 18:46:44 -070048 ZipFileCRO.cpp \
49 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
Andrew Hsieha19d2c72012-03-13 00:55:34 -070053host_commonCflags := -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080054
55ifeq ($(HOST_OS),windows)
56ifeq ($(strip $(USE_CYGWIN),),)
57# Under MinGW, ctype.h doesn't need multi-byte support
Andrew Hsieha19d2c72012-03-13 00:55:34 -070058host_commonCflags += -DMB_CUR_MAX=1
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080059endif
60endif
61
Andrew Hsieha19d2c72012-03-13 00:55:34 -070062host_commonLdlibs :=
63
Iliyan Malchev26ad3452011-10-19 22:35:56 -070064ifeq ($(TARGET_OS),linux)
Andrew Hsieha19d2c72012-03-13 00:55:34 -070065host_commonLdlibs += -lrt -ldl
Iliyan Malchev26ad3452011-10-19 22:35:56 -070066endif
67
Andrew Hsieha19d2c72012-03-13 00:55:34 -070068
69# For the host
70# =====================================================
71include $(CLEAR_VARS)
72LOCAL_SRC_FILES:= $(commonSources)
Keun young Park4e371ce2012-03-26 14:44:24 -070073ifeq ($(HOST_OS), linux)
74LOCAL_SRC_FILES += Looper.cpp
75endif
Andrew Hsieha19d2c72012-03-13 00:55:34 -070076LOCAL_MODULE:= libutils
Colin Crosse29b5c32012-03-23 10:14:56 -070077LOCAL_STATIC_LIBRARIES := libz
78LOCAL_C_INCLUDES := \
79 external/zlib
Andrew Hsieha19d2c72012-03-13 00:55:34 -070080LOCAL_CFLAGS += $(host_commonCflags)
81LOCAL_LDLIBS += $(host_commonLdlibs)
82include $(BUILD_HOST_STATIC_LIBRARY)
83
84
85# For the host, 64-bit
86# =====================================================
87include $(CLEAR_VARS)
88LOCAL_SRC_FILES:= $(commonSources)
Keun young Park4e371ce2012-03-26 14:44:24 -070089ifeq ($(HOST_OS), linux)
90LOCAL_SRC_FILES += Looper.cpp
91endif
Andrew Hsieha19d2c72012-03-13 00:55:34 -070092LOCAL_MODULE:= lib64utils
Colin Crosse29b5c32012-03-23 10:14:56 -070093LOCAL_STATIC_LIBRARIES := libz
94LOCAL_C_INCLUDES := \
95 external/zlib
Andrew Hsieha19d2c72012-03-13 00:55:34 -070096LOCAL_CFLAGS += $(host_commonCflags) -m64
97LOCAL_LDLIBS += $(host_commonLdlibs)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080098include $(BUILD_HOST_STATIC_LIBRARY)
99
100
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800101# For the device
102# =====================================================
103include $(CLEAR_VARS)
104
105
106# we have the common sources, plus some device-specific stuff
107LOCAL_SRC_FILES:= \
108 $(commonSources) \
Jamie Gennis2ccfe1a2012-02-23 11:28:28 -0800109 Looper.cpp \
110 Trace.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800111
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800112ifeq ($(TARGET_OS),linux)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800113LOCAL_LDLIBS += -lrt -ldl
114endif
115
Chris Craik551fcf42012-12-05 10:36:45 -0800116ifeq ($(TARGET_ARCH),mips)
117LOCAL_CFLAGS += -DALIGN_DOUBLE
118endif
119
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800120LOCAL_C_INCLUDES += \
Colin Cross3abdea92012-03-22 18:46:44 -0700121 bionic/libc/private \
122 external/zlib
Mathias Agopian15554362009-07-12 23:11:20 -0700123
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800124LOCAL_LDLIBS += -lpthread
125
126LOCAL_SHARED_LIBRARIES := \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800127 liblog \
Mathias Agopian9c63a802011-09-28 17:33:11 -0700128 libcutils \
Jeff Brownea45b012011-10-19 20:32:43 -0700129 libdl \
Colin Cross3abdea92012-03-22 18:46:44 -0700130 libcorkscrew \
131 libz
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800132
133LOCAL_MODULE:= libutils
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800134include $(BUILD_SHARED_LIBRARY)
135
Jeff Brown7aba2312010-06-30 16:10:35 -0700136# Include subdirectory makefiles
137# ============================================================
138
139# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
140# team really wants is to build the stuff defined by this makefile.
141ifeq (,$(ONE_SHOT_MAKEFILE))
142include $(call first-makefiles-under,$(LOCAL_PATH))
Christopher Tatec28f2142010-07-26 11:24:18 -0700143endif