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
16LOCAL_PATH:= $(call my-dir)
17
18#
19# Common definitions.
20#
21
22src_files := \
23	cmemory.c          cstring.c          \
24	cwchar.c           locmap.c           \
25	punycode.c         putil.c            \
26	uarrsort.c         ubidi.c            \
27	ubidiln.c          ubidi_props.c      \
28	ubidiwrt.c         ucase.c            \
29	ucasemap.c         ucat.c             \
30	uchar.c            ucln_cmn.c         \
31	ucmndata.c                            \
32	ucnv2022.c         ucnv_bld.c         \
33	ucnvbocu.c         ucnv.c             \
34	ucnv_cb.c          ucnv_cnv.c         \
35	ucnvdisp.c         ucnv_err.c         \
36	ucnv_ext.c         ucnvhz.c           \
37	ucnv_io.c          ucnvisci.c         \
38	ucnvlat1.c         ucnv_lmb.c         \
39	ucnvmbcs.c         ucnvscsu.c         \
40	ucnv_set.c         ucnv_u16.c         \
41	ucnv_u32.c         ucnv_u7.c          \
42	ucnv_u8.c                             \
43	udatamem.c         \
44	udataswp.c         uenum.c            \
45	uhash.c            uinit.c            \
46	uinvchar.c         uloc.c             \
47	umapfile.c         umath.c            \
48	umutex.c           unames.c           \
49	unorm_it.c         uresbund.c         \
50	ures_cnv.c         uresdata.c         \
51	usc_impl.c         uscript.c          \
52	ushape.c           ustrcase.c         \
53	ustr_cnv.c         ustrfmt.c          \
54	ustring.c          ustrtrns.c         \
55	ustr_wcs.c         utf_impl.c         \
56	utrace.c           utrie.c            \
57	utypes.c           wintz.c            \
58	utrie2_builder.c   icuplug.c          \
59	propsvec.c         ulist.c            \
60	uloc_tag.c
61
62src_files += \
63        bmpset.cpp      unisetspan.cpp   \
64	brkeng.cpp      brkiter.cpp      \
65	caniter.cpp     chariter.cpp     \
66	dictbe.cpp      locbased.cpp     \
67	locid.cpp       locutil.cpp      \
68	normlzr.cpp     parsepos.cpp     \
69	propname.cpp    rbbi.cpp         \
70	rbbidata.cpp    rbbinode.cpp     \
71	rbbirb.cpp      rbbiscan.cpp     \
72	rbbisetb.cpp    rbbistbl.cpp     \
73	rbbitblb.cpp    resbund_cnv.cpp  \
74	resbund.cpp     ruleiter.cpp     \
75	schriter.cpp    serv.cpp         \
76	servlk.cpp      servlkf.cpp      \
77	servls.cpp      servnotf.cpp     \
78	servrbf.cpp     servslkf.cpp     \
79	triedict.cpp    ubrk.cpp         \
80	uchriter.cpp    uhash_us.cpp     \
81	uidna.cpp       uiter.cpp        \
82	unifilt.cpp     unifunct.cpp     \
83	uniset.cpp      uniset_props.cpp \
84	unistr_case.cpp unistr_cnv.cpp   \
85	unistr.cpp      unistr_props.cpp \
86	unormcmp.cpp    unorm.cpp        \
87	uobject.cpp     uset.cpp         \
88	usetiter.cpp    uset_props.cpp   \
89	usprep.cpp      ustack.cpp       \
90	ustrenum.cpp    utext.cpp        \
91	util.cpp        util_props.cpp   \
92	uvector.cpp     uvectr32.cpp     \
93	errorcode.cpp                    \
94	bytestream.cpp  stringpiece.cpp  \
95	mutex.cpp       dtintrv.cpp      \
96	ucnvsel.cpp     uvectr64.cpp     \
97	locavailable.cpp         locdispnames.cpp   \
98	loclikely.cpp            locresdata.cpp     \
99	normalizer2impl.cpp      normalizer2.cpp    \
100	filterednormalizer2.cpp  ucol_swp.cpp       \
101	uprops.cpp      utrie2.cpp \
102        charstr.cpp     uts46.cpp \
103        udata.cpp
104
105
106# This is the empty compiled-in icu data structure
107# that we need to satisfy the linker.
108src_files += ../stubdata/stubdata.c
109
110c_includes := \
111	$(LOCAL_PATH) \
112	$(LOCAL_PATH)/../i18n
113
114# We make the ICU data directory relative to $ANDROID_ROOT on Android, so both
115# device and sim builds can use the same codepath, and it's hard to break one
116# without noticing because the other still works.
117local_cflags := '-DICU_DATA_DIR_PREFIX_ENV_VAR="ANDROID_ROOT"'
118local_cflags += '-DICU_DATA_DIR="/usr/icu"'
119
120local_cflags += -D_REENTRANT -DU_COMMON_IMPLEMENTATION -O3 -fvisibility=hidden
121local_ldlibs := -lpthread -lm
122
123
124#
125# Build for the target (device).
126#
127
128include $(CLEAR_VARS)
129LOCAL_SRC_FILES := $(src_files)
130LOCAL_C_INCLUDES := $(c_includes) \
131                    abi/cpp/include
132LOCAL_CFLAGS := $(local_cflags) -DPIC -fPIC
133LOCAL_RTTI_FLAG := -frtti
134LOCAL_SHARED_LIBRARIES += libgabi++
135LOCAL_LDLIBS += $(local_ldlibs)
136LOCAL_MODULE_TAGS := optional
137LOCAL_MODULE := libicuuc
138include $(BUILD_SHARED_LIBRARY)
139
140
141#
142# Build for the host.
143#
144
145ifeq ($(WITH_HOST_DALVIK),true)
146    include $(CLEAR_VARS)
147    include $(LOCAL_PATH)/../stubdata/root.mk
148    LOCAL_SRC_FILES := $(src_files)
149    LOCAL_C_INCLUDES := $(c_includes)
150    LOCAL_CFLAGS := $(local_cflags)
151    LOCAL_LDLIBS += $(local_ldlibs)
152    LOCAL_ADDITIONAL_DEPENDENCIES += $(HOST_OUT)/usr/icu/$(root).dat
153    LOCAL_MODULE_TAGS := optional
154    LOCAL_MODULE := libicuuc
155    include $(BUILD_HOST_SHARED_LIBRARY)
156endif
157