blob: 631b5a3b42fd9c00331dd2f999b0050b0d4ccd4d [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:= \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080018 CallStack.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080019 FileMap.cpp \
Raph Levienb6ea1752012-10-25 23:11:13 -070020 JenkinsHash.cpp \
Jason Simmonsb86c8e42011-06-28 17:43:30 -070021 LinearTransform.cpp \
Jeff Brown6454f462012-08-10 20:44:39 -070022 Log.cpp \
Jesse Hall29cc9ce2014-03-03 10:52:14 -080023 NativeHandle.cpp \
Igor Murashkinec79ef22013-10-24 17:09:15 -070024 Printer.cpp \
25 ProcessCallStack.cpp \
Jeff Brown04cbbc12010-11-29 17:37:49 -080026 PropertyMap.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080027 RefBase.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080028 SharedBuffer.cpp \
29 Static.cpp \
30 StopWatch.cpp \
31 String8.cpp \
32 String16.cpp \
33 SystemClock.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080034 Threads.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080035 Timers.cpp \
Jeff Brown647925d2010-11-10 16:03:06 -080036 Tokenizer.cpp \
Kenny Rootba0165b2010-11-09 14:37:23 -080037 Unicode.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080038 VectorImpl.cpp \
Elliott Hughesdec12b22015-02-02 17:31:27 -080039 misc.cpp \
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080040
Mark Salyzyn5bed8032014-04-30 11:10:46 -070041host_commonCflags := -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -Werror
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080042
Andrew Hsieha19d2c72012-03-13 00:55:34 -070043# For the host
44# =====================================================
45include $(CLEAR_VARS)
46LOCAL_SRC_FILES:= $(commonSources)
Dan Willemsen87a419c2015-08-13 14:43:34 -070047LOCAL_SRC_FILES_linux := Looper.cpp
48LOCAL_CFLAGS_darwin := -Wno-unused-parameter
Andrew Hsieha19d2c72012-03-13 00:55:34 -070049LOCAL_MODULE:= libutils
Colin Cross946003a2013-07-23 17:39:35 -070050LOCAL_STATIC_LIBRARIES := liblog
Andrew Hsieha19d2c72012-03-13 00:55:34 -070051LOCAL_CFLAGS += $(host_commonCflags)
Dan Willemsen87a419c2015-08-13 14:43:34 -070052# Under MinGW, ctype.h doesn't need multi-byte support
53LOCAL_CFLAGS_windows := -DMB_CUR_MAX=1
Ian Rogers59ec7652014-06-05 14:32:49 -070054LOCAL_MULTILIB := both
Dan Willemsen87a419c2015-08-13 14:43:34 -070055LOCAL_MODULE_HOST_OS := darwin linux windows
Narayan Kamathc609c312015-08-28 12:59:48 +010056LOCAL_C_INCLUDES += external/safe-iop/include
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
Narayan Kamathc609c312015-08-28 12:59:48 +010089LOCAL_C_INCLUDES += external/safe-iop/include
Bjorn Bringert00c14b42013-03-22 14:26:33 +000090include $(BUILD_STATIC_LIBRARY)
91
92# For the device, shared
93# =====================================================
94include $(CLEAR_VARS)
95LOCAL_MODULE:= libutils
96LOCAL_WHOLE_STATIC_LIBRARIES := libutils
97LOCAL_SHARED_LIBRARIES := \
Dan Albert7bc49a12014-05-30 19:40:58 +000098 libbacktrace \
Bjorn Bringert00c14b42013-03-22 14:26:33 +000099 libcutils \
100 libdl \
Mark Salyzyn5bed8032014-04-30 11:10:46 -0700101 liblog
102LOCAL_CFLAGS := -Werror
Narayan Kamathc609c312015-08-28 12:59:48 +0100103LOCAL_C_INCLUDES += external/safe-iop/include
Christopher Ferris9b0e0742013-10-31 16:25:04 -0700104
Nick Kralevich4d587f22015-08-24 10:51:38 -0700105LOCAL_CLANG := true
106LOCAL_SANITIZE := integer
The Android Open Source Projectcbb10112009-03-03 19:31:44 -0800107include $(BUILD_SHARED_LIBRARY)
108
Sergio Girod95e47f2015-08-18 17:36:50 +0100109# Include subdirectory makefiles
110# ============================================================
111
112include $(CLEAR_VARS)
113LOCAL_MODULE := SharedBufferTest
114LOCAL_STATIC_LIBRARIES := libutils libcutils
115LOCAL_SHARED_LIBRARIES := liblog
116LOCAL_SRC_FILES := SharedBufferTest.cpp
117include $(BUILD_NATIVE_TEST)
118
119include $(CLEAR_VARS)
120LOCAL_MODULE := SharedBufferTest
121LOCAL_STATIC_LIBRARIES := libutils libcutils
122LOCAL_SHARED_LIBRARIES := liblog
123LOCAL_SRC_FILES := SharedBufferTest.cpp
124include $(BUILD_HOST_NATIVE_TEST)
Jeff Brown7aba2312010-06-30 16:10:35 -0700125
Elliott Hughesdec12b22015-02-02 17:31:27 -0800126# Build the tests in the tests/ subdirectory.
Jeff Brown7aba2312010-06-30 16:10:35 -0700127include $(call first-makefiles-under,$(LOCAL_PATH))