1 # Copyright (C) 2016 and later: Unicode, Inc. and others.
2 # License & terms of use: http://www.unicode.org/copyright.html
3 #******************************************************************************
5 # Copyright (C) 1999-2011, International Business Machines
6 # Corporation and others. All Rights Reserved.
8 #******************************************************************************
9 ## Makefile.in for ICU - icuio.so
12 ## Source directory information
14 top_srcdir = @top_srcdir@
18 ## All the flags and other definitions are included here.
19 include $(top_builddir)/icudefs.mk
21 ## Build directory information
24 ## Extra files to remove for 'make clean'
25 CLEANFILES = *~ $(DEPS) $(IMPORT_LIB) $(MIDDLE_IMPORT_LIB) $(FINAL_IMPORT_LIB)
29 TARGET_STUBNAME=$(IO_STUBNAME)
31 ifneq ($(ENABLE_STATIC),)
32 TARGET = $(LIBDIR)/$(LIBSICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(A)
35 ifneq ($(ENABLE_SHARED),)
36 SO_TARGET = $(LIBDIR)/$(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(SO)
37 ALL_SO_TARGETS = $(SO_TARGET) $(MIDDLE_SO_TARGET) $(FINAL_SO_TARGET) $(SHARED_OBJECT)
39 ifeq ($(ENABLE_SO_VERSION_DATA),1)
40 SO_VERSION_DATA = io.res
43 ifeq ($(OS390BATCH),1)
44 BATCH_TARGET = $(BATCH_IO_TARGET)
45 BATCH_LIBS = $(BATCH_LIBICUUC) $(BATCH_LIBICUI18N) -lm
50 ALL_TARGETS = $(TARGET) $(ALL_SO_TARGETS) $(BATCH_TARGET)
52 DYNAMICCPPFLAGS = $(SHAREDLIBCPPFLAGS)
53 DYNAMICCFLAGS = $(SHAREDLIBCFLAGS)
54 DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS)
55 CFLAGS += $(LIBCFLAGS)
56 CXXFLAGS += $(LIBCXXFLAGS)
58 CPPFLAGS += -I$(srcdir) -I$(top_srcdir)/common -I$(top_srcdir)/i18n $(LIBCPPFLAGS) $(CPPFLAGSICUIO)
59 DEFS += -DU_IO_IMPLEMENTATION
60 LDFLAGS += $(LDFLAGSICUIO)
61 LIBS = $(LIBICUUC) $(LIBICUI18N) $(DEFAULT_LIBS)
63 OBJECTS = locbund.o ufile.o ufmt_cmn.o uprintf.o uprntf_p.o \
64 uscanf.o uscanf_p.o ustdio.o sprintf.o sscanf.o \
67 ## Header files to install
68 HEADERS = $(srcdir)/unicode/*.h
70 STATIC_OBJECTS = $(OBJECTS:.o=.$(STATIC_O))
72 DEPS = $(OBJECTS:.o=.d)
74 -include Makefile.local
76 ## List of phony targets
77 .PHONY : all all-local install install-local clean clean-local \
78 distclean distclean-local install-library install-headers dist \
79 dist-local check check-local check-exhaustive
84 ## List of standard targets
86 install: install-local
88 distclean : distclean-local
90 check: all check-local
92 check-exhaustive: check
94 all-local: $(ALL_TARGETS)
96 install-local: install-headers install-library
98 install-library: all-local
99 $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
100 ifneq ($(ENABLE_STATIC),)
101 $(INSTALL-L) $(TARGET) $(DESTDIR)$(libdir)
103 ifneq ($(ENABLE_SHARED),)
104 $(INSTALL-L) $(FINAL_SO_TARGET) $(DESTDIR)$(libdir)
105 ifneq ($(FINAL_SO_TARGET),$(SO_TARGET))
106 cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(SO_TARGET)) && ln -s $(notdir $(FINAL_SO_TARGET)) $(notdir $(SO_TARGET))
107 ifneq ($(FINAL_SO_TARGET),$(MIDDLE_SO_TARGET))
108 cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(MIDDLE_SO_TARGET)) && ln -s $(notdir $(FINAL_SO_TARGET)) $(notdir $(MIDDLE_SO_TARGET))
111 ifneq ($(IMPORT_LIB_EXT),)
112 $(INSTALL-L) $(FINAL_IMPORT_LIB) $(DESTDIR)$(libdir)
113 ifneq ($(IMPORT_LIB),$(FINAL_IMPORT_LIB))
114 cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(IMPORT_LIB)) && ln -s $(notdir $(FINAL_IMPORT_LIB)) $(notdir $(IMPORT_LIB))
116 ifneq ($(MIDDLE_IMPORT_LIB),$(FINAL_IMPORT_LIB))
117 cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(MIDDLE_IMPORT_LIB)) && ln -s $(notdir $(FINAL_IMPORT_LIB)) $(notdir $(MIDDLE_IMPORT_LIB))
123 $(MKINSTALLDIRS) $(DESTDIR)$(includedir)/unicode
124 @for file in $(HEADERS); do \
125 echo "$(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/unicode"; \
126 $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/unicode || exit; \
132 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
133 $(RMV) $(OBJECTS) $(STATIC_OBJECTS) $(ALL_TARGETS) $(SO_VERSION_DATA)
135 distclean-local: clean-local
140 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
142 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
144 ifneq ($(ENABLE_STATIC),)
145 $(TARGET): $(STATIC_OBJECTS)
146 $(AR) $(ARFLAGS) $(AR_OUTOPT)$@ $^
150 ifneq ($(ENABLE_SHARED),)
151 $(SHARED_OBJECT): $(OBJECTS) $(SO_VERSION_DATA)
152 $(SHLIB.cc) $(LD_SONAME) $(OUTOPT)$@ $^ $(LIBS)
153 ifeq ($(ENABLE_RPATH),YES)
154 ifneq ($(wildcard $(libdir)/$(MIDDLE_SO_TARGET)),)
155 $(warning RPATH warning: --enable-rpath means test programs may use existing $(libdir)/$(MIDDLE_SO_TARGET))
159 ifeq ($(OS390BATCH),1)
160 $(BATCH_TARGET):$(OBJECTS)
161 $(SHLIB.cc) $(LD_SONAME) $(OUTOPT)$@ $^ $(BATCH_LIBS)
163 endif # ENABLE_SHARED
165 ifeq (,$(MAKECMDGOALS))
168 ifneq ($(patsubst %clean,,$(MAKECMDGOALS)),)