| The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | # 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 |  | 
|  | 15 | LOCAL_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 |  | 
|  | 20 | commonSources:= \ | 
| Jeff Brown | e735f23 | 2011-11-14 18:29:15 -0800 | [diff] [blame] | 21 | BasicHashtable.cpp \ | 
| Jamie Gennis | 1a20993 | 2011-04-28 16:19:45 -0700 | [diff] [blame] | 22 | BlobCache.cpp \ | 
| The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 23 | CallStack.cpp \ | 
| The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 24 | FileMap.cpp \ | 
| Raph Levien | b6ea175 | 2012-10-25 23:11:13 -0700 | [diff] [blame] | 25 | JenkinsHash.cpp \ | 
| Chris Craik | 551fcf4 | 2012-12-05 10:36:45 -0800 | [diff] [blame] | 26 | LinearAllocator.cpp \ | 
| Jason Simmons | b86c8e4 | 2011-06-28 17:43:30 -0700 | [diff] [blame] | 27 | LinearTransform.cpp \ | 
| Jeff Brown | 6454f46 | 2012-08-10 20:44:39 -0700 | [diff] [blame] | 28 | Log.cpp \ | 
| Igor Murashkin | ec79ef2 | 2013-10-24 17:09:15 -0700 | [diff] [blame] | 29 | Printer.cpp \ | 
|  | 30 | ProcessCallStack.cpp \ | 
| Jeff Brown | 04cbbc1 | 2010-11-29 17:37:49 -0800 | [diff] [blame] | 31 | PropertyMap.cpp \ | 
| The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 32 | RefBase.cpp \ | 
| The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 33 | SharedBuffer.cpp \ | 
|  | 34 | Static.cpp \ | 
|  | 35 | StopWatch.cpp \ | 
|  | 36 | String8.cpp \ | 
|  | 37 | String16.cpp \ | 
|  | 38 | SystemClock.cpp \ | 
| The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 39 | Threads.cpp \ | 
| The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 40 | Timers.cpp \ | 
| Jeff Brown | 647925d | 2010-11-10 16:03:06 -0800 | [diff] [blame] | 41 | Tokenizer.cpp \ | 
| Kenny Root | ba0165b | 2010-11-09 14:37:23 -0800 | [diff] [blame] | 42 | Unicode.cpp \ | 
| The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 43 | VectorImpl.cpp \ | 
| Mathias Agopian | 14d978d | 2009-06-05 15:11:23 -0700 | [diff] [blame] | 44 | misc.cpp | 
| The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 45 |  | 
| Mark Salyzyn | 5bed803 | 2014-04-30 11:10:46 -0700 | [diff] [blame] | 46 | host_commonCflags := -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -Werror | 
| The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 47 |  | 
|  | 48 | ifeq ($(HOST_OS),windows) | 
|  | 49 | ifeq ($(strip $(USE_CYGWIN),),) | 
|  | 50 | # Under MinGW, ctype.h doesn't need multi-byte support | 
| Andrew Hsieh | a19d2c7 | 2012-03-13 00:55:34 -0700 | [diff] [blame] | 51 | host_commonCflags += -DMB_CUR_MAX=1 | 
| The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 52 | endif | 
|  | 53 | endif | 
|  | 54 |  | 
| Andrew Hsieh | a19d2c7 | 2012-03-13 00:55:34 -0700 | [diff] [blame] | 55 | host_commonLdlibs := | 
|  | 56 |  | 
| Iliyan Malchev | 26ad345 | 2011-10-19 22:35:56 -0700 | [diff] [blame] | 57 | ifeq ($(TARGET_OS),linux) | 
| Andrew Hsieh | a19d2c7 | 2012-03-13 00:55:34 -0700 | [diff] [blame] | 58 | host_commonLdlibs += -lrt -ldl | 
| Iliyan Malchev | 26ad345 | 2011-10-19 22:35:56 -0700 | [diff] [blame] | 59 | endif | 
|  | 60 |  | 
| Andrew Hsieh | a19d2c7 | 2012-03-13 00:55:34 -0700 | [diff] [blame] | 61 |  | 
|  | 62 | # For the host | 
|  | 63 | # ===================================================== | 
|  | 64 | include $(CLEAR_VARS) | 
|  | 65 | LOCAL_SRC_FILES:= $(commonSources) | 
| Keun young Park | 4e371ce | 2012-03-26 14:44:24 -0700 | [diff] [blame] | 66 | ifeq ($(HOST_OS), linux) | 
|  | 67 | LOCAL_SRC_FILES += Looper.cpp | 
|  | 68 | endif | 
| Andrew Hsieh | a19d2c7 | 2012-03-13 00:55:34 -0700 | [diff] [blame] | 69 | LOCAL_MODULE:= libutils | 
| Colin Cross | 946003a | 2013-07-23 17:39:35 -0700 | [diff] [blame] | 70 | LOCAL_STATIC_LIBRARIES := liblog | 
| Andrew Hsieh | a19d2c7 | 2012-03-13 00:55:34 -0700 | [diff] [blame] | 71 | LOCAL_CFLAGS += $(host_commonCflags) | 
| Ian Rogers | 59ec765 | 2014-06-05 14:32:49 -0700 | [diff] [blame] | 72 | LOCAL_MULTILIB := both | 
| Andrew Hsieh | a19d2c7 | 2012-03-13 00:55:34 -0700 | [diff] [blame] | 73 | include $(BUILD_HOST_STATIC_LIBRARY) | 
|  | 74 |  | 
|  | 75 |  | 
|  | 76 | # For the host, 64-bit | 
|  | 77 | # ===================================================== | 
|  | 78 | include $(CLEAR_VARS) | 
|  | 79 | LOCAL_SRC_FILES:= $(commonSources) | 
| Keun young Park | 4e371ce | 2012-03-26 14:44:24 -0700 | [diff] [blame] | 80 | ifeq ($(HOST_OS), linux) | 
|  | 81 | LOCAL_SRC_FILES += Looper.cpp | 
|  | 82 | endif | 
| Andrew Hsieh | a19d2c7 | 2012-03-13 00:55:34 -0700 | [diff] [blame] | 83 | LOCAL_MODULE:= lib64utils | 
| Colin Cross | 946003a | 2013-07-23 17:39:35 -0700 | [diff] [blame] | 84 | LOCAL_STATIC_LIBRARIES := liblog | 
| Andrew Hsieh | a19d2c7 | 2012-03-13 00:55:34 -0700 | [diff] [blame] | 85 | LOCAL_CFLAGS += $(host_commonCflags) -m64 | 
| The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 86 | include $(BUILD_HOST_STATIC_LIBRARY) | 
|  | 87 |  | 
|  | 88 |  | 
| Bjorn Bringert | 00c14b4 | 2013-03-22 14:26:33 +0000 | [diff] [blame] | 89 | # For the device, static | 
| The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 90 | # ===================================================== | 
|  | 91 | include $(CLEAR_VARS) | 
|  | 92 |  | 
|  | 93 |  | 
|  | 94 | # we have the common sources, plus some device-specific stuff | 
|  | 95 | LOCAL_SRC_FILES:= \ | 
|  | 96 | $(commonSources) \ | 
| Jamie Gennis | 2ccfe1a | 2012-02-23 11:28:28 -0800 | [diff] [blame] | 97 | Looper.cpp \ | 
|  | 98 | Trace.cpp | 
| The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 99 |  | 
| Chris Craik | 551fcf4 | 2012-12-05 10:36:45 -0800 | [diff] [blame] | 100 | ifeq ($(TARGET_ARCH),mips) | 
|  | 101 | LOCAL_CFLAGS += -DALIGN_DOUBLE | 
|  | 102 | endif | 
| Mark Salyzyn | 5bed803 | 2014-04-30 11:10:46 -0700 | [diff] [blame] | 103 | LOCAL_CFLAGS += -Werror | 
| Chris Craik | 551fcf4 | 2012-12-05 10:36:45 -0800 | [diff] [blame] | 104 |  | 
| The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 105 | LOCAL_C_INCLUDES += \ | 
| Colin Cross | 3abdea9 | 2012-03-22 18:46:44 -0700 | [diff] [blame] | 106 | bionic/libc/private \ | 
|  | 107 | external/zlib | 
| Mathias Agopian | 1555436 | 2009-07-12 23:11:20 -0700 | [diff] [blame] | 108 |  | 
| Bjorn Bringert | 00c14b4 | 2013-03-22 14:26:33 +0000 | [diff] [blame] | 109 | LOCAL_STATIC_LIBRARIES := \ | 
| Mathias Agopian | 9eb2a3b | 2013-05-06 20:20:50 -0700 | [diff] [blame] | 110 | libcutils | 
| The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 111 |  | 
| Bjorn Bringert | 00c14b4 | 2013-03-22 14:26:33 +0000 | [diff] [blame] | 112 | LOCAL_SHARED_LIBRARIES := \ | 
| Dan Albert | 7bc49a1 | 2014-05-30 19:40:58 +0000 | [diff] [blame] | 113 | libbacktrace \ | 
| Bjorn Bringert | 00c14b4 | 2013-03-22 14:26:33 +0000 | [diff] [blame] | 114 | liblog \ | 
|  | 115 | libdl | 
|  | 116 |  | 
| Dan Albert | 7bc49a1 | 2014-05-30 19:40:58 +0000 | [diff] [blame] | 117 | include external/stlport/libstlport.mk | 
| Christopher Ferris | 038ac69 | 2013-10-31 16:25:04 -0700 | [diff] [blame] | 118 |  | 
| The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 119 | LOCAL_MODULE:= libutils | 
| Bjorn Bringert | 00c14b4 | 2013-03-22 14:26:33 +0000 | [diff] [blame] | 120 | include $(BUILD_STATIC_LIBRARY) | 
|  | 121 |  | 
|  | 122 | # For the device, shared | 
|  | 123 | # ===================================================== | 
|  | 124 | include $(CLEAR_VARS) | 
|  | 125 | LOCAL_MODULE:= libutils | 
|  | 126 | LOCAL_WHOLE_STATIC_LIBRARIES := libutils | 
|  | 127 | LOCAL_SHARED_LIBRARIES := \ | 
| Dan Albert | 7bc49a1 | 2014-05-30 19:40:58 +0000 | [diff] [blame] | 128 | libbacktrace \ | 
| Bjorn Bringert | 00c14b4 | 2013-03-22 14:26:33 +0000 | [diff] [blame] | 129 | libcutils \ | 
|  | 130 | libdl \ | 
| Mark Salyzyn | 5bed803 | 2014-04-30 11:10:46 -0700 | [diff] [blame] | 131 | liblog | 
|  | 132 | LOCAL_CFLAGS := -Werror | 
| Christopher Ferris | 038ac69 | 2013-10-31 16:25:04 -0700 | [diff] [blame] | 133 |  | 
| Dan Albert | 7bc49a1 | 2014-05-30 19:40:58 +0000 | [diff] [blame] | 134 | include external/stlport/libstlport.mk | 
| Mathias Agopian | 9eb2a3b | 2013-05-06 20:20:50 -0700 | [diff] [blame] | 135 |  | 
| The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 136 | include $(BUILD_SHARED_LIBRARY) | 
|  | 137 |  | 
| Jeff Brown | 7aba231 | 2010-06-30 16:10:35 -0700 | [diff] [blame] | 138 | # 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. | 
|  | 143 | ifeq (,$(ONE_SHOT_MAKEFILE)) | 
|  | 144 | include $(call first-makefiles-under,$(LOCAL_PATH)) | 
| Christopher Tate | c28f214 | 2010-07-26 11:24:18 -0700 | [diff] [blame] | 145 | endif |