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 15 LOCAL_PATH:= $(call my-dir) 16 17 commonSources:= \ 18 BasicHashtable.cpp \ 19 CallStack.cpp \ 20 FileMap.cpp \ 21 JenkinsHash.cpp \ 22 LinearTransform.cpp \ 23 Log.cpp \ 24 NativeHandle.cpp \ 25 Printer.cpp \ 26 ProcessCallStack.cpp \ 27 PropertyMap.cpp \ 28 RefBase.cpp \ 29 SharedBuffer.cpp \ 30 Static.cpp \ 31 StopWatch.cpp \ 32 String8.cpp \ 33 String16.cpp \ 34 SystemClock.cpp \ 35 Threads.cpp \ 36 Timers.cpp \ 37 Tokenizer.cpp \ 38 Unicode.cpp \ 39 VectorImpl.cpp \ 40 misc.cpp \ 41 42 host_commonCflags := -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -Werror 43 44 ifeq ($(HOST_OS),windows) 45 ifeq ($(strip $(USE_CYGWIN),),) 46 # Under MinGW, ctype.h doesn't need multi-byte support 47 host_commonCflags += -DMB_CUR_MAX=1 48 endif 49 endif 50 51 # For the host 52 # ===================================================== 53 include $(CLEAR_VARS) 54 LOCAL_SRC_FILES:= $(commonSources) 55 ifeq ($(HOST_OS), linux) 56 LOCAL_SRC_FILES += Looper.cpp 57 endif 58 ifeq ($(HOST_OS),darwin) 59 LOCAL_CFLAGS += -Wno-unused-parameter 60 endif 61 LOCAL_MODULE:= libutils 62 LOCAL_STATIC_LIBRARIES := liblog 63 LOCAL_CFLAGS += $(host_commonCflags) 64 LOCAL_MULTILIB := both 65 include $(BUILD_HOST_STATIC_LIBRARY) 66 67 68 # For the device, static 69 # ===================================================== 70 include $(CLEAR_VARS) 71 72 73 # we have the common sources, plus some device-specific stuff 74 LOCAL_SRC_FILES:= \ 75 $(commonSources) \ 76 BlobCache.cpp \ 77 Looper.cpp \ 78 Trace.cpp 79 80 ifeq ($(TARGET_ARCH),mips) 81 LOCAL_CFLAGS += -DALIGN_DOUBLE 82 endif 83 LOCAL_CFLAGS += -Werror 84 85 LOCAL_STATIC_LIBRARIES := \ 86 libcutils \ 87 libc 88 89 LOCAL_SHARED_LIBRARIES := \ 90 libbacktrace \ 91 liblog \ 92 libdl 93 94 LOCAL_MODULE:= libutils 95 include $(BUILD_STATIC_LIBRARY) 96 97 # For the device, shared 98 # ===================================================== 99 include $(CLEAR_VARS) 100 LOCAL_MODULE:= libutils 101 LOCAL_WHOLE_STATIC_LIBRARIES := libutils 102 LOCAL_SHARED_LIBRARIES := \ 103 libbacktrace \ 104 libcutils \ 105 libdl \ 106 liblog 107 LOCAL_CFLAGS := -Werror 108 109 include $(BUILD_SHARED_LIBRARY) 110 111 # Include subdirectory makefiles 112 # ============================================================ 113 114 include $(CLEAR_VARS) 115 LOCAL_MODULE := SharedBufferTest 116 LOCAL_STATIC_LIBRARIES := libutils libcutils 117 LOCAL_SHARED_LIBRARIES := liblog 118 LOCAL_SRC_FILES := SharedBufferTest.cpp 119 include $(BUILD_NATIVE_TEST) 120 121 include $(CLEAR_VARS) 122 LOCAL_MODULE := SharedBufferTest 123 LOCAL_STATIC_LIBRARIES := libutils libcutils 124 LOCAL_SHARED_LIBRARIES := liblog 125 LOCAL_SRC_FILES := SharedBufferTest.cpp 126 include $(BUILD_HOST_NATIVE_TEST) 127 128 # Build the tests in the tests/ subdirectory. 129 include $(call first-makefiles-under,$(LOCAL_PATH)) 130