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 15LOCAL_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 20commonSources:= \ 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 53host_commonCflags := -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) 54 55ifeq ($(HOST_OS),windows) 56ifeq ($(strip $(USE_CYGWIN),),) 57# Under MinGW, ctype.h doesn't need multi-byte support 58host_commonCflags += -DMB_CUR_MAX=1 59endif 60endif 61 62host_commonLdlibs := 63 64ifeq ($(TARGET_OS),linux) 65host_commonLdlibs += -lrt -ldl 66endif 67 68 69# For the host 70# ===================================================== 71include $(CLEAR_VARS) 72LOCAL_SRC_FILES:= $(commonSources) 73ifeq ($(HOST_OS), linux) 74LOCAL_SRC_FILES += Looper.cpp 75endif 76LOCAL_MODULE:= libutils 77LOCAL_STATIC_LIBRARIES := libz 78LOCAL_C_INCLUDES := \ 79 external/zlib 80LOCAL_CFLAGS += $(host_commonCflags) 81LOCAL_LDLIBS += $(host_commonLdlibs) 82include $(BUILD_HOST_STATIC_LIBRARY) 83 84 85# For the host, 64-bit 86# ===================================================== 87include $(CLEAR_VARS) 88LOCAL_SRC_FILES:= $(commonSources) 89ifeq ($(HOST_OS), linux) 90LOCAL_SRC_FILES += Looper.cpp 91endif 92LOCAL_MODULE:= lib64utils 93LOCAL_STATIC_LIBRARIES := libz 94LOCAL_C_INCLUDES := \ 95 external/zlib 96LOCAL_CFLAGS += $(host_commonCflags) -m64 97LOCAL_LDLIBS += $(host_commonLdlibs) 98include $(BUILD_HOST_STATIC_LIBRARY) 99 100 101# For the device 102# ===================================================== 103include $(CLEAR_VARS) 104 105 106# we have the common sources, plus some device-specific stuff 107LOCAL_SRC_FILES:= \ 108 $(commonSources) \ 109 Looper.cpp \ 110 Trace.cpp 111 112ifeq ($(TARGET_OS),linux) 113LOCAL_LDLIBS += -lrt -ldl 114endif 115 116ifeq ($(TARGET_ARCH),mips) 117LOCAL_CFLAGS += -DALIGN_DOUBLE 118endif 119 120LOCAL_C_INCLUDES += \ 121 bionic/libc/private \ 122 external/zlib 123 124LOCAL_LDLIBS += -lpthread 125 126LOCAL_SHARED_LIBRARIES := \ 127 liblog \ 128 libcutils \ 129 libdl \ 130 libcorkscrew \ 131 libz 132 133LOCAL_MODULE:= libutils 134include $(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. 141ifeq (,$(ONE_SHOT_MAKEFILE)) 142include $(call first-makefiles-under,$(LOCAL_PATH)) 143endif 144