Android.mk revision b100cbf178e91d6652ebbad3ed36684cacb9d10e
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	Asset.cpp \
22	AssetDir.cpp \
23	AssetManager.cpp \
24	BufferedTextOutput.cpp \
25	CallStack.cpp \
26	Debug.cpp \
27	FileMap.cpp \
28	Flattenable.cpp \
29	ObbFile.cpp \
30	Pool.cpp \
31	RefBase.cpp \
32	ResourceTypes.cpp \
33	SharedBuffer.cpp \
34	Static.cpp \
35	StopWatch.cpp \
36	StreamingZipInflater.cpp \
37	String8.cpp \
38	String16.cpp \
39	StringArray.cpp \
40	SystemClock.cpp \
41	TextOutput.cpp \
42	Threads.cpp \
43	Timers.cpp \
44	VectorImpl.cpp \
45	ZipFileCRO.cpp \
46	ZipFileRO.cpp \
47	ZipUtils.cpp \
48	misc.cpp
49
50
51# For the host
52# =====================================================
53
54include $(CLEAR_VARS)
55
56LOCAL_SRC_FILES:= $(commonSources)
57
58LOCAL_MODULE:= libutils
59
60LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
61LOCAL_C_INCLUDES += external/zlib
62
63ifeq ($(HOST_OS),windows)
64ifeq ($(strip $(USE_CYGWIN),),)
65# Under MinGW, ctype.h doesn't need multi-byte support
66LOCAL_CFLAGS += -DMB_CUR_MAX=1
67endif
68endif
69
70ifeq ($(HOST_OS),darwin)
71# MacOS doesn't have lseek64. However, off_t is 64-bit anyway.
72LOCAL_CFLAGS += -DOFF_T_IS_64_BIT
73endif
74
75include $(BUILD_HOST_STATIC_LIBRARY)
76
77
78
79# For the device
80# =====================================================
81include $(CLEAR_VARS)
82
83
84# we have the common sources, plus some device-specific stuff
85LOCAL_SRC_FILES:= \
86	$(commonSources) \
87	BackupData.cpp \
88	BackupHelpers.cpp \
89	PollLoop.cpp
90
91ifeq ($(TARGET_OS),linux)
92LOCAL_LDLIBS += -lrt -ldl
93endif
94
95LOCAL_C_INCLUDES += \
96		external/zlib \
97		external/icu4c/common
98
99LOCAL_LDLIBS += -lpthread
100
101LOCAL_SHARED_LIBRARIES := \
102	libz \
103	liblog \
104	libcutils
105
106ifneq ($(TARGET_SIMULATOR),true)
107ifeq ($(TARGET_OS)-$(TARGET_ARCH),linux-x86)
108# This is needed on x86 to bring in dl_iterate_phdr for CallStack.cpp
109LOCAL_SHARED_LIBRARIES += libdl
110endif # linux-x86
111endif # sim
112
113LOCAL_MODULE:= libutils
114include $(BUILD_SHARED_LIBRARY)
115
116ifneq ($(TARGET_SIMULATOR),true)
117ifeq ($(TARGET_OS),linux)
118include $(CLEAR_VARS)
119LOCAL_C_INCLUDES += external/zlib external/icu4c/common
120LOCAL_LDLIBS := -lrt -ldl -lpthread
121LOCAL_MODULE := libutils
122LOCAL_SRC_FILES := $(commonSources) BackupData.cpp BackupHelpers.cpp
123include $(BUILD_STATIC_LIBRARY)
124endif
125endif
126
127
128# Include subdirectory makefiles
129# ============================================================
130
131# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
132# team really wants is to build the stuff defined by this makefile.
133ifeq (,$(ONE_SHOT_MAKEFILE))
134include $(call first-makefiles-under,$(LOCAL_PATH))
135endif
136