blob: d610b8cb9cdf948fc3e3235e6bf4bbb94b2ffb15 [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 \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080019 CallStack.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080020 FileMap.cpp \
Raph Levienb6ea1752012-10-25 23:11:13 -070021 JenkinsHash.cpp \
Jason Simmonsb86c8e42011-06-28 17:43:30 -070022 LinearTransform.cpp \
Jeff Brown6454f462012-08-10 20:44:39 -070023 Log.cpp \
Jesse Hall29cc9ce2014-03-03 10:52:14 -080024 NativeHandle.cpp \
Igor Murashkinec79ef22013-10-24 17:09:15 -070025 Printer.cpp \
26 ProcessCallStack.cpp \
Jeff Brown04cbbc12010-11-29 17:37:49 -080027 PropertyMap.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080028 RefBase.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080029 SharedBuffer.cpp \
30 Static.cpp \
31 StopWatch.cpp \
32 String8.cpp \
33 String16.cpp \
34 SystemClock.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080035 Threads.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080036 Timers.cpp \
Jeff Brown647925d2010-11-10 16:03:06 -080037 Tokenizer.cpp \
Kenny Rootba0165b2010-11-09 14:37:23 -080038 Unicode.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080039 VectorImpl.cpp \
Elliott Hughesdec12b22015-02-02 17:31:27 -080040 misc.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080041
Mark Salyzyn5bed8032014-04-30 11:10:46 -070042host_commonCflags := -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -Werror
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080043
Andrew Hsieha19d2c72012-03-13 00:55:34 -070044# For the host
45# =====================================================
46include $(CLEAR_VARS)
47LOCAL_SRC_FILES:= $(commonSources)
Dan Willemsen87a419c2015-08-13 14:43:34 -070048LOCAL_SRC_FILES_linux := Looper.cpp
49LOCAL_CFLAGS_darwin := -Wno-unused-parameter
Andrew Hsieha19d2c72012-03-13 00:55:34 -070050LOCAL_MODULE:= libutils
Colin Cross946003a2013-07-23 17:39:35 -070051LOCAL_STATIC_LIBRARIES := liblog
Andrew Hsieha19d2c72012-03-13 00:55:34 -070052LOCAL_CFLAGS += $(host_commonCflags)
Dan Willemsen87a419c2015-08-13 14:43:34 -070053# Under MinGW, ctype.h doesn't need multi-byte support
54LOCAL_CFLAGS_windows := -DMB_CUR_MAX=1
Ian Rogers59ec7652014-06-05 14:32:49 -070055LOCAL_MULTILIB := both
Dan Willemsen87a419c2015-08-13 14:43:34 -070056LOCAL_MODULE_HOST_OS := darwin linux windows
Andrew Hsieha19d2c72012-03-13 00:55:34 -070057include $(BUILD_HOST_STATIC_LIBRARY)
58
59
Bjorn Bringert00c14b42013-03-22 14:26:33 +000060# For the device, static
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080061# =====================================================
62include $(CLEAR_VARS)
63
64
65# we have the common sources, plus some device-specific stuff
66LOCAL_SRC_FILES:= \
67 $(commonSources) \
Michael Lentine60788052015-05-18 13:04:01 -070068 BlobCache.cpp \
Jamie Gennis2ccfe1a2012-02-23 11:28:28 -080069 Looper.cpp \
70 Trace.cpp
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080071
Chris Craik551fcf42012-12-05 10:36:45 -080072ifeq ($(TARGET_ARCH),mips)
73LOCAL_CFLAGS += -DALIGN_DOUBLE
74endif
Mark Salyzyn5bed8032014-04-30 11:10:46 -070075LOCAL_CFLAGS += -Werror
Chris Craik551fcf42012-12-05 10:36:45 -080076
Bjorn Bringert00c14b42013-03-22 14:26:33 +000077LOCAL_STATIC_LIBRARIES := \
Michael Lentine60788052015-05-18 13:04:01 -070078 libcutils \
79 libc
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080080
Bjorn Bringert00c14b42013-03-22 14:26:33 +000081LOCAL_SHARED_LIBRARIES := \
Dan Albert7bc49a12014-05-30 19:40:58 +000082 libbacktrace \
Bjorn Bringert00c14b42013-03-22 14:26:33 +000083 liblog \
84 libdl
85
Evgenii Stepanov6aaf7402015-06-12 13:10:55 -070086LOCAL_MODULE := libutils
Nick Kralevich4d587f22015-08-24 10:51:38 -070087LOCAL_CLANG := true
88LOCAL_SANITIZE := integer
Bjorn Bringert00c14b42013-03-22 14:26:33 +000089include $(BUILD_STATIC_LIBRARY)
90
91# For the device, shared
92# =====================================================
93include $(CLEAR_VARS)
94LOCAL_MODULE:= libutils
95LOCAL_WHOLE_STATIC_LIBRARIES := libutils
96LOCAL_SHARED_LIBRARIES := \
Dan Albert7bc49a12014-05-30 19:40:58 +000097 libbacktrace \
Bjorn Bringert00c14b42013-03-22 14:26:33 +000098 libcutils \
99 libdl \
Mark Salyzyn5bed8032014-04-30 11:10:46 -0700100 liblog
101LOCAL_CFLAGS := -Werror
Christopher Ferris9b0e0742013-10-31 16:25:04 -0700102
Nick Kralevich4d587f22015-08-24 10:51:38 -0700103LOCAL_CLANG := true
104LOCAL_SANITIZE := integer
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800105include $(BUILD_SHARED_LIBRARY)
106
Sergio Girod95e47f2015-08-18 17:36:50 +0100107# Include subdirectory makefiles
108# ============================================================
109
110include $(CLEAR_VARS)
111LOCAL_MODULE := SharedBufferTest
112LOCAL_STATIC_LIBRARIES := libutils libcutils
113LOCAL_SHARED_LIBRARIES := liblog
114LOCAL_SRC_FILES := SharedBufferTest.cpp
115include $(BUILD_NATIVE_TEST)
116
117include $(CLEAR_VARS)
118LOCAL_MODULE := SharedBufferTest
119LOCAL_STATIC_LIBRARIES := libutils libcutils
120LOCAL_SHARED_LIBRARIES := liblog
121LOCAL_SRC_FILES := SharedBufferTest.cpp
122include $(BUILD_HOST_NATIVE_TEST)
Jeff Brown7aba2312010-06-30 16:10:35 -0700123
Elliott Hughesdec12b22015-02-02 17:31:27 -0800124# Build the tests in the tests/ subdirectory.
Jeff Brown7aba2312010-06-30 16:10:35 -0700125include $(call first-makefiles-under,$(LOCAL_PATH))