blob: abf4b2e3340d3b21be93d0dc1b6c2de16d6f1816 [file] [log] [blame]
The Android Open Source Projectedbf3b62009-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 Brown66fbde32011-11-14 18:29:15 -080021 BasicHashtable.cpp \
Jamie Gennis58c8dd22011-04-28 16:19:45 -070022 BlobCache.cpp \
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080023 CallStack.cpp \
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080024 FileMap.cpp \
Mathias Agopian98e71dd2010-02-11 17:30:52 -080025 Flattenable.cpp \
Raph Levien8185e472012-10-25 23:11:13 -070026 JenkinsHash.cpp \
Chris Craik0a73f822012-12-05 10:36:45 -080027 LinearAllocator.cpp \
Jason Simmonsc18d4da2011-06-28 17:43:30 -070028 LinearTransform.cpp \
Jeff Brown6f12d572012-08-10 20:44:39 -070029 Log.cpp \
Jeff Brown66888372010-11-29 17:37:49 -080030 PropertyMap.cpp \
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080031 RefBase.cpp \
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080032 SharedBuffer.cpp \
33 Static.cpp \
34 StopWatch.cpp \
35 String8.cpp \
36 String16.cpp \
37 SystemClock.cpp \
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080038 Threads.cpp \
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080039 Timers.cpp \
Jeff Browna3477c82010-11-10 16:03:06 -080040 Tokenizer.cpp \
Kenny Rootc412dcb2010-11-09 14:37:23 -080041 Unicode.cpp \
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080042 VectorImpl.cpp \
Mathias Agopian4fcd9c72009-06-05 15:11:23 -070043 misc.cpp
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080044
Andrew Hsieh93f283d2012-03-13 00:55:34 -070045host_commonCflags := -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080046
47ifeq ($(HOST_OS),windows)
48ifeq ($(strip $(USE_CYGWIN),),)
49# Under MinGW, ctype.h doesn't need multi-byte support
Andrew Hsieh93f283d2012-03-13 00:55:34 -070050host_commonCflags += -DMB_CUR_MAX=1
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080051endif
52endif
53
Andrew Hsieh93f283d2012-03-13 00:55:34 -070054host_commonLdlibs :=
55
Iliyan Malchevb5fe3172011-10-19 22:35:56 -070056ifeq ($(TARGET_OS),linux)
Andrew Hsieh93f283d2012-03-13 00:55:34 -070057host_commonLdlibs += -lrt -ldl
Iliyan Malchevb5fe3172011-10-19 22:35:56 -070058endif
59
Andrew Hsieh93f283d2012-03-13 00:55:34 -070060
61# For the host
62# =====================================================
63include $(CLEAR_VARS)
64LOCAL_SRC_FILES:= $(commonSources)
Keun young Parkb7beba42012-03-26 14:44:24 -070065ifeq ($(HOST_OS), linux)
66LOCAL_SRC_FILES += Looper.cpp
67endif
Andrew Hsieh93f283d2012-03-13 00:55:34 -070068LOCAL_MODULE:= libutils
Colin Cross4afb57b2013-07-23 17:39:35 -070069LOCAL_STATIC_LIBRARIES := liblog
Andrew Hsieh93f283d2012-03-13 00:55:34 -070070LOCAL_CFLAGS += $(host_commonCflags)
71LOCAL_LDLIBS += $(host_commonLdlibs)
72include $(BUILD_HOST_STATIC_LIBRARY)
73
74
75# For the host, 64-bit
76# =====================================================
77include $(CLEAR_VARS)
78LOCAL_SRC_FILES:= $(commonSources)
Keun young Parkb7beba42012-03-26 14:44:24 -070079ifeq ($(HOST_OS), linux)
80LOCAL_SRC_FILES += Looper.cpp
81endif
Andrew Hsieh93f283d2012-03-13 00:55:34 -070082LOCAL_MODULE:= lib64utils
Colin Cross4afb57b2013-07-23 17:39:35 -070083LOCAL_STATIC_LIBRARIES := liblog
Andrew Hsieh93f283d2012-03-13 00:55:34 -070084LOCAL_CFLAGS += $(host_commonCflags) -m64
85LOCAL_LDLIBS += $(host_commonLdlibs)
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080086include $(BUILD_HOST_STATIC_LIBRARY)
87
88
Bjorn Bringertf19c4ae2013-03-22 14:26:33 +000089# For the device, static
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080090# =====================================================
91include $(CLEAR_VARS)
92
93
94# we have the common sources, plus some device-specific stuff
95LOCAL_SRC_FILES:= \
96 $(commonSources) \
Jamie Gennisf64b1ca2012-02-23 11:28:28 -080097 Looper.cpp \
98 Trace.cpp
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080099
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800100ifeq ($(TARGET_OS),linux)
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800101LOCAL_LDLIBS += -lrt -ldl
102endif
103
Chris Craik0a73f822012-12-05 10:36:45 -0800104ifeq ($(TARGET_ARCH),mips)
105LOCAL_CFLAGS += -DALIGN_DOUBLE
106endif
107
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800108LOCAL_C_INCLUDES += \
Colin Cross163d5a92012-03-22 18:46:44 -0700109 bionic/libc/private \
110 external/zlib
Mathias Agopianec0f1f62009-07-12 23:11:20 -0700111
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800112LOCAL_LDLIBS += -lpthread
113
Bjorn Bringertf19c4ae2013-03-22 14:26:33 +0000114LOCAL_STATIC_LIBRARIES := \
Mathias Agopian002e1e52013-05-06 20:20:50 -0700115 libcutils
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800116
Bjorn Bringertf19c4ae2013-03-22 14:26:33 +0000117LOCAL_SHARED_LIBRARIES := \
118 libcorkscrew \
119 liblog \
120 libdl
121
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800122LOCAL_MODULE:= libutils
Bjorn Bringertf19c4ae2013-03-22 14:26:33 +0000123include $(BUILD_STATIC_LIBRARY)
124
125# For the device, shared
126# =====================================================
127include $(CLEAR_VARS)
128LOCAL_MODULE:= libutils
129LOCAL_WHOLE_STATIC_LIBRARIES := libutils
130LOCAL_SHARED_LIBRARIES := \
131 liblog \
132 libcutils \
133 libdl \
Mathias Agopian002e1e52013-05-06 20:20:50 -0700134 libcorkscrew
135
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800136include $(BUILD_SHARED_LIBRARY)
137
Jeff Brown8575a872010-06-30 16:10:35 -0700138# Include subdirectory makefiles
139# ============================================================
140
141# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
142# team really wants is to build the stuff defined by this makefile.
143ifeq (,$(ONE_SHOT_MAKEFILE))
144include $(call first-makefiles-under,$(LOCAL_PATH))
Christopher Tatea45a8002010-07-26 11:24:18 -0700145endif