1 #******************************************************************************
3 # Copyright (C) 1998-2013, 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 layoutex
33 @ICUIO_TRUE@ICUIO = io
34 @EXTRAS_TRUE@EXTRA = extra
35 @TESTS_TRUE@TEST = test
36 @SAMPLES_TRUE@SAMPLE = samples
38 ## pkgconfig setup. Always have uc and i18n. Others are optional.
39 ALL_PKGCONFIG_SUFFIX=uc i18n
40 @LAYOUT_TRUE@ALL_PKGCONFIG_SUFFIX+= le lx
41 @ICUIO_TRUE@ALL_PKGCONFIG_SUFFIX+= io
46 ## Files to remove for 'make clean'
49 ALL_PKGCONFIG_FILES=$(ALL_PKGCONFIG_SUFFIX:%=$(top_builddir)/config/icu-%.pc)
51 ## Files built (autoconfed) and installed
52 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)
54 ## Files built (autoconfed) but not installed
55 LOCAL_BUILT_FILES = icudefs.mk config/icucross.mk config/icucross.inc
58 SUBDIRS = stubdata common i18n $(LAYOUT) tools data $(ICUIO) $(EXTRA) $(SAMPLE) $(TEST)
62 MANX_FILES = config/icu-config.$(SECTION)
64 ALL_MAN_FILES = $(MANX_FILES)
66 ## Extra files to install [nothing at present]
69 ## List of phony targets
70 .PHONY : all all-local all-recursive install install-local install-udata install-udata-files install-udata-dlls \
71 install-recursive clean clean-local clean-recursive distclean \
72 distclean-local distclean-recursive doc dist dist-local dist-recursive \
73 check check-local check-recursive clean-recursive-with-twist install-icu \
74 doc install-doc tests icu4j-data icu4j-data-install update-windows-makefiles xcheck-local xcheck-recursive xperf xcheck xperf-recursive \
75 check-exhaustive check-exhaustive-local check-exhaustive-recursive releaseDist
80 ## List of standard targets
81 all: all-local all-recursive
82 install: install-recursive install-local
83 clean: clean-recursive-with-twist clean-local
84 distclean : distclean-recursive distclean-local
85 dist: dist-recursive dist-local
86 check: all check-recursive
88 xcheck: all xcheck-recursive
89 xperf: all xperf-recursive
90 check-exhaustive: all check-exhaustive-recursive
92 check-exhaustive-local: check-local
94 xcheck-recursive: all xcheck-local
95 @$(MAKE) -C test xcheck
97 xperf-recursive: all tests
98 @$(MAKE) -C test/perf xperf
100 $(top_builddir)/config/icuinfo.xml: all
101 @$(MAKE) -C tools/icuinfo check
104 doc doc-searchengine:
105 @echo you need Doxygen to generate documentation. Doxygen can be found on the Web
106 @echo at http://www.doxygen.org/
108 doc: doc/html/index.html
110 doc-searchengine: Doxyfile $(wildcard ./common/unicode/platform.h $(srcdir)/common/unicode/*.h $(srcdir)/i18n/unicode/*.h $(srcdir)/layout/unicode/*.h $(srcdir)/io/unicode/*.h)
111 sed < Doxyfile -e 's%[^#]*SEARCHENGINE.*%SEARCHENGINE=YES%' | $(DOXYGEN) -
112 @echo adding links from non-namespaced class files
113 find doc/html -name 'classicu_1_1*' -print | sed -e 's%^\(.*class\)icu_1_1\(.*\)$$%ln & \1\2%' | sh
114 @echo Docs created - WARNING, probably contains non-GPL .js files
116 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)
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
121 Doxyfile: $(srcdir)/Doxyfile.in
122 CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
126 ( cd doc/html ; zip -r ../../$(DOCZIP) * )
129 LOCAL_SUBDIRS = $(SUBDIRS)
130 CLEAN_FIRST_SUBDIRS = tools
136 all-recursive install-recursive clean-recursive distclean-recursive dist-recursive check-recursive check-exhaustive-recursive: $(LIBDIR) $(BINDIR)
138 target=`echo $@ | sed s/-recursive//`; \
139 list='$(LOCAL_SUBDIRS)'; for subdir in $$list; do \
140 echo "$(MAKE)[$(MAKELEVEL)]: Making \`$$target' in \`$$subdir'"; \
141 if test "$$subdir" = "."; then \
143 local_target="$$target-local"; \
145 local_target="$$target"; \
147 (cd $$subdir && $(MAKE) RECURSIVE=YES $$local_target) || exit; \
149 if test "$$dot_seen" = "no"; then \
150 $(MAKE) "$$target-local" || exit; \
153 clean-recursive-with-twist:
154 $(MAKE) clean-recursive LOCAL_SUBDIRS='$(CLEAN_FIRST_SUBDIRS) $(filter-out $(CLEAN_FIRST_SUBDIRS),$(LOCAL_SUBDIRS))'
156 all-local: $(srcdir)/configure $(LOCAL_BUILT_FILES) $(INSTALLED_BUILT_FILES)
158 @echo "Note: rebuild with \"$(MAKE) VERBOSE=1 $(MAKECMDGOALS)\" to show all compiler parameters."
160 install-local: install-icu install-manx
162 install-icu: $(INSTALLED_BUILT_FILES)
163 @$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/config
164 @$(MKINSTALLDIRS) $(DESTDIR)$(pkglibdir)
165 @$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
166 @$(MKINSTALLDIRS) $(DESTDIR)$(sbindir)
167 $(INSTALL_DATA) @platform_make_fragment@ $(DESTDIR)$(pkgdatadir)/config/@platform_make_fragment_name@
168 $(INSTALL_SCRIPT) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(pkgdatadir)/mkinstalldirs
169 $(INSTALL_SCRIPT) $(top_srcdir)/install-sh $(DESTDIR)$(pkgdatadir)/install-sh
170 @$(MKINSTALLDIRS) $(DESTDIR)$(libdir)/pkgconfig
171 $(INSTALL_DATA) $(ALL_PKGCONFIG_FILES) $(DESTDIR)$(libdir)/pkgconfig/
172 $(INSTALL_DATA) $(top_srcdir)/../license.html $(DESTDIR)$(pkgdatadir)/license.html
173 $(INSTALL_SCRIPT) $(top_builddir)/config/icu-config $(DESTDIR)$(bindir)/icu-config
174 $(INSTALL_DATA) $(top_builddir)/config/Makefile.inc $(DESTDIR)$(pkglibdir)/Makefile.inc
175 $(INSTALL_DATA) $(top_builddir)/config/pkgdata.inc $(DESTDIR)$(pkglibdir)/pkgdata.inc
176 # @echo icuinfo.xml is built after make check.
177 # -$(INSTALL_DATA) $(top_builddir)/config/icuinfo.xml $(DESTDIR)$(pkglibdir)/icuinfo.xml
178 cd $(DESTDIR)$(pkglibdir)/..; \
179 $(RM) current && ln -s $(VERSION) current; \
180 $(RM) Makefile.inc && ln -s current/Makefile.inc Makefile.inc; \
181 $(RM) pkgdata.inc && ln -s current/pkgdata.inc pkgdata.inc
187 $(RM) -r $(DESTDIR)$(docdir)/$(docsubdir)
188 $(MKINSTALLDIRS) $(DESTDIR)$(docdir)/$(docsubdir)
189 $(INSTALL_DATA) $(docfiles) $(DESTDIR)$(docdir)/$(docsubdir)
193 $(DESTDIR)$(pkglibdir)/%: $(top_srcdir)/../data/%
194 $(INSTALL_DATA) $< $@
196 # Build the tests, but don't run them.
198 $(MAKE) -C $(top_builddir)/test
201 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
204 -$(RMV) $(ALL_PKGCONFIG_FILES) $(top_builddir)/config/icuinfo.xml
205 $(RMV) Doxyfile doc $(DOCZIP)
207 distclean-local: clean-local
208 $(RMV) $(top_builddir)/config/Makefile.inc $(top_builddir)/config/pkgdata.inc $(top_builddir)/config/icu-config $(top_builddir)/config/icu.pc $(ALL_PKGCONFIG_FILES)
209 $(RMV) config.cache config.log config.status $(top_builddir)/config/icucross.mk $(top_builddir)/config/icucross.inc autom4te.cache uconfig.h.prepend
210 $(RMV) Makefile config/Makefile icudefs.mk $(LIBDIR) $(BINDIR)
213 check-local: xcheck-local
214 -$(RMV) test-local.xml
216 xcheck-local: $(top_builddir)/config/icu-config $(top_builddir)/config/Makefile.inc $(top_builddir)/config/pkgdata.inc
217 @echo verifying that icu-config --selfcheck can operate
218 @test "passed" = "$(shell $(top_builddir)/config/icu-config --selfcheck 2>&1)" || (echo "FAIL: icu-config could not run properly." ; exit 1)
219 @echo verifying that $(MAKE) -f Makefile.inc selfcheck can operate
220 @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 )
221 @echo "PASS: config selfcheck OK"
223 #$(srcdir)/configure : $(srcdir)/configure.in $(top_srcdir)/aclocal.m4
224 # cd $(srcdir) && $(AUTOCONF)
226 icudefs.mk: $(srcdir)/icudefs.mk.in $(top_builddir)/config.status
228 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
230 config/icucross.mk: $(top_builddir)/icudefs.mk $(top_builddir)/Makefile
232 @(echo "CROSS_ICU_VERSION=$(VERSION)" ;\
233 echo "TOOLEXEEXT=$(EXEEXT)" \
235 @(echo 'TOOLBINDIR=$$(cross_buildroot)/bin' ;\
236 echo 'TOOLLIBDIR=$$(cross_buildroot)/lib' ;\
237 echo "INVOKE=$(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)"'$$(TOOLLIBDIR):$$(cross_buildroot)/stubdata:$$(cross_buildroot)/tools/ctestfw:$$$$'"$(LDLIBRARYPATH_ENVVAR)" ;\
238 echo "PKGDATA_INVOKE=$(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)"'$$(cross_buildroot)/stubdata:$$(cross_buildroot)/tools/ctestfw:$$(TOOLLIBDIR):$$$$'"$(LDLIBRARYPATH_ENVVAR) " ;\
241 config/icucross.inc: $(top_builddir)/icudefs.mk $(top_builddir)/Makefile @platform_make_fragment@
243 @(grep '^CURR_FULL_DIR' $(top_builddir)/icudefs.mk ; \
244 grep '^CURR_FULL_DIR' @platform_make_fragment@ || echo ""; \
247 config/icu.pc: $(srcdir)/config/icu.pc.in
249 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
251 config/icu-uc.pc: config/icu.pc Makefile icudefs.mk
252 @cat config/icu.pc > $@
253 @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Common and Data libraries" >> $@
254 @echo "Name: $(PACKAGE)-uc" >> $@
255 @echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" "${ICULIBS_DT}" >> $@
256 @echo "Libs.private:" '$${baselibs}' >> $@
259 config/icu-i18n.pc: config/icu.pc Makefile icudefs.mk
260 @cat config/icu.pc > $@
261 @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Internationalization library" >> $@
262 @echo "Name: $(PACKAGE)-i18n" >> $@
263 @echo "Requires: icu-uc" >> $@
264 @echo "Libs:" "${ICULIBS_I18N}" >> $@
267 config/icu-io.pc: config/icu.pc Makefile icudefs.mk
268 @cat config/icu.pc > $@
269 @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Stream and I/O Library" >> $@
270 @echo "Name: $(PACKAGE)-io" >> $@
271 @echo "Requires: icu-i18n" >> $@
272 @echo "Libs:" "${ICULIBS_IO}" >> $@
275 config/icu-le.pc: config/icu.pc Makefile icudefs.mk
276 @cat config/icu.pc > $@
277 @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Layout library" >> $@
278 @echo "Name: $(PACKAGE)-le" >> $@
279 @echo "Requires: icu-uc" >> $@
280 @echo "Libs:" "${ICULIBS_LE}" >> $@
283 config/icu-lx.pc: config/icu.pc Makefile icudefs.mk
284 @cat config/icu.pc > $@
285 @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Paragraph Layout library" >> $@
286 @echo "Name: $(PACKAGE)-lx" >> $@
287 @echo "Requires: icu-le" >> $@
288 @echo "Libs:" "${ICULIBS_LX}" >> $@
292 Makefile: $(srcdir)/Makefile.in icudefs.mk $(top_builddir)/config.status
294 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
296 $(top_builddir)/config/Makefile.inc: $(srcdir)/config/Makefile.inc.in $(top_builddir)/config.status
298 && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
300 $(top_builddir)/config/pkgdata.inc: icudefs.mk $(top_builddir)/config/pkgdataMakefile
301 cd $(top_builddir)/config; \
302 $(MAKE) -f pkgdataMakefile
304 $(top_builddir)/config/pkgdataMakefile:
306 && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
308 $(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
310 $(INSTALL_SCRIPT) $(top_srcdir)/config/icu-config-top $@
312 @echo "# Following from @platform_make_fragment@" >> $@
313 LC_ALL=C sed -f $(top_srcdir)/config/make2sh.sed < $(top_builddir)/config/Makefile.inc | grep -v '#M#' | uniq >> $@
314 LC_ALL=C sed -f $(top_srcdir)/config/make2sh.sed < @platform_make_fragment@ | grep -v '#M#' | uniq >> $@
315 cat $(top_srcdir)/config/icu-config-bottom >> $@
316 echo "# Rebuilt on "`date` >> $@
319 config.status: $(srcdir)/configure $(srcdir)/common/unicode/uvernum.h
322 @echo "*** config.status has become stale ***"
323 @echo " 'configure' and/or 'uvernum.h' have changed, please"
324 @echo " do 'runConfigureICU' (or 'configure') again, as per"
325 @echo " the readme.html."
331 install-manx: $(MANX_FILES)
332 $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION)
333 $(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION)
335 config/%.$(SECTION): $(srcdir)/config/%.$(SECTION).in
337 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
339 icu4j-data-install icu4j-data: all tests
340 @echo ICU4J_ROOT=$(ICU4J_ROOT)
341 @$(MAKE) -C test/testdata $@
344 # For updating Windows makefiles
346 WINDOWS_UPDATEFILES=$(srcdir)/data/makedata.mak $(shell find $(srcdir) -name '*.vcproj' -o -name '*.vcxproj')
348 WINDOWS_UPDATEFILES_SED=config/windows-update.sed
350 update-windows-makefiles: config.status
351 @echo Updating Windows Makefiles for ICU $(VERSION)
352 CONFIG_FILES=$(WINDOWS_UPDATEFILES_SED) CONFIG_HEADERS= $(SHELL) ./config.status
353 @for file in $(WINDOWS_UPDATEFILES); do \
354 echo "Updating $$file"; \
355 mv "$${file}" "$${file}.bak" && \
356 sed -f $(WINDOWS_UPDATEFILES_SED) < "$${file}.bak" > "$${file}" && \
359 $(RMV) $(WINDOWS_UPDATEFILES_SED)
360 @echo Please check over the changes carefully before checking them in.
362 # For building a source distribution.
363 distcheck dist-local:
364 $(MAKE) -C . -f $(top_srcdir)/config/dist.mk srcdir="$(srcdir)" top_srcdir="$(top_srcdir)" $@
368 @echo "Please provide DESTDIR when calling the target releaseDist."
371 @echo -n "ICU Version: " > $(DESTDIR)/readme.txt
372 @echo `./config/icu-config --noverify --version` >> $(DESTDIR)/readme.txt
373 @echo -n "HOST: " >> $(DESTDIR)/readme.txt
374 @echo `./config/icu-config --noverify --host` >> $(DESTDIR)/readme.txt
375 @echo -n "CC Compiler: " >> $(DESTDIR)/readme.txt
376 @echo `./config/icu-config --noverify --cc` >> $(DESTDIR)/readme.txt
377 @echo -n "CXX Compiler: " >> $(DESTDIR)/readme.txt
378 @echo `./config/icu-config --noverify --cxx` >> $(DESTDIR)/readme.txt
381 check-installed-icu: install
382 @echo "Testing ICU installed in $(prefix)"
383 $(INSTALLED_INVOKE) $(bindir)/icuinfo$(EXEEXT)
384 $(INSTALLED_INVOKE) $(bindir)/uconv$(EXEEXT) -V
385 $(INSTALLED_INVOKE) $(bindir)/genrb$(EXEEXT) -V
386 $(INSTALLED_INVOKE) $(bindir)/gencnval$(EXEEXT) -h
387 @echo INSTALLED ICU IN "$(prefix)" OK!