Home | History | Annotate | Download | only in icu4c
      1 #******************************************************************************
      2 #
      3 #   Copyright (C) 1998-2010, International Business Machines
      4 #   Corporation and others.  All Rights Reserved.
      5 #
      6 #******************************************************************************
      7 ## Top-level Makefile.in for ICU
      8 ## Stephen F. Booth
      9 
     10 srcdir = @srcdir@
     11 top_srcdir = @top_srcdir@
     12 
     13 top_builddir = .
     14 
     15 include $(top_builddir)/icudefs.mk
     16 
     17 docdir = $(datadir)/doc
     18 docsubdir = $(PACKAGE)$(ICULIBDASHSUFFIX)/html
     19 docsubsrchdir = $(docsubdir)/search
     20 docfilesdir = doc/html
     21 docfiles = $(docfilesdir)/*.gif $(docfilesdir)/*.png $(docfilesdir)/*.html $(docfilesdir)/*.css $(docfilesdir)/*.tag $(docfilesdir)/installdox
     22 docsrchdir = $(docfilesdir)/search
     23 docsrchfiles = $(docsrchdir)/*
     24 
     25 ##
     26 
     27 ## Build directory information
     28 subdir = .
     29 
     30 #AUTOCONF = @AUTOCONF@
     31 
     32 ## Optional directory setup
     33 @LAYOUT_TRUE@LAYOUT = layout layoutex
     34 @ICUIO_TRUE@ICUIO = io
     35 @EXTRAS_TRUE@EXTRA = extra
     36 @TESTS_TRUE@TEST = test
     37 @SAMPLES_TRUE@SAMPLE = samples
     38 
     39 DOXYGEN = @DOXYGEN@
     40 DOCZIP = icu-docs.zip
     41 
     42 ## Files to remove for 'make clean'
     43 CLEANFILES = *~
     44 
     45 ## Files built (autoconfed) and installed
     46 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)/%)
     47 
     48 ## Files built (autoconfed) but not installed
     49 LOCAL_BUILT_FILES = icudefs.mk config/icucross.mk
     50 
     51 DOCDIRS = common i18n
     52 SUBDIRS =  stubdata common i18n $(LAYOUT) tools data $(ICUIO) $(EXTRA) $(SAMPLE) $(TEST)
     53 
     54 SECTION = 1
     55 
     56 MANX_FILES = config/icu-config.$(SECTION)
     57 
     58 ALL_MAN_FILES = $(MANX_FILES)
     59 
     60 ## Extra files to install [nothing at present]
     61 EXTRA_DATA =
     62 
     63 ## List of phony targets
     64 .PHONY : all all-local all-recursive install install-local install-udata install-udata-files install-udata-dlls		\
     65 install-recursive clean clean-local clean-recursive distclean		\
     66 distclean-local distclean-recursive doc dist dist-local dist-recursive	\
     67 check check-local check-recursive clean-recursive-with-twist install-icu \
     68 doc install-doc tests icu4j-data icu4j-data-install update-windows-makefiles
     69 
     70 ## Clear suffix list
     71 .SUFFIXES :
     72 
     73 ## List of standard targets
     74 all: all-local all-recursive
     75 install: install-recursive install-local
     76 clean: clean-recursive-with-twist clean-local
     77 distclean : distclean-recursive distclean-local
     78 dist: dist-recursive dist-local
     79 check: all check-recursive
     80 check-recursive: all
     81 
     82 ifeq ($(DOXYGEN),)
     83 doc:
     84 	@echo you need Doxygen to generate documentation. Doxygen can be found on the Web
     85 	@echo at http://www.doxygen.org/
     86 else
     87 doc: doc/html/index.html
     88 
     89 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)
     90 	$(DOXYGEN)
     91 
     92 Doxyfile: $(srcdir)/Doxyfile.in
     93 	CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
     94 
     95 $(DOCZIP): doc
     96 	-$(RMV) $(DOCZIP)
     97 	( cd doc/html ; zip -r ../../$(DOCZIP) * )
     98 endif
     99 
    100 LOCAL_SUBDIRS = $(SUBDIRS)
    101 CLEAN_FIRST_SUBDIRS = tools
    102 
    103 $(LIBDIR) $(BINDIR):
    104 	-$(MKINSTALLDIRS) $@
    105 
    106 ## Recursive targets
    107 all-recursive install-recursive clean-recursive distclean-recursive dist-recursive check-recursive: $(LIBDIR) $(BINDIR)
    108 	@dot_seen=no; \
    109 	target=`echo $@ | sed s/-recursive//`; \
    110 	list='$(LOCAL_SUBDIRS)'; for subdir in $$list; do \
    111 	  echo "$(MAKE)[$(MAKELEVEL)]: Making \`$$target' in \`$$subdir'"; \
    112 	  if test "$$subdir" = "."; then \
    113 	    dot_seen=yes; \
    114 	    local_target="$$target-local"; \
    115 	  else \
    116 	    local_target="$$target"; \
    117 	  fi; \
    118 	  (cd $$subdir && $(MAKE) RECURSIVE=YES $$local_target) || exit; \
    119 	done; \
    120 	if test "$$dot_seen" = "no"; then \
    121 	  $(MAKE) "$$target-local" || exit; \
    122 	fi
    123 
    124 clean-recursive-with-twist:
    125 	$(MAKE) clean-recursive LOCAL_SUBDIRS='$(CLEAN_FIRST_SUBDIRS) $(filter-out $(CLEAN_FIRST_SUBDIRS),$(LOCAL_SUBDIRS))'
    126 
    127 all-local: $(srcdir)/configure $(LOCAL_BUILT_FILES) $(INSTALLED_BUILT_FILES)
    128 
    129 install-local: install-icu install-manx
    130 
    131 install-icu: $(INSTALLED_BUILT_FILES)
    132 	@$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/config
    133 	@$(MKINSTALLDIRS) $(DESTDIR)$(pkglibdir)
    134 	@$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
    135 	@$(MKINSTALLDIRS) $(DESTDIR)$(sbindir)
    136 	$(INSTALL_DATA) @platform_make_fragment@ $(DESTDIR)$(pkgdatadir)/config/@platform_make_fragment_name@
    137 	$(INSTALL_SCRIPT) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(pkgdatadir)/mkinstalldirs
    138 	$(INSTALL_SCRIPT) $(top_srcdir)/install-sh $(DESTDIR)$(pkgdatadir)/install-sh
    139 	$(INSTALL_DATA) $(top_srcdir)/../license.html $(DESTDIR)$(pkgdatadir)/license.html
    140 	$(INSTALL_SCRIPT) $(top_builddir)/config/icu-config $(DESTDIR)$(bindir)/icu-config
    141 	$(INSTALL_DATA) $(top_builddir)/config/Makefile.inc $(DESTDIR)$(pkglibdir)/Makefile.inc
    142 	$(INSTALL_DATA) $(top_builddir)/config/pkgdata.inc $(DESTDIR)$(pkglibdir)/pkgdata.inc
    143 	cd $(DESTDIR)$(pkglibdir)/..; \
    144 	    $(RM) current && ln -s $(VERSION) current; \
    145 	    $(RM) Makefile.inc && ln -s current/Makefile.inc Makefile.inc; \
    146 	    $(RM) pkgdata.inc && ln -s current/pkgdata.inc pkgdata.inc
    147 
    148 ifeq ($(DOXYGEN),)
    149 install-doc:
    150 else
    151 install-doc: doc
    152 	$(RM) -r $(DESTDIR)$(docdir)/$(docsubdir)
    153 	$(MKINSTALLDIRS) $(DESTDIR)$(docdir)/$(docsubsrchdir)
    154 	$(INSTALL_DATA) $(docfiles) $(DESTDIR)$(docdir)/$(docsubdir)
    155 	$(INSTALL_DATA) $(docsrchfiles) $(DESTDIR)$(docdir)/$(docsubsrchdir)
    156 endif
    157 
    158 $(DESTDIR)$(pkglibdir)/%: $(top_srcdir)/../data/%
    159 	$(INSTALL_DATA) $< $@
    160 
    161 # Build the tests, but don't run them.
    162 tests: all
    163 	$(MAKE) -C $(top_builddir)/test
    164 
    165 dist-local:
    166 
    167 clean-local:
    168 	test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
    169 	$(RMV) Doxyfile doc $(DOCZIP)
    170 
    171 distclean-local: clean-local
    172 	$(RMV) $(top_builddir)/config/Makefile.inc $(top_builddir)/config/pkgdata.inc $(top_builddir)/config/icu-config
    173 	$(RMV) config.cache config.log config.status $(top_builddir)/config/icucross.mk autom4te.cache
    174 	$(RMV) Makefile config/Makefile icudefs.mk $(LIBDIR) $(BINDIR)
    175 
    176 check-local: $(top_builddir)/config/icu-config $(top_builddir)/config/Makefile.inc $(top_builddir)/config/pkgdata.inc
    177 	@echo verifying that icu-config --selfcheck can operate
    178 	@test "passed" = "$(shell $(top_builddir)/config/icu-config --selfcheck 2>&1)" || (echo "FAIL: icu-config could not run properly." ; exit 1)
    179 	@echo verifying that $(MAKE) -f Makefile.inc selfcheck can operate
    180 	@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 )
    181 	@echo "PASS: config selfcheck OK"
    182 
    183 #$(srcdir)/configure : $(srcdir)/configure.in $(top_srcdir)/aclocal.m4
    184 #	cd $(srcdir) && $(AUTOCONF)
    185 
    186 icudefs.mk: $(srcdir)/icudefs.mk.in  $(top_builddir)/config.status
    187 	cd $(top_builddir) \
    188 		&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
    189 
    190 config/icucross.mk: $(top_builddir)/icudefs.mk  $(top_builddir)/Makefile
    191 	@echo rebuilding $@
    192 	@(echo "CROSS_ICU_VERSION=$(VERSION)" ;\
    193 	  echo "TOOLEXEEXT=$(EXEEXT)" \
    194 	   ) > $@
    195 	@(echo 'TOOLBINDIR=$$(cross_buildroot)/bin' ;\
    196 	  echo 'TOOLLIBDIR=$$(cross_buildroot)/lib' ;\
    197 	  echo "INVOKE=$(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)"'$$(TOOLLIBDIR):$$(cross_buildroot)/stubdata:$$(cross_buildroot)/tools/ctestfw:$$$$'"$(LDLIBRARYPATH_ENVVAR)" ;\
    198 	  echo "PKGDATA_INVOKE=$(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)"'$$(cross_buildroot)/stubdata:$$(cross_buildroot)/tools/ctestfw:$$(TOOLLIBDIR):$$$$'"$(LDLIBRARYPATH_ENVVAR) "'$$'"(PKGDATA_INVOKE_OPTS)" ;\
    199 	  echo ) >> $@
    200 
    201 Makefile: $(srcdir)/Makefile.in icudefs.mk $(top_builddir)/config.status
    202 	cd $(top_builddir) \
    203 		&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
    204 
    205 $(top_builddir)/config/Makefile.inc: $(srcdir)/config/Makefile.inc.in  $(top_builddir)/config.status
    206 	cd $(top_builddir) \
    207 		&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
    208 
    209 $(top_builddir)/config/pkgdata.inc: icudefs.mk $(top_builddir)/config/pkgdataMakefile
    210 	cd $(top_builddir)/config; \
    211 		$(MAKE) -f pkgdataMakefile
    212 
    213 $(top_builddir)/config/pkgdataMakefile:
    214 	cd $(top_builddir) \
    215 		&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
    216 
    217 $(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
    218 	-$(RMV) $@
    219 	$(INSTALL_SCRIPT) $(top_srcdir)/config/icu-config-top $@
    220 	chmod u+w $@
    221 	@echo "# Following from @platform_make_fragment@" >> $@
    222 	sed -f $(top_srcdir)/config/make2sh.sed < $(top_builddir)/config/Makefile.inc | grep -v '#M#' | uniq >> $@
    223 	sed -f $(top_srcdir)/config/make2sh.sed < @platform_make_fragment@ | grep -v '#M#' | uniq >> $@
    224 	cat $(top_srcdir)/config/icu-config-bottom >> $@
    225 	echo "# Rebuilt on "`date` >> $@
    226 	chmod u-w $@
    227 
    228 config.status: $(srcdir)/configure $(srcdir)/common/unicode/uvernum.h
    229 	@echo
    230 	@echo
    231 	@echo "*** config.status has become stale ***"
    232 	@echo "   'configure' and/or 'uvernum.h' have changed, please"
    233 	@echo "  do 'runConfigureICU' (or 'configure') again, as per"
    234 	@echo "  the readme.html."
    235 	@echo
    236 	@echo
    237 	exit 1
    238 
    239 
    240 install-manx: $(MANX_FILES)
    241 	$(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION)
    242 	$(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION)
    243 
    244 config/%.$(SECTION): $(srcdir)/config/%.$(SECTION).in
    245 	cd $(top_builddir) \
    246 	 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
    247 
    248 icu4j-data-install icu4j-data: all tests
    249 	@echo ICU4J_ROOT=$(ICU4J_ROOT)
    250 	@$(MAKE) -C test/testdata $@
    251 	@$(MAKE) -C data $@
    252 
    253 WINDOWS_UPDATEFILES=$(srcdir)/data/makedata.mak $(shell find $(srcdir) -name '*.vcproj')
    254 
    255 WINDOWS_UPDATEFILES_SED=config/windows-update.sed
    256 
    257 update-windows-makefiles: config.status
    258 	@echo Updating Windows Makefiles for ICU $(VERSION)
    259 	CONFIG_FILES=$(WINDOWS_UPDATEFILES_SED) CONFIG_HEADERS= $(SHELL) ./config.status
    260 	@for file in $(WINDOWS_UPDATEFILES); do \
    261 	  echo "Updating $$file"; \
    262 	  mv "$${file}" "$${file}.bak" && \
    263 	  sed -f $(WINDOWS_UPDATEFILES_SED) < "$${file}.bak" > "$${file}" && \
    264 	  rm "$${file}.bak"; \
    265 	done;
    266 	$(RMV) $(WINDOWS_UPDATEFILES_SED)
    267 	@echo Please check over the changes carefully before checking them in.
    268