• 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	BufferedTextOutput.cpp \
24	CallStack.cpp \
25	Debug.cpp \
26	FileMap.cpp \
27	Flattenable.cpp \
28	LinearTransform.cpp \
29	PropertyMap.cpp \
30	RefBase.cpp \
31	SharedBuffer.cpp \
32	Static.cpp \
33	StopWatch.cpp \
34	String8.cpp \
35	String16.cpp \
36	StringArray.cpp \
37	SystemClock.cpp \
38	TextOutput.cpp \
39	Threads.cpp \
40	Timers.cpp \
41	Tokenizer.cpp \
42	Unicode.cpp \
43	VectorImpl.cpp \
44	WorkQueue.cpp \
45	ZipFileCRO.cpp \
46	ZipFileRO.cpp \
47	ZipUtils.cpp \
48	misc.cpp
49
50host_commonCflags := -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
51
52ifeq ($(HOST_OS),windows)
53ifeq ($(strip $(USE_CYGWIN),),)
54# Under MinGW, ctype.h doesn't need multi-byte support
55host_commonCflags += -DMB_CUR_MAX=1
56endif
57endif
58
59host_commonLdlibs :=
60
61ifeq ($(TARGET_OS),linux)
62host_commonLdlibs += -lrt -ldl
63endif
64
65
66# For the host
67# =====================================================
68include $(CLEAR_VARS)
69LOCAL_SRC_FILES:= $(commonSources)
70ifeq ($(HOST_OS), linux)
71LOCAL_SRC_FILES += Looper.cpp
72endif
73LOCAL_MODULE:= libutils
74LOCAL_STATIC_LIBRARIES := libz
75LOCAL_C_INCLUDES := \
76	external/zlib
77LOCAL_CFLAGS += $(host_commonCflags)
78LOCAL_LDLIBS += $(host_commonLdlibs)
79include $(BUILD_HOST_STATIC_LIBRARY)
80
81
82# For the host, 64-bit
83# =====================================================
84include $(CLEAR_VARS)
85LOCAL_SRC_FILES:= $(commonSources)
86ifeq ($(HOST_OS), linux)
87LOCAL_SRC_FILES += Looper.cpp
88endif
89LOCAL_MODULE:= lib64utils
90LOCAL_STATIC_LIBRARIES := libz
91LOCAL_C_INCLUDES := \
92	external/zlib
93LOCAL_CFLAGS += $(host_commonCflags) -m64
94LOCAL_LDLIBS += $(host_commonLdlibs)
95include $(BUILD_HOST_STATIC_LIBRARY)
96
97
98# For the device
99# =====================================================
100include $(CLEAR_VARS)
101
102
103# we have the common sources, plus some device-specific stuff
104LOCAL_SRC_FILES:= \
105	$(commonSources) \
106	Looper.cpp \
107	Trace.cpp
108
109ifeq ($(TARGET_OS),linux)
110LOCAL_LDLIBS += -lrt -ldl
111endif
112
113LOCAL_C_INCLUDES += \
114		bionic/libc/private \
115		external/zlib
116
117LOCAL_LDLIBS += -lpthread
118
119LOCAL_SHARED_LIBRARIES := \
120	liblog \
121	libcutils \
122	libdl \
123	libcorkscrew \
124	libz
125
126LOCAL_MODULE:= libutils
127include $(BUILD_SHARED_LIBRARY)
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