1 #******************************************************************************
3 # Copyright (C) 1998-2016, International Business Machines
4 # Corporation and others. All Rights Reserved.
6 #******************************************************************************
7 ## Top-level Makefile.in for ICU
11 top_srcdir = @top_srcdir@
15 include $(top_builddir)/icudefs.mk
17 docdir = $(datadir)/doc
18 docsubdir = $(PACKAGE)$(ICULIBDASHSUFFIX)/html
19 docfilesdir = doc/html
20 docfiles = $(docfilesdir)/*.png $(docfilesdir)/*.html $(docfilesdir)/*.css $(docfilesdir)/*.tag
21 docsrchdir = $(docfilesdir)/search
22 docsrchfiles = $(docsrchdir)/*
26 ## Build directory information
29 #AUTOCONF = @AUTOCONF@
31 ## Optional directory setup
32 @LAYOUT_TRUE@LAYOUT = layout
33 @LAYOUTEX_TRUE@LAYOUTEX = layoutex
34 @ICUIO_TRUE@ICUIO = io
35 @EXTRAS_TRUE@EXTRA = extra
36 @TESTS_TRUE@TEST = test
37 @SAMPLES_TRUE@SAMPLE = samples
38 @TOOLS_TRUE@TOOLS = tools
40 ## pkgconfig setup. Always have uc and i18n. Others are optional.
41 ALL_PKGCONFIG_SUFFIX=uc i18n
42 @LAYOUT_TRUE@ALL_PKGCONFIG_SUFFIX+= le
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 $(LAYOUT) $(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)/layout/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)/layout/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)
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 \
149 local_target="$$target-local"; \
151 local_target="$$target"; \
153 (cd $$subdir && $(MAKE) RECURSIVE=YES $$local_target) || exit; \
155 if test "$$dot_seen" = "no"; then \
156 $(MAKE) "$$target-local" || exit; \
159 clean-recursive-with-twist:
160 $(MAKE) clean-recursive LOCAL_SUBDIRS='$(CLEAN_FIRST_SUBDIRS) $(filter-out $(CLEAN_FIRST_SUBDIRS),$(LOCAL_SUBDIRS))'
162 all-local: $(srcdir)/configure $(LOCAL_BUILT_FILES) $(INSTALLED_BUILT_FILES)
164 @echo "Note: rebuild with \"$(MAKE) VERBOSE=1 $(MAKECMDGOALS)\" to show all compiler parameters."
166 install-local: install-icu install-manx
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/
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
198 $(RM) -r $(DESTDIR)$(docdir)/$(docsubdir)
199 $(MKINSTALLDIRS) $(DESTDIR)$(docdir)/$(docsubdir)
200 $(INSTALL_DATA) $(docfiles) $(DESTDIR)$(docdir)/$(docsubdir)
204 $(DESTDIR)$(pkglibdir)/%: $(top_srcdir)/../data/%
205 $(INSTALL_DATA) $< $@
207 # Build the tests, but don't run them.
209 $(MAKE) -C $(top_builddir)/test
212 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
215 -$(RMV) $(ALL_PKGCONFIG_FILES) $(top_builddir)/config/icuinfo.xml
216 $(RMV) Doxyfile doc $(DOCZIP)
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)
224 check-local: xcheck-local
225 -$(RMV) test-local.xml
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"
234 #$(srcdir)/configure : $(srcdir)/configure.ac $(top_srcdir)/aclocal.m4
235 # cd $(srcdir) && aclocal && $(AUTOCONF)
237 icudefs.mk: $(srcdir)/icudefs.mk.in $(top_builddir)/config.status
239 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
241 config/icucross.mk: $(top_builddir)/icudefs.mk $(top_builddir)/Makefile
243 @(echo "CROSS_ICU_VERSION=$(VERSION)" ;\
244 echo "TOOLEXEEXT=$(EXEEXT)" \
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) " ;\
252 config/icucross.inc: $(top_builddir)/icudefs.mk $(top_builddir)/Makefile @platform_make_fragment@
254 @(grep '^CURR_FULL_DIR' $(top_builddir)/icudefs.mk ; \
255 grep '^CURR_FULL_DIR' @platform_make_fragment@ || echo ""; \
258 config/icu.pc: $(srcdir)/config/icu.pc.in
260 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
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}' >> $@
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}" >> $@
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}" >> $@
286 config/icu-le.pc: config/icu.pc Makefile icudefs.mk
287 @cat config/icu.pc > $@
288 @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Layout library" >> $@
289 @echo "Name: $(PACKAGE)-le" >> $@
290 @echo "Requires: icu-uc" >> $@
291 @echo "Libs:" "${ICULIBS_LE}" >> $@
294 ICULEHB_LIBS=@ICULEHB_LIBS@
296 ifneq ($(ICULEHB_LIBS),)
297 USING_HB=(Using HarfBuzz)
301 config/icu-lx.pc: config/icu.pc Makefile icudefs.mk
302 @cat config/icu.pc > $@
303 @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Paragraph Layout library $(USING_HB)" >> $@
304 @echo "Name: $(PACKAGE)-lx" >> $@
305 ifneq ($(ICULEHB_LIBS),)
306 @echo "Requires: icu-le-hb icu-uc" >> $@
308 @echo "Requires: icu-le" >> $@
310 @echo "Libs:" "${ICULIBS_LX}" >> $@
314 Makefile: $(srcdir)/Makefile.in icudefs.mk $(top_builddir)/config.status
316 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
318 $(top_builddir)/config/Makefile.inc: $(srcdir)/config/Makefile.inc.in $(top_builddir)/config.status
320 && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
322 $(top_builddir)/config/pkgdata.inc: icudefs.mk $(top_builddir)/config/pkgdataMakefile
323 cd $(top_builddir)/config; \
324 $(MAKE) -f pkgdataMakefile
326 $(top_builddir)/config/pkgdataMakefile:
328 && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
330 $(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
332 $(INSTALL_SCRIPT) $(top_srcdir)/config/icu-config-top $@
334 @echo "# Following from @platform_make_fragment@" >> $@
335 LC_ALL=C sed -f $(top_srcdir)/config/make2sh.sed < $(top_builddir)/config/Makefile.inc | grep -v '#M#' | uniq >> $@
336 LC_ALL=C sed -f $(top_srcdir)/config/make2sh.sed < @platform_make_fragment@ | grep -v '#M#' | uniq >> $@
337 cat $(top_srcdir)/config/icu-config-bottom >> $@
340 config.status: $(srcdir)/configure $(srcdir)/common/unicode/uvernum.h
343 @echo "*** config.status has become stale ***"
344 @echo " 'configure' and/or 'uvernum.h' have changed, please"
345 @echo " do 'runConfigureICU' (or 'configure') again, as per"
346 @echo " the readme.html."
352 install-manx: $(MANX_FILES)
353 $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION)
354 $(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION)
356 config/%.$(SECTION): $(srcdir)/config/%.$(SECTION).in
358 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
360 icu4j-data-install icu4j-data: all tests
361 @echo ICU4J_ROOT=$(ICU4J_ROOT)
362 @$(MAKE) -C test/testdata $@
365 # For updating Windows makefiles
367 WINDOWS_UPDATEFILES=$(srcdir)/data/makedata.mak $(shell find $(srcdir) -name '*.vcproj' -o -name '*.vcxproj')
369 WINDOWS_UPDATEFILES_SED=config/windows-update.sed
371 update-windows-makefiles: config.status
372 @echo Updating Windows Makefiles for ICU $(VERSION)
373 CONFIG_FILES=$(WINDOWS_UPDATEFILES_SED) CONFIG_HEADERS= $(SHELL) ./config.status
374 @for file in $(WINDOWS_UPDATEFILES); do \
375 echo "Updating $$file"; \
376 mv "$${file}" "$${file}.bak" && \
377 sed -f $(WINDOWS_UPDATEFILES_SED) < "$${file}.bak" > "$${file}" && \
380 $(RMV) $(WINDOWS_UPDATEFILES_SED)
381 @echo Please check over the changes carefully before checking them in.
383 # For building a source distribution.
384 distcheck dist-local:
385 $(MAKE) -C . -f $(top_srcdir)/config/dist.mk srcdir="$(srcdir)" top_srcdir="$(top_srcdir)" $@
389 @echo "Please provide DESTDIR when calling the target releaseDist."
392 @echo -n "ICU Version: " > $(DESTDIR)/readme.txt
393 @echo `./config/icu-config --noverify --version` >> $(DESTDIR)/readme.txt
394 @echo -n "HOST: " >> $(DESTDIR)/readme.txt
395 @echo `./config/icu-config --noverify --host` >> $(DESTDIR)/readme.txt
396 @echo -n "CC Compiler: " >> $(DESTDIR)/readme.txt
397 @echo `./config/icu-config --noverify --cc` >> $(DESTDIR)/readme.txt
398 @echo -n "CXX Compiler: " >> $(DESTDIR)/readme.txt
399 @echo `./config/icu-config --noverify --cxx` >> $(DESTDIR)/readme.txt
402 check-installed-icu: install
403 @echo "Testing ICU installed in $(prefix)"
404 $(INSTALLED_INVOKE) $(bindir)/icuinfo$(EXEEXT)
405 $(INSTALLED_INVOKE) $(bindir)/uconv$(EXEEXT) -V
406 $(INSTALLED_INVOKE) $(bindir)/genrb$(EXEEXT) -V
407 $(INSTALLED_INVOKE) $(bindir)/gencnval$(EXEEXT) -h
408 @echo INSTALLED ICU IN "$(prefix)" OK!