Android.mk revision 5bed8036644f552210a7cfcbed2d6d20cf2981b0
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) -Werror 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 102LOCAL_CFLAGS += -Werror 103 104LOCAL_C_INCLUDES += \ 105 bionic/libc/private \ 106 external/zlib 107 108LOCAL_STATIC_LIBRARIES := \ 109 libcutils 110 111LOCAL_SHARED_LIBRARIES := \ 112 libbacktrace \ 113 liblog \ 114 libdl 115 116include external/stlport/libstlport.mk 117 118LOCAL_MODULE:= libutils 119include $(BUILD_STATIC_LIBRARY) 120 121# For the device, shared 122# ===================================================== 123include $(CLEAR_VARS) 124LOCAL_MODULE:= libutils 125LOCAL_WHOLE_STATIC_LIBRARIES := libutils 126LOCAL_SHARED_LIBRARIES := \ 127 libbacktrace \ 128 libcutils \ 129 libdl \ 130 liblog 131LOCAL_CFLAGS := -Werror 132 133include external/stlport/libstlport.mk 134 135include $(BUILD_SHARED_LIBRARY) 136 137# Include subdirectory makefiles 138# ============================================================ 139 140# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework 141# team really wants is to build the stuff defined by this makefile. 142ifeq (,$(ONE_SHOT_MAKEFILE)) 143include $(call first-makefiles-under,$(LOCAL_PATH)) 144endif 145