Home | History | Annotate | Download | only in io
      1 #******************************************************************************
      2 #
      3 #   Copyright (C) 1999-2007, International Business Machines
      4 #   Corporation and others.  All Rights Reserved.
      5 #
      6 #******************************************************************************
      7 ## Makefile.in for ICU - icuio.so
      8 ## Stephen F. Booth
      9 
     10 ## Source directory information
     11 srcdir = .
     12 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 = io
     21 
     22 ## Extra files to remove for 'make clean'
     23 CLEANFILES = *~ $(DEPS) $(IMPORT_LIB) $(MIDDLE_IMPORT_LIB) $(FINAL_IMPORT_LIB)
     24 
     25 ## Target information
     26 
     27 TARGET_STUBNAME=$(IO_STUBNAME)
     28 
     29 ifneq ($(ENABLE_STATIC),)
     30 TARGET = $(LIBDIR)/$(LIBSICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(A)
     31 endif
     32 
     33 ifneq ($(ENABLE_SHARED),)
     34 SO_TARGET = $(LIBDIR)/$(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(SO)
     35 ALL_SO_TARGETS = $(SO_TARGET) $(MIDDLE_SO_TARGET) $(FINAL_SO_TARGET) $(SHARED_OBJECT)
     36 
     37 ifeq ($(ENABLE_SO_VERSION_DATA),1)
     38 SO_VERSION_DATA = io.res
     39 endif
     40 
     41 ifeq ($(OS390BATCH),1)
     42 BATCH_TARGET = $(BATCH_IO_TARGET)
     43 BATCH_LIBS = $(BATCH_LIBICUUC) $(BATCH_LIBICUI18N) -lm
     44 endif   # OS390BATCH
     45 
     46 endif   # ENABLE_SHARED
     47 
     48 ALL_TARGETS = $(TARGET) $(ALL_SO_TARGETS) $(BATCH_TARGET)
     49 
     50 DYNAMICCPPFLAGS = $(SHAREDLIBCPPFLAGS)
     51 DYNAMICCFLAGS = $(SHAREDLIBCFLAGS)
     52 DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS)
     53 CFLAGS += $(LIBCFLAGS)
     54 CXXFLAGS += $(LIBCXXFLAGS)
     55 
     56 ifneq ($(top_builddir),$(top_srcdir))
     57 CPPFLAGS += -I$(top_builddir)/common
     58 endif
     59 CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n $(LIBCPPFLAGS)
     60 DEFS += -DU_IO_IMPLEMENTATION
     61 LDFLAGS += $(LDFLAGSICUIO)
     62 LIBS = $(LIBICUUC) $(LIBICUI18N) $(DEFAULT_LIBS)
     63 
     64 OBJECTS = locbund.o ufile.o ufmt_cmn.o uprintf.o uprntf_p.o \
     65 uscanf.o uscanf_p.o ustdio.o sprintf.o sscanf.o \
     66 ustream.o ucln_io.o
     67 
     68 ## Header files to install
     69 HEADERS = $(srcdir)/unicode/*.h
     70 
     71 STATIC_OBJECTS = $(OBJECTS:.o=.$(STATIC_O))
     72 
     73 DEPS = $(OBJECTS:.o=.d)
     74 
     75 -include Makefile.local
     76 
     77 ## List of phony targets
     78 .PHONY : all all-local install install-local clean clean-local	\
     79 distclean distclean-local install-library install-headers dist	\
     80 dist-local check check-local
     81 
     82 ## Clear suffix list
     83 .SUFFIXES :
     84 
     85 ## List of standard targets
     86 all: all-local
     87 install: install-local
     88 clean: clean-local
     89 distclean : distclean-local
     90 dist: dist-local
     91 check: all check-local
     92 
     93 all-local: $(ALL_TARGETS)
     94 
     95 install-local: install-headers install-library
     96 
     97 install-library: all-local
     98 	$(MKINSTALLDIRS) $(DESTDIR)$(libdir)
     99 ifneq ($(ENABLE_STATIC),)
    100 	$(INSTALL-L) $(TARGET) $(DESTDIR)$(libdir)
    101 endif
    102 ifneq ($(ENABLE_SHARED),)
    103 	$(INSTALL-L) $(FINAL_SO_TARGET) $(DESTDIR)$(libdir)
    104 ifneq ($(FINAL_SO_TARGET),$(SO_TARGET))
    105 	cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(SO_TARGET)) && ln -s $(notdir $(FINAL_SO_TARGET)) $(notdir $(SO_TARGET))
    106 ifneq ($(FINAL_SO_TARGET),$(MIDDLE_SO_TARGET))
    107 	cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(MIDDLE_SO_TARGET)) && ln -s $(notdir $(FINAL_SO_TARGET)) $(notdir $(MIDDLE_SO_TARGET))
    108 endif
    109 endif
    110 ifneq ($(IMPORT_LIB_EXT),)
    111 	$(INSTALL-L) $(FINAL_IMPORT_LIB) $(DESTDIR)$(libdir)
    112 ifneq ($(IMPORT_LIB),$(FINAL_IMPORT_LIB))
    113 	cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(IMPORT_LIB)) && ln -s $(notdir $(FINAL_IMPORT_LIB)) $(notdir $(IMPORT_LIB))
    114 endif
    115 ifneq ($(MIDDLE_IMPORT_LIB),$(FINAL_IMPORT_LIB))
    116 	cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(MIDDLE_IMPORT_LIB)) && ln -s $(notdir $(FINAL_IMPORT_LIB)) $(notdir $(MIDDLE_IMPORT_LIB))
    117 endif
    118 endif
    119 endif
    120 
    121 install-headers:
    122 	$(MKINSTALLDIRS) $(DESTDIR)$(includedir)/unicode
    123 	@for file in $(HEADERS); do \
    124 	 echo "$(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/unicode"; \
    125 	 $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/unicode || exit; \
    126 	done
    127 
    128 dist-local:
    129 
    130 clean-local:
    131 	test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
    132 	$(RMV) $(OBJECTS) $(STATIC_OBJECTS) $(ALL_TARGETS) $(SO_VERSION_DATA)
    133 
    134 distclean-local: clean-local
    135 	$(RMV) Makefile
    136 
    137 check-local:
    138 
    139 Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
    140 	cd $(top_builddir) \
    141 	 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
    142 
    143 ifneq ($(ENABLE_STATIC),)
    144 $(TARGET): $(STATIC_OBJECTS)
    145 	$(AR) $(ARFLAGS) $(AR_OUTOPT)$@ $^
    146 	$(RANLIB) $@
    147 endif
    148 
    149 ifneq ($(ENABLE_SHARED),)
    150 $(SHARED_OBJECT): $(OBJECTS) $(SO_VERSION_DATA)
    151 	$(SHLIB.cc) $(LD_SONAME) $(OUTOPT)$@ $^ $(LIBS)
    152 
    153 ifeq ($(OS390BATCH),1)
    154 $(BATCH_TARGET):$(OBJECTS)
    155 	$(SHLIB.cc) $(LD_SONAME) $(OUTOPT)$@ $^ $(BATCH_LIBS)
    156 endif   # OS390BATCH
    157 endif   # ENABLE_SHARED
    158 
    159 ifeq (,$(MAKECMDGOALS))
    160 -include $(DEPS)
    161 else
    162 ifneq ($(patsubst %clean,,$(MAKECMDGOALS)),)
    163 -include $(DEPS)
    164 endif
    165 endif
    166 
    167