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