The Android Open Source Project | edbf3b6 | 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 | 66fbde3 | 2011-11-14 18:29:15 -0800 | [diff] [blame] | 21 | BasicHashtable.cpp \ |
Jamie Gennis | 58c8dd2 | 2011-04-28 16:19:45 -0700 | [diff] [blame] | 22 | BlobCache.cpp \ |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 23 | BufferedTextOutput.cpp \ |
| 24 | CallStack.cpp \ |
| 25 | Debug.cpp \ |
| 26 | FileMap.cpp \ |
Mathias Agopian | 98e71dd | 2010-02-11 17:30:52 -0800 | [diff] [blame] | 27 | Flattenable.cpp \ |
Raph Levien | 8185e47 | 2012-10-25 23:11:13 -0700 | [diff] [blame^] | 28 | JenkinsHash.cpp \ |
Jason Simmons | c18d4da | 2011-06-28 17:43:30 -0700 | [diff] [blame] | 29 | LinearTransform.cpp \ |
Jeff Brown | 6f12d57 | 2012-08-10 20:44:39 -0700 | [diff] [blame] | 30 | Log.cpp \ |
Jeff Brown | 6688837 | 2010-11-29 17:37:49 -0800 | [diff] [blame] | 31 | PropertyMap.cpp \ |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 32 | RefBase.cpp \ |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 33 | SharedBuffer.cpp \ |
| 34 | Static.cpp \ |
| 35 | StopWatch.cpp \ |
| 36 | String8.cpp \ |
| 37 | String16.cpp \ |
Mathias Agopian | 861aa2f | 2009-06-05 01:26:23 -0700 | [diff] [blame] | 38 | StringArray.cpp \ |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 39 | SystemClock.cpp \ |
| 40 | TextOutput.cpp \ |
| 41 | Threads.cpp \ |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 42 | Timers.cpp \ |
Jeff Brown | a3477c8 | 2010-11-10 16:03:06 -0800 | [diff] [blame] | 43 | Tokenizer.cpp \ |
Kenny Root | c412dcb | 2010-11-09 14:37:23 -0800 | [diff] [blame] | 44 | Unicode.cpp \ |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 45 | VectorImpl.cpp \ |
Jeff Brown | 0818b09 | 2012-03-16 22:18:39 -0700 | [diff] [blame] | 46 | WorkQueue.cpp \ |
Colin Cross | 163d5a9 | 2012-03-22 18:46:44 -0700 | [diff] [blame] | 47 | ZipFileCRO.cpp \ |
| 48 | ZipFileRO.cpp \ |
| 49 | ZipUtils.cpp \ |
Mathias Agopian | 4fcd9c7 | 2009-06-05 15:11:23 -0700 | [diff] [blame] | 50 | misc.cpp |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 51 | |
Andrew Hsieh | 93f283d | 2012-03-13 00:55:34 -0700 | [diff] [blame] | 52 | host_commonCflags := -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 53 | |
| 54 | ifeq ($(HOST_OS),windows) |
| 55 | ifeq ($(strip $(USE_CYGWIN),),) |
| 56 | # Under MinGW, ctype.h doesn't need multi-byte support |
Andrew Hsieh | 93f283d | 2012-03-13 00:55:34 -0700 | [diff] [blame] | 57 | host_commonCflags += -DMB_CUR_MAX=1 |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 58 | endif |
| 59 | endif |
| 60 | |
Andrew Hsieh | 93f283d | 2012-03-13 00:55:34 -0700 | [diff] [blame] | 61 | host_commonLdlibs := |
| 62 | |
Iliyan Malchev | b5fe317 | 2011-10-19 22:35:56 -0700 | [diff] [blame] | 63 | ifeq ($(TARGET_OS),linux) |
Andrew Hsieh | 93f283d | 2012-03-13 00:55:34 -0700 | [diff] [blame] | 64 | host_commonLdlibs += -lrt -ldl |
Iliyan Malchev | b5fe317 | 2011-10-19 22:35:56 -0700 | [diff] [blame] | 65 | endif |
| 66 | |
Andrew Hsieh | 93f283d | 2012-03-13 00:55:34 -0700 | [diff] [blame] | 67 | |
| 68 | # For the host |
| 69 | # ===================================================== |
| 70 | include $(CLEAR_VARS) |
| 71 | LOCAL_SRC_FILES:= $(commonSources) |
Keun young Park | b7beba4 | 2012-03-26 14:44:24 -0700 | [diff] [blame] | 72 | ifeq ($(HOST_OS), linux) |
| 73 | LOCAL_SRC_FILES += Looper.cpp |
| 74 | endif |
Andrew Hsieh | 93f283d | 2012-03-13 00:55:34 -0700 | [diff] [blame] | 75 | LOCAL_MODULE:= libutils |
Colin Cross | 1c6cd38 | 2012-03-23 10:14:56 -0700 | [diff] [blame] | 76 | LOCAL_STATIC_LIBRARIES := libz |
| 77 | LOCAL_C_INCLUDES := \ |
| 78 | external/zlib |
Andrew Hsieh | 93f283d | 2012-03-13 00:55:34 -0700 | [diff] [blame] | 79 | LOCAL_CFLAGS += $(host_commonCflags) |
| 80 | LOCAL_LDLIBS += $(host_commonLdlibs) |
| 81 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 82 | |
| 83 | |
| 84 | # For the host, 64-bit |
| 85 | # ===================================================== |
| 86 | include $(CLEAR_VARS) |
| 87 | LOCAL_SRC_FILES:= $(commonSources) |
Keun young Park | b7beba4 | 2012-03-26 14:44:24 -0700 | [diff] [blame] | 88 | ifeq ($(HOST_OS), linux) |
| 89 | LOCAL_SRC_FILES += Looper.cpp |
| 90 | endif |
Andrew Hsieh | 93f283d | 2012-03-13 00:55:34 -0700 | [diff] [blame] | 91 | LOCAL_MODULE:= lib64utils |
Colin Cross | 1c6cd38 | 2012-03-23 10:14:56 -0700 | [diff] [blame] | 92 | LOCAL_STATIC_LIBRARIES := libz |
| 93 | LOCAL_C_INCLUDES := \ |
| 94 | external/zlib |
Andrew Hsieh | 93f283d | 2012-03-13 00:55:34 -0700 | [diff] [blame] | 95 | LOCAL_CFLAGS += $(host_commonCflags) -m64 |
| 96 | LOCAL_LDLIBS += $(host_commonLdlibs) |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 97 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 98 | |
| 99 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 100 | # For the device |
| 101 | # ===================================================== |
| 102 | include $(CLEAR_VARS) |
| 103 | |
| 104 | |
| 105 | # we have the common sources, plus some device-specific stuff |
| 106 | LOCAL_SRC_FILES:= \ |
| 107 | $(commonSources) \ |
Jamie Gennis | f64b1ca | 2012-02-23 11:28:28 -0800 | [diff] [blame] | 108 | Looper.cpp \ |
| 109 | Trace.cpp |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 110 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 111 | ifeq ($(TARGET_OS),linux) |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 112 | LOCAL_LDLIBS += -lrt -ldl |
| 113 | endif |
| 114 | |
| 115 | LOCAL_C_INCLUDES += \ |
Colin Cross | 163d5a9 | 2012-03-22 18:46:44 -0700 | [diff] [blame] | 116 | bionic/libc/private \ |
| 117 | external/zlib |
Mathias Agopian | ec0f1f6 | 2009-07-12 23:11:20 -0700 | [diff] [blame] | 118 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 119 | LOCAL_LDLIBS += -lpthread |
| 120 | |
| 121 | LOCAL_SHARED_LIBRARIES := \ |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 122 | liblog \ |
Mathias Agopian | 55b81b1 | 2011-09-28 17:33:11 -0700 | [diff] [blame] | 123 | libcutils \ |
Jeff Brown | e27d62b | 2011-10-19 20:32:43 -0700 | [diff] [blame] | 124 | libdl \ |
Colin Cross | 163d5a9 | 2012-03-22 18:46:44 -0700 | [diff] [blame] | 125 | libcorkscrew \ |
| 126 | libz |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 127 | |
| 128 | LOCAL_MODULE:= libutils |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 129 | include $(BUILD_SHARED_LIBRARY) |
| 130 | |
Jeff Brown | 8575a87 | 2010-06-30 16:10:35 -0700 | [diff] [blame] | 131 | # Include subdirectory makefiles |
| 132 | # ============================================================ |
| 133 | |
| 134 | # If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework |
| 135 | # team really wants is to build the stuff defined by this makefile. |
| 136 | ifeq (,$(ONE_SHOT_MAKEFILE)) |
| 137 | include $(call first-makefiles-under,$(LOCAL_PATH)) |
Christopher Tate | a45a800 | 2010-07-26 11:24:18 -0700 | [diff] [blame] | 138 | endif |