1 # Copyright (C) 2008 The Android Open Source Project
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
15 LOCAL_PATH:= $(call my-dir)
17 # libutils is a little unique: It's built twice, once for the host
18 # and once for the device.
44 host_commonCflags := -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
46 ifeq ($(HOST_OS),windows)
47 ifeq ($(strip $(USE_CYGWIN),),)
48 # Under MinGW, ctype.h doesn't need multi-byte support
49 host_commonCflags += -DMB_CUR_MAX=1
55 ifeq ($(TARGET_OS),linux)
56 host_commonLdlibs += -lrt -ldl
61 # =====================================================
63 LOCAL_SRC_FILES:= $(commonSources)
64 ifeq ($(HOST_OS), linux)
65 LOCAL_SRC_FILES += Looper.cpp
67 LOCAL_MODULE:= libutils
68 LOCAL_STATIC_LIBRARIES := liblog
69 LOCAL_CFLAGS += $(host_commonCflags)
70 LOCAL_LDLIBS += $(host_commonLdlibs)
71 include $(BUILD_HOST_STATIC_LIBRARY)
74 # For the host, 64-bit
75 # =====================================================
77 LOCAL_SRC_FILES:= $(commonSources)
78 ifeq ($(HOST_OS), linux)
79 LOCAL_SRC_FILES += Looper.cpp
81 LOCAL_MODULE:= lib64utils
82 LOCAL_STATIC_LIBRARIES := liblog
83 LOCAL_CFLAGS += $(host_commonCflags) -m64
84 LOCAL_LDLIBS += $(host_commonLdlibs)
85 include $(BUILD_HOST_STATIC_LIBRARY)
88 # For the device, static
89 # =====================================================
93 # we have the common sources, plus some device-specific stuff
99 ifeq ($(TARGET_OS),linux)
100 LOCAL_LDLIBS += -lrt -ldl
103 ifeq ($(TARGET_ARCH),mips)
104 LOCAL_CFLAGS += -DALIGN_DOUBLE
107 LOCAL_C_INCLUDES += \
108 bionic/libc/private \
111 LOCAL_LDLIBS += -lpthread
113 LOCAL_STATIC_LIBRARIES := \
116 LOCAL_SHARED_LIBRARIES := \
121 LOCAL_MODULE:= libutils
122 include $(BUILD_STATIC_LIBRARY)
124 # For the device, shared
125 # =====================================================
126 include $(CLEAR_VARS)
127 LOCAL_MODULE:= libutils
128 LOCAL_WHOLE_STATIC_LIBRARIES := libutils
129 LOCAL_SHARED_LIBRARIES := \
135 include $(BUILD_SHARED_LIBRARY)
137 # Include subdirectory makefiles
138 # ============================================================
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.
142 ifeq (,$(ONE_SHOT_MAKEFILE))
143 include $(call first-makefiles-under,$(LOCAL_PATH))