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