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 \ |
Mathias Agopian | 98e71dd | 2010-02-11 17:30:52 -0800 | [diff] [blame] | 28 | Flattenable.cpp \ |
Kenny Root | b94a9a6 | 2010-06-01 10:34:29 -0700 | [diff] [blame^] | 29 | ObbFile.cpp \ |
Jeff Brown | e839a58 | 2010-04-22 18:58:52 -0700 | [diff] [blame] | 30 | Pool.cpp \ |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 31 | RefBase.cpp \ |
| 32 | ResourceTypes.cpp \ |
| 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 \ |
| 43 | VectorImpl.cpp \ |
Jeff Brown | beb2359 | 2010-06-13 20:21:19 -0700 | [diff] [blame] | 44 | ZipFileCRO.cpp \ |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 45 | ZipFileRO.cpp \ |
| 46 | ZipUtils.cpp \ |
Mathias Agopian | 4fcd9c7 | 2009-06-05 15:11:23 -0700 | [diff] [blame] | 47 | misc.cpp |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 48 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 49 | |
| 50 | # For the host |
| 51 | # ===================================================== |
| 52 | |
| 53 | include $(CLEAR_VARS) |
| 54 | |
Mathias Agopian | 7e83f04 | 2009-06-05 14:56:35 -0700 | [diff] [blame] | 55 | LOCAL_SRC_FILES:= $(commonSources) |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 56 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 57 | LOCAL_MODULE:= libutils |
| 58 | |
| 59 | LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) |
| 60 | LOCAL_C_INCLUDES += external/zlib |
| 61 | |
| 62 | ifeq ($(HOST_OS),windows) |
| 63 | ifeq ($(strip $(USE_CYGWIN),),) |
| 64 | # Under MinGW, ctype.h doesn't need multi-byte support |
| 65 | LOCAL_CFLAGS += -DMB_CUR_MAX=1 |
| 66 | endif |
| 67 | endif |
| 68 | |
Kenny Root | b94a9a6 | 2010-06-01 10:34:29 -0700 | [diff] [blame^] | 69 | ifeq ($(HOST_OS),darwin) |
| 70 | # MacOS doesn't have lseek64. However, off_t is 64-bit anyway. |
| 71 | LOCAL_CFLAGS += -DOFF_T_IS_64_BIT |
| 72 | endif |
| 73 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 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) \ |
Jeff Brown | beb2359 | 2010-06-13 20:21:19 -0700 | [diff] [blame] | 86 | BackupData.cpp \ |
| 87 | BackupHelpers.cpp \ |
| 88 | PollLoop.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) |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 91 | LOCAL_LDLIBS += -lrt -ldl |
| 92 | endif |
| 93 | |
| 94 | LOCAL_C_INCLUDES += \ |
| 95 | external/zlib \ |
| 96 | external/icu4c/common |
Mathias Agopian | ec0f1f6 | 2009-07-12 23:11:20 -0700 | [diff] [blame] | 97 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 98 | LOCAL_LDLIBS += -lpthread |
| 99 | |
| 100 | LOCAL_SHARED_LIBRARIES := \ |
| 101 | libz \ |
| 102 | liblog \ |
| 103 | libcutils |
| 104 | |
| 105 | ifneq ($(TARGET_SIMULATOR),true) |
| 106 | ifeq ($(TARGET_OS)-$(TARGET_ARCH),linux-x86) |
| 107 | # This is needed on x86 to bring in dl_iterate_phdr for CallStack.cpp |
Mathias Agopian | ec0f1f6 | 2009-07-12 23:11:20 -0700 | [diff] [blame] | 108 | LOCAL_SHARED_LIBRARIES += libdl |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 109 | endif # linux-x86 |
| 110 | endif # sim |
| 111 | |
| 112 | LOCAL_MODULE:= libutils |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 113 | include $(BUILD_SHARED_LIBRARY) |
| 114 | |
Dan Egnor | 386a332 | 2010-05-06 00:55:09 -0700 | [diff] [blame] | 115 | ifneq ($(TARGET_SIMULATOR),true) |
| 116 | ifeq ($(TARGET_OS),linux) |
| 117 | include $(CLEAR_VARS) |
| 118 | LOCAL_C_INCLUDES += external/zlib external/icu4c/common |
| 119 | LOCAL_LDLIBS := -lrt -ldl -lpthread |
| 120 | LOCAL_MODULE := libutils |
| 121 | LOCAL_SRC_FILES := $(commonSources) BackupData.cpp BackupHelpers.cpp |
| 122 | include $(BUILD_STATIC_LIBRARY) |
| 123 | endif |
| 124 | endif |