Makefile.in.in 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. # Makefile for program source directory in GNU NLS utilities package.
  2. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
  3. # Copyright (C) 2004-2008 Rodney Dawes <dobey.pwns@gmail.com>
  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 <otaylor@redhat.com> to use GETTEXT_PACKAGE
  10. # instead of PACKAGE and to look for po2tbl in ./ not in intl/
  11. #
  12. # - Modified by jacob berkman <jacob@ximian.com> to install
  13. # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
  14. #
  15. # - Modified by Rodney Dawes <dobey.pwns@gmail.com> 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) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
  47. GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) 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. .po.pox:
  61. $(MAKE) $(GETTEXT_PACKAGE).pot
  62. $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
  63. .po.mo:
  64. $(MSGFMT) -o $@ $<
  65. .po.gmo:
  66. file=`echo $* | sed 's,.*/,,'`.gmo \
  67. && rm -f $$file && $(GMSGFMT) -o $$file $<
  68. .po.cat:
  69. sed -f ../intl/po2msg.sed < $< > $*.msg \
  70. && rm -f $@ && gencat $@ $*.msg
  71. all: all-@USE_NLS@
  72. all-yes: $(CATALOGS)
  73. all-no:
  74. $(GETTEXT_PACKAGE).pot: $(POTFILES)
  75. $(GENPOT)
  76. install: install-data
  77. install-data: install-data-@USE_NLS@
  78. install-data-no: all
  79. install-data-yes: all
  80. linguas="$(USE_LINGUAS)"; \
  81. for lang in $$linguas; do \
  82. dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
  83. $(mkdir_p) $$dir; \
  84. if test -r $$lang.gmo; then \
  85. $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
  86. echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
  87. else \
  88. $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
  89. echo "installing $(srcdir)/$$lang.gmo as" \
  90. "$$dir/$(GETTEXT_PACKAGE).mo"; \
  91. fi; \
  92. if test -r $$lang.gmo.m; then \
  93. $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
  94. echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
  95. else \
  96. if test -r $(srcdir)/$$lang.gmo.m ; then \
  97. $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
  98. $$dir/$(GETTEXT_PACKAGE).mo.m; \
  99. echo "installing $(srcdir)/$$lang.gmo.m as" \
  100. "$$dir/$(GETTEXT_PACKAGE).mo.m"; \
  101. else \
  102. true; \
  103. fi; \
  104. fi; \
  105. done
  106. # Empty stubs to satisfy archaic automake needs
  107. dvi info ctags tags CTAGS TAGS ID:
  108. # Define this as empty until I found a useful application.
  109. install-exec installcheck:
  110. uninstall:
  111. linguas="$(USE_LINGUAS)"; \
  112. for lang in $$linguas; do \
  113. rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
  114. rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
  115. done
  116. check: all $(GETTEXT_PACKAGE).pot
  117. rm -f missing notexist
  118. srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m
  119. if [ -r missing -o -r notexist ]; then \
  120. exit 1; \
  121. fi
  122. mostlyclean:
  123. rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
  124. rm -f .intltool-merge-cache
  125. clean: mostlyclean
  126. distclean: clean
  127. rm -f Makefile Makefile.in POTFILES stamp-it
  128. rm -f *.mo *.msg *.cat *.cat.m *.gmo
  129. maintainer-clean: distclean
  130. @echo "This command is intended for maintainers to use;"
  131. @echo "it deletes files that may require special tools to rebuild."
  132. rm -f Makefile.in.in
  133. distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
  134. dist distdir: $(DISTFILES)
  135. dists="$(DISTFILES)"; \
  136. extra_dists="$(EXTRA_DISTFILES)"; \
  137. for file in $$extra_dists; do \
  138. test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \
  139. done; \
  140. for file in $$dists; do \
  141. test -f $$file || file="$(srcdir)/$$file"; \
  142. ln $$file $(distdir) 2> /dev/null \
  143. || cp -p $$file $(distdir); \
  144. done
  145. update-po: Makefile
  146. $(MAKE) $(GETTEXT_PACKAGE).pot
  147. tmpdir=`pwd`; \
  148. linguas="$(USE_LINGUAS)"; \
  149. for lang in $$linguas; do \
  150. echo "$$lang:"; \
  151. result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
  152. if $$result; then \
  153. if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
  154. rm -f $$tmpdir/$$lang.new.po; \
  155. else \
  156. if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
  157. :; \
  158. else \
  159. echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
  160. rm -f $$tmpdir/$$lang.new.po; \
  161. exit 1; \
  162. fi; \
  163. fi; \
  164. else \
  165. echo "msgmerge for $$lang.gmo failed!"; \
  166. rm -f $$tmpdir/$$lang.new.po; \
  167. fi; \
  168. done
  169. Makefile POTFILES: stamp-it
  170. @if test ! -f $@; then \
  171. rm -f stamp-it; \
  172. $(MAKE) stamp-it; \
  173. fi
  174. stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in
  175. cd $(top_builddir) \
  176. && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \
  177. $(SHELL) ./config.status
  178. # Tell versions [3.59,3.63) of GNU make not to export all variables.
  179. # Otherwise a system limit (for SysV at least) may be exceeded.
  180. .NOEXPORT: