blob: 8f829f39a8a239f7e6e4e9e8a8af44bed8c30183 [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
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080017commonSources:= \
Jeff Browne735f232011-11-14 18:29:15 -080018 BasicHashtable.cpp \
Jamie Gennis1a209932011-04-28 16:19:45 -070019 BlobCache.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080020 CallStack.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080021 FileMap.cpp \
Raph Levienb6ea1752012-10-25 23:11:13 -070022 JenkinsHash.cpp \
Chris Craik551fcf42012-12-05 10:36:45 -080023 LinearAllocator.cpp \
Jason Simmonsb86c8e42011-06-28 17:43:30 -070024 LinearTransform.cpp \
Jeff Brown6454f462012-08-10 20:44:39 -070025 Log.cpp \
Jesse Hall29cc9ce2014-03-03 10:52:14 -080026 NativeHandle.cpp \
Igor Murashkinec79ef22013-10-24 17:09:15 -070027 Printer.cpp \
28 ProcessCallStack.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 \
36 SystemClock.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080037 Threads.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080038 Timers.cpp \
Jeff Brown647925d2010-11-10 16:03:06 -080039 Tokenizer.cpp \
Kenny Rootba0165b2010-11-09 14:37:23 -080040 Unicode.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080041 VectorImpl.cpp \
Elliott Hughesdec12b22015-02-02 17:31:27 -080042 misc.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080043
Mark Salyzyn5bed8032014-04-30 11:10:46 -070044host_commonCflags := -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -Werror
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080045
46ifeq ($(HOST_OS),windows)
47ifeq ($(strip $(USE_CYGWIN),),)
48# Under MinGW, ctype.h doesn't need multi-byte support
Andrew Hsieha19d2c72012-03-13 00:55:34 -070049host_commonCflags += -DMB_CUR_MAX=1
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080050endif
51endif
52
Andrew Hsieha19d2c72012-03-13 00:55:34 -070053# For the host
54# =====================================================
55include $(CLEAR_VARS)
56LOCAL_SRC_FILES:= $(commonSources)
Keun young Park4e371ce2012-03-26 14:44:24 -070057ifeq ($(HOST_OS), linux)
58LOCAL_SRC_FILES += Looper.cpp
59endif
Tim Murrayb37009f2014-07-24 17:22:09 -070060ifeq ($(HOST_OS),darwin)
61LOCAL_CFLAGS += -Wno-unused-parameter
62endif
Andrew Hsieha19d2c72012-03-13 00:55:34 -070063LOCAL_MODULE:= libutils
Colin Cross946003a2013-07-23 17:39:35 -070064LOCAL_STATIC_LIBRARIES := liblog
Andrew Hsieha19d2c72012-03-13 00:55:34 -070065LOCAL_CFLAGS += $(host_commonCflags)
Ian Rogers59ec7652014-06-05 14:32:49 -070066LOCAL_MULTILIB := both
Andrew Hsieha19d2c72012-03-13 00:55:34 -070067include $(BUILD_HOST_STATIC_LIBRARY)
68
69
Bjorn Bringert00c14b42013-03-22 14:26:33 +000070# For the device, static
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080071# =====================================================
72include $(CLEAR_VARS)
73
74
75# we have the common sources, plus some device-specific stuff
76LOCAL_SRC_FILES:= \
77 $(commonSources) \
Jamie Gennis2ccfe1a2012-02-23 11:28:28 -080078 Looper.cpp \
79 Trace.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080080
Chris Craik551fcf42012-12-05 10:36:45 -080081ifeq ($(TARGET_ARCH),mips)
82LOCAL_CFLAGS += -DALIGN_DOUBLE
83endif
Mark Salyzyn5bed8032014-04-30 11:10:46 -070084LOCAL_CFLAGS += -Werror
Chris Craik551fcf42012-12-05 10:36:45 -080085
Bjorn Bringert00c14b42013-03-22 14:26:33 +000086LOCAL_STATIC_LIBRARIES := \
Mathias Agopian9eb2a3b2013-05-06 20:20:50 -070087 libcutils
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080088
Bjorn Bringert00c14b42013-03-22 14:26:33 +000089LOCAL_SHARED_LIBRARIES := \
Dan Albert7bc49a12014-05-30 19:40:58 +000090 libbacktrace \
Bjorn Bringert00c14b42013-03-22 14:26:33 +000091 liblog \
92 libdl
93
Evgenii Stepanov6aaf7402015-06-12 13:10:55 -070094LOCAL_MODULE := libutils
Bjorn Bringert00c14b42013-03-22 14:26:33 +000095include $(BUILD_STATIC_LIBRARY)
96
97# For the device, shared
98# =====================================================
99include $(CLEAR_VARS)
100LOCAL_MODULE:= libutils
101LOCAL_WHOLE_STATIC_LIBRARIES := libutils
102LOCAL_SHARED_LIBRARIES := \
Dan Albert7bc49a12014-05-30 19:40:58 +0000103 libbacktrace \
Bjorn Bringert00c14b42013-03-22 14:26:33 +0000104 libcutils \
105 libdl \
Mark Salyzyn5bed8032014-04-30 11:10:46 -0700106 liblog
107LOCAL_CFLAGS := -Werror
Christopher Ferris9b0e0742013-10-31 16:25:04 -0700108
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800109include $(BUILD_SHARED_LIBRARY)
110
Jeff Brown7aba2312010-06-30 16:10:35 -0700111
Elliott Hughesdec12b22015-02-02 17:31:27 -0800112# Build the tests in the tests/ subdirectory.
Jeff Brown7aba2312010-06-30 16:10:35 -0700113include $(call first-makefiles-under,$(LOCAL_PATH))