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 | |
The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 17 | commonSources:= \ |
Jeff Brown | e735f23 | 2011-11-14 18:29:15 -0800 | [diff] [blame] | 18 | BasicHashtable.cpp \ |
Jamie Gennis | 1a20993 | 2011-04-28 16:19:45 -0700 | [diff] [blame] | 19 | BlobCache.cpp \ |
The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 20 | CallStack.cpp \ |
The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 21 | FileMap.cpp \ |
Raph Levien | b6ea175 | 2012-10-25 23:11:13 -0700 | [diff] [blame] | 22 | JenkinsHash.cpp \ |
Chris Craik | 551fcf4 | 2012-12-05 10:36:45 -0800 | [diff] [blame] | 23 | LinearAllocator.cpp \ |
Jason Simmons | b86c8e4 | 2011-06-28 17:43:30 -0700 | [diff] [blame] | 24 | LinearTransform.cpp \ |
Jeff Brown | 6454f46 | 2012-08-10 20:44:39 -0700 | [diff] [blame] | 25 | Log.cpp \ |
Jesse Hall | 29cc9ce | 2014-03-03 10:52:14 -0800 | [diff] [blame] | 26 | NativeHandle.cpp \ |
Igor Murashkin | ec79ef2 | 2013-10-24 17:09:15 -0700 | [diff] [blame] | 27 | Printer.cpp \ |
| 28 | ProcessCallStack.cpp \ |
Jeff Brown | 04cbbc1 | 2010-11-29 17:37:49 -0800 | [diff] [blame] | 29 | PropertyMap.cpp \ |
The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 30 | RefBase.cpp \ |
The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 31 | SharedBuffer.cpp \ |
| 32 | Static.cpp \ |
| 33 | StopWatch.cpp \ |
| 34 | String8.cpp \ |
| 35 | String16.cpp \ |
| 36 | SystemClock.cpp \ |
The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 37 | Threads.cpp \ |
The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 38 | Timers.cpp \ |
Jeff Brown | 647925d | 2010-11-10 16:03:06 -0800 | [diff] [blame] | 39 | Tokenizer.cpp \ |
Kenny Root | ba0165b | 2010-11-09 14:37:23 -0800 | [diff] [blame] | 40 | Unicode.cpp \ |
The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 41 | VectorImpl.cpp \ |
Elliott Hughes | dec12b2 | 2015-02-02 17:31:27 -0800 | [diff] [blame] | 42 | file.cpp \ |
| 43 | misc.cpp \ |
Elliott Hughes | 6b3be29 | 2015-02-03 14:23:53 -0800 | [diff] [blame] | 44 | stringprintf.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 | # For the host |
| 56 | # ===================================================== |
| 57 | include $(CLEAR_VARS) |
| 58 | LOCAL_SRC_FILES:= $(commonSources) |
Keun young Park | 4e371ce | 2012-03-26 14:44:24 -0700 | [diff] [blame] | 59 | ifeq ($(HOST_OS), linux) |
| 60 | LOCAL_SRC_FILES += Looper.cpp |
| 61 | endif |
Tim Murray | b37009f | 2014-07-24 17:22:09 -0700 | [diff] [blame] | 62 | ifeq ($(HOST_OS),darwin) |
| 63 | LOCAL_CFLAGS += -Wno-unused-parameter |
| 64 | endif |
Andrew Hsieh | a19d2c7 | 2012-03-13 00:55:34 -0700 | [diff] [blame] | 65 | LOCAL_MODULE:= libutils |
Colin Cross | 946003a | 2013-07-23 17:39:35 -0700 | [diff] [blame] | 66 | LOCAL_STATIC_LIBRARIES := liblog |
Andrew Hsieh | a19d2c7 | 2012-03-13 00:55:34 -0700 | [diff] [blame] | 67 | LOCAL_CFLAGS += $(host_commonCflags) |
Ian Rogers | 59ec765 | 2014-06-05 14:32:49 -0700 | [diff] [blame] | 68 | LOCAL_MULTILIB := both |
Andrew Hsieh | a19d2c7 | 2012-03-13 00:55:34 -0700 | [diff] [blame] | 69 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 70 | |
| 71 | |
Bjorn Bringert | 00c14b4 | 2013-03-22 14:26:33 +0000 | [diff] [blame] | 72 | # For the device, static |
The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 73 | # ===================================================== |
| 74 | include $(CLEAR_VARS) |
| 75 | |
| 76 | |
| 77 | # we have the common sources, plus some device-specific stuff |
| 78 | LOCAL_SRC_FILES:= \ |
| 79 | $(commonSources) \ |
Jamie Gennis | 2ccfe1a | 2012-02-23 11:28:28 -0800 | [diff] [blame] | 80 | Looper.cpp \ |
| 81 | Trace.cpp |
The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 82 | |
Chris Craik | 551fcf4 | 2012-12-05 10:36:45 -0800 | [diff] [blame] | 83 | ifeq ($(TARGET_ARCH),mips) |
| 84 | LOCAL_CFLAGS += -DALIGN_DOUBLE |
| 85 | endif |
Mark Salyzyn | 5bed803 | 2014-04-30 11:10:46 -0700 | [diff] [blame] | 86 | LOCAL_CFLAGS += -Werror |
Chris Craik | 551fcf4 | 2012-12-05 10:36:45 -0800 | [diff] [blame] | 87 | |
Bjorn Bringert | 00c14b4 | 2013-03-22 14:26:33 +0000 | [diff] [blame] | 88 | LOCAL_STATIC_LIBRARIES := \ |
Mathias Agopian | 9eb2a3b | 2013-05-06 20:20:50 -0700 | [diff] [blame] | 89 | libcutils |
The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 90 | |
Bjorn Bringert | 00c14b4 | 2013-03-22 14:26:33 +0000 | [diff] [blame] | 91 | LOCAL_SHARED_LIBRARIES := \ |
Dan Albert | 7bc49a1 | 2014-05-30 19:40:58 +0000 | [diff] [blame] | 92 | libbacktrace \ |
Bjorn Bringert | 00c14b4 | 2013-03-22 14:26:33 +0000 | [diff] [blame] | 93 | liblog \ |
| 94 | libdl |
| 95 | |
The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 96 | LOCAL_MODULE:= libutils |
Bjorn Bringert | 00c14b4 | 2013-03-22 14:26:33 +0000 | [diff] [blame] | 97 | include $(BUILD_STATIC_LIBRARY) |
| 98 | |
| 99 | # For the device, shared |
| 100 | # ===================================================== |
| 101 | include $(CLEAR_VARS) |
| 102 | LOCAL_MODULE:= libutils |
| 103 | LOCAL_WHOLE_STATIC_LIBRARIES := libutils |
| 104 | LOCAL_SHARED_LIBRARIES := \ |
Dan Albert | 7bc49a1 | 2014-05-30 19:40:58 +0000 | [diff] [blame] | 105 | libbacktrace \ |
Bjorn Bringert | 00c14b4 | 2013-03-22 14:26:33 +0000 | [diff] [blame] | 106 | libcutils \ |
| 107 | libdl \ |
Mark Salyzyn | 5bed803 | 2014-04-30 11:10:46 -0700 | [diff] [blame] | 108 | liblog |
| 109 | LOCAL_CFLAGS := -Werror |
Christopher Ferris | 9b0e074 | 2013-10-31 16:25:04 -0700 | [diff] [blame] | 110 | |
The Android Open Source Project | cbb1011 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 111 | include $(BUILD_SHARED_LIBRARY) |
| 112 | |
Jeff Brown | 7aba231 | 2010-06-30 16:10:35 -0700 | [diff] [blame] | 113 | |
Elliott Hughes | dec12b2 | 2015-02-02 17:31:27 -0800 | [diff] [blame] | 114 | # Build the tests in the tests/ subdirectory. |
Jeff Brown | 7aba231 | 2010-06-30 16:10:35 -0700 | [diff] [blame] | 115 | include $(call first-makefiles-under,$(LOCAL_PATH)) |