blob: 57c048a3eaa26e3ccd7f4c1ba7c5ab48599a1bfb [file] [log] [blame]
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -08001# 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:= \
Jeff Brown66fbde32011-11-14 18:29:15 -080021 BasicHashtable.cpp \
Jamie Gennis58c8dd22011-04-28 16:19:45 -070022 BlobCache.cpp \
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080023 BufferedTextOutput.cpp \
24 CallStack.cpp \
25 Debug.cpp \
26 FileMap.cpp \
Mathias Agopian98e71dd2010-02-11 17:30:52 -080027 Flattenable.cpp \
Jason Simmonsc18d4da2011-06-28 17:43:30 -070028 LinearTransform.cpp \
Jeff Brown66888372010-11-29 17:37:49 -080029 PropertyMap.cpp \
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080030 RefBase.cpp \
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080031 SharedBuffer.cpp \
32 Static.cpp \
33 StopWatch.cpp \
34 String8.cpp \
35 String16.cpp \
Mathias Agopian861aa2f2009-06-05 01:26:23 -070036 StringArray.cpp \
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080037 SystemClock.cpp \
38 TextOutput.cpp \
39 Threads.cpp \
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080040 Timers.cpp \
Jeff Browna3477c82010-11-10 16:03:06 -080041 Tokenizer.cpp \
Kenny Rootc412dcb2010-11-09 14:37:23 -080042 Unicode.cpp \
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080043 VectorImpl.cpp \
Mathias Agopian4fcd9c72009-06-05 15:11:23 -070044 misc.cpp
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080045
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080046
47# For the host
48# =====================================================
49
50include $(CLEAR_VARS)
51
Mathias Agopian7e83f042009-06-05 14:56:35 -070052LOCAL_SRC_FILES:= $(commonSources)
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080053
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080054LOCAL_MODULE:= libutils
55
56LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080057
58ifeq ($(HOST_OS),windows)
59ifeq ($(strip $(USE_CYGWIN),),)
60# Under MinGW, ctype.h doesn't need multi-byte support
61LOCAL_CFLAGS += -DMB_CUR_MAX=1
62endif
63endif
64
Iliyan Malchevb5fe3172011-10-19 22:35:56 -070065ifeq ($(TARGET_OS),linux)
66LOCAL_LDLIBS += -lrt -ldl
67endif
68
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080069include $(BUILD_HOST_STATIC_LIBRARY)
70
71
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080072# For the device
73# =====================================================
74include $(CLEAR_VARS)
75
76
77# we have the common sources, plus some device-specific stuff
78LOCAL_SRC_FILES:= \
79 $(commonSources) \
Jamie Gennisf64b1ca2012-02-23 11:28:28 -080080 Looper.cpp \
81 Trace.cpp
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080082
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080083ifeq ($(TARGET_OS),linux)
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080084LOCAL_LDLIBS += -lrt -ldl
85endif
86
87LOCAL_C_INCLUDES += \
Glenn Kastenba699cb2011-07-11 15:59:22 -070088 bionic/libc/private
Mathias Agopianec0f1f62009-07-12 23:11:20 -070089
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080090LOCAL_LDLIBS += -lpthread
91
92LOCAL_SHARED_LIBRARIES := \
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080093 liblog \
Mathias Agopian55b81b12011-09-28 17:33:11 -070094 libcutils \
Jeff Browne27d62b2011-10-19 20:32:43 -070095 libdl \
96 libcorkscrew
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080097
98LOCAL_MODULE:= libutils
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080099include $(BUILD_SHARED_LIBRARY)
100
Jeff Brown8575a872010-06-30 16:10:35 -0700101# Include subdirectory makefiles
102# ============================================================
103
104# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
105# team really wants is to build the stuff defined by this makefile.
106ifeq (,$(ONE_SHOT_MAKEFILE))
107include $(call first-makefiles-under,$(LOCAL_PATH))
Christopher Tatea45a8002010-07-26 11:24:18 -0700108endif