• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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)
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)
72LOCAL_LDLIBS += $(host_commonLdlibs)
73include $(BUILD_HOST_STATIC_LIBRARY)
74
75
76# For the host, 64-bit
77# =====================================================
78include $(CLEAR_VARS)
79LOCAL_SRC_FILES:= $(commonSources)
80ifeq ($(HOST_OS), linux)
81LOCAL_SRC_FILES += Looper.cpp
82endif
83LOCAL_MODULE:= lib64utils
84LOCAL_STATIC_LIBRARIES := liblog
85LOCAL_CFLAGS += $(host_commonCflags) -m64
86LOCAL_LDLIBS += $(host_commonLdlibs)
87include $(BUILD_HOST_STATIC_LIBRARY)
88
89
90# For the device, static
91# =====================================================
92include $(CLEAR_VARS)
93
94
95# we have the common sources, plus some device-specific stuff
96LOCAL_SRC_FILES:= \
97	$(commonSources) \
98	Looper.cpp \
99	Trace.cpp
100
101ifeq ($(TARGET_OS),linux)
102LOCAL_LDLIBS += -lrt -ldl
103endif
104
105ifeq ($(TARGET_ARCH),mips)
106LOCAL_CFLAGS += -DALIGN_DOUBLE
107endif
108
109LOCAL_C_INCLUDES += \
110		bionic/libc/private \
111		external/zlib
112
113LOCAL_LDLIBS += -lpthread
114
115LOCAL_STATIC_LIBRARIES := \
116	libcutils
117
118LOCAL_SHARED_LIBRARIES := \
119        libcorkscrew \
120        liblog \
121        libdl
122
123LOCAL_MODULE:= libutils
124include $(BUILD_STATIC_LIBRARY)
125
126# For the device, shared
127# =====================================================
128include $(CLEAR_VARS)
129LOCAL_MODULE:= libutils
130LOCAL_WHOLE_STATIC_LIBRARIES := libutils
131LOCAL_SHARED_LIBRARIES := \
132        liblog \
133        libcutils \
134        libdl \
135        libcorkscrew
136
137include $(BUILD_SHARED_LIBRARY)
138
139# Include subdirectory makefiles
140# ============================================================
141
142# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
143# team really wants is to build the stuff defined by this makefile.
144ifeq (,$(ONE_SHOT_MAKEFILE))
145include $(call first-makefiles-under,$(LOCAL_PATH))
146endif
147