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