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) 1998-2016, International Business Machines
6 # Corporation and others. All Rights Reserved.
8 #******************************************************************************
9 ## Top-level Makefile.in for ICU
13 top_srcdir = @top_srcdir@
17 include $(top_builddir)/icudefs.mk
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)/*
28 ## Build directory information
31 #AUTOCONF = @AUTOCONF@
33 ## Optional directory setup
34 @LAYOUTEX_TRUE@LAYOUTEX = layoutex
35 @ICUIO_TRUE@ICUIO = io
36 @EXTRAS_TRUE@EXTRA = extra
37 # need tools for tests
38 @TOOLS_TRUE@@TESTS_TRUE@TEST = test
39 @SAMPLES_TRUE@SAMPLE = samples
40 @TOOLS_TRUE@TOOLS = tools
41 @TOOLS_TRUE@DATASUBDIR = data
43 ## pkgconfig setup. Always have uc and i18n. Others are optional.
44 ALL_PKGCONFIG_SUFFIX=uc i18n
45 @LAYOUTEX_TRUE@ALL_PKGCONFIG_SUFFIX+= lx
46 @ICUIO_TRUE@ALL_PKGCONFIG_SUFFIX+= io
51 ## Files to remove for 'make clean'
54 ALL_PKGCONFIG_FILES=$(ALL_PKGCONFIG_SUFFIX:%=$(top_builddir)/config/icu-%.pc)
56 ## Files built (autoconfed) and installed
57 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)
59 ## Files built (autoconfed) but not installed
60 LOCAL_BUILT_FILES = icudefs.mk config/icucross.mk config/icucross.inc
63 SUBDIRS = stubdata common i18n $(LAYOUTEX) $(ICUIO) $(TOOLS) $(DATASUBDIR) $(EXTRA) $(SAMPLE) $(TEST)
67 MANX_FILES = config/icu-config.$(SECTION)
69 ALL_MAN_FILES = $(MANX_FILES)
71 ## Extra files to install [nothing at present]
74 ## List of phony targets
75 .PHONY : all all-local all-recursive install install-local install-udata install-udata-files install-udata-dlls \
76 install-recursive clean clean-local clean-recursive distclean \
77 distclean-local distclean-recursive doc dist dist-local dist-recursive \
78 check check-local check-recursive clean-recursive-with-twist install-icu \
79 doc install-doc tests icu4j-data icu4j-data-install update-windows-makefiles xcheck-local xcheck-recursive xperf xcheck xperf-recursive \
80 check-exhaustive check-exhaustive-local check-exhaustive-recursive releaseDist
85 ## List of standard targets
86 all: all-local all-recursive
87 install: install-recursive install-local
88 clean: clean-recursive-with-twist clean-local
89 distclean : distclean-recursive distclean-local
91 check: all check-recursive
93 xcheck: all xcheck-recursive
94 xperf: all xperf-recursive
95 check-exhaustive: all check-exhaustive-recursive
98 @$(MAKE) -C test pcheck
100 check-exhaustive-local: check-local
102 xcheck-recursive: all xcheck-local
103 @$(MAKE) -C test xcheck
105 xperf-recursive: all tests
106 @$(MAKE) -C test/perf xperf
108 $(top_builddir)/config/icuinfo.xml: all
109 @$(MAKE) -C tools/icuinfo check
112 doc doc-searchengine:
113 @echo you need Doxygen to generate documentation. Doxygen can be found on the Web
114 @echo at http://www.doxygen.org/
116 doc: doc/html/index.html
118 doc-searchengine: Doxyfile $(wildcard ./common/unicode/platform.h $(srcdir)/common/unicode/*.h $(srcdir)/i18n/unicode/*.h $(srcdir)/io/unicode/*.h)
119 sed < Doxyfile -e 's%[^#]*SEARCHENGINE.*%SEARCHENGINE=YES%' | $(DOXYGEN) -
120 @echo adding links from non-namespaced class files
121 find doc/html -name 'classicu_1_1*' -print | sed -e 's%^\(.*class\)icu_1_1\(.*\)$$%ln & \1\2%' | sh
122 @echo Docs created - WARNING, probably contains non-GPL .js files
124 doc/html/index.html: Doxyfile $(wildcard ./common/unicode/platform.h $(srcdir)/common/unicode/*.h $(srcdir)/i18n/unicode/*.h $(srcdir)/io/unicode/*.h)
126 @echo adding links from non-namespaced class files
127 find doc/html -name 'classicu_1_1*' -print | sed -e 's%^\(.*class\)icu_1_1\(.*\)$$%ln & \1\2%' | sh
129 Doxyfile: $(srcdir)/Doxyfile.in
130 CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
134 ( cd doc/html ; zip -r ../../$(DOCZIP) * )
137 LOCAL_SUBDIRS = $(SUBDIRS)
138 CLEAN_FIRST_SUBDIRS = $(TOOLS)
144 all-recursive install-recursive clean-recursive distclean-recursive dist-recursive check-recursive check-exhaustive-recursive: $(LIBDIR) $(BINDIR)
145 ifneq ($(NEED_ESCAPING),)
146 @echo "building tools/escapesrc (Needed for this platform with NEED_ESCAPING)"
147 @(cd tools/escapesrc && $(MAKE) RECURSIVE=YES $$local_target) || exit
150 target=`echo $@ | sed s/-recursive//`; \
151 list='$(LOCAL_SUBDIRS)'; for subdir in $$list; do \
152 echo "$(MAKE)[$(MAKELEVEL)]: Making \`$$target' in \`$$subdir'"; \
153 if test "$$subdir" = "."; then \
155 local_target="$$target-local"; \
157 local_target="$$target"; \
159 (cd $$subdir && $(MAKE) RECURSIVE=YES $$local_target) || exit; \
161 if test "$$dot_seen" = "no"; then \
162 $(MAKE) "$$target-local" || exit; \
165 clean-recursive-with-twist:
166 $(MAKE) clean-recursive LOCAL_SUBDIRS='$(CLEAN_FIRST_SUBDIRS) $(filter-out $(CLEAN_FIRST_SUBDIRS),$(LOCAL_SUBDIRS))'
168 all-local: $(srcdir)/configure $(LOCAL_BUILT_FILES) $(INSTALLED_BUILT_FILES)
170 @echo "Note: rebuild with \"$(MAKE) VERBOSE=1 $(MAKECMDGOALS)\" to show all compiler parameters."
172 install-local: install-icu install-manx
174 # always installs. Used by layoutex.
175 install-pkgconfig: $(ALL_PKGCONFIG_FILES)
176 @$(MKINSTALLDIRS) $(DESTDIR)$(libdir)/pkgconfig
177 $(INSTALL_DATA) $(ALL_PKGCONFIG_FILES) $(DESTDIR)$(libdir)/pkgconfig/
179 install-icu: $(INSTALLED_BUILT_FILES)
180 @$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/config
181 @$(MKINSTALLDIRS) $(DESTDIR)$(pkglibdir)
182 @$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
183 @$(MKINSTALLDIRS) $(DESTDIR)$(sbindir)
184 $(INSTALL_DATA) @platform_make_fragment@ $(DESTDIR)$(pkgdatadir)/config/@platform_make_fragment_name@
185 $(INSTALL_SCRIPT) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(pkgdatadir)/mkinstalldirs
186 $(INSTALL_SCRIPT) $(top_srcdir)/install-sh $(DESTDIR)$(pkgdatadir)/install-sh
187 @$(MKINSTALLDIRS) $(DESTDIR)$(libdir)/pkgconfig
188 $(INSTALL_DATA) $(ALL_PKGCONFIG_FILES) $(DESTDIR)$(libdir)/pkgconfig/
189 $(INSTALL_DATA) $(top_srcdir)/../LICENSE $(DESTDIR)$(pkgdatadir)/LICENSE
190 $(INSTALL_SCRIPT) $(top_builddir)/config/icu-config $(DESTDIR)$(bindir)/icu-config
191 $(INSTALL_DATA) $(top_builddir)/config/Makefile.inc $(DESTDIR)$(pkglibdir)/Makefile.inc
192 $(INSTALL_DATA) $(top_builddir)/config/pkgdata.inc $(DESTDIR)$(pkglibdir)/pkgdata.inc
193 # @echo icuinfo.xml is built after make check.
194 # -$(INSTALL_DATA) $(top_builddir)/config/icuinfo.xml $(DESTDIR)$(pkglibdir)/icuinfo.xml
195 cd $(DESTDIR)$(pkglibdir)/..; \
196 $(RM) current && ln -s $(VERSION) current; \
197 $(RM) Makefile.inc && ln -s current/Makefile.inc Makefile.inc; \
198 $(RM) pkgdata.inc && ln -s current/pkgdata.inc pkgdata.inc
204 $(RM) -r $(DESTDIR)$(docdir)/$(docsubdir)
205 $(MKINSTALLDIRS) $(DESTDIR)$(docdir)/$(docsubdir)
206 $(INSTALL_DATA) $(docfiles) $(DESTDIR)$(docdir)/$(docsubdir)
210 $(DESTDIR)$(pkglibdir)/%: $(top_srcdir)/../data/%
211 $(INSTALL_DATA) $< $@
213 # Build the tests, but don't run them.
215 $(MAKE) -C $(top_builddir)/test
218 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
221 -$(RMV) $(ALL_PKGCONFIG_FILES) $(top_builddir)/config/icuinfo.xml
222 $(RMV) Doxyfile doc $(DOCZIP)
224 distclean-local: clean-local
225 $(RMV) $(top_builddir)/config/Makefile.inc $(top_builddir)/config/pkgdata.inc $(top_builddir)/config/icu-config $(top_builddir)/config/icu.pc $(ALL_PKGCONFIG_FILES)
226 $(RMV) config.cache config.log config.status $(top_builddir)/config/icucross.mk $(top_builddir)/config/icucross.inc autom4te.cache uconfig.h.prepend
227 $(RMV) Makefile config/Makefile icudefs.mk $(LIBDIR) $(BINDIR)
230 check-local: xcheck-local
231 -$(RMV) test-local.xml
233 xcheck-local: $(top_builddir)/config/icu-config $(top_builddir)/config/Makefile.inc $(top_builddir)/config/pkgdata.inc
234 @echo verifying that icu-config --selfcheck can operate
235 @test "passed" = "$(shell $(top_builddir)/config/icu-config --selfcheck 2>&1)" || (echo "FAIL: icu-config could not run properly." ; exit 1)
236 @echo verifying that $(MAKE) -f Makefile.inc selfcheck can operate
237 @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 )
238 @echo "PASS: config selfcheck OK"
240 #$(srcdir)/configure : $(srcdir)/configure.ac $(top_srcdir)/aclocal.m4
241 # cd $(srcdir) && aclocal && $(AUTOCONF)
243 icudefs.mk: $(srcdir)/icudefs.mk.in $(top_builddir)/config.status
245 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
247 config/icucross.mk: $(top_builddir)/icudefs.mk $(top_builddir)/Makefile
249 @(echo "CROSS_ICU_VERSION=$(VERSION)" ;\
250 echo "TOOLEXEEXT=$(EXEEXT)" \
252 @(echo 'TOOLBINDIR=$$(cross_buildroot)/bin' ;\
253 echo 'TOOLLIBDIR=$$(cross_buildroot)/lib' ;\
254 echo "INVOKE=$(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)"'$$(TOOLLIBDIR):$$(cross_buildroot)/stubdata:$$(cross_buildroot)/tools/ctestfw:$$$$'"$(LDLIBRARYPATH_ENVVAR)" ;\
255 echo "PKGDATA_INVOKE=$(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)"'$$(cross_buildroot)/stubdata:$$(cross_buildroot)/tools/ctestfw:$$(TOOLLIBDIR):$$$$'"$(LDLIBRARYPATH_ENVVAR) " ;\
258 config/icucross.inc: $(top_builddir)/icudefs.mk $(top_builddir)/Makefile @platform_make_fragment@
260 @(grep '^CURR_FULL_DIR' $(top_builddir)/icudefs.mk ; \
261 grep '^CURR_FULL_DIR' @platform_make_fragment@ || echo ""; \
264 config/icu.pc: $(srcdir)/config/icu.pc.in
266 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
268 config/icu-uc.pc: config/icu.pc Makefile icudefs.mk
269 @cat config/icu.pc > $@
270 @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Common and Data libraries" >> $@
271 @echo "Name: $(PACKAGE)-uc" >> $@
272 @echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" "${ICULIBS_DT}" >> $@
273 @echo "Libs.private:" '$${baselibs}' >> $@
276 config/icu-i18n.pc: config/icu.pc Makefile icudefs.mk
277 @cat config/icu.pc > $@
278 @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Internationalization library" >> $@
279 @echo "Name: $(PACKAGE)-i18n" >> $@
280 @echo "Requires: icu-uc" >> $@
281 @echo "Libs:" "${ICULIBS_I18N}" >> $@
284 config/icu-io.pc: config/icu.pc Makefile icudefs.mk
285 @cat config/icu.pc > $@
286 @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Stream and I/O Library" >> $@
287 @echo "Name: $(PACKAGE)-io" >> $@
288 @echo "Requires: icu-i18n" >> $@
289 @echo "Libs:" "${ICULIBS_IO}" >> $@
292 ICULEHB_LIBS=@ICULEHB_LIBS@
294 ifneq ($(ICULEHB_LIBS),)
295 USING_HB=(Using HarfBuzz)
299 config/icu-lx.pc: config/icu.pc Makefile icudefs.mk
300 @cat config/icu.pc > $@
301 @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Paragraph Layout library $(USING_HB)" >> $@
302 @echo "Name: $(PACKAGE)-lx" >> $@
303 ifneq ($(ICULEHB_LIBS),)
304 @echo "Requires: icu-le-hb icu-uc" >> $@
306 @echo "Requires: icu-le" >> $@
308 @echo "Libs:" "${ICULIBS_LX}" >> $@
312 Makefile: $(srcdir)/Makefile.in icudefs.mk $(top_builddir)/config.status
314 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
316 $(top_builddir)/config/Makefile.inc: $(srcdir)/config/Makefile.inc.in $(top_builddir)/config.status
318 && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
320 $(top_builddir)/config/pkgdata.inc: icudefs.mk $(top_builddir)/config/pkgdataMakefile
321 cd $(top_builddir)/config; \
322 $(MAKE) -f pkgdataMakefile
324 $(top_builddir)/config/pkgdataMakefile:
326 && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
328 $(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
330 $(INSTALL_SCRIPT) $(top_srcdir)/config/icu-config-top $@
332 @echo "# Following from icu/icu4c/source/config/Makefile.inc" >> $@
333 LC_ALL=C $(SED) -f $(top_srcdir)/config/make2sh.sed < $(top_builddir)/config/Makefile.inc | grep -v '#M#' | uniq >> $@
334 @echo "# Following from @platform_make_fragment@" >> $@
335 LC_ALL=C $(SED) -f $(top_srcdir)/config/make2sh.sed < @platform_make_fragment@ | grep -v '#M#' | uniq >> $@
336 cat $(top_srcdir)/config/icu-config-bottom >> $@
339 config.status: $(srcdir)/configure $(srcdir)/common/unicode/uvernum.h
342 @echo "*** config.status has become stale ***"
343 @echo " 'configure' and/or 'uvernum.h' have changed, please"
344 @echo " do 'runConfigureICU' (or 'configure') again, as per"
345 @echo " the readme.html."
351 install-manx: $(MANX_FILES)
352 $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION)
353 $(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION)
355 config/%.$(SECTION): $(srcdir)/config/%.$(SECTION).in
357 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
359 icu4j-data-install icu4j-data: all tests
360 @echo ICU4J_ROOT=$(ICU4J_ROOT)
361 @$(MAKE) -C test/testdata $@
364 # For updating Windows makefiles
366 WINDOWS_UPDATEFILES=$(srcdir)/data/makedata.mak $(shell find $(srcdir) -name '*.vcproj' -o -name '*.vcxproj')
368 WINDOWS_UPDATEFILES_SED=config/windows-update.sed
370 update-windows-makefiles: config.status
371 @echo Updating Windows Makefiles for ICU $(VERSION)
372 CONFIG_FILES=$(WINDOWS_UPDATEFILES_SED) CONFIG_HEADERS= $(SHELL) ./config.status
373 @for file in $(WINDOWS_UPDATEFILES); do \
374 echo "Updating $$file"; \
375 mv "$${file}" "$${file}.bak" && \
376 sed -f $(WINDOWS_UPDATEFILES_SED) < "$${file}.bak" > "$${file}" && \
379 $(RMV) $(WINDOWS_UPDATEFILES_SED)
380 @echo Please check over the changes carefully before checking them in.
382 # For building a source distribution.
383 distcheck dist-local:
384 $(MAKE) -C . -f $(top_srcdir)/config/dist.mk srcdir="$(srcdir)" top_srcdir="$(top_srcdir)" $@
388 @echo "Please provide DESTDIR when calling the target releaseDist."
391 @echo -n "ICU Version: " > $(DESTDIR)/readme.txt
392 @echo `./config/icu-config --noverify --version` >> $(DESTDIR)/readme.txt
393 @echo -n "HOST: " >> $(DESTDIR)/readme.txt
394 @echo `./config/icu-config --noverify --host` >> $(DESTDIR)/readme.txt
395 @echo -n "CC Compiler: " >> $(DESTDIR)/readme.txt
396 @echo `./config/icu-config --noverify --cc` >> $(DESTDIR)/readme.txt
397 @echo -n "CXX Compiler: " >> $(DESTDIR)/readme.txt
398 @echo `./config/icu-config --noverify --cxx` >> $(DESTDIR)/readme.txt
401 check-installed-icu: install
402 @echo "Testing ICU installed in $(prefix)"
403 $(INSTALLED_INVOKE) $(bindir)/icuinfo$(EXEEXT)
404 $(INSTALLED_INVOKE) $(bindir)/uconv$(EXEEXT) -V
405 $(INSTALLED_INVOKE) $(bindir)/genrb$(EXEEXT) -V
406 $(INSTALLED_INVOKE) $(bindir)/gencnval$(EXEEXT) -h
407 @echo INSTALLED ICU IN "$(prefix)" OK!