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