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 @TESTS_TRUE@TEST = test
38 @SAMPLES_TRUE@SAMPLE = samples
39 @TOOLS_TRUE@TOOLS = tools
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
49 ## Files to remove for 'make clean'
52 ALL_PKGCONFIG_FILES=$(ALL_PKGCONFIG_SUFFIX:%=$(top_builddir)/config/icu-%.pc)
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)
57 ## Files built (autoconfed) but not installed
58 LOCAL_BUILT_FILES = icudefs.mk config/icucross.mk config/icucross.inc
61 SUBDIRS = stubdata common i18n $(LAYOUTEX) $(ICUIO) $(TOOLS) data $(EXTRA) $(SAMPLE) $(TEST)
65 MANX_FILES = config/icu-config.$(SECTION)
67 ALL_MAN_FILES = $(MANX_FILES)
69 ## Extra files to install [nothing at present]
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
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
91 xcheck: all xcheck-recursive
92 xperf: all xperf-recursive
93 check-exhaustive: all check-exhaustive-recursive
96 @$(MAKE) -C test pcheck
98 check-exhaustive-local: check-local
100 xcheck-recursive: all xcheck-local
101 @$(MAKE) -C test xcheck
103 xperf-recursive: all tests
104 @$(MAKE) -C test/perf xperf
106 $(top_builddir)/config/icuinfo.xml: all
107 @$(MAKE) -C tools/icuinfo check
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/
114 doc: doc/html/index.html
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
122 doc/html/index.html: Doxyfile $(wildcard ./common/unicode/platform.h $(srcdir)/common/unicode/*.h $(srcdir)/i18n/unicode/*.h $(srcdir)/io/unicode/*.h)
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
127 Doxyfile: $(srcdir)/Doxyfile.in
128 CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
132 ( cd doc/html ; zip -r ../../$(DOCZIP) * )
135 LOCAL_SUBDIRS = $(SUBDIRS)
136 CLEAN_FIRST_SUBDIRS = $(TOOLS)
142 all-recursive install-recursive clean-recursive distclean-recursive dist-recursive check-recursive check-exhaustive-recursive: $(LIBDIR) $(BINDIR)
143 ifneq ($(NEED_ESCAPING),)
144 @echo "building tools/escapesrc (Needed for this platform with NEED_ESCAPING)"
145 @(cd tools/escapesrc && $(MAKE) RECURSIVE=YES $$local_target) || exit
148 target=`echo $@ | sed s/-recursive//`; \
149 list='$(LOCAL_SUBDIRS)'; for subdir in $$list; do \
150 echo "$(MAKE)[$(MAKELEVEL)]: Making \`$$target' in \`$$subdir'"; \
151 if test "$$subdir" = "."; then \
153 local_target="$$target-local"; \
155 local_target="$$target"; \
157 (cd $$subdir && $(MAKE) RECURSIVE=YES $$local_target) || exit; \
159 if test "$$dot_seen" = "no"; then \
160 $(MAKE) "$$target-local" || exit; \
163 clean-recursive-with-twist:
164 $(MAKE) clean-recursive LOCAL_SUBDIRS='$(CLEAN_FIRST_SUBDIRS) $(filter-out $(CLEAN_FIRST_SUBDIRS),$(LOCAL_SUBDIRS))'
166 all-local: $(srcdir)/configure $(LOCAL_BUILT_FILES) $(INSTALLED_BUILT_FILES)
168 @echo "Note: rebuild with \"$(MAKE) VERBOSE=1 $(MAKECMDGOALS)\" to show all compiler parameters."
170 install-local: install-icu install-manx
172 # always installs. Used by layoutex.
173 install-pkgconfig: $(ALL_PKGCONFIG_FILES)
174 @$(MKINSTALLDIRS) $(DESTDIR)$(libdir)/pkgconfig
175 $(INSTALL_DATA) $(ALL_PKGCONFIG_FILES) $(DESTDIR)$(libdir)/pkgconfig/
177 install-icu: $(INSTALLED_BUILT_FILES)
178 @$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/config
179 @$(MKINSTALLDIRS) $(DESTDIR)$(pkglibdir)
180 @$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
181 @$(MKINSTALLDIRS) $(DESTDIR)$(sbindir)
182 $(INSTALL_DATA) @platform_make_fragment@ $(DESTDIR)$(pkgdatadir)/config/@platform_make_fragment_name@
183 $(INSTALL_SCRIPT) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(pkgdatadir)/mkinstalldirs
184 $(INSTALL_SCRIPT) $(top_srcdir)/install-sh $(DESTDIR)$(pkgdatadir)/install-sh
185 @$(MKINSTALLDIRS) $(DESTDIR)$(libdir)/pkgconfig
186 $(INSTALL_DATA) $(ALL_PKGCONFIG_FILES) $(DESTDIR)$(libdir)/pkgconfig/
187 $(INSTALL_DATA) $(top_srcdir)/../LICENSE $(DESTDIR)$(pkgdatadir)/LICENSE
188 $(INSTALL_SCRIPT) $(top_builddir)/config/icu-config $(DESTDIR)$(bindir)/icu-config
189 $(INSTALL_DATA) $(top_builddir)/config/Makefile.inc $(DESTDIR)$(pkglibdir)/Makefile.inc
190 $(INSTALL_DATA) $(top_builddir)/config/pkgdata.inc $(DESTDIR)$(pkglibdir)/pkgdata.inc
191 # @echo icuinfo.xml is built after make check.
192 # -$(INSTALL_DATA) $(top_builddir)/config/icuinfo.xml $(DESTDIR)$(pkglibdir)/icuinfo.xml
193 cd $(DESTDIR)$(pkglibdir)/..; \
194 $(RM) current && ln -s $(VERSION) current; \
195 $(RM) Makefile.inc && ln -s current/Makefile.inc Makefile.inc; \
196 $(RM) pkgdata.inc && ln -s current/pkgdata.inc pkgdata.inc
202 $(RM) -r $(DESTDIR)$(docdir)/$(docsubdir)
203 $(MKINSTALLDIRS) $(DESTDIR)$(docdir)/$(docsubdir)
204 $(INSTALL_DATA) $(docfiles) $(DESTDIR)$(docdir)/$(docsubdir)
208 $(DESTDIR)$(pkglibdir)/%: $(top_srcdir)/../data/%
209 $(INSTALL_DATA) $< $@
211 # Build the tests, but don't run them.
213 $(MAKE) -C $(top_builddir)/test
216 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
219 -$(RMV) $(ALL_PKGCONFIG_FILES) $(top_builddir)/config/icuinfo.xml
220 $(RMV) Doxyfile doc $(DOCZIP)
222 distclean-local: clean-local
223 $(RMV) $(top_builddir)/config/Makefile.inc $(top_builddir)/config/pkgdata.inc $(top_builddir)/config/icu-config $(top_builddir)/config/icu.pc $(ALL_PKGCONFIG_FILES)
224 $(RMV) config.cache config.log config.status $(top_builddir)/config/icucross.mk $(top_builddir)/config/icucross.inc autom4te.cache uconfig.h.prepend
225 $(RMV) Makefile config/Makefile icudefs.mk $(LIBDIR) $(BINDIR)
228 check-local: xcheck-local
229 -$(RMV) test-local.xml
231 xcheck-local: $(top_builddir)/config/icu-config $(top_builddir)/config/Makefile.inc $(top_builddir)/config/pkgdata.inc
232 @echo verifying that icu-config --selfcheck can operate
233 @test "passed" = "$(shell $(top_builddir)/config/icu-config --selfcheck 2>&1)" || (echo "FAIL: icu-config could not run properly." ; exit 1)
234 @echo verifying that $(MAKE) -f Makefile.inc selfcheck can operate
235 @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 )
236 @echo "PASS: config selfcheck OK"
238 #$(srcdir)/configure : $(srcdir)/configure.ac $(top_srcdir)/aclocal.m4
239 # cd $(srcdir) && aclocal && $(AUTOCONF)
241 icudefs.mk: $(srcdir)/icudefs.mk.in $(top_builddir)/config.status
243 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
245 config/icucross.mk: $(top_builddir)/icudefs.mk $(top_builddir)/Makefile
247 @(echo "CROSS_ICU_VERSION=$(VERSION)" ;\
248 echo "TOOLEXEEXT=$(EXEEXT)" \
250 @(echo 'TOOLBINDIR=$$(cross_buildroot)/bin' ;\
251 echo 'TOOLLIBDIR=$$(cross_buildroot)/lib' ;\
252 echo "INVOKE=$(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)"'$$(TOOLLIBDIR):$$(cross_buildroot)/stubdata:$$(cross_buildroot)/tools/ctestfw:$$$$'"$(LDLIBRARYPATH_ENVVAR)" ;\
253 echo "PKGDATA_INVOKE=$(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)"'$$(cross_buildroot)/stubdata:$$(cross_buildroot)/tools/ctestfw:$$(TOOLLIBDIR):$$$$'"$(LDLIBRARYPATH_ENVVAR) " ;\
256 config/icucross.inc: $(top_builddir)/icudefs.mk $(top_builddir)/Makefile @platform_make_fragment@
258 @(grep '^CURR_FULL_DIR' $(top_builddir)/icudefs.mk ; \
259 grep '^CURR_FULL_DIR' @platform_make_fragment@ || echo ""; \
262 config/icu.pc: $(srcdir)/config/icu.pc.in
264 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
266 config/icu-uc.pc: config/icu.pc Makefile icudefs.mk
267 @cat config/icu.pc > $@
268 @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Common and Data libraries" >> $@
269 @echo "Name: $(PACKAGE)-uc" >> $@
270 @echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" "${ICULIBS_DT}" >> $@
271 @echo "Libs.private:" '$${baselibs}' >> $@
274 config/icu-i18n.pc: config/icu.pc Makefile icudefs.mk
275 @cat config/icu.pc > $@
276 @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Internationalization library" >> $@
277 @echo "Name: $(PACKAGE)-i18n" >> $@
278 @echo "Requires: icu-uc" >> $@
279 @echo "Libs:" "${ICULIBS_I18N}" >> $@
282 config/icu-io.pc: config/icu.pc Makefile icudefs.mk
283 @cat config/icu.pc > $@
284 @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Stream and I/O Library" >> $@
285 @echo "Name: $(PACKAGE)-io" >> $@
286 @echo "Requires: icu-i18n" >> $@
287 @echo "Libs:" "${ICULIBS_IO}" >> $@
290 ICULEHB_LIBS=@ICULEHB_LIBS@
292 ifneq ($(ICULEHB_LIBS),)
293 USING_HB=(Using HarfBuzz)
297 config/icu-lx.pc: config/icu.pc Makefile icudefs.mk
298 @cat config/icu.pc > $@
299 @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Paragraph Layout library $(USING_HB)" >> $@
300 @echo "Name: $(PACKAGE)-lx" >> $@
301 ifneq ($(ICULEHB_LIBS),)
302 @echo "Requires: icu-le-hb icu-uc" >> $@
304 @echo "Requires: icu-le" >> $@
306 @echo "Libs:" "${ICULIBS_LX}" >> $@
310 Makefile: $(srcdir)/Makefile.in icudefs.mk $(top_builddir)/config.status
312 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
314 $(top_builddir)/config/Makefile.inc: $(srcdir)/config/Makefile.inc.in $(top_builddir)/config.status
316 && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
318 $(top_builddir)/config/pkgdata.inc: icudefs.mk $(top_builddir)/config/pkgdataMakefile
319 cd $(top_builddir)/config; \
320 $(MAKE) -f pkgdataMakefile
322 $(top_builddir)/config/pkgdataMakefile:
324 && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
326 $(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
328 $(INSTALL_SCRIPT) $(top_srcdir)/config/icu-config-top $@
330 @echo "# Following from icu/icu4c/source/config/Makefile.inc" >> $@
331 LC_ALL=C $(SED) -f $(top_srcdir)/config/make2sh.sed < $(top_builddir)/config/Makefile.inc | grep -v '#M#' | uniq >> $@
332 @echo "# Following from @platform_make_fragment@" >> $@
333 LC_ALL=C $(SED) -f $(top_srcdir)/config/make2sh.sed < @platform_make_fragment@ | grep -v '#M#' | uniq >> $@
334 cat $(top_srcdir)/config/icu-config-bottom >> $@
337 config.status: $(srcdir)/configure $(srcdir)/common/unicode/uvernum.h
340 @echo "*** config.status has become stale ***"
341 @echo " 'configure' and/or 'uvernum.h' have changed, please"
342 @echo " do 'runConfigureICU' (or 'configure') again, as per"
343 @echo " the readme.html."
349 install-manx: $(MANX_FILES)
350 $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION)
351 $(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION)
353 config/%.$(SECTION): $(srcdir)/config/%.$(SECTION).in
355 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
357 icu4j-data-install icu4j-data: all tests
358 @echo ICU4J_ROOT=$(ICU4J_ROOT)
359 @$(MAKE) -C test/testdata $@
362 # For updating Windows makefiles
364 WINDOWS_UPDATEFILES=$(srcdir)/data/makedata.mak $(shell find $(srcdir) -name '*.vcproj' -o -name '*.vcxproj')
366 WINDOWS_UPDATEFILES_SED=config/windows-update.sed
368 update-windows-makefiles: config.status
369 @echo Updating Windows Makefiles for ICU $(VERSION)
370 CONFIG_FILES=$(WINDOWS_UPDATEFILES_SED) CONFIG_HEADERS= $(SHELL) ./config.status
371 @for file in $(WINDOWS_UPDATEFILES); do \
372 echo "Updating $$file"; \
373 mv "$${file}" "$${file}.bak" && \
374 sed -f $(WINDOWS_UPDATEFILES_SED) < "$${file}.bak" > "$${file}" && \
377 $(RMV) $(WINDOWS_UPDATEFILES_SED)
378 @echo Please check over the changes carefully before checking them in.
380 # For building a source distribution.
381 distcheck dist-local:
382 $(MAKE) -C . -f $(top_srcdir)/config/dist.mk srcdir="$(srcdir)" top_srcdir="$(top_srcdir)" $@
386 @echo "Please provide DESTDIR when calling the target releaseDist."
389 @echo -n "ICU Version: " > $(DESTDIR)/readme.txt
390 @echo `./config/icu-config --noverify --version` >> $(DESTDIR)/readme.txt
391 @echo -n "HOST: " >> $(DESTDIR)/readme.txt
392 @echo `./config/icu-config --noverify --host` >> $(DESTDIR)/readme.txt
393 @echo -n "CC Compiler: " >> $(DESTDIR)/readme.txt
394 @echo `./config/icu-config --noverify --cc` >> $(DESTDIR)/readme.txt
395 @echo -n "CXX Compiler: " >> $(DESTDIR)/readme.txt
396 @echo `./config/icu-config --noverify --cxx` >> $(DESTDIR)/readme.txt
399 check-installed-icu: install
400 @echo "Testing ICU installed in $(prefix)"
401 $(INSTALLED_INVOKE) $(bindir)/icuinfo$(EXEEXT)
402 $(INSTALLED_INVOKE) $(bindir)/uconv$(EXEEXT) -V
403 $(INSTALLED_INVOKE) $(bindir)/genrb$(EXEEXT) -V
404 $(INSTALLED_INVOKE) $(bindir)/gencnval$(EXEEXT) -h
405 @echo INSTALLED ICU IN "$(prefix)" OK!