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 \ |
| 28 | RefBase.cpp \ |
| 29 | ResourceTypes.cpp \ |
| 30 | SharedBuffer.cpp \ |
| 31 | Static.cpp \ |
| 32 | StopWatch.cpp \ |
| 33 | String8.cpp \ |
| 34 | String16.cpp \ |
Mathias Agopian | 8ed6beb | 2009-06-05 01:26:23 -0700 | [diff] [blame] | 35 | StringArray.cpp \ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 36 | SystemClock.cpp \ |
| 37 | TextOutput.cpp \ |
| 38 | Threads.cpp \ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 39 | Timers.cpp \ |
| 40 | VectorImpl.cpp \ |
| 41 | ZipFileCRO.cpp \ |
| 42 | ZipFileRO.cpp \ |
| 43 | ZipUtils.cpp \ |
Mathias Agopian | e583a4e | 2009-06-05 15:11:23 -0700 | [diff] [blame] | 44 | misc.cpp |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 45 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 46 | |
| 47 | # For the host |
| 48 | # ===================================================== |
| 49 | |
| 50 | include $(CLEAR_VARS) |
| 51 | |
Mathias Agopian | 55e3d60 | 2009-06-05 14:56:35 -0700 | [diff] [blame] | 52 | LOCAL_SRC_FILES:= $(commonSources) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 53 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 54 | LOCAL_MODULE:= libutils |
| 55 | |
| 56 | LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) |
| 57 | LOCAL_C_INCLUDES += external/zlib |
| 58 | |
| 59 | ifeq ($(HOST_OS),windows) |
| 60 | ifeq ($(strip $(USE_CYGWIN),),) |
| 61 | # Under MinGW, ctype.h doesn't need multi-byte support |
| 62 | LOCAL_CFLAGS += -DMB_CUR_MAX=1 |
| 63 | endif |
| 64 | endif |
| 65 | |
| 66 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 67 | |
| 68 | |
| 69 | |
| 70 | # For the device |
| 71 | # ===================================================== |
| 72 | include $(CLEAR_VARS) |
| 73 | |
| 74 | |
| 75 | # we have the common sources, plus some device-specific stuff |
| 76 | LOCAL_SRC_FILES:= \ |
| 77 | $(commonSources) \ |
Joe Onorato | 3ad977b | 2009-05-05 11:50:51 -0700 | [diff] [blame] | 78 | Unicode.cpp \ |
Mathias Agopian | 8ae2335 | 2009-06-04 13:53:57 -0700 | [diff] [blame] | 79 | BackupData.cpp \ |
| 80 | BackupHelpers.cpp |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 81 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 82 | ifeq ($(TARGET_OS),linux) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 83 | LOCAL_LDLIBS += -lrt -ldl |
| 84 | endif |
| 85 | |
| 86 | LOCAL_C_INCLUDES += \ |
| 87 | external/zlib \ |
| 88 | external/icu4c/common |
Mathias Agopian | b1c4ca5 | 2009-07-12 23:11:20 -0700 | [diff] [blame] | 89 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 90 | LOCAL_LDLIBS += -lpthread |
| 91 | |
| 92 | LOCAL_SHARED_LIBRARIES := \ |
| 93 | libz \ |
| 94 | liblog \ |
| 95 | libcutils |
| 96 | |
| 97 | ifneq ($(TARGET_SIMULATOR),true) |
| 98 | ifeq ($(TARGET_OS)-$(TARGET_ARCH),linux-x86) |
| 99 | # 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] | 100 | LOCAL_SHARED_LIBRARIES += libdl |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 101 | endif # linux-x86 |
| 102 | endif # sim |
| 103 | |
| 104 | LOCAL_MODULE:= libutils |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 105 | include $(BUILD_SHARED_LIBRARY) |
| 106 | |