]> git.saurik.com Git - apple/icu.git/blob - icuSources/Makefile.in
ICU-62123.0.1.tar.gz
[apple/icu.git] / icuSources / Makefile.in
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
12 srcdir = @srcdir@
13 top_srcdir = @top_srcdir@
14
15 top_builddir = .
16
17 include $(top_builddir)/icudefs.mk
18
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)/*
25
26 ##
27
28 ## Build directory information
29 subdir = .
30
31 #AUTOCONF = @AUTOCONF@
32
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
42
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
47
48 DOXYGEN = @DOXYGEN@
49 DOCZIP = icu-docs.zip
50
51 ## Files to remove for 'make clean'
52 CLEANFILES = *~
53
54 ALL_PKGCONFIG_FILES=$(ALL_PKGCONFIG_SUFFIX:%=$(top_builddir)/config/icu-%.pc)
55
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)
58
59 ## Files built (autoconfed) but not installed
60 LOCAL_BUILT_FILES = icudefs.mk config/icucross.mk config/icucross.inc
61
62 DOCDIRS = common i18n
63 SUBDIRS = stubdata common i18n $(LAYOUTEX) $(ICUIO) $(TOOLS) $(DATASUBDIR) $(EXTRA) $(SAMPLE) $(TEST)
64
65 SECTION = 1
66
67 MANX_FILES = config/icu-config.$(SECTION)
68
69 ALL_MAN_FILES = $(MANX_FILES)
70
71 ## Extra files to install [nothing at present]
72 EXTRA_DATA =
73
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
81
82 ## Clear suffix list
83 .SUFFIXES :
84
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
90 dist: dist-recursive
91 check: all check-recursive
92 check-recursive: all
93 xcheck: all xcheck-recursive
94 xperf: all xperf-recursive
95 check-exhaustive: all check-exhaustive-recursive
96
97 pcheck: all tests
98 @$(MAKE) -C test pcheck
99
100 check-exhaustive-local: check-local
101
102 xcheck-recursive: all xcheck-local
103 @$(MAKE) -C test xcheck
104
105 xperf-recursive: all tests
106 @$(MAKE) -C test/perf xperf
107
108 $(top_builddir)/config/icuinfo.xml: all
109 @$(MAKE) -C tools/icuinfo check
110
111 ifeq ($(DOXYGEN),)
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/
115 else
116 doc: doc/html/index.html
117
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
123
124 doc/html/index.html: Doxyfile $(wildcard ./common/unicode/platform.h $(srcdir)/common/unicode/*.h $(srcdir)/i18n/unicode/*.h $(srcdir)/io/unicode/*.h)
125 $(DOXYGEN)
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
128
129 Doxyfile: $(srcdir)/Doxyfile.in
130 CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
131
132 $(DOCZIP): doc
133 -$(RMV) $(DOCZIP)
134 ( cd doc/html ; zip -r ../../$(DOCZIP) * )
135 endif
136
137 LOCAL_SUBDIRS = $(SUBDIRS)
138 CLEAN_FIRST_SUBDIRS = $(TOOLS)
139
140 $(LIBDIR) $(BINDIR):
141 -$(MKINSTALLDIRS) $@
142
143 ## Recursive targets
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
148 endif
149 @dot_seen=no; \
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 \
154 dot_seen=yes; \
155 local_target="$$target-local"; \
156 else \
157 local_target="$$target"; \
158 fi; \
159 (cd $$subdir && $(MAKE) RECURSIVE=YES $$local_target) || exit; \
160 done; \
161 if test "$$dot_seen" = "no"; then \
162 $(MAKE) "$$target-local" || exit; \
163 fi
164
165 clean-recursive-with-twist:
166 $(MAKE) clean-recursive LOCAL_SUBDIRS='$(CLEAN_FIRST_SUBDIRS) $(filter-out $(CLEAN_FIRST_SUBDIRS),$(LOCAL_SUBDIRS))'
167
168 all-local: $(srcdir)/configure $(LOCAL_BUILT_FILES) $(INSTALLED_BUILT_FILES)
169 ifndef VERBOSE
170 @echo "Note: rebuild with \"$(MAKE) VERBOSE=1 $(MAKECMDGOALS)\" to show all compiler parameters."
171 endif
172 install-local: install-icu install-manx
173
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/
178
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
199
200 ifeq ($(DOXYGEN),)
201 install-doc:
202 else
203 install-doc: doc
204 $(RM) -r $(DESTDIR)$(docdir)/$(docsubdir)
205 $(MKINSTALLDIRS) $(DESTDIR)$(docdir)/$(docsubdir)
206 $(INSTALL_DATA) $(docfiles) $(DESTDIR)$(docdir)/$(docsubdir)
207
208 endif
209
210 $(DESTDIR)$(pkglibdir)/%: $(top_srcdir)/../data/%
211 $(INSTALL_DATA) $< $@
212
213 # Build the tests, but don't run them.
214 tests: all
215 $(MAKE) -C $(top_builddir)/test
216
217 clean-local:
218 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
219 -$(RMV) "test-*.xml"
220 -$(RMV) "perf-*.xml"
221 -$(RMV) $(ALL_PKGCONFIG_FILES) $(top_builddir)/config/icuinfo.xml
222 $(RMV) Doxyfile doc $(DOCZIP)
223
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)
228 -$(RMV) dist
229
230 check-local: xcheck-local
231 -$(RMV) test-local.xml
232
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"
239
240 #$(srcdir)/configure : $(srcdir)/configure.ac $(top_srcdir)/aclocal.m4
241 # cd $(srcdir) && aclocal && $(AUTOCONF)
242
243 icudefs.mk: $(srcdir)/icudefs.mk.in $(top_builddir)/config.status
244 cd $(top_builddir) \
245 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
246
247 config/icucross.mk: $(top_builddir)/icudefs.mk $(top_builddir)/Makefile
248 @echo rebuilding $@
249 @(echo "CROSS_ICU_VERSION=$(VERSION)" ;\
250 echo "TOOLEXEEXT=$(EXEEXT)" \
251 ) > $@
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) " ;\
256 echo ) >> $@
257
258 config/icucross.inc: $(top_builddir)/icudefs.mk $(top_builddir)/Makefile @platform_make_fragment@
259 @echo rebuilding $@
260 @(grep '^CURR_FULL_DIR' $(top_builddir)/icudefs.mk ; \
261 grep '^CURR_FULL_DIR' @platform_make_fragment@ || echo ""; \
262 ) > $@
263
264 config/icu.pc: $(srcdir)/config/icu.pc.in
265 cd $(top_builddir) \
266 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
267
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}' >> $@
274 @echo $@ updated.
275
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}" >> $@
282 @echo $@ updated.
283
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}" >> $@
290 @echo $@ updated.
291
292 ICULEHB_LIBS=@ICULEHB_LIBS@
293 USING_HB=
294 ifneq ($(ICULEHB_LIBS),)
295 USING_HB=(Using HarfBuzz)
296 endif
297
298
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" >> $@
305 else
306 @echo "Requires: icu-le" >> $@
307 endif
308 @echo "Libs:" "${ICULIBS_LX}" >> $@
309 @echo $@ updated.
310
311
312 Makefile: $(srcdir)/Makefile.in icudefs.mk $(top_builddir)/config.status
313 cd $(top_builddir) \
314 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
315
316 $(top_builddir)/config/Makefile.inc: $(srcdir)/config/Makefile.inc.in $(top_builddir)/config.status
317 cd $(top_builddir) \
318 && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
319
320 $(top_builddir)/config/pkgdata.inc: icudefs.mk $(top_builddir)/config/pkgdataMakefile
321 cd $(top_builddir)/config; \
322 $(MAKE) -f pkgdataMakefile
323
324 $(top_builddir)/config/pkgdataMakefile:
325 cd $(top_builddir) \
326 && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
327
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
329 -$(RMV) $@
330 $(INSTALL_SCRIPT) $(top_srcdir)/config/icu-config-top $@
331 chmod u+w $@
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 >> $@
337 chmod u-w $@
338
339 config.status: $(srcdir)/configure $(srcdir)/common/unicode/uvernum.h
340 @echo
341 @echo
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."
346 @echo
347 @echo
348 exit 1
349
350
351 install-manx: $(MANX_FILES)
352 $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION)
353 $(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION)
354
355 config/%.$(SECTION): $(srcdir)/config/%.$(SECTION).in
356 cd $(top_builddir) \
357 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
358
359 icu4j-data-install icu4j-data: all tests
360 @echo ICU4J_ROOT=$(ICU4J_ROOT)
361 @$(MAKE) -C test/testdata $@
362 @$(MAKE) -C data $@
363
364 # For updating Windows makefiles
365
366 WINDOWS_UPDATEFILES=$(srcdir)/data/makedata.mak $(shell find $(srcdir) -name '*.vcproj' -o -name '*.vcxproj')
367
368 WINDOWS_UPDATEFILES_SED=config/windows-update.sed
369
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}" && \
377 rm "$${file}.bak"; \
378 done;
379 $(RMV) $(WINDOWS_UPDATEFILES_SED)
380 @echo Please check over the changes carefully before checking them in.
381
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)" $@
385
386 ifeq ($(DESTDIR),)
387 releaseDist:
388 @echo "Please provide DESTDIR when calling the target releaseDist."
389 else
390 releaseDist: install
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
399 endif
400
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!