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:= \ |
| 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 | 861aa2f | 2009-06-05 01:26:23 -0700 | [diff] [blame] | 35 | StringArray.cpp \ |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 36 | SystemClock.cpp \ |
| 37 | TextOutput.cpp \ |
| 38 | Threads.cpp \ |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 39 | Timers.cpp \ |
| 40 | VectorImpl.cpp \ |
| 41 | ZipFileCRO.cpp \ |
| 42 | ZipFileRO.cpp \ |
| 43 | ZipUtils.cpp \ |
| 44 | misc.cpp \ |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 45 | LogSocket.cpp |
| 46 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 47 | |
| 48 | # For the host |
| 49 | # ===================================================== |
| 50 | |
| 51 | include $(CLEAR_VARS) |
| 52 | |
Mathias Agopian | 7e83f04 | 2009-06-05 14:56:35 -0700 | [diff] [blame^] | 53 | LOCAL_SRC_FILES:= $(commonSources) |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 54 | |
| 55 | ifeq ($(HOST_OS),linux) |
| 56 | # Use the futex based mutex and condition variable |
| 57 | # implementation from android-arm because it's shared mem safe |
| 58 | LOCAL_SRC_FILES += \ |
Andy McFadden | da41641 | 2009-05-27 16:01:39 -0700 | [diff] [blame] | 59 | futex_synchro.c |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 60 | endif |
| 61 | |
| 62 | LOCAL_MODULE:= libutils |
| 63 | |
| 64 | LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) |
| 65 | LOCAL_C_INCLUDES += external/zlib |
| 66 | |
| 67 | ifeq ($(HOST_OS),windows) |
| 68 | ifeq ($(strip $(USE_CYGWIN),),) |
| 69 | # Under MinGW, ctype.h doesn't need multi-byte support |
| 70 | LOCAL_CFLAGS += -DMB_CUR_MAX=1 |
| 71 | endif |
| 72 | endif |
| 73 | |
| 74 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 75 | |
| 76 | |
| 77 | |
| 78 | # For the device |
| 79 | # ===================================================== |
| 80 | include $(CLEAR_VARS) |
| 81 | |
| 82 | |
| 83 | # we have the common sources, plus some device-specific stuff |
| 84 | LOCAL_SRC_FILES:= \ |
| 85 | $(commonSources) \ |
Joe Onorato | 0c4863b | 2009-05-05 11:50:51 -0700 | [diff] [blame] | 86 | Unicode.cpp \ |
Mathias Agopian | f446ba9 | 2009-06-04 13:53:57 -0700 | [diff] [blame] | 87 | BackupData.cpp \ |
| 88 | BackupHelpers.cpp |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 89 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 90 | ifeq ($(TARGET_OS),linux) |
| 91 | # Use the futex based mutex and condition variable |
| 92 | # implementation from android-arm because it's shared mem safe |
| 93 | LOCAL_SRC_FILES += futex_synchro.c |
| 94 | LOCAL_LDLIBS += -lrt -ldl |
| 95 | endif |
| 96 | |
| 97 | LOCAL_C_INCLUDES += \ |
| 98 | external/zlib \ |
| 99 | external/icu4c/common |
| 100 | LOCAL_LDLIBS += -lpthread |
| 101 | |
| 102 | LOCAL_SHARED_LIBRARIES := \ |
| 103 | libz \ |
| 104 | liblog \ |
| 105 | libcutils |
| 106 | |
| 107 | ifneq ($(TARGET_SIMULATOR),true) |
| 108 | ifeq ($(TARGET_OS)-$(TARGET_ARCH),linux-x86) |
| 109 | # This is needed on x86 to bring in dl_iterate_phdr for CallStack.cpp |
| 110 | LOCAL_SHARED_LIBRARIES += \ |
| 111 | libdl |
| 112 | endif # linux-x86 |
| 113 | endif # sim |
| 114 | |
| 115 | LOCAL_MODULE:= libutils |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 116 | include $(BUILD_SHARED_LIBRARY) |
| 117 | |