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