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