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