blob: 3024d2f1e70779c4b5063ff0344c9275fdc25267 [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 CallStack.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080024 FileMap.cpp \
Raph Levienb6ea1752012-10-25 23:11:13 -070025 JenkinsHash.cpp \
Chris Craik551fcf42012-12-05 10:36:45 -080026 LinearAllocator.cpp \
Jason Simmonsb86c8e42011-06-28 17:43:30 -070027 LinearTransform.cpp \
Jeff Brown6454f462012-08-10 20:44:39 -070028 Log.cpp \
Igor Murashkinec79ef22013-10-24 17:09:15 -070029 Printer.cpp \
30 ProcessCallStack.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 \
38 SystemClock.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080039 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 \
Mathias Agopian14d978d2009-06-05 15:11:23 -070044 misc.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080045
Andrew Hsieha19d2c72012-03-13 00:55:34 -070046host_commonCflags := -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080047
48ifeq ($(HOST_OS),windows)
49ifeq ($(strip $(USE_CYGWIN),),)
50# Under MinGW, ctype.h doesn't need multi-byte support
Andrew Hsieha19d2c72012-03-13 00:55:34 -070051host_commonCflags += -DMB_CUR_MAX=1
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080052endif
53endif
54
Andrew Hsieha19d2c72012-03-13 00:55:34 -070055host_commonLdlibs :=
56
Iliyan Malchev26ad3452011-10-19 22:35:56 -070057ifeq ($(TARGET_OS),linux)
Andrew Hsieha19d2c72012-03-13 00:55:34 -070058host_commonLdlibs += -lrt -ldl
Iliyan Malchev26ad3452011-10-19 22:35:56 -070059endif
60
Andrew Hsieha19d2c72012-03-13 00:55:34 -070061
62# For the host
63# =====================================================
64include $(CLEAR_VARS)
65LOCAL_SRC_FILES:= $(commonSources)
Keun young Park4e371ce2012-03-26 14:44:24 -070066ifeq ($(HOST_OS), linux)
67LOCAL_SRC_FILES += Looper.cpp
68endif
Andrew Hsieha19d2c72012-03-13 00:55:34 -070069LOCAL_MODULE:= libutils
Colin Cross946003a2013-07-23 17:39:35 -070070LOCAL_STATIC_LIBRARIES := liblog
Andrew Hsieha19d2c72012-03-13 00:55:34 -070071LOCAL_CFLAGS += $(host_commonCflags)
72LOCAL_LDLIBS += $(host_commonLdlibs)
Narayan Kamathb6381262015-08-28 12:59:48 +010073LOCAL_C_INCLUDES += external/safe-iop/include
Andrew Hsieha19d2c72012-03-13 00:55:34 -070074include $(BUILD_HOST_STATIC_LIBRARY)
75
76
77# For the host, 64-bit
78# =====================================================
79include $(CLEAR_VARS)
80LOCAL_SRC_FILES:= $(commonSources)
Keun young Park4e371ce2012-03-26 14:44:24 -070081ifeq ($(HOST_OS), linux)
82LOCAL_SRC_FILES += Looper.cpp
83endif
Andrew Hsieha19d2c72012-03-13 00:55:34 -070084LOCAL_MODULE:= lib64utils
Colin Cross946003a2013-07-23 17:39:35 -070085LOCAL_STATIC_LIBRARIES := liblog
Andrew Hsieha19d2c72012-03-13 00:55:34 -070086LOCAL_CFLAGS += $(host_commonCflags) -m64
87LOCAL_LDLIBS += $(host_commonLdlibs)
Narayan Kamathb6381262015-08-28 12:59:48 +010088LOCAL_C_INCLUDES += external/safe-iop/include
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080089include $(BUILD_HOST_STATIC_LIBRARY)
90
91
Bjorn Bringert00c14b42013-03-22 14:26:33 +000092# For the device, static
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080093# =====================================================
94include $(CLEAR_VARS)
95
96
97# we have the common sources, plus some device-specific stuff
98LOCAL_SRC_FILES:= \
99 $(commonSources) \
Jamie Gennis2ccfe1a2012-02-23 11:28:28 -0800100 Looper.cpp \
101 Trace.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800102
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800103ifeq ($(TARGET_OS),linux)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800104LOCAL_LDLIBS += -lrt -ldl
105endif
106
Chris Craik551fcf42012-12-05 10:36:45 -0800107ifeq ($(TARGET_ARCH),mips)
108LOCAL_CFLAGS += -DALIGN_DOUBLE
109endif
110
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800111LOCAL_C_INCLUDES += \
Colin Cross3abdea92012-03-22 18:46:44 -0700112 bionic/libc/private \
113 external/zlib
Mathias Agopian15554362009-07-12 23:11:20 -0700114
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800115LOCAL_LDLIBS += -lpthread
116
Bjorn Bringert00c14b42013-03-22 14:26:33 +0000117LOCAL_STATIC_LIBRARIES := \
Mathias Agopian9eb2a3b2013-05-06 20:20:50 -0700118 libcutils
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800119
Bjorn Bringert00c14b42013-03-22 14:26:33 +0000120LOCAL_SHARED_LIBRARIES := \
121 libcorkscrew \
122 liblog \
123 libdl
124
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800125LOCAL_MODULE:= libutils
Narayan Kamathb6381262015-08-28 12:59:48 +0100126LOCAL_C_INCLUDES += external/safe-iop/include
Bjorn Bringert00c14b42013-03-22 14:26:33 +0000127include $(BUILD_STATIC_LIBRARY)
128
129# For the device, shared
130# =====================================================
131include $(CLEAR_VARS)
132LOCAL_MODULE:= libutils
133LOCAL_WHOLE_STATIC_LIBRARIES := libutils
134LOCAL_SHARED_LIBRARIES := \
135 liblog \
136 libcutils \
137 libdl \
Mathias Agopian9eb2a3b2013-05-06 20:20:50 -0700138 libcorkscrew
Narayan Kamathb6381262015-08-28 12:59:48 +0100139LOCAL_C_INCLUDES += external/safe-iop/include
Mathias Agopian9eb2a3b2013-05-06 20:20:50 -0700140
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800141include $(BUILD_SHARED_LIBRARY)
142
Jeff Brown7aba2312010-06-30 16:10:35 -0700143# Include subdirectory makefiles
144# ============================================================
Sergio Giro66b6eb92015-08-18 17:36:50 +0100145include $(CLEAR_VARS)
146LOCAL_MODULE := SharedBufferTest
147LOCAL_STATIC_LIBRARIES := libutils libcutils
148LOCAL_SHARED_LIBRARIES := liblog
149LOCAL_SRC_FILES := SharedBufferTest.cpp
150include $(BUILD_NATIVE_TEST)
151
152include $(CLEAR_VARS)
153LOCAL_MODULE := SharedBufferTest
154LOCAL_STATIC_LIBRARIES := libutils libcutils
155LOCAL_SHARED_LIBRARIES := liblog
156LOCAL_SRC_FILES := SharedBufferTest.cpp
157include $(BUILD_HOST_NATIVE_TEST)
Jeff Brown7aba2312010-06-30 16:10:35 -0700158
159# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
160# team really wants is to build the stuff defined by this makefile.
161ifeq (,$(ONE_SHOT_MAKEFILE))
162include $(call first-makefiles-under,$(LOCAL_PATH))
Christopher Tatec28f2142010-07-26 11:24:18 -0700163endif