• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#******************************************************************************
2#
3#   Copyright (C) 1999-2011, 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)
59
60ifneq ($(top_builddir),$(top_srcdir))
61CPPFLAGS += -I$(top_builddir)/common
62endif
63CPPFLAGS += -I$(srcdir) -I$(top_srcdir)/i18n $(LIBCPPFLAGS) $(CPPFLAGSICUUC)
64# we want DEFS here, because we want icucfg.h
65DEFS += -DU_COMMON_IMPLEMENTATION -DU_HAVE_ICUCFG
66LDFLAGS += $(LDFLAGSICUUC)
67
68# for plugin configuration
69CPPFLAGS += "-DDEFAULT_ICU_PLUGINS=\"$(libdir)/icu\" "
70
71# for icu data location
72ifeq ($(PKGDATA_MODE),common)
73CPPFLAGS += "-DU_ICU_DATA_DEFAULT_DIR=\"$(ICUDATA_DIR)\""
74endif
75
76# $(LIBICUDT) is either stub data or the real DLL common data.
77LIBS = $(LIBICUDT) $(DEFAULT_LIBS)
78
79OBJECTS = errorcode.o putil.o umath.o utypes.o uinvchar.o umutex.o ucln_cmn.o \
80uinit.o uobject.o cmemory.o charstr.o \
81udata.o ucmndata.o udatamem.o umapfile.o udataswp.o ucol_swp.o utrace.o \
82uhash.o uhash_us.o uenum.o ustrenum.o uvector.o ustack.o uvectr32.o uvectr64.o \
83ucnv.o ucnv_bld.o ucnv_cnv.o ucnv_io.o ucnv_cb.o ucnv_err.o ucnvlat1.o \
84ucnv_u7.o ucnv_u8.o ucnv_u16.o ucnv_u32.o ucnvscsu.o ucnvbocu.o \
85ucnv_ext.o ucnvmbcs.o ucnv2022.o ucnvhz.o ucnv_lmb.o ucnvisci.o ucnvdisp.o ucnv_set.o ucnv_ct.o \
86uresbund.o ures_cnv.o uresdata.o resbund.o resbund_cnv.o \
87messagepattern.o ucat.o locmap.o uloc.o locid.o locutil.o locavailable.o locdispnames.o loclikely.o locresdata.o \
88bytestream.o stringpiece.o \
89stringtriebuilder.o bytestriebuilder.o \
90bytestrie.o bytestrieiterator.o \
91ucharstrie.o ucharstriebuilder.o ucharstrieiterator.o \
92appendable.o ustr_cnv.o unistr_cnv.o unistr.o unistr_case.o unistr_props.o \
93utf_impl.o ustring.o ustrcase.o ucasemap.o cstring.o ustrfmt.o ustrtrns.o ustr_wcs.o utext.o \
94normalizer2impl.o normalizer2.o filterednormalizer2.o normlzr.o unorm.o unormcmp.o unorm_it.o \
95chariter.o schriter.o uchriter.o uiter.o \
96patternprops.o uchar.o uprops.o ucase.o propname.o ubidi_props.o ubidi.o ubidiwrt.o ubidiln.o ushape.o \
97uscript.o usc_impl.o unames.o \
98utrie.o utrie2.o utrie2_builder.o bmpset.o unisetspan.o uset_props.o uniset_props.o uset.o uniset.o usetiter.o ruleiter.o caniter.o unifilt.o unifunct.o \
99uarrsort.o brkiter.o ubrk.o brkeng.o dictbe.o triedict.o \
100rbbi.o rbbidata.o rbbinode.o rbbirb.o rbbiscan.o rbbisetb.o rbbistbl.o rbbitblb.o \
101serv.o servnotf.o servls.o servlk.o servlkf.o servrbf.o servslkf.o \
102uidna.o usprep.o uts46.o punycode.o \
103util.o util_props.o parsepos.o locbased.o cwchar.o wintz.o mutex.o dtintrv.o ucnvsel.o propsvec.o \
104ulist.o uloc_tag.o icudataver.o icuplug.o
105
106## Header files to install
107HEADERS = $(srcdir)/unicode/*.h unicode/*.h
108
109STATIC_OBJECTS = $(OBJECTS:.o=.$(STATIC_O))
110
111DEPS = $(OBJECTS:.o=.d)
112
113-include Makefile.local
114
115-include $(SVC_HOOK_INC)
116
117
118## List of phony targets
119.PHONY : all all-local install install-local clean clean-local	\
120distclean distclean-local install-library install-headers dist	\
121dist-local check check-local
122
123## Clear suffix list
124.SUFFIXES :
125
126## List of standard targets
127all: all-local
128install: install-local
129clean: clean-local
130distclean : distclean-local
131dist: dist-local
132check: all check-local
133
134all-local: $(ALL_TARGETS) unicode/platform.h
135
136install-local: install-headers install-library
137
138install-library: all-local
139	$(MKINSTALLDIRS) $(DESTDIR)$(libdir)
140ifneq ($(ENABLE_STATIC),)
141	$(INSTALL-L) $(TARGET) $(DESTDIR)$(libdir)
142endif
143ifneq ($(ENABLE_SHARED),)
144	$(INSTALL-L) $(FINAL_SO_TARGET) $(DESTDIR)$(libdir)
145ifneq ($(FINAL_SO_TARGET),$(SO_TARGET))
146	cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(SO_TARGET)) && ln -s $(notdir $(FINAL_SO_TARGET)) $(notdir $(SO_TARGET))
147ifneq ($(FINAL_SO_TARGET),$(MIDDLE_SO_TARGET))
148	cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(MIDDLE_SO_TARGET)) && ln -s $(notdir $(FINAL_SO_TARGET)) $(notdir $(MIDDLE_SO_TARGET))
149endif
150endif
151ifneq ($(IMPORT_LIB_EXT),)
152	$(INSTALL-L) $(FINAL_IMPORT_LIB) $(DESTDIR)$(libdir)
153ifneq ($(IMPORT_LIB),$(FINAL_IMPORT_LIB))
154	cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(IMPORT_LIB)) && ln -s $(notdir $(FINAL_IMPORT_LIB)) $(notdir $(IMPORT_LIB))
155endif
156ifneq ($(MIDDLE_IMPORT_LIB),$(FINAL_IMPORT_LIB))
157	cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(MIDDLE_IMPORT_LIB)) && ln -s $(notdir $(FINAL_IMPORT_LIB)) $(notdir $(MIDDLE_IMPORT_LIB))
158endif
159endif
160endif
161
162$(SVC_HOOK_INC):
163	@echo generating $@
164	@-test -f $(top_srcdir)/common/$(LOCALSVC_CPP) && ( echo "have $(LOCALSVC_CPP) - U_LOCAL_SERVICE_HOOK=1" ; \
165		echo 'CPPFLAGS +=-DU_LOCAL_SERVICE_HOOK=1' > $@ ; \
166		echo 'OBJECTS += $(LOCALSVC_CPP:%.cpp=%.o)' >> $@ \
167		 ) ; true
168	@echo "# Autogenerated by Makefile" >> $@
169
170install-headers:
171	$(MKINSTALLDIRS) $(DESTDIR)$(includedir)/unicode
172	@for file in $(HEADERS); do \
173	 echo "$(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/unicode"; \
174	 $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/unicode || exit; \
175	done
176
177dist-local:
178
179clean-local:
180	test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
181	$(RMV) $(OBJECTS) $(STATIC_OBJECTS) $(ALL_TARGETS) $(SO_VERSION_DATA)
182
183distclean-local: clean-local
184	$(RMV) Makefile icucfg.h unicode/platform.h $(SVC_HOOK_INC)
185
186check-local:
187
188Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(SVC_HOOK_INC)
189	cd $(top_builddir) \
190	 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
191
192unicode/platform.h: $(srcdir)/unicode/platform.h.in $(top_builddir)/config.status
193	cd $(top_builddir) \
194	 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
195
196ifneq ($(ENABLE_STATIC),)
197$(TARGET): $(STATIC_OBJECTS)
198	$(AR) $(ARFLAGS) $(AR_OUTOPT)$@ $^
199	$(RANLIB) $@
200endif
201
202ifneq ($(ENABLE_SHARED),)
203$(SHARED_OBJECT): $(OBJECTS) $(SO_VERSION_DATA)
204	$(SHLIB.cc) $(LD_SONAME) $(OUTOPT)$@ $^ $(LIBS)
205
206ifeq ($(OS390BATCH),1)
207$(BATCH_TARGET):$(OBJECTS)
208	$(SHLIB.cc) $(LD_SONAME) $(OUTOPT)$@ $^ $(BATCH_LIBS)
209endif   # OS390BATCH
210endif   # ENABLE_SHARED
211
212ifeq (,$(MAKECMDGOALS))
213-include $(DEPS)
214else
215ifneq ($(patsubst %clean,,$(MAKECMDGOALS)),)
216-include $(DEPS)
217endif
218endif
219
220