Imported Upstream version 58.1
[platform/upstream/icu.git] / source / Makefile.in
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 ## Top-level Makefile.in for ICU
10 ## Stephen F. Booth
11
12 srcdir = @srcdir@
13 top_srcdir = @top_srcdir@
14
15 top_builddir = .
16
17 include $(top_builddir)/icudefs.mk
18
19 docdir = $(datadir)/doc
20 docsubdir = $(PACKAGE)$(ICULIBDASHSUFFIX)/html
21 docfilesdir = doc/html
22 docfiles = $(docfilesdir)/*.png $(docfilesdir)/*.html $(docfilesdir)/*.css $(docfilesdir)/*.tag 
23 docsrchdir = $(docfilesdir)/search
24 docsrchfiles = $(docsrchdir)/*
25
26 ##
27
28 ## Build directory information
29 subdir = .
30
31 #AUTOCONF = @AUTOCONF@
32
33 ## Optional directory setup
34 @LAYOUTEX_TRUE@LAYOUTEX = layoutex
35 @ICUIO_TRUE@ICUIO = io
36 @EXTRAS_TRUE@EXTRA = extra
37 @TESTS_TRUE@TEST = test
38 @SAMPLES_TRUE@SAMPLE = samples
39 @TOOLS_TRUE@TOOLS = tools
40
41 ## pkgconfig setup. Always have uc and i18n. Others are optional.
42 ALL_PKGCONFIG_SUFFIX=uc i18n
43 @LAYOUTEX_TRUE@ALL_PKGCONFIG_SUFFIX+= lx
44 @ICUIO_TRUE@ALL_PKGCONFIG_SUFFIX+= io
45
46 DOXYGEN = @DOXYGEN@
47 DOCZIP = icu-docs.zip
48
49 ## Files to remove for 'make clean'
50 CLEANFILES = *~
51
52 ALL_PKGCONFIG_FILES=$(ALL_PKGCONFIG_SUFFIX:%=$(top_builddir)/config/icu-%.pc)
53
54 ## Files built (autoconfed) and installed
55 INSTALLED_BUILT_FILES = $(top_builddir)/config/Makefile.inc $(top_builddir)/config/pkgdata.inc $(top_builddir)/config/icu-config @platform_make_fragment@ $(EXTRA_DATA:%=$(DESTDIR)$(pkglibdir)/%) $(ALL_PKGCONFIG_FILES)
56
57 ## Files built (autoconfed) but not installed
58 LOCAL_BUILT_FILES = icudefs.mk config/icucross.mk config/icucross.inc
59
60 DOCDIRS = common i18n
61 SUBDIRS =  stubdata common i18n $(LAYOUTEX) $(ICUIO) $(TOOLS) data $(EXTRA) $(SAMPLE) $(TEST)
62
63 SECTION = 1
64
65 MANX_FILES = config/icu-config.$(SECTION)
66
67 ALL_MAN_FILES = $(MANX_FILES)
68
69 ## Extra files to install [nothing at present]
70 EXTRA_DATA =
71
72 ## List of phony targets
73 .PHONY : all all-local all-recursive install install-local install-udata install-udata-files install-udata-dlls         \
74 install-recursive clean clean-local clean-recursive distclean           \
75 distclean-local distclean-recursive doc dist dist-local dist-recursive  \
76 check check-local check-recursive clean-recursive-with-twist install-icu \
77 doc install-doc tests icu4j-data icu4j-data-install update-windows-makefiles xcheck-local xcheck-recursive xperf xcheck xperf-recursive \
78 check-exhaustive check-exhaustive-local check-exhaustive-recursive releaseDist
79
80 ## Clear suffix list
81 .SUFFIXES :
82
83 ## List of standard targets
84 all: all-local all-recursive
85 install: install-recursive install-local
86 clean: clean-recursive-with-twist clean-local
87 distclean : distclean-recursive distclean-local
88 dist: dist-recursive dist-local
89 check: all check-recursive
90 check-recursive: all
91 xcheck: all xcheck-recursive
92 xperf: all xperf-recursive
93 check-exhaustive: all check-exhaustive-recursive
94
95 pcheck: all tests
96         @$(MAKE) -C test pcheck
97
98 check-exhaustive-local: check-local
99
100 xcheck-recursive: all xcheck-local
101         @$(MAKE) -C test xcheck
102
103 xperf-recursive: all tests
104         @$(MAKE) -C test/perf xperf
105
106 $(top_builddir)/config/icuinfo.xml: all
107         @$(MAKE) -C tools/icuinfo check
108
109 ifeq ($(DOXYGEN),)
110 doc doc-searchengine:
111         @echo you need Doxygen to generate documentation. Doxygen can be found on the Web
112         @echo at http://www.doxygen.org/
113 else
114 doc: doc/html/index.html
115
116 doc-searchengine: Doxyfile $(wildcard ./common/unicode/platform.h $(srcdir)/common/unicode/*.h $(srcdir)/i18n/unicode/*.h $(srcdir)/io/unicode/*.h)
117         sed < Doxyfile -e 's%[^#]*SEARCHENGINE.*%SEARCHENGINE=YES%' | $(DOXYGEN) -
118         @echo adding links from non-namespaced class files
119         find doc/html -name 'classicu_1_1*' -print | sed -e 's%^\(.*class\)icu_1_1\(.*\)$$%ln & \1\2%' | sh
120         @echo Docs created - WARNING, probably contains non-GPL .js files
121
122 doc/html/index.html: Doxyfile $(wildcard ./common/unicode/platform.h $(srcdir)/common/unicode/*.h $(srcdir)/i18n/unicode/*.h $(srcdir)/io/unicode/*.h)
123         $(DOXYGEN)
124         @echo adding links from non-namespaced class files
125         find doc/html -name 'classicu_1_1*' -print | sed -e 's%^\(.*class\)icu_1_1\(.*\)$$%ln & \1\2%' | sh
126
127 Doxyfile: $(srcdir)/Doxyfile.in
128         CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
129
130 $(DOCZIP): doc
131         -$(RMV) $(DOCZIP)
132         ( cd doc/html ; zip -r ../../$(DOCZIP) * )
133 endif
134
135 LOCAL_SUBDIRS = $(SUBDIRS)
136 CLEAN_FIRST_SUBDIRS = $(TOOLS)
137
138 $(LIBDIR) $(BINDIR):
139         -$(MKINSTALLDIRS) $@
140
141 ## Recursive targets
142 all-recursive install-recursive clean-recursive distclean-recursive dist-recursive check-recursive check-exhaustive-recursive: $(LIBDIR) $(BINDIR)
143         @dot_seen=no; \
144         target=`echo $@ | sed s/-recursive//`; \
145         list='$(LOCAL_SUBDIRS)'; for subdir in $$list; do \
146           echo "$(MAKE)[$(MAKELEVEL)]: Making \`$$target' in \`$$subdir'"; \
147           if test "$$subdir" = "."; then \
148             dot_seen=yes; \
149             local_target="$$target-local"; \
150           else \
151             local_target="$$target"; \
152           fi; \
153           (cd $$subdir && $(MAKE) RECURSIVE=YES $$local_target) || exit; \
154         done; \
155         if test "$$dot_seen" = "no"; then \
156           $(MAKE) "$$target-local" || exit; \
157         fi
158
159 clean-recursive-with-twist:
160         $(MAKE) clean-recursive LOCAL_SUBDIRS='$(CLEAN_FIRST_SUBDIRS) $(filter-out $(CLEAN_FIRST_SUBDIRS),$(LOCAL_SUBDIRS))'
161
162 all-local: $(srcdir)/configure $(LOCAL_BUILT_FILES) $(INSTALLED_BUILT_FILES)
163 ifndef VERBOSE
164         @echo "Note: rebuild with \"$(MAKE) VERBOSE=1 $(MAKECMDGOALS)\" to show all compiler parameters."
165 endif
166 install-local: install-icu install-manx
167
168 # always installs. Used by layoutex.
169 install-pkgconfig: $(ALL_PKGCONFIG_FILES)
170         @$(MKINSTALLDIRS) $(DESTDIR)$(libdir)/pkgconfig
171         $(INSTALL_DATA) $(ALL_PKGCONFIG_FILES) $(DESTDIR)$(libdir)/pkgconfig/
172
173 install-icu: $(INSTALLED_BUILT_FILES)
174         @$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/config
175         @$(MKINSTALLDIRS) $(DESTDIR)$(pkglibdir)
176         @$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
177         @$(MKINSTALLDIRS) $(DESTDIR)$(sbindir)
178         $(INSTALL_DATA) @platform_make_fragment@ $(DESTDIR)$(pkgdatadir)/config/@platform_make_fragment_name@
179         $(INSTALL_SCRIPT) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(pkgdatadir)/mkinstalldirs
180         $(INSTALL_SCRIPT) $(top_srcdir)/install-sh $(DESTDIR)$(pkgdatadir)/install-sh
181         @$(MKINSTALLDIRS) $(DESTDIR)$(libdir)/pkgconfig
182         $(INSTALL_DATA) $(ALL_PKGCONFIG_FILES) $(DESTDIR)$(libdir)/pkgconfig/
183         $(INSTALL_DATA) $(top_srcdir)/../LICENSE $(DESTDIR)$(pkgdatadir)/LICENSE
184         $(INSTALL_SCRIPT) $(top_builddir)/config/icu-config $(DESTDIR)$(bindir)/icu-config
185         $(INSTALL_DATA) $(top_builddir)/config/Makefile.inc $(DESTDIR)$(pkglibdir)/Makefile.inc
186         $(INSTALL_DATA) $(top_builddir)/config/pkgdata.inc $(DESTDIR)$(pkglibdir)/pkgdata.inc
187 #       @echo icuinfo.xml is built after make check.
188 #       -$(INSTALL_DATA) $(top_builddir)/config/icuinfo.xml $(DESTDIR)$(pkglibdir)/icuinfo.xml
189         cd $(DESTDIR)$(pkglibdir)/..; \
190             $(RM) current && ln -s $(VERSION) current; \
191             $(RM) Makefile.inc && ln -s current/Makefile.inc Makefile.inc; \
192             $(RM) pkgdata.inc && ln -s current/pkgdata.inc pkgdata.inc
193
194 ifeq ($(DOXYGEN),)
195 install-doc:
196 else
197 install-doc: doc
198         $(RM) -r $(DESTDIR)$(docdir)/$(docsubdir)
199         $(MKINSTALLDIRS) $(DESTDIR)$(docdir)/$(docsubdir)
200         $(INSTALL_DATA) $(docfiles) $(DESTDIR)$(docdir)/$(docsubdir)
201
202 endif
203
204 $(DESTDIR)$(pkglibdir)/%: $(top_srcdir)/../data/%
205         $(INSTALL_DATA) $< $@
206
207 # Build the tests, but don't run them.
208 tests: all
209         $(MAKE) -C $(top_builddir)/test
210
211 clean-local:
212         test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
213         -$(RMV) "test-*.xml"
214         -$(RMV) "perf-*.xml"
215         -$(RMV) $(ALL_PKGCONFIG_FILES) $(top_builddir)/config/icuinfo.xml
216         $(RMV) Doxyfile doc $(DOCZIP)
217
218 distclean-local: clean-local
219         $(RMV) $(top_builddir)/config/Makefile.inc $(top_builddir)/config/pkgdata.inc $(top_builddir)/config/icu-config $(top_builddir)/config/icu.pc $(ALL_PKGCONFIG_FILES)
220         $(RMV) config.cache config.log config.status $(top_builddir)/config/icucross.mk $(top_builddir)/config/icucross.inc autom4te.cache uconfig.h.prepend
221         $(RMV) Makefile config/Makefile icudefs.mk $(LIBDIR) $(BINDIR)
222         -$(RMV) dist
223
224 check-local: xcheck-local
225         -$(RMV) test-local.xml
226
227 xcheck-local: $(top_builddir)/config/icu-config $(top_builddir)/config/Makefile.inc $(top_builddir)/config/pkgdata.inc
228         @echo verifying that icu-config --selfcheck can operate
229         @test "passed" = "$(shell $(top_builddir)/config/icu-config --selfcheck 2>&1)" || (echo "FAIL: icu-config could not run properly." ; exit 1)
230         @echo verifying that $(MAKE) -f Makefile.inc selfcheck can operate
231         @test "passed" = "$(shell $(MAKE) --no-print-directory -f $(top_builddir)/config/Makefile.inc SELFCHECK=1 selfcheck)" || (echo "FAIL: Makefile.inc could not run properly." ; exit 1 )
232         @echo "PASS: config selfcheck OK"
233
234 #$(srcdir)/configure : $(srcdir)/configure.ac $(top_srcdir)/aclocal.m4
235 #       cd $(srcdir) && aclocal && $(AUTOCONF)
236
237 icudefs.mk: $(srcdir)/icudefs.mk.in  $(top_builddir)/config.status
238         cd $(top_builddir) \
239                 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
240
241 config/icucross.mk: $(top_builddir)/icudefs.mk  $(top_builddir)/Makefile
242         @echo rebuilding $@
243         @(echo "CROSS_ICU_VERSION=$(VERSION)" ;\
244           echo "TOOLEXEEXT=$(EXEEXT)" \
245            ) > $@
246         @(echo 'TOOLBINDIR=$$(cross_buildroot)/bin' ;\
247           echo 'TOOLLIBDIR=$$(cross_buildroot)/lib' ;\
248           echo "INVOKE=$(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)"'$$(TOOLLIBDIR):$$(cross_buildroot)/stubdata:$$(cross_buildroot)/tools/ctestfw:$$$$'"$(LDLIBRARYPATH_ENVVAR)" ;\
249           echo "PKGDATA_INVOKE=$(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)"'$$(cross_buildroot)/stubdata:$$(cross_buildroot)/tools/ctestfw:$$(TOOLLIBDIR):$$$$'"$(LDLIBRARYPATH_ENVVAR) " ;\
250           echo ) >> $@
251
252 config/icucross.inc: $(top_builddir)/icudefs.mk  $(top_builddir)/Makefile @platform_make_fragment@
253         @echo rebuilding $@
254         @(grep '^CURR_FULL_DIR' $(top_builddir)/icudefs.mk ; \
255           grep '^CURR_FULL_DIR' @platform_make_fragment@ || echo ""; \
256            ) > $@
257
258 config/icu.pc: $(srcdir)/config/icu.pc.in
259         cd $(top_builddir) \
260          && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
261
262 config/icu-uc.pc: config/icu.pc Makefile icudefs.mk
263         @cat config/icu.pc > $@
264         @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Common and Data libraries" >> $@
265         @echo "Name: $(PACKAGE)-uc" >> $@
266         @echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" "${ICULIBS_DT}" >> $@
267         @echo "Libs.private:" '$${baselibs}' >> $@
268         @echo $@ updated.
269
270 config/icu-i18n.pc: config/icu.pc Makefile icudefs.mk
271         @cat config/icu.pc > $@
272         @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Internationalization library" >> $@
273         @echo "Name: $(PACKAGE)-i18n" >> $@
274         @echo "Requires: icu-uc" >> $@
275         @echo "Libs:" "${ICULIBS_I18N}" >> $@
276         @echo $@ updated.
277
278 config/icu-io.pc: config/icu.pc Makefile icudefs.mk
279         @cat config/icu.pc > $@
280         @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Stream and I/O Library" >> $@
281         @echo "Name: $(PACKAGE)-io" >> $@
282         @echo "Requires: icu-i18n" >> $@
283         @echo "Libs:" "${ICULIBS_IO}" >> $@
284         @echo $@ updated.
285
286 ICULEHB_LIBS=@ICULEHB_LIBS@
287 USING_HB=
288 ifneq ($(ICULEHB_LIBS),)
289 USING_HB=(Using HarfBuzz)
290 endif
291
292
293 config/icu-lx.pc: config/icu.pc Makefile icudefs.mk
294         @cat config/icu.pc > $@
295         @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Paragraph Layout library $(USING_HB)" >> $@
296         @echo "Name: $(PACKAGE)-lx" >> $@
297 ifneq ($(ICULEHB_LIBS),)
298         @echo "Requires: icu-le-hb icu-uc" >> $@
299 else
300         @echo "Requires: icu-le" >> $@
301 endif
302         @echo "Libs:" "${ICULIBS_LX}" >> $@
303         @echo $@ updated.
304
305
306 Makefile: $(srcdir)/Makefile.in icudefs.mk $(top_builddir)/config.status
307         cd $(top_builddir) \
308                 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
309
310 $(top_builddir)/config/Makefile.inc: $(srcdir)/config/Makefile.inc.in  $(top_builddir)/config.status
311         cd $(top_builddir) \
312                 && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
313
314 $(top_builddir)/config/pkgdata.inc: icudefs.mk $(top_builddir)/config/pkgdataMakefile
315         cd $(top_builddir)/config; \
316                 $(MAKE) -f pkgdataMakefile
317
318 $(top_builddir)/config/pkgdataMakefile:
319         cd $(top_builddir) \
320                 && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
321
322 $(top_builddir)/config/icu-config: $(top_builddir)/Makefile $(top_srcdir)/config/icu-config-top $(top_srcdir)/config/icu-config-bottom $(top_builddir)/config/Makefile.inc @platform_make_fragment@ $(top_srcdir)/config/make2sh.sed
323         -$(RMV) $@
324         $(INSTALL_SCRIPT) $(top_srcdir)/config/icu-config-top $@
325         chmod u+w $@
326         @echo "# Following from @platform_make_fragment@" >> $@
327         LC_ALL=C sed -f $(top_srcdir)/config/make2sh.sed < $(top_builddir)/config/Makefile.inc | grep -v '#M#' | uniq >> $@
328         LC_ALL=C sed -f $(top_srcdir)/config/make2sh.sed < @platform_make_fragment@ | grep -v '#M#' | uniq >> $@
329         cat $(top_srcdir)/config/icu-config-bottom >> $@
330         chmod u-w $@
331
332 config.status: $(srcdir)/configure $(srcdir)/common/unicode/uvernum.h
333         @echo
334         @echo
335         @echo "*** config.status has become stale ***"
336         @echo "   'configure' and/or 'uvernum.h' have changed, please"
337         @echo "  do 'runConfigureICU' (or 'configure') again, as per"
338         @echo "  the readme.html."
339         @echo
340         @echo
341         exit 1
342
343
344 install-manx: $(MANX_FILES)
345         $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION)
346         $(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION)
347
348 config/%.$(SECTION): $(srcdir)/config/%.$(SECTION).in
349         cd $(top_builddir) \
350          && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
351
352 icu4j-data-install icu4j-data: all tests
353         @echo ICU4J_ROOT=$(ICU4J_ROOT)
354         @$(MAKE) -C test/testdata $@
355         @$(MAKE) -C data $@
356
357 # For updating Windows makefiles
358
359 WINDOWS_UPDATEFILES=$(srcdir)/data/makedata.mak $(shell find $(srcdir) -name '*.vcproj' -o -name '*.vcxproj')
360
361 WINDOWS_UPDATEFILES_SED=config/windows-update.sed
362
363 update-windows-makefiles: config.status
364         @echo Updating Windows Makefiles for ICU $(VERSION)
365         CONFIG_FILES=$(WINDOWS_UPDATEFILES_SED) CONFIG_HEADERS= $(SHELL) ./config.status
366         @for file in $(WINDOWS_UPDATEFILES); do \
367           echo "Updating $$file"; \
368           mv "$${file}" "$${file}.bak" && \
369           sed -f $(WINDOWS_UPDATEFILES_SED) < "$${file}.bak" > "$${file}" && \
370           rm "$${file}.bak"; \
371         done;
372         $(RMV) $(WINDOWS_UPDATEFILES_SED)
373         @echo Please check over the changes carefully before checking them in.
374
375 # For building a source distribution.
376 distcheck dist-local:
377         $(MAKE) -C . -f $(top_srcdir)/config/dist.mk srcdir="$(srcdir)" top_srcdir="$(top_srcdir)" $@
378
379 ifeq ($(DESTDIR),)
380 releaseDist:
381         @echo "Please provide DESTDIR when calling the target releaseDist."
382 else
383 releaseDist: install
384         @echo -n "ICU Version: " > $(DESTDIR)/readme.txt
385         @echo `./config/icu-config --noverify --version` >> $(DESTDIR)/readme.txt
386         @echo -n "HOST: " >> $(DESTDIR)/readme.txt
387         @echo `./config/icu-config --noverify --host` >> $(DESTDIR)/readme.txt
388         @echo -n "CC Compiler: " >> $(DESTDIR)/readme.txt
389         @echo `./config/icu-config --noverify --cc` >> $(DESTDIR)/readme.txt
390         @echo -n "CXX Compiler: " >> $(DESTDIR)/readme.txt
391         @echo `./config/icu-config --noverify --cxx` >> $(DESTDIR)/readme.txt
392 endif
393
394 check-installed-icu: install
395         @echo "Testing ICU installed in $(prefix)"
396         $(INSTALLED_INVOKE) $(bindir)/icuinfo$(EXEEXT)
397         $(INSTALLED_INVOKE) $(bindir)/uconv$(EXEEXT) -V
398         $(INSTALLED_INVOKE) $(bindir)/genrb$(EXEEXT) -V
399         $(INSTALLED_INVOKE) $(bindir)/gencnval$(EXEEXT) -h
400         @echo INSTALLED ICU IN "$(prefix)" OK!