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 63SOURCES = $(shell cat $(srcdir)/sources.txt) 64OBJECTS = $(SOURCES:.cpp=.o) 65 66## Header files to install 67HEADERS = $(srcdir)/unicode/*.h 68 69STATIC_OBJECTS = $(OBJECTS:.o=.$(STATIC_O)) 70 71DEPS = $(OBJECTS:.o=.d) 72 73-include Makefile.local 74 75## List of phony targets 76.PHONY : all all-local install install-local clean clean-local \ 77distclean distclean-local install-library install-headers dist \ 78dist-local check check-local check-exhaustive 79 80## Clear suffix list 81.SUFFIXES : 82 83## List of standard targets 84all: all-local 85install: install-local 86clean: clean-local 87distclean : distclean-local 88dist: dist-local 89check: all check-local 90 91check-exhaustive: check 92 93all-local: $(ALL_TARGETS) 94 95install-local: install-headers install-library 96 97install-library: all-local 98 $(MKINSTALLDIRS) $(DESTDIR)$(libdir) 99ifneq ($(ENABLE_STATIC),) 100 $(INSTALL-L) $(TARGET) $(DESTDIR)$(libdir) 101endif 102ifneq ($(ENABLE_SHARED),) 103# For MinGW, do we want the DLL to go in the bin location? 104ifeq ($(MINGW_MOVEDLLSTOBINDIR),YES) 105 $(MKINSTALLDIRS) $(DESTDIR)$(bindir) 106 $(INSTALL-L) $(FINAL_SO_TARGET) $(DESTDIR)$(bindir) 107else 108 $(INSTALL-L) $(FINAL_SO_TARGET) $(DESTDIR)$(libdir) 109ifneq ($(FINAL_SO_TARGET),$(SO_TARGET)) 110 cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(SO_TARGET)) && ln -s $(notdir $(FINAL_SO_TARGET)) $(notdir $(SO_TARGET)) 111ifneq ($(FINAL_SO_TARGET),$(MIDDLE_SO_TARGET)) 112 cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(MIDDLE_SO_TARGET)) && ln -s $(notdir $(FINAL_SO_TARGET)) $(notdir $(MIDDLE_SO_TARGET)) 113endif 114endif 115endif 116ifneq ($(IMPORT_LIB_EXT),) 117 $(INSTALL-L) $(FINAL_IMPORT_LIB) $(DESTDIR)$(libdir) 118ifneq ($(IMPORT_LIB),$(FINAL_IMPORT_LIB)) 119 cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(IMPORT_LIB)) && ln -s $(notdir $(FINAL_IMPORT_LIB)) $(notdir $(IMPORT_LIB)) 120endif 121ifneq ($(MIDDLE_IMPORT_LIB),$(FINAL_IMPORT_LIB)) 122 cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(MIDDLE_IMPORT_LIB)) && ln -s $(notdir $(FINAL_IMPORT_LIB)) $(notdir $(MIDDLE_IMPORT_LIB)) 123endif 124endif 125endif 126 127install-headers: 128 $(MKINSTALLDIRS) $(DESTDIR)$(includedir)/unicode 129 @for file in $(HEADERS); do \ 130 echo "$(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/unicode"; \ 131 $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/unicode || exit; \ 132 done 133 134dist-local: 135 136clean-local: 137 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) 138 $(RMV) $(OBJECTS) $(STATIC_OBJECTS) $(ALL_TARGETS) $(SO_VERSION_DATA) 139 140distclean-local: clean-local 141 $(RMV) Makefile 142 143check-local: 144 145Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 146 cd $(top_builddir) \ 147 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status 148 149ifneq ($(ENABLE_STATIC),) 150$(TARGET): $(STATIC_OBJECTS) 151 $(AR) $(ARFLAGS) $(AR_OUTOPT)$@ $^ 152 $(RANLIB) $@ 153endif 154 155ifneq ($(ENABLE_SHARED),) 156$(SHARED_OBJECT): $(OBJECTS) $(SO_VERSION_DATA) 157 $(SHLIB.cc) $(LD_SONAME) $(OUTOPT)$@ $^ $(LIBS) 158ifeq ($(ENABLE_RPATH),YES) 159ifneq ($(wildcard $(libdir)/$(MIDDLE_SO_TARGET)),) 160 $(warning RPATH warning: --enable-rpath means test programs may use existing $(libdir)/$(MIDDLE_SO_TARGET)) 161endif 162endif 163 164ifeq ($(OS390BATCH),1) 165$(BATCH_TARGET):$(OBJECTS) 166 $(SHLIB.cc) $(LD_SONAME) $(OUTOPT)$@ $^ $(BATCH_LIBS) 167endif # OS390BATCH 168endif # ENABLE_SHARED 169 170ifeq (,$(MAKECMDGOALS)) 171-include $(DEPS) 172else 173ifneq ($(patsubst %clean,,$(MAKECMDGOALS)),) 174-include $(DEPS) 175endif 176endif 177 178