The Android Open Source Project | 9066cfe | 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:= \ |
| 21 | Asset.cpp \ |
| 22 | AssetDir.cpp \ |
| 23 | AssetManager.cpp \ |
| 24 | BufferedTextOutput.cpp \ |
| 25 | CallStack.cpp \ |
| 26 | Debug.cpp \ |
| 27 | FileMap.cpp \ |
Mathias Agopian | c86727f | 2010-02-11 17:30:52 -0800 | [diff] [blame] | 28 | Flattenable.cpp \ |
Kenny Root | 7cee34a | 2010-06-01 10:34:29 -0700 | [diff] [blame] | 29 | ObbFile.cpp \ |
Jeff Brown | 46b9ac0 | 2010-04-22 18:58:52 -0700 | [diff] [blame] | 30 | Pool.cpp \ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 31 | RefBase.cpp \ |
| 32 | ResourceTypes.cpp \ |
| 33 | SharedBuffer.cpp \ |
| 34 | Static.cpp \ |
| 35 | StopWatch.cpp \ |
Christopher Tate | b100cbf | 2010-07-26 11:24:18 -0700 | [diff] [blame] | 36 | StreamingZipInflater.cpp \ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 37 | String8.cpp \ |
| 38 | String16.cpp \ |
Mathias Agopian | 8ed6beb | 2009-06-05 01:26:23 -0700 | [diff] [blame] | 39 | StringArray.cpp \ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 40 | SystemClock.cpp \ |
| 41 | TextOutput.cpp \ |
| 42 | Threads.cpp \ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 43 | Timers.cpp \ |
| 44 | VectorImpl.cpp \ |
Jeff Brown | d890cbf | 2010-06-13 20:21:19 -0700 | [diff] [blame] | 45 | ZipFileCRO.cpp \ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 46 | ZipFileRO.cpp \ |
| 47 | ZipUtils.cpp \ |
Mathias Agopian | e583a4e | 2009-06-05 15:11:23 -0700 | [diff] [blame] | 48 | misc.cpp |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 49 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 50 | |
| 51 | # For the host |
| 52 | # ===================================================== |
| 53 | |
| 54 | include $(CLEAR_VARS) |
| 55 | |
Mathias Agopian | 55e3d60 | 2009-06-05 14:56:35 -0700 | [diff] [blame] | 56 | LOCAL_SRC_FILES:= $(commonSources) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 57 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 58 | LOCAL_MODULE:= libutils |
| 59 | |
| 60 | LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) |
| 61 | LOCAL_C_INCLUDES += external/zlib |
| 62 | |
| 63 | ifeq ($(HOST_OS),windows) |
| 64 | ifeq ($(strip $(USE_CYGWIN),),) |
| 65 | # Under MinGW, ctype.h doesn't need multi-byte support |
| 66 | LOCAL_CFLAGS += -DMB_CUR_MAX=1 |
| 67 | endif |
| 68 | endif |
| 69 | |
Kenny Root | 7cee34a | 2010-06-01 10:34:29 -0700 | [diff] [blame] | 70 | ifeq ($(HOST_OS),darwin) |
| 71 | # MacOS doesn't have lseek64. However, off_t is 64-bit anyway. |
| 72 | LOCAL_CFLAGS += -DOFF_T_IS_64_BIT |
| 73 | endif |
| 74 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 75 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 76 | |
| 77 | |
| 78 | |
| 79 | # For the device |
| 80 | # ===================================================== |
| 81 | include $(CLEAR_VARS) |
| 82 | |
| 83 | |
| 84 | # we have the common sources, plus some device-specific stuff |
| 85 | LOCAL_SRC_FILES:= \ |
| 86 | $(commonSources) \ |
Jeff Brown | d890cbf | 2010-06-13 20:21:19 -0700 | [diff] [blame] | 87 | BackupData.cpp \ |
| 88 | BackupHelpers.cpp \ |
| 89 | PollLoop.cpp |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 90 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 91 | ifeq ($(TARGET_OS),linux) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 92 | LOCAL_LDLIBS += -lrt -ldl |
| 93 | endif |
| 94 | |
| 95 | LOCAL_C_INCLUDES += \ |
| 96 | external/zlib \ |
| 97 | external/icu4c/common |
Mathias Agopian | b1c4ca5 | 2009-07-12 23:11:20 -0700 | [diff] [blame] | 98 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 99 | LOCAL_LDLIBS += -lpthread |
| 100 | |
| 101 | LOCAL_SHARED_LIBRARIES := \ |
| 102 | libz \ |
| 103 | liblog \ |
| 104 | libcutils |
| 105 | |
| 106 | ifneq ($(TARGET_SIMULATOR),true) |
| 107 | ifeq ($(TARGET_OS)-$(TARGET_ARCH),linux-x86) |
| 108 | # This is needed on x86 to bring in dl_iterate_phdr for CallStack.cpp |
Mathias Agopian | b1c4ca5 | 2009-07-12 23:11:20 -0700 | [diff] [blame] | 109 | LOCAL_SHARED_LIBRARIES += libdl |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 110 | endif # linux-x86 |
| 111 | endif # sim |
| 112 | |
| 113 | LOCAL_MODULE:= libutils |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 114 | include $(BUILD_SHARED_LIBRARY) |
| 115 | |
Dan Egnor | 08b3d2e | 2010-05-06 00:55:09 -0700 | [diff] [blame] | 116 | ifneq ($(TARGET_SIMULATOR),true) |
| 117 | ifeq ($(TARGET_OS),linux) |
| 118 | include $(CLEAR_VARS) |
| 119 | LOCAL_C_INCLUDES += external/zlib external/icu4c/common |
| 120 | LOCAL_LDLIBS := -lrt -ldl -lpthread |
| 121 | LOCAL_MODULE := libutils |
| 122 | LOCAL_SRC_FILES := $(commonSources) BackupData.cpp BackupHelpers.cpp |
| 123 | include $(BUILD_STATIC_LIBRARY) |
| 124 | endif |
| 125 | endif |
Jeff Brown | fd03582 | 2010-06-30 16:10:35 -0700 | [diff] [blame] | 126 | |
| 127 | |
| 128 | # Include subdirectory makefiles |
| 129 | # ============================================================ |
| 130 | |
| 131 | # If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework |
| 132 | # team really wants is to build the stuff defined by this makefile. |
| 133 | ifeq (,$(ONE_SHOT_MAKEFILE)) |
| 134 | include $(call first-makefiles-under,$(LOCAL_PATH)) |
Christopher Tate | b100cbf | 2010-07-26 11:24:18 -0700 | [diff] [blame] | 135 | endif |