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
22include $(CLEAR_VARS)
23
24src_files := \
25	ucln_in.cpp decContext.c \
26	ulocdata.c utmscale.c decNumber.c
27
28src_files += \
29        indiancal.cpp   dtptngen.cpp dtrule.cpp   \
30        persncal.cpp    rbtz.cpp     reldtfmt.cpp \
31        taiwncal.cpp    tzrule.cpp   tztrans.cpp  \
32        udatpg.cpp      vtzone.cpp                \
33	anytrans.cpp    astro.cpp    buddhcal.cpp \
34	basictz.cpp     calendar.cpp casetrn.cpp  \
35	choicfmt.cpp    coleitr.cpp  coll.cpp     \
36	collation.cpp \
37	collationbuilder.cpp \
38	collationcompare.cpp collationdata.cpp \
39	collationdatabuilder.cpp collationdatareader.cpp \
40	collationdatawriter.cpp collationfastlatin.cpp \
41	collationfastlatinbuilder.cpp collationfcd.cpp \
42	collationiterator.cpp collationkeys.cpp collationroot.cpp \
43	collationrootelements.cpp collationruleparser.cpp \
44	collationsets.cpp collationsettings.cpp \
45	collationtailoring.cpp collationweights.cpp \
46	compactdecimalformat.cpp \
47	cpdtrans.cpp    csdetect.cpp csmatch.cpp  \
48	csr2022.cpp     csrecog.cpp  csrmbcs.cpp  \
49	csrsbcs.cpp     csrucode.cpp csrutf8.cpp  \
50	curramt.cpp     currfmt.cpp  currunit.cpp \
51	dangical.cpp \
52	datefmt.cpp     dcfmtsym.cpp decimfmt.cpp \
53	decimalformatpattern.cpp \
54	digitlst.cpp    dtfmtsym.cpp esctrn.cpp   \
55	filteredbrk.cpp \
56	fmtable_cnv.cpp fmtable.cpp  format.cpp   \
57	funcrepl.cpp    gender.cpp \
58	gregocal.cpp gregoimp.cpp \
59	hebrwcal.cpp 	identifier_info.cpp \
60	inputext.cpp islamcal.cpp \
61	japancal.cpp    measfmt.cpp measunit.cpp  \
62	measure.cpp  \
63	msgfmt.cpp      name2uni.cpp nfrs.cpp     \
64	nfrule.cpp      nfsubs.cpp   nortrans.cpp \
65	nultrans.cpp    numfmt.cpp   olsontz.cpp  \
66	quant.cpp       quantityformatter.cpp \
67	rbnf.cpp     rbt.cpp      \
68	rbt_data.cpp    rbt_pars.cpp rbt_rule.cpp \
69	rbt_set.cpp     regexcmp.cpp regexst.cpp  \
70	regeximp.cpp 	region.cpp \
71	reldatefmt.cpp \
72	rematch.cpp     remtrans.cpp repattrn.cpp \
73	rulebasedcollator.cpp \
74	scriptset.cpp \
75	search.cpp      simpletz.cpp smpdtfmt.cpp \
76	sortkey.cpp     strmatch.cpp strrepl.cpp  \
77	stsearch.cpp    timezone.cpp \
78	titletrn.cpp    tolowtrn.cpp toupptrn.cpp \
79	translit.cpp    transreg.cpp tridpars.cpp \
80	ucal.cpp        \
81	ucol.cpp        ucoleitr.cpp \
82	ucol_res.cpp    ucol_sit.cpp \
83	ucsdet.cpp      ucurr.cpp    udat.cpp     \
84	uitercollationiterator.cpp \
85	umsg.cpp        unesctrn.cpp uni2name.cpp \
86	unum.cpp        uregexc.cpp  uregex.cpp   \
87	usearch.cpp     \
88	ufieldpositer.cpp \
89	utf16collationiterator.cpp \
90	utf8collationiterator.cpp \
91	utrans.cpp   windtfmt.cpp \
92	winnmfmt.cpp    zonemeta.cpp \
93	numsys.cpp      chnsecal.cpp \
94	cecal.cpp       coptccal.cpp ethpccal.cpp \
95	brktrans.cpp    wintzimpl.cpp plurrule.cpp \
96	plurfmt.cpp     dtitvfmt.cpp dtitvinf.cpp \
97	tmunit.cpp      tmutamt.cpp  tmutfmt.cpp  \
98        currpinf.cpp    uspoof.cpp   uspoof_impl.cpp \
99        uspoof_build.cpp     \
100        regextxt.cpp    selfmt.cpp   uspoof_conf.cpp \
101        uspoof_wsconf.cpp ztrans.cpp zrule.cpp  \
102        vzone.cpp       fphdlimp.cpp fpositer.cpp\
103        locdspnm.cpp    \
104        alphaindex.cpp  bocsu.cpp    decfmtst.cpp \
105        smpdtfst.cpp    smpdtfst.h   tzfmt.cpp \
106        tzgnames.cpp    tznames.cpp  tznames_impl.cpp \
107        udateintervalformat.cpp  upluralrules.cpp \
108        sharedbreakiterator.cpp \
109        scientificnumberformatter.cpp
110
111
112c_includes = \
113	$(LOCAL_PATH) \
114	$(LOCAL_PATH)/../common
115
116local_cflags := -D_REENTRANT
117local_cflags += -DU_I18N_IMPLEMENTATION
118local_cflags += -O3 -fvisibility=hidden
119
120
121#
122# Build for the target (device).
123#
124
125include $(CLEAR_VARS)
126LOCAL_SRC_FILES += $(src_files)
127LOCAL_C_INCLUDES += $(c_includes) $(optional_android_logging_includes)
128LOCAL_CFLAGS += $(local_cflags) -DPIC -fPIC
129LOCAL_RTTI_FLAG := -frtti
130LOCAL_SHARED_LIBRARIES += libicuuc $(optional_android_logging_libraries)
131LOCAL_MODULE_TAGS := optional
132LOCAL_MODULE := libicui18n
133LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk
134LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
135include $(BUILD_SHARED_LIBRARY)
136
137
138#
139# Build for the host.
140#
141
142include $(CLEAR_VARS)
143LOCAL_SRC_FILES += $(src_files)
144LOCAL_C_INCLUDES += $(c_includes) $(optional_android_logging_includes)
145LOCAL_CFLAGS += $(local_cflags)
146LOCAL_SHARED_LIBRARIES += libicuuc-host $(optional_android_logging_libraries)
147LOCAL_LDLIBS += -lm -lpthread
148LOCAL_MODULE_TAGS := optional
149LOCAL_MODULE := libicui18n-host
150LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk
151LOCAL_MULTILIB := both
152LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
153include $(BUILD_HOST_SHARED_LIBRARY)
154
155#
156# Build as a static library against the NDK
157#
158
159include $(CLEAR_VARS)
160LOCAL_SDK_VERSION := 9
161LOCAL_NDK_STL_VARIANT := stlport_static
162LOCAL_SRC_FILES += $(src_files)
163LOCAL_C_INCLUDES += $(c_includes) $(optional_android_logging_includes)
164LOCAL_SHARED_LIBRARIES += $(optional_android_logging_libraries)
165LOCAL_STATIC_LIBRARIES += libicuuc_static
166LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)
167LOCAL_RTTI_FLAG := -frtti
168LOCAL_CFLAGS += $(local_cflags) -DPIC -fPIC
169# Using -Os over -O3 actually cuts down the final executable size by a few dozen kilobytes
170LOCAL_CFLAGS += -Os
171LOCAL_EXPORT_CFLAGS += -DU_STATIC_IMPLEMENTATION=1
172LOCAL_MODULE_TAGS := optional
173LOCAL_MODULE := libicui18n_static
174include $(BUILD_STATIC_LIBRARY)
175