Home | History | Annotate | Download | only in common
      1 #******************************************************************************
      2 #
      3 #   Copyright (C) 1999-2009, 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
     11 srcdir = @srcdir@
     12 top_srcdir = @top_srcdir@
     13 
     14 top_builddir = ..
     15 
     16 ## All the flags and other definitions are included here.
     17 include $(top_builddir)/icudefs.mk
     18 
     19 ## Build directory information
     20 subdir = common
     21 
     22 # for service hook
     23 LOCALSVC_CPP=localsvc.cpp
     24 SVC_HOOK_INC=$(top_builddir)/common/svchook.mk
     25 
     26 ## Extra files to remove for 'make clean'
     27 CLEANFILES = *~ $(DEPS) $(IMPORT_LIB) $(MIDDLE_IMPORT_LIB) $(FINAL_IMPORT_LIB) $(SVC_HOOK_INC)
     28 
     29 ## Target information
     30 
     31 TARGET_STUBNAME=$(COMMON_STUBNAME)
     32 
     33 ifneq ($(ENABLE_STATIC),)
     34 TARGET = $(LIBDIR)/$(LIBSICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(A)
     35 endif
     36 
     37 ifneq ($(ENABLE_SHARED),)
     38 SO_TARGET = $(LIBDIR)/$(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(SO)
     39 ALL_SO_TARGETS = $(SO_TARGET) $(MIDDLE_SO_TARGET) $(FINAL_SO_TARGET) $(SHARED_OBJECT)
     40 
     41 ifeq ($(ENABLE_SO_VERSION_DATA),1)
     42 SO_VERSION_DATA = common.res
     43 endif
     44 
     45 ifeq ($(OS390BATCH),1)
     46 BATCH_TARGET = $(BATCH_COMMON_TARGET)
     47 BATCH_LIBS = $(BATCH_LIBICUDT) -lm
     48 endif   # OS390BATCH
     49 
     50 endif   # ENABLE_SHARED
     51 
     52 ALL_TARGETS = $(TARGET) $(ALL_SO_TARGETS) $(BATCH_TARGET)
     53 
     54 DYNAMICCPPFLAGS = $(SHAREDLIBCPPFLAGS)
     55 DYNAMICCFLAGS = $(SHAREDLIBCFLAGS)
     56 DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS)
     57 CFLAGS += $(LIBCFLAGS)
     58 CXXFLAGS += $(LIBCXXFLAGS)
     59 
     60 ifneq ($(top_builddir),$(top_srcdir))
     61 CPPFLAGS += -I$(top_builddir)/common
     62 endif
     63 CPPFLAGS += -I$(srcdir) -I$(top_srcdir)/i18n $(LIBCPPFLAGS)
     64 DEFS += -DU_COMMON_IMPLEMENTATION
     65 LDFLAGS += $(LDFLAGSICUUC)
     66 
     67 # $(LIBICUDT) is either stub data or the real DLL common data.
     68 LIBS = $(LIBICUDT) $(DEFAULT_LIBS)
     69 
     70 OBJECTS = errorcode.o putil.o umath.o utypes.o uinvchar.o umutex.o ucln_cmn.o uinit.o uobject.o cmemory.o \
     71 udata.o ucmndata.o udatamem.o umapfile.o udataswp.o ucol_swp.o utrace.o \
     72 uhash.o uhash_us.o uenum.o ustrenum.o uvector.o ustack.o uvectr32.o \
     73 ucnv.o ucnv_bld.o ucnv_cnv.o ucnv_io.o ucnv_cb.o ucnv_err.o ucnvlat1.o \
     74 ucnv_u7.o ucnv_u8.o ucnv_u16.o ucnv_u32.o ucnvscsu.o ucnvbocu.o \
     75 ucnv_ext.o ucnvmbcs.o ucnv2022.o ucnvhz.o ucnv_lmb.o ucnvisci.o ucnvdisp.o ucnv_set.o \
     76 uresbund.o ures_cnv.o uresdata.o resbund.o resbund_cnv.o \
     77 ucat.o locmap.o uloc.o locid.o locutil.o \
     78 bytestream.o stringpiece.o \
     79 ustr_cnv.o unistr_cnv.o unistr.o unistr_case.o unistr_props.o \
     80 utf_impl.o ustring.o ustrcase.o ucasemap.o cstring.o ustrfmt.o ustrtrns.o ustr_wcs.o utext.o \
     81 normlzr.o unorm.o unormcmp.o unorm_it.o chariter.o schriter.o uchriter.o uiter.o \
     82 uchar.o uprops.o ucase.o propname.o ubidi_props.o ubidi.o ubidiwrt.o ubidiln.o ushape.o \
     83 uscript.o usc_impl.o unames.o \
     84 utrie.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 \
     85 uarrsort.o brkiter.o ubrk.o brkeng.o dictbe.o triedict.o \
     86 rbbi.o rbbidata.o rbbinode.o rbbirb.o rbbiscan.o rbbisetb.o rbbistbl.o rbbitblb.o \
     87 serv.o servnotf.o servls.o servlk.o servlkf.o servrbf.o servslkf.o \
     88 uidna.o usprep.o punycode.o \
     89 util.o util_props.o parsepos.o locbased.o cwchar.o wintz.o mutex.o dtintrv.o ucnvsel.o propsvec.o \
     90 ulist.o uloc_tag.o
     91 
     92 ## Header files to install
     93 HEADERS = $(srcdir)/unicode/*.h unicode/*.h
     94 
     95 STATIC_OBJECTS = $(OBJECTS:.o=.$(STATIC_O))
     96 
     97 DEPS = $(OBJECTS:.o=.d)
     98 
     99 -include Makefile.local
    100 
    101 -include $(SVC_HOOK_INC)
    102 
    103 
    104 ## List of phony targets
    105 .PHONY : all all-local install install-local clean clean-local	\
    106 distclean distclean-local install-library install-headers dist	\
    107 dist-local check check-local
    108 
    109 ## Clear suffix list
    110 .SUFFIXES :
    111 
    112 ## List of standard targets
    113 all: all-local
    114 install: install-local
    115 clean: clean-local
    116 distclean : distclean-local
    117 dist: dist-local
    118 check: all check-local
    119 
    120 all-local: $(ALL_TARGETS) unicode/platform.h
    121 
    122 install-local: install-headers install-library
    123 
    124 install-library: all-local
    125 	$(MKINSTALLDIRS) $(DESTDIR)$(libdir)
    126 ifneq ($(ENABLE_STATIC),)
    127 	$(INSTALL-L) $(TARGET) $(DESTDIR)$(libdir)
    128 endif
    129 ifneq ($(ENABLE_SHARED),)
    130 	$(INSTALL-L) $(FINAL_SO_TARGET) $(DESTDIR)$(libdir)
    131 ifneq ($(FINAL_SO_TARGET),$(SO_TARGET))
    132 	cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(SO_TARGET)) && ln -s $(notdir $(FINAL_SO_TARGET)) $(notdir $(SO_TARGET))
    133 ifneq ($(FINAL_SO_TARGET),$(MIDDLE_SO_TARGET))
    134 	cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(MIDDLE_SO_TARGET)) && ln -s $(notdir $(FINAL_SO_TARGET)) $(notdir $(MIDDLE_SO_TARGET))
    135 endif
    136 endif
    137 ifneq ($(IMPORT_LIB_EXT),)
    138 	$(INSTALL-L) $(FINAL_IMPORT_LIB) $(DESTDIR)$(libdir)
    139 ifneq ($(IMPORT_LIB),$(FINAL_IMPORT_LIB))
    140 	cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(IMPORT_LIB)) && ln -s $(notdir $(FINAL_IMPORT_LIB)) $(notdir $(IMPORT_LIB))
    141 endif
    142 ifneq ($(MIDDLE_IMPORT_LIB),$(FINAL_IMPORT_LIB))
    143 	cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(MIDDLE_IMPORT_LIB)) && ln -s $(notdir $(FINAL_IMPORT_LIB)) $(notdir $(MIDDLE_IMPORT_LIB))
    144 endif
    145 endif
    146 endif
    147 
    148 $(SVC_HOOK_INC):
    149 	@echo generating $@
    150 	@-test -f $(top_srcdir)/common/$(LOCALSVC_CPP) && ( echo "have $(LOCALSVC_CPP) - U_LOCAL_SERVICE_HOOK=1" ; \
    151 		echo 'CPPFLAGS +=-DU_LOCAL_SERVICE_HOOK=1' > $@ ; \
    152 		echo 'OBJECTS += $(LOCALSVC_CPP:%.cpp=%.o)' >> $@ \
    153 		 ) ; true
    154 	@echo "# Autogenerated by Makefile" >> $@
    155 
    156 install-headers:
    157 	$(MKINSTALLDIRS) $(DESTDIR)$(includedir)/unicode
    158 	@for file in $(HEADERS); do \
    159 	 echo "$(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/unicode"; \
    160 	 $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/unicode || exit; \
    161 	done
    162 
    163 dist-local:
    164 
    165 clean-local:
    166 	test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
    167 	$(RMV) $(OBJECTS) $(STATIC_OBJECTS) $(ALL_TARGETS) $(SO_VERSION_DATA)
    168 
    169 distclean-local: clean-local
    170 	$(RMV) Makefile icucfg.h unicode/platform.h $(SVC_HOOK_INC)
    171 
    172 check-local:
    173 
    174 Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(SVC_HOOK_INC)
    175 	cd $(top_builddir) \
    176 	 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
    177 
    178 unicode/platform.h: $(srcdir)/unicode/platform.h.in $(top_builddir)/config.status
    179 	cd $(top_builddir) \
    180 	 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
    181 
    182 ifneq ($(ENABLE_STATIC),)
    183 $(TARGET): $(STATIC_OBJECTS)
    184 	$(AR) $(ARFLAGS) $(AR_OUTOPT)$@ $^
    185 	$(RANLIB) $@
    186 endif
    187 
    188 ifneq ($(ENABLE_SHARED),)
    189 $(SHARED_OBJECT): $(OBJECTS) $(SO_VERSION_DATA)
    190 	$(SHLIB.cc) $(LD_SONAME) $(OUTOPT)$@ $^ $(LIBS)
    191 
    192 ifeq ($(OS390BATCH),1)
    193 $(BATCH_TARGET):$(OBJECTS)
    194 	$(SHLIB.cc) $(LD_SONAME) $(OUTOPT)$@ $^ $(BATCH_LIBS)
    195 endif   # OS390BATCH
    196 endif   # ENABLE_SHARED
    197 
    198 ifeq (,$(MAKECMDGOALS))
    199 -include $(DEPS)
    200 else
    201 ifneq ($(patsubst %clean,,$(MAKECMDGOALS)),)
    202 -include $(DEPS)
    203 endif
    204 endif
    205 
    206