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 BlobCache.cpp \ 25 BufferedTextOutput.cpp \ 26 CallStack.cpp \ 27 Debug.cpp \ 28 FileMap.cpp \ 29 Flattenable.cpp \ 30 LinearTransform.cpp \ 31 ObbFile.cpp \ 32 PropertyMap.cpp \ 33 RefBase.cpp \ 34 ResourceTypes.cpp \ 35 SharedBuffer.cpp \ 36 Static.cpp \ 37 StopWatch.cpp \ 38 StreamingZipInflater.cpp \ 39 String8.cpp \ 40 String16.cpp \ 41 StringArray.cpp \ 42 SystemClock.cpp \ 43 TextOutput.cpp \ 44 Threads.cpp \ 45 Timers.cpp \ 46 Tokenizer.cpp \ 47 Unicode.cpp \ 48 VectorImpl.cpp \ 49 ZipFileCRO.cpp \ 50 ZipFileRO.cpp \ 51 ZipUtils.cpp \ 52 misc.cpp 53 54 55 # For the host 56 # ===================================================== 57 58 include $(CLEAR_VARS) 59 60 LOCAL_SRC_FILES:= $(commonSources) 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) \ 86 BackupData.cpp \ 87 BackupHelpers.cpp \ 88 Looper.cpp 89 90 ifeq ($(TARGET_OS),linux) 91 LOCAL_LDLIBS += -lrt -ldl 92 endif 93 94 LOCAL_C_INCLUDES += \ 95 external/zlib \ 96 external/icu4c/common 97 98 LOCAL_LDLIBS += -lpthread 99 100 LOCAL_SHARED_LIBRARIES := \ 101 libz \ 102 liblog \ 103 libcutils \ 104 libdl 105 106 LOCAL_MODULE:= libutils 107 include $(BUILD_SHARED_LIBRARY) 108 109 ifeq ($(TARGET_OS),linux) 110 include $(CLEAR_VARS) 111 LOCAL_C_INCLUDES += external/zlib external/icu4c/common 112 LOCAL_LDLIBS := -lrt -ldl -lpthread 113 LOCAL_MODULE := libutils 114 LOCAL_SRC_FILES := $(commonSources) BackupData.cpp BackupHelpers.cpp 115 include $(BUILD_STATIC_LIBRARY) 116 endif 117 118 119 # Include subdirectory makefiles 120 # ============================================================ 121 122 # If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework 123 # team really wants is to build the stuff defined by this makefile. 124 ifeq (,$(ONE_SHOT_MAKEFILE)) 125 include $(call first-makefiles-under,$(LOCAL_PATH)) 126 endif 127