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 BasicHashtable.cpp \ 22 BlobCache.cpp \ 23 BufferedTextOutput.cpp \ 24 CallStack.cpp \ 25 Debug.cpp \ 26 FileMap.cpp \ 27 Flattenable.cpp \ 28 JenkinsHash.cpp \ 29 LinearAllocator.cpp \ 30 LinearTransform.cpp \ 31 Log.cpp \ 32 PropertyMap.cpp \ 33 RefBase.cpp \ 34 SharedBuffer.cpp \ 35 Static.cpp \ 36 StopWatch.cpp \ 37 String8.cpp \ 38 String16.cpp \ 39 StringArray.cpp \ 40 SystemClock.cpp \ 41 TextOutput.cpp \ 42 Threads.cpp \ 43 Timers.cpp \ 44 Tokenizer.cpp \ 45 Unicode.cpp \ 46 VectorImpl.cpp \ 47 WorkQueue.cpp \ 48 ZipFileCRO.cpp \ 49 ZipFileRO.cpp \ 50 ZipUtils.cpp \ 51 misc.cpp 52 53 host_commonCflags := -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) 54 55 ifeq ($(HOST_OS),windows) 56 ifeq ($(strip $(USE_CYGWIN),),) 57 # Under MinGW, ctype.h doesn't need multi-byte support 58 host_commonCflags += -DMB_CUR_MAX=1 59 endif 60 endif 61 62 host_commonLdlibs := 63 64 ifeq ($(TARGET_OS),linux) 65 host_commonLdlibs += -lrt -ldl 66 endif 67 68 69 # For the host 70 # ===================================================== 71 include $(CLEAR_VARS) 72 LOCAL_SRC_FILES:= $(commonSources) 73 ifeq ($(HOST_OS), linux) 74 LOCAL_SRC_FILES += Looper.cpp 75 endif 76 LOCAL_MODULE:= libutils 77 LOCAL_STATIC_LIBRARIES := libz 78 LOCAL_C_INCLUDES := \ 79 external/zlib 80 LOCAL_CFLAGS += $(host_commonCflags) 81 LOCAL_LDLIBS += $(host_commonLdlibs) 82 include $(BUILD_HOST_STATIC_LIBRARY) 83 84 85 # For the host, 64-bit 86 # ===================================================== 87 include $(CLEAR_VARS) 88 LOCAL_SRC_FILES:= $(commonSources) 89 ifeq ($(HOST_OS), linux) 90 LOCAL_SRC_FILES += Looper.cpp 91 endif 92 LOCAL_MODULE:= lib64utils 93 LOCAL_STATIC_LIBRARIES := libz 94 LOCAL_C_INCLUDES := \ 95 external/zlib 96 LOCAL_CFLAGS += $(host_commonCflags) -m64 97 LOCAL_LDLIBS += $(host_commonLdlibs) 98 include $(BUILD_HOST_STATIC_LIBRARY) 99 100 101 # For the device 102 # ===================================================== 103 include $(CLEAR_VARS) 104 105 106 # we have the common sources, plus some device-specific stuff 107 LOCAL_SRC_FILES:= \ 108 $(commonSources) \ 109 Looper.cpp \ 110 Trace.cpp 111 112 ifeq ($(TARGET_OS),linux) 113 LOCAL_LDLIBS += -lrt -ldl 114 endif 115 116 ifeq ($(TARGET_ARCH),mips) 117 LOCAL_CFLAGS += -DALIGN_DOUBLE 118 endif 119 120 LOCAL_C_INCLUDES += \ 121 bionic/libc/private \ 122 external/zlib 123 124 LOCAL_LDLIBS += -lpthread 125 126 LOCAL_SHARED_LIBRARIES := \ 127 liblog \ 128 libcutils \ 129 libdl \ 130 libcorkscrew \ 131 libz 132 133 LOCAL_MODULE:= libutils 134 include $(BUILD_SHARED_LIBRARY) 135 136 # Include subdirectory makefiles 137 # ============================================================ 138 139 # If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework 140 # team really wants is to build the stuff defined by this makefile. 141 ifeq (,$(ONE_SHOT_MAKEFILE)) 142 include $(call first-makefiles-under,$(LOCAL_PATH)) 143 endif 144