1
0

Makefile.in.in 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. # Makefile for program source directory in GNU NLS utilities package.
  2. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <[email protected]>
  3. # Copyright (C) 2004-2008 Rodney Dawes <[email protected]>
  4. #
  5. # This file may be copied and used freely without restrictions. It may
  6. # be used in projects which are not available under a GNU Public License,
  7. # but which still want to provide support for the GNU gettext functionality.
  8. #
  9. # - Modified by Owen Taylor <[email protected]> to use GETTEXT_PACKAGE
  10. # instead of PACKAGE and to look for po2tbl in ./ not in intl/
  11. #
  12. # - Modified by jacob berkman <[email protected]> to install
  13. # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
  14. #
  15. # - Modified by Rodney Dawes <[email protected]> for use with intltool
  16. #
  17. # We have the following line for use by intltoolize:
  18. # INTLTOOL_MAKEFILE
  19. GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
  20. PACKAGE = @PACKAGE@
  21. VERSION = @VERSION@
  22. SHELL = @SHELL@
  23. srcdir = @srcdir@
  24. top_srcdir = @top_srcdir@
  25. top_builddir = @top_builddir@
  26. VPATH = @srcdir@
  27. prefix = @prefix@
  28. exec_prefix = @exec_prefix@
  29. datadir = @datadir@
  30. datarootdir = @datarootdir@
  31. libdir = @libdir@
  32. DATADIRNAME = @DATADIRNAME@
  33. itlocaledir = $(prefix)/$(DATADIRNAME)/locale
  34. subdir = po
  35. install_sh = @install_sh@
  36. # Automake >= 1.8 provides @mkdir_p@.
  37. # Until it can be supposed, use the safe fallback:
  38. mkdir_p = $(install_sh) -d
  39. INSTALL = @INSTALL@
  40. INSTALL_DATA = @INSTALL_DATA@
  41. GMSGFMT = @GMSGFMT@
  42. MSGFMT = @MSGFMT@
  43. XGETTEXT = @XGETTEXT@
  44. INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
  45. INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
  46. MSGMERGE = INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
  47. GENPOT = INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
  48. ALL_LINGUAS = @ALL_LINGUAS@
  49. PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi)
  50. USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep \^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep \^$$lang$$`"; then printf "$$lang "; fi; done; fi)
  51. USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
  52. POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
  53. DISTFILES = Makefile.in.in POTFILES.in $(POFILES)
  54. EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS
  55. POTFILES = \
  56. # This comment gets stripped out
  57. CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
  58. .SUFFIXES:
  59. .SUFFIXES: .po .pox .gmo .mo .msg .cat
  60. AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
  61. INTLTOOL_V_MSGFMT = $(INTLTOOL__v_MSGFMT_$(V))
  62. INTLTOOL__v_MSGFMT_= $(INTLTOOL__v_MSGFMT_$(AM_DEFAULT_VERBOSITY))
  63. INTLTOOL__v_MSGFMT_0 = @echo " MSGFMT" $@;
  64. .po.pox:
  65. $(MAKE) $(GETTEXT_PACKAGE).pot
  66. $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
  67. .po.mo:
  68. $(INTLTOOL_V_MSGFMT)$(MSGFMT) -o $@ $<
  69. .po.gmo:
  70. $(INTLTOOL_V_MSGFMT)file=`echo $* | sed 's,.*/,,'`.gmo \
  71. && rm -f $$file && $(GMSGFMT) -o $$file $<
  72. .po.cat:
  73. sed -f ../intl/po2msg.sed < $< > $*.msg \
  74. && rm -f $@ && gencat $@ $*.msg
  75. all: all-@USE_NLS@
  76. all-yes: $(CATALOGS)
  77. all-no:
  78. $(GETTEXT_PACKAGE).pot: $(POTFILES)
  79. $(GENPOT)
  80. install: install-data
  81. install-data: install-data-@USE_NLS@
  82. install-data-no: all
  83. install-data-yes: all
  84. linguas="$(USE_LINGUAS)"; \
  85. for lang in $$linguas; do \
  86. dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
  87. $(mkdir_p) $$dir; \
  88. if test -r $$lang.gmo; then \
  89. $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
  90. echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
  91. else \
  92. $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
  93. echo "installing $(srcdir)/$$lang.gmo as" \
  94. "$$dir/$(GETTEXT_PACKAGE).mo"; \
  95. fi; \
  96. if test -r $$lang.gmo.m; then \
  97. $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
  98. echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
  99. else \
  100. if test -r $(srcdir)/$$lang.gmo.m ; then \
  101. $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
  102. $$dir/$(GETTEXT_PACKAGE).mo.m; \
  103. echo "installing $(srcdir)/$$lang.gmo.m as" \
  104. "$$dir/$(GETTEXT_PACKAGE).mo.m"; \
  105. else \
  106. true; \
  107. fi; \
  108. fi; \
  109. done
  110. # Empty stubs to satisfy archaic automake needs
  111. dvi info ctags tags CTAGS TAGS ID:
  112. # Define this as empty until I found a useful application.
  113. install-exec installcheck:
  114. uninstall:
  115. linguas="$(USE_LINGUAS)"; \
  116. for lang in $$linguas; do \
  117. rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
  118. rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
  119. done
  120. check: all $(GETTEXT_PACKAGE).pot
  121. rm -f missing notexist
  122. srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m
  123. if [ -r missing -o -r notexist ]; then \
  124. exit 1; \
  125. fi
  126. mostlyclean:
  127. rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
  128. rm -f .intltool-merge-cache
  129. clean: mostlyclean
  130. distclean: clean
  131. rm -f Makefile Makefile.in POTFILES stamp-it
  132. rm -f *.mo *.msg *.cat *.cat.m *.gmo
  133. maintainer-clean: distclean
  134. @echo "This command is intended for maintainers to use;"
  135. @echo "it deletes files that may require special tools to rebuild."
  136. rm -f Makefile.in.in
  137. distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
  138. dist distdir: $(DISTFILES)
  139. dists="$(DISTFILES)"; \
  140. extra_dists="$(EXTRA_DISTFILES)"; \
  141. for file in $$extra_dists; do \
  142. test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \
  143. done; \
  144. for file in $$dists; do \
  145. test -f $$file || file="$(srcdir)/$$file"; \
  146. ln $$file $(distdir) 2> /dev/null \
  147. || cp -p $$file $(distdir); \
  148. done
  149. update-po: Makefile
  150. $(MAKE) $(GETTEXT_PACKAGE).pot
  151. tmpdir=`pwd`; \
  152. linguas="$(USE_LINGUAS)"; \
  153. for lang in $$linguas; do \
  154. echo "$$lang:"; \
  155. result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
  156. if $$result; then \
  157. if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
  158. rm -f $$tmpdir/$$lang.new.po; \
  159. else \
  160. if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
  161. :; \
  162. else \
  163. echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
  164. rm -f $$tmpdir/$$lang.new.po; \
  165. exit 1; \
  166. fi; \
  167. fi; \
  168. else \
  169. echo "msgmerge for $$lang.gmo failed!"; \
  170. rm -f $$tmpdir/$$lang.new.po; \
  171. fi; \
  172. done
  173. Makefile POTFILES: stamp-it
  174. @if test ! -f $@; then \
  175. rm -f stamp-it; \
  176. $(MAKE) stamp-it; \
  177. fi
  178. stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in
  179. cd $(top_builddir) \
  180. && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \
  181. $(SHELL) ./config.status
  182. # Tell versions [3.59,3.63) of GNU make not to export all variables.
  183. # Otherwise a system limit (for SysV at least) may be exceeded.
  184. .NOEXPORT: