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