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