Makefile.in 15 KB

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