Android.mk revision e839a589bf582568cf220c1040ed93b948e6e362
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 Asset.cpp \ 22 AssetDir.cpp \ 23 AssetManager.cpp \ 24 BufferedTextOutput.cpp \ 25 CallStack.cpp \ 26 Debug.cpp \ 27 FileMap.cpp \ 28 Flattenable.cpp \ 29 PollLoop.cpp \ 30 Pool.cpp \ 31 RefBase.cpp \ 32 ResourceTypes.cpp \ 33 SharedBuffer.cpp \ 34 Static.cpp \ 35 StopWatch.cpp \ 36 String8.cpp \ 37 String16.cpp \ 38 StringArray.cpp \ 39 SystemClock.cpp \ 40 TextOutput.cpp \ 41 Threads.cpp \ 42 Timers.cpp \ 43 VectorImpl.cpp \ 44 ZipFileCRO.cpp \ 45 ZipFileRO.cpp \ 46 ZipUtils.cpp \ 47 misc.cpp 48 49 50# For the host 51# ===================================================== 52 53include $(CLEAR_VARS) 54 55LOCAL_SRC_FILES:= $(commonSources) 56 57LOCAL_MODULE:= libutils 58 59LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) 60LOCAL_C_INCLUDES += external/zlib 61 62ifeq ($(HOST_OS),windows) 63ifeq ($(strip $(USE_CYGWIN),),) 64# Under MinGW, ctype.h doesn't need multi-byte support 65LOCAL_CFLAGS += -DMB_CUR_MAX=1 66endif 67endif 68 69include $(BUILD_HOST_STATIC_LIBRARY) 70 71 72 73# For the device 74# ===================================================== 75include $(CLEAR_VARS) 76 77 78# we have the common sources, plus some device-specific stuff 79LOCAL_SRC_FILES:= \ 80 $(commonSources) \ 81 BackupData.cpp \ 82 BackupHelpers.cpp 83 84ifeq ($(TARGET_OS),linux) 85LOCAL_LDLIBS += -lrt -ldl 86endif 87 88LOCAL_C_INCLUDES += \ 89 external/zlib \ 90 external/icu4c/common 91 92LOCAL_LDLIBS += -lpthread 93 94LOCAL_SHARED_LIBRARIES := \ 95 libz \ 96 liblog \ 97 libcutils 98 99ifneq ($(TARGET_SIMULATOR),true) 100ifeq ($(TARGET_OS)-$(TARGET_ARCH),linux-x86) 101# This is needed on x86 to bring in dl_iterate_phdr for CallStack.cpp 102LOCAL_SHARED_LIBRARIES += libdl 103endif # linux-x86 104endif # sim 105 106LOCAL_MODULE:= libutils 107include $(BUILD_SHARED_LIBRARY) 108 109ifneq ($(TARGET_SIMULATOR),true) 110ifeq ($(TARGET_OS),linux) 111include $(CLEAR_VARS) 112LOCAL_C_INCLUDES += external/zlib external/icu4c/common 113LOCAL_LDLIBS := -lrt -ldl -lpthread 114LOCAL_MODULE := libutils 115LOCAL_SRC_FILES := $(commonSources) BackupData.cpp BackupHelpers.cpp 116include $(BUILD_STATIC_LIBRARY) 117endif 118endif 119