]> git.saurik.com Git - apple/icu.git/blame - icuSources/Makefile.in
ICU-511.34.tar.gz
[apple/icu.git] / icuSources / Makefile.in
CommitLineData
b75a7d8f
A
1#******************************************************************************
2#
51004dcb 3# Copyright (C) 1998-2013, International Business Machines
b75a7d8f
A
4# Corporation and others. All Rights Reserved.
5#
6#******************************************************************************
7## Top-level Makefile.in for ICU
8## Stephen F. Booth
9
10srcdir = @srcdir@
11top_srcdir = @top_srcdir@
12
13top_builddir = .
14
15include $(top_builddir)/icudefs.mk
16
17docdir = $(datadir)/doc
18docsubdir = $(PACKAGE)$(ICULIBDASHSUFFIX)/html
729e4ab9 19docfilesdir = doc/html
51004dcb 20docfiles = $(docfilesdir)/*.png $(docfilesdir)/*.html $(docfilesdir)/*.css $(docfilesdir)/*.tag
729e4ab9
A
21docsrchdir = $(docfilesdir)/search
22docsrchfiles = $(docsrchdir)/*
b75a7d8f
A
23
24##
25
26## Build directory information
27subdir = .
28
374ca955 29#AUTOCONF = @AUTOCONF@
b75a7d8f
A
30
31## Optional directory setup
b75a7d8f 32@LAYOUT_TRUE@LAYOUT = layout layoutex
374ca955
A
33@ICUIO_TRUE@ICUIO = io
34@EXTRAS_TRUE@EXTRA = extra
b75a7d8f 35@TESTS_TRUE@TEST = test
b75a7d8f 36@SAMPLES_TRUE@SAMPLE = samples
b75a7d8f 37
51004dcb
A
38## pkgconfig setup. Always have uc and i18n. Others are optional.
39ALL_PKGCONFIG_SUFFIX=uc i18n
40@LAYOUT_TRUE@ALL_PKGCONFIG_SUFFIX+= le lx
41@ICUIO_TRUE@ALL_PKGCONFIG_SUFFIX+= io
42
b75a7d8f 43DOXYGEN = @DOXYGEN@
46f4442e 44DOCZIP = icu-docs.zip
b75a7d8f
A
45
46## Files to remove for 'make clean'
46f4442e 47CLEANFILES = *~
b75a7d8f 48
729e4ab9
A
49ALL_PKGCONFIG_FILES=$(ALL_PKGCONFIG_SUFFIX:%=$(top_builddir)/config/icu-%.pc)
50
b75a7d8f 51## Files built (autoconfed) and installed
729e4ab9 52INSTALLED_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)
b75a7d8f
A
53
54## Files built (autoconfed) but not installed
51004dcb 55LOCAL_BUILT_FILES = icudefs.mk config/icucross.mk config/icucross.inc
b75a7d8f
A
56
57DOCDIRS = common i18n
374ca955 58SUBDIRS = stubdata common i18n $(LAYOUT) tools data $(ICUIO) $(EXTRA) $(SAMPLE) $(TEST)
b75a7d8f
A
59
60SECTION = 1
61
62MANX_FILES = config/icu-config.$(SECTION)
63
64ALL_MAN_FILES = $(MANX_FILES)
65
66## Extra files to install [nothing at present]
67EXTRA_DATA =
68
69## List of phony targets
70.PHONY : all all-local all-recursive install install-local install-udata install-udata-files install-udata-dlls \
71install-recursive clean clean-local clean-recursive distclean \
72distclean-local distclean-recursive doc dist dist-local dist-recursive \
73check check-local check-recursive clean-recursive-with-twist install-icu \
4388f060
A
74doc install-doc tests icu4j-data icu4j-data-install update-windows-makefiles xcheck-local xcheck-recursive xperf xcheck xperf-recursive \
75check-exhaustive check-exhaustive-local check-exhaustive-recursive releaseDist
b75a7d8f
A
76
77## Clear suffix list
78.SUFFIXES :
79
80## List of standard targets
81all: all-local all-recursive
82install: install-recursive install-local
83clean: clean-recursive-with-twist clean-local
84distclean : distclean-recursive distclean-local
85dist: dist-recursive dist-local
729e4ab9 86check: all check-recursive
374ca955 87check-recursive: all
729e4ab9
A
88xcheck: all xcheck-recursive
89xperf: all xperf-recursive
4388f060
A
90check-exhaustive: all check-exhaustive-recursive
91
92check-exhaustive-local: check-local
729e4ab9
A
93
94xcheck-recursive: all xcheck-local
95 @$(MAKE) -C test xcheck
96
97xperf-recursive: all tests
98 @$(MAKE) -C test/perf xperf
b75a7d8f 99
4388f060
A
100$(top_builddir)/config/icuinfo.xml: all
101 @$(MAKE) -C tools/icuinfo check
102
b75a7d8f 103ifeq ($(DOXYGEN),)
4388f060 104doc doc-searchengine:
b75a7d8f
A
105 @echo you need Doxygen to generate documentation. Doxygen can be found on the Web
106 @echo at http://www.doxygen.org/
107else
108doc: doc/html/index.html
109
4388f060
A
110doc-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) -
51004dcb
A
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
4388f060
A
114 @echo Docs created - WARNING, probably contains non-GPL .js files
115
374ca955 116doc/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)
b75a7d8f 117 $(DOXYGEN)
51004dcb
A
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
b75a7d8f
A
120
121Doxyfile: $(srcdir)/Doxyfile.in
122 CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
46f4442e
A
123
124$(DOCZIP): doc
125 -$(RMV) $(DOCZIP)
126 ( cd doc/html ; zip -r ../../$(DOCZIP) * )
b75a7d8f
A
127endif
128
129LOCAL_SUBDIRS = $(SUBDIRS)
130CLEAN_FIRST_SUBDIRS = tools
131
374ca955
A
132$(LIBDIR) $(BINDIR):
133 -$(MKINSTALLDIRS) $@
134
b75a7d8f 135## Recursive targets
4388f060 136all-recursive install-recursive clean-recursive distclean-recursive dist-recursive check-recursive check-exhaustive-recursive: $(LIBDIR) $(BINDIR)
b75a7d8f
A
137 @dot_seen=no; \
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 \
142 dot_seen=yes; \
143 local_target="$$target-local"; \
144 else \
145 local_target="$$target"; \
146 fi; \
147 (cd $$subdir && $(MAKE) RECURSIVE=YES $$local_target) || exit; \
148 done; \
149 if test "$$dot_seen" = "no"; then \
150 $(MAKE) "$$target-local" || exit; \
151 fi
152
153clean-recursive-with-twist:
154 $(MAKE) clean-recursive LOCAL_SUBDIRS='$(CLEAN_FIRST_SUBDIRS) $(filter-out $(CLEAN_FIRST_SUBDIRS),$(LOCAL_SUBDIRS))'
155
156all-local: $(srcdir)/configure $(LOCAL_BUILT_FILES) $(INSTALLED_BUILT_FILES)
51004dcb
A
157ifndef VERBOSE
158 @echo "Note: rebuild with \"$(MAKE) VERBOSE=1 $(MAKECMDGOALS)\" to show all compiler parameters."
159endif
b75a7d8f
A
160install-local: install-icu install-manx
161
162install-icu: $(INSTALLED_BUILT_FILES)
163 @$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/config
164 @$(MKINSTALLDIRS) $(DESTDIR)$(pkglibdir)
165 @$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
166 @$(MKINSTALLDIRS) $(DESTDIR)$(sbindir)
374ca955
A
167 $(INSTALL_DATA) @platform_make_fragment@ $(DESTDIR)$(pkgdatadir)/config/@platform_make_fragment_name@
168 $(INSTALL_SCRIPT) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(pkgdatadir)/mkinstalldirs
46f4442e 169 $(INSTALL_SCRIPT) $(top_srcdir)/install-sh $(DESTDIR)$(pkgdatadir)/install-sh
729e4ab9
A
170 @$(MKINSTALLDIRS) $(DESTDIR)$(libdir)/pkgconfig
171 $(INSTALL_DATA) $(ALL_PKGCONFIG_FILES) $(DESTDIR)$(libdir)/pkgconfig/
374ca955
A
172 $(INSTALL_DATA) $(top_srcdir)/../license.html $(DESTDIR)$(pkgdatadir)/license.html
173 $(INSTALL_SCRIPT) $(top_builddir)/config/icu-config $(DESTDIR)$(bindir)/icu-config
b75a7d8f 174 $(INSTALL_DATA) $(top_builddir)/config/Makefile.inc $(DESTDIR)$(pkglibdir)/Makefile.inc
729e4ab9 175 $(INSTALL_DATA) $(top_builddir)/config/pkgdata.inc $(DESTDIR)$(pkglibdir)/pkgdata.inc
4388f060
A
176# @echo icuinfo.xml is built after make check.
177# -$(INSTALL_DATA) $(top_builddir)/config/icuinfo.xml $(DESTDIR)$(pkglibdir)/icuinfo.xml
b75a7d8f
A
178 cd $(DESTDIR)$(pkglibdir)/..; \
179 $(RM) current && ln -s $(VERSION) current; \
729e4ab9
A
180 $(RM) Makefile.inc && ln -s current/Makefile.inc Makefile.inc; \
181 $(RM) pkgdata.inc && ln -s current/pkgdata.inc pkgdata.inc
b75a7d8f
A
182
183ifeq ($(DOXYGEN),)
184install-doc:
185else
186install-doc: doc
187 $(RM) -r $(DESTDIR)$(docdir)/$(docsubdir)
51004dcb 188 $(MKINSTALLDIRS) $(DESTDIR)$(docdir)/$(docsubdir)
729e4ab9 189 $(INSTALL_DATA) $(docfiles) $(DESTDIR)$(docdir)/$(docsubdir)
51004dcb 190
b75a7d8f
A
191endif
192
193$(DESTDIR)$(pkglibdir)/%: $(top_srcdir)/../data/%
194 $(INSTALL_DATA) $< $@
195
46f4442e
A
196# Build the tests, but don't run them.
197tests: all
198 $(MAKE) -C $(top_builddir)/test
199
b75a7d8f
A
200clean-local:
201 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
729e4ab9
A
202 -$(RMV) "test-*.xml"
203 -$(RMV) "perf-*.xml"
4388f060 204 -$(RMV) $(ALL_PKGCONFIG_FILES) $(top_builddir)/config/icuinfo.xml
46f4442e 205 $(RMV) Doxyfile doc $(DOCZIP)
b75a7d8f
A
206
207distclean-local: clean-local
729e4ab9 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)
51004dcb 209 $(RMV) config.cache config.log config.status $(top_builddir)/config/icucross.mk $(top_builddir)/config/icucross.inc autom4te.cache uconfig.h.prepend
46f4442e 210 $(RMV) Makefile config/Makefile icudefs.mk $(LIBDIR) $(BINDIR)
729e4ab9
A
211 -$(RMV) dist
212
213check-local: xcheck-local
214 -$(RMV) test-local.xml
b75a7d8f 215
729e4ab9
A
216xcheck-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"
b75a7d8f
A
222
223#$(srcdir)/configure : $(srcdir)/configure.in $(top_srcdir)/aclocal.m4
224# cd $(srcdir) && $(AUTOCONF)
225
226icudefs.mk: $(srcdir)/icudefs.mk.in $(top_builddir)/config.status
227 cd $(top_builddir) \
228 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
229
729e4ab9
A
230config/icucross.mk: $(top_builddir)/icudefs.mk $(top_builddir)/Makefile
231 @echo rebuilding $@
232 @(echo "CROSS_ICU_VERSION=$(VERSION)" ;\
233 echo "TOOLEXEEXT=$(EXEEXT)" \
234 ) > $@
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)" ;\
51004dcb 238 echo "PKGDATA_INVOKE=$(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)"'$$(cross_buildroot)/stubdata:$$(cross_buildroot)/tools/ctestfw:$$(TOOLLIBDIR):$$$$'"$(LDLIBRARYPATH_ENVVAR) " ;\
729e4ab9
A
239 echo ) >> $@
240
51004dcb
A
241config/icucross.inc: $(top_builddir)/icudefs.mk $(top_builddir)/Makefile @platform_make_fragment@
242 @echo rebuilding $@
243 @(grep '^CURR_FULL_DIR' $(top_builddir)/icudefs.mk ; \
244 grep '^CURR_FULL_DIR' @platform_make_fragment@ || echo ""; \
245 ) > $@
729e4ab9
A
246
247config/icu.pc: $(srcdir)/config/icu.pc.in
248 cd $(top_builddir) \
249 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
250
251config/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}' >> $@
257 @echo $@ updated.
258
259config/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}" >> $@
265 @echo $@ updated.
266
267config/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}" >> $@
273 @echo $@ updated.
274
275config/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}" >> $@
281 @echo $@ updated.
282
283config/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}" >> $@
289 @echo $@ updated.
290
291
b75a7d8f
A
292Makefile: $(srcdir)/Makefile.in icudefs.mk $(top_builddir)/config.status
293 cd $(top_builddir) \
294 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
295
296$(top_builddir)/config/Makefile.inc: $(srcdir)/config/Makefile.inc.in $(top_builddir)/config.status
297 cd $(top_builddir) \
298 && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
299
729e4ab9
A
300$(top_builddir)/config/pkgdata.inc: icudefs.mk $(top_builddir)/config/pkgdataMakefile
301 cd $(top_builddir)/config; \
302 $(MAKE) -f pkgdataMakefile
303
304$(top_builddir)/config/pkgdataMakefile:
305 cd $(top_builddir) \
306 && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
307
b75a7d8f
A
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
309 -$(RMV) $@
374ca955 310 $(INSTALL_SCRIPT) $(top_srcdir)/config/icu-config-top $@
73c04bcf 311 chmod u+w $@
b75a7d8f 312 @echo "# Following from @platform_make_fragment@" >> $@
729e4ab9
A
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 >> $@
b75a7d8f
A
315 cat $(top_srcdir)/config/icu-config-bottom >> $@
316 echo "# Rebuilt on "`date` >> $@
73c04bcf 317 chmod u-w $@
b75a7d8f 318
729e4ab9 319config.status: $(srcdir)/configure $(srcdir)/common/unicode/uvernum.h
b75a7d8f
A
320 @echo
321 @echo
322 @echo "*** config.status has become stale ***"
729e4ab9 323 @echo " 'configure' and/or 'uvernum.h' have changed, please"
b75a7d8f
A
324 @echo " do 'runConfigureICU' (or 'configure') again, as per"
325 @echo " the readme.html."
326 @echo
327 @echo
328 exit 1
329
330
331install-manx: $(MANX_FILES)
332 $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION)
333 $(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION)
334
335config/%.$(SECTION): $(srcdir)/config/%.$(SECTION).in
336 cd $(top_builddir) \
337 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
338
729e4ab9
A
339icu4j-data-install icu4j-data: all tests
340 @echo ICU4J_ROOT=$(ICU4J_ROOT)
341 @$(MAKE) -C test/testdata $@
342 @$(MAKE) -C data $@
343
344# For updating Windows makefiles
345
346WINDOWS_UPDATEFILES=$(srcdir)/data/makedata.mak $(shell find $(srcdir) -name '*.vcproj' -o -name '*.vcxproj')
347
348WINDOWS_UPDATEFILES_SED=config/windows-update.sed
349
350update-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}" && \
357 rm "$${file}.bak"; \
358 done;
359 $(RMV) $(WINDOWS_UPDATEFILES_SED)
360 @echo Please check over the changes carefully before checking them in.
361
362# For building a source distribution.
363distcheck dist-local:
51004dcb 364 $(MAKE) -C . -f $(top_srcdir)/config/dist.mk srcdir="$(srcdir)" top_srcdir="$(top_srcdir)" $@
4388f060
A
365
366ifeq ($(DESTDIR),)
367releaseDist:
368 @echo "Please provide DESTDIR when calling the target releaseDist."
369else
370releaseDist: install
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
379endif
380
381check-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!