OSDN Git Service

7e6b1be42579ac0d4916cf28b918ac16382f5816
[android-x86/frameworks-native.git] / libs / utils / Android.mk
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
15 LOCAL_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
20 commonSources:= \
21         BasicHashtable.cpp \
22         BlobCache.cpp \
23         CallStack.cpp \
24         FileMap.cpp \
25         JenkinsHash.cpp \
26         LinearAllocator.cpp \
27         LinearTransform.cpp \
28         Log.cpp \
29         PropertyMap.cpp \
30         RefBase.cpp \
31         SharedBuffer.cpp \
32         Static.cpp \
33         StopWatch.cpp \
34         String8.cpp \
35         String16.cpp \
36         SystemClock.cpp \
37         Threads.cpp \
38         Timers.cpp \
39         Tokenizer.cpp \
40         Unicode.cpp \
41         VectorImpl.cpp \
42         misc.cpp
43
44 host_commonCflags := -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
45
46 ifeq ($(HOST_OS),windows)
47 ifeq ($(strip $(USE_CYGWIN),),)
48 # Under MinGW, ctype.h doesn't need multi-byte support
49 host_commonCflags += -DMB_CUR_MAX=1
50 endif
51 endif
52
53 host_commonLdlibs :=
54
55 ifeq ($(TARGET_OS),linux)
56 host_commonLdlibs += -lrt -ldl
57 endif
58
59
60 # For the host
61 # =====================================================
62 include $(CLEAR_VARS)
63 LOCAL_SRC_FILES:= $(commonSources)
64 ifeq ($(HOST_OS), linux)
65 LOCAL_SRC_FILES += Looper.cpp
66 endif
67 LOCAL_MODULE:= libutils
68 LOCAL_STATIC_LIBRARIES := liblog
69 LOCAL_CFLAGS += $(host_commonCflags)
70 LOCAL_LDLIBS += $(host_commonLdlibs)
71 include $(BUILD_HOST_STATIC_LIBRARY)
72
73
74 # For the host, 64-bit
75 # =====================================================
76 include $(CLEAR_VARS)
77 LOCAL_SRC_FILES:= $(commonSources)
78 ifeq ($(HOST_OS), linux)
79 LOCAL_SRC_FILES += Looper.cpp
80 endif
81 LOCAL_MODULE:= lib64utils
82 LOCAL_STATIC_LIBRARIES := liblog
83 LOCAL_CFLAGS += $(host_commonCflags) -m64
84 LOCAL_LDLIBS += $(host_commonLdlibs)
85 include $(BUILD_HOST_STATIC_LIBRARY)
86
87
88 # For the device, static
89 # =====================================================
90 include $(CLEAR_VARS)
91
92
93 # we have the common sources, plus some device-specific stuff
94 LOCAL_SRC_FILES:= \
95         $(commonSources) \
96         Looper.cpp \
97         Trace.cpp
98
99 ifeq ($(TARGET_OS),linux)
100 LOCAL_LDLIBS += -lrt -ldl
101 endif
102
103 ifeq ($(TARGET_ARCH),mips)
104 LOCAL_CFLAGS += -DALIGN_DOUBLE
105 endif
106
107 LOCAL_C_INCLUDES += \
108                 bionic/libc/private \
109                 external/zlib
110
111 LOCAL_LDLIBS += -lpthread
112
113 LOCAL_STATIC_LIBRARIES := \
114         libcutils
115
116 LOCAL_SHARED_LIBRARIES := \
117         libcorkscrew \
118         liblog \
119         libdl
120
121 LOCAL_MODULE:= libutils
122 include $(BUILD_STATIC_LIBRARY)
123
124 # For the device, shared
125 # =====================================================
126 include $(CLEAR_VARS)
127 LOCAL_MODULE:= libutils
128 LOCAL_WHOLE_STATIC_LIBRARIES := libutils
129 LOCAL_SHARED_LIBRARIES := \
130         liblog \
131         libcutils \
132         libdl \
133         libcorkscrew
134
135 include $(BUILD_SHARED_LIBRARY)
136
137 # Include subdirectory makefiles
138 # ============================================================
139
140 # If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
141 # team really wants is to build the stuff defined by this makefile.
142 ifeq (,$(ONE_SHOT_MAKEFILE))
143 include $(call first-makefiles-under,$(LOCAL_PATH))
144 endif