• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#******************************************************************************
2#
3#   Copyright (C) 1999-2015, International Business Machines
4#   Corporation and others.  All Rights Reserved.
5#
6#******************************************************************************
7## Makefile.in for ICU - icuuc.so
8## Stephen F. Booth
9
10## Source directory information
11srcdir = @srcdir@
12top_srcdir = @top_srcdir@
13
14top_builddir = ..
15
16## All the flags and other definitions are included here.
17include $(top_builddir)/icudefs.mk
18
19## Build directory information
20subdir = common
21
22# for service hook
23LOCALSVC_CPP=localsvc.cpp
24SVC_HOOK_INC=$(top_builddir)/common/svchook.mk
25
26## Extra files to remove for 'make clean'
27CLEANFILES = *~ $(DEPS) $(IMPORT_LIB) $(MIDDLE_IMPORT_LIB) $(FINAL_IMPORT_LIB) $(SVC_HOOK_INC)
28
29## Target information
30
31TARGET_STUBNAME=$(COMMON_STUBNAME)
32
33ifneq ($(ENABLE_STATIC),)
34TARGET = $(LIBDIR)/$(LIBSICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(A)
35endif
36
37ifneq ($(ENABLE_SHARED),)
38SO_TARGET = $(LIBDIR)/$(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(SO)
39ALL_SO_TARGETS = $(SO_TARGET) $(MIDDLE_SO_TARGET) $(FINAL_SO_TARGET) $(SHARED_OBJECT)
40
41ifeq ($(ENABLE_SO_VERSION_DATA),1)
42SO_VERSION_DATA = common.res
43endif
44
45ifeq ($(OS390BATCH),1)
46BATCH_TARGET = $(BATCH_COMMON_TARGET)
47BATCH_LIBS = $(BATCH_LIBICUDT) -lm
48endif   # OS390BATCH
49
50endif   # ENABLE_SHARED
51
52ALL_TARGETS = $(TARGET) $(ALL_SO_TARGETS) $(BATCH_TARGET)
53
54DYNAMICCPPFLAGS = $(SHAREDLIBCPPFLAGS)
55DYNAMICCFLAGS = $(SHAREDLIBCFLAGS)
56DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS)
57CFLAGS += $(LIBCFLAGS)
58CXXFLAGS += $(LIBCXXFLAGS)
59ifeq ($(OS390BATCH),1)
60CFLAGS += -WI
61CXXFLAGS += -WI
62endif
63
64CPPFLAGS += -I$(srcdir) $(LIBCPPFLAGS) $(CPPFLAGSICUUC)
65# we want DEFS here
66DEFS += -DU_COMMON_IMPLEMENTATION
67LDFLAGS += $(LDFLAGSICUUC)
68
69# for plugin configuration
70CPPFLAGS += "-DDEFAULT_ICU_PLUGINS=\"$(libdir)/icu\" "
71
72# for icu data location
73ifeq ($(PKGDATA_MODE),common)
74CPPFLAGS += "-DU_ICU_DATA_DEFAULT_DIR=\"$(ICUDATA_DIR)\""
75endif
76
77# $(LIBICUDT) is either stub data or the real DLL common data.
78LIBS = $(LIBICUDT) $(DEFAULT_LIBS)
79
80OBJECTS = errorcode.o putil.o umath.o utypes.o uinvchar.o umutex.o ucln_cmn.o \
81uinit.o uobject.o cmemory.o charstr.o cstr.o \
82udata.o ucmndata.o udatamem.o umapfile.o udataswp.o ucol_swp.o utrace.o \
83uhash.o uhash_us.o uenum.o ustrenum.o uvector.o ustack.o uvectr32.o uvectr64.o \
84ucnv.o ucnv_bld.o ucnv_cnv.o ucnv_io.o ucnv_cb.o ucnv_err.o ucnvlat1.o \
85ucnv_u7.o ucnv_u8.o ucnv_u16.o ucnv_u32.o ucnvscsu.o ucnvbocu.o \
86ucnv_ext.o ucnvmbcs.o ucnv2022.o ucnvhz.o ucnv_lmb.o ucnvisci.o ucnvdisp.o ucnv_set.o ucnv_ct.o \
87resource.o uresbund.o ures_cnv.o uresdata.o resbund.o resbund_cnv.o \
88messagepattern.o ucat.o locmap.o uloc.o locid.o locutil.o locavailable.o locdispnames.o loclikely.o locresdata.o \
89bytestream.o stringpiece.o \
90stringtriebuilder.o bytestriebuilder.o \
91bytestrie.o bytestrieiterator.o \
92ucharstrie.o ucharstriebuilder.o ucharstrieiterator.o \
93dictionarydata.o \
94appendable.o ustr_cnv.o unistr_cnv.o unistr.o unistr_case.o unistr_props.o \
95utf_impl.o ustring.o ustrcase.o ucasemap.o ucasemap_titlecase_brkiter.o cstring.o ustrfmt.o ustrtrns.o ustr_wcs.o utext.o \
96unistr_case_locale.o ustrcase_locale.o unistr_titlecase_brkiter.o ustr_titlecase_brkiter.o \
97normalizer2impl.o normalizer2.o filterednormalizer2.o normlzr.o unorm.o unormcmp.o loadednormalizer2impl.o \
98chariter.o schriter.o uchriter.o uiter.o \
99patternprops.o uchar.o uprops.o ucase.o propname.o ubidi_props.o ubidi.o ubidiwrt.o ubidiln.o ushape.o \
100uscript.o uscript_props.o usc_impl.o unames.o \
101utrie.o utrie2.o utrie2_builder.o bmpset.o unisetspan.o uset_props.o uniset_props.o uniset_closure.o uset.o uniset.o usetiter.o ruleiter.o caniter.o unifilt.o unifunct.o \
102uarrsort.o brkiter.o ubrk.o brkeng.o dictbe.o filteredbrk.o \
103rbbi.o rbbidata.o rbbinode.o rbbirb.o rbbiscan.o rbbisetb.o rbbistbl.o rbbitblb.o \
104serv.o servnotf.o servls.o servlk.o servlkf.o servrbf.o servslkf.o \
105uidna.o usprep.o uts46.o punycode.o \
106util.o util_props.o parsepos.o locbased.o cwchar.o wintz.o dtintrv.o ucnvsel.o propsvec.o \
107ulist.o uloc_tag.o icudataver.o icuplug.o listformatter.o ulistformatter.o \
108sharedobject.o simplepatternformatter.o unifiedcache.o uloc_keytype.o \
109pluralmap.o
110
111## Header files to install
112HEADERS = $(srcdir)/unicode/*.h
113
114STATIC_OBJECTS = $(OBJECTS:.o=.$(STATIC_O))
115
116DEPS = $(OBJECTS:.o=.d)
117
118-include Makefile.local
119
120-include $(SVC_HOOK_INC)
121
122
123## List of phony targets
124.PHONY : all all-local install install-local clean clean-local	\
125distclean distclean-local install-library install-headers dist	\
126dist-local check check-local check-exhaustive
127
128## Clear suffix list
129.SUFFIXES :
130
131## List of standard targets
132all: all-local
133install: install-local
134clean: clean-local
135distclean : distclean-local
136dist: dist-local
137check: all check-local
138
139check-exhaustive: check
140
141all-local: $(ALL_TARGETS)
142
143install-local: install-headers install-library
144
145install-library: all-local
146	$(MKINSTALLDIRS) $(DESTDIR)$(libdir)
147ifneq ($(ENABLE_STATIC),)
148	$(INSTALL-L) $(TARGET) $(DESTDIR)$(libdir)
149endif
150ifneq ($(ENABLE_SHARED),)
151	$(INSTALL-L) $(FINAL_SO_TARGET) $(DESTDIR)$(libdir)
152ifneq ($(FINAL_SO_TARGET),$(SO_TARGET))
153	cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(SO_TARGET)) && ln -s $(notdir $(FINAL_SO_TARGET)) $(notdir $(SO_TARGET))
154ifneq ($(FINAL_SO_TARGET),$(MIDDLE_SO_TARGET))
155	cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(MIDDLE_SO_TARGET)) && ln -s $(notdir $(FINAL_SO_TARGET)) $(notdir $(MIDDLE_SO_TARGET))
156endif
157endif
158ifneq ($(IMPORT_LIB_EXT),)
159	$(INSTALL-L) $(FINAL_IMPORT_LIB) $(DESTDIR)$(libdir)
160ifneq ($(IMPORT_LIB),$(FINAL_IMPORT_LIB))
161	cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(IMPORT_LIB)) && ln -s $(notdir $(FINAL_IMPORT_LIB)) $(notdir $(IMPORT_LIB))
162endif
163ifneq ($(MIDDLE_IMPORT_LIB),$(FINAL_IMPORT_LIB))
164	cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(MIDDLE_IMPORT_LIB)) && ln -s $(notdir $(FINAL_IMPORT_LIB)) $(notdir $(MIDDLE_IMPORT_LIB))
165endif
166endif
167endif
168
169$(SVC_HOOK_INC):
170	@echo generating $@
171	@-test -f $(top_srcdir)/common/$(LOCALSVC_CPP) && ( echo "have $(LOCALSVC_CPP) - U_LOCAL_SERVICE_HOOK=1" ; \
172		echo 'CPPFLAGS +=-DU_LOCAL_SERVICE_HOOK=1' > $@ ; \
173		echo 'OBJECTS += $(LOCALSVC_CPP:%.cpp=%.o)' >> $@ \
174		 ) ; true
175	@echo "# Autogenerated by Makefile" >> $@
176
177install-headers:
178	$(MKINSTALLDIRS) $(DESTDIR)$(includedir)/unicode
179	@for file in $(HEADERS); do \
180	 echo "$(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/unicode"; \
181	 $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/unicode || exit; \
182	done
183
184dist-local:
185
186clean-local:
187	test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
188	$(RMV) $(OBJECTS) $(STATIC_OBJECTS) $(ALL_TARGETS) $(SO_VERSION_DATA)
189
190distclean-local: clean-local
191	$(RMV) Makefile icucfg.h $(SVC_HOOK_INC)
192
193check-local:
194
195Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(SVC_HOOK_INC)
196	cd $(top_builddir) \
197	 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
198
199ifneq ($(ENABLE_STATIC),)
200$(TARGET): $(STATIC_OBJECTS)
201	$(AR) $(ARFLAGS) $(AR_OUTOPT)$@ $^
202	$(RANLIB) $@
203endif
204
205ifneq ($(ENABLE_SHARED),)
206$(SHARED_OBJECT): $(OBJECTS) $(SO_VERSION_DATA)
207	$(SHLIB.cc) $(LD_SONAME) $(OUTOPT)$@ $^ $(LIBS)
208ifeq ($(ENABLE_RPATH),YES)
209ifneq ($(wildcard $(libdir)/$(MIDDLE_SO_TARGET)),)
210	$(warning RPATH warning: --enable-rpath means test programs may use existing $(libdir)/$(MIDDLE_SO_TARGET))
211endif
212endif
213
214ifeq ($(OS390BATCH),1)
215$(BATCH_TARGET):$(OBJECTS)
216	$(SHLIB.cc) $(LD_SONAME) $(OUTOPT)$@ $^ $(BATCH_LIBS)
217endif   # OS390BATCH
218endif   # ENABLE_SHARED
219
220ifeq (,$(MAKECMDGOALS))
221-include $(DEPS)
222else
223ifneq ($(patsubst %clean,,$(MAKECMDGOALS)),)
224-include $(DEPS)
225endif
226endif
227
228