Makefile.in.in 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. # Makefile for program source directory in GNU NLS utilities package.
  2. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <[email protected]>
  3. #
  4. # This file file be copied and used freely without restrictions. It can
  5. # be used in projects which are not available under the GNU Public License
  6. # but which still want to provide support for the GNU gettext functionality.
  7. # Please note that the actual code is *not* freely available.
  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. GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
  15. PACKAGE = @PACKAGE@
  16. VERSION = @VERSION@
  17. SHELL = @SHELL@
  18. @SET_MAKE@
  19. srcdir = @srcdir@
  20. top_srcdir = @top_srcdir@
  21. VPATH = @srcdir@
  22. prefix = @prefix@
  23. exec_prefix = @exec_prefix@
  24. datarootdir = @datarootdir@
  25. datadir = @datadir@
  26. libdir = @libdir@
  27. localedir = $(libdir)/locale
  28. gnulocaledir = $(datadir)/locale
  29. gettextsrcdir = $(datadir)/glib-2.0/gettext/po
  30. subdir = po
  31. INSTALL = @INSTALL@
  32. INSTALL_DATA = @INSTALL_DATA@
  33. MKINSTALLDIRS = mkdir -p
  34. CC = @CC@
  35. GENCAT = @GENCAT@
  36. GMSGFMT = @GMSGFMT@
  37. MSGFMT = @MSGFMT@
  38. MSGFMT_OPTS = @MSGFMT_OPTS@
  39. XGETTEXT = @XGETTEXT@
  40. MSGMERGE = msgmerge
  41. DEFS = @DEFS@
  42. CFLAGS = @CFLAGS@
  43. CPPFLAGS = @CPPFLAGS@
  44. INCLUDES = -I.. -I$(top_srcdir)/intl
  45. COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
  46. SOURCES =
  47. POFILES = @POFILES@
  48. GMOFILES = @GMOFILES@
  49. DISTFILES = LINGUAS ChangeLog Makefile.in.in POTFILES.in $(GETTEXT_PACKAGE).pot \
  50. $(POFILES) $(GMOFILES) $(SOURCES)
  51. POTFILES = \
  52. CATALOGS = @CATALOGS@
  53. CATOBJEXT = @CATOBJEXT@
  54. INSTOBJEXT = .mo
  55. .SUFFIXES:
  56. .SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
  57. .c.o:
  58. $(COMPILE) $<
  59. .po.pox:
  60. $(MAKE) $(GETTEXT_PACKAGE).pot
  61. $(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*.pox
  62. .po.mo:
  63. $(MSGFMT) -o $@ $<
  64. .po.gmo:
  65. $(AM_V_GEN) file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
  66. && rm -f $$file && $(GMSGFMT) $(MSGFMT_OPTS) -o $$file $<
  67. .po.cat:
  68. sed -f ../intl/po2msg.sed < $< > $*.msg \
  69. && rm -f $@ && $(GENCAT) $@ $*.msg
  70. all: all-@USE_NLS@
  71. all-yes: $(CATALOGS)
  72. all-no:
  73. $(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES)
  74. $(XGETTEXT) --default-domain=$(GETTEXT_PACKAGE) \
  75. --msgid-bugs-address='http://bugzilla.gnome.org/enter_bug.cgi?product=glib&keywords=I18N+L10N&component=general' \
  76. --add-comments --keyword=_ --keyword=N_ \
  77. --keyword=C_:1c,2 \
  78. --keyword=NC_:1c,2 \
  79. --keyword=g_dcgettext:2 \
  80. --keyword=g_dngettext:2,3 \
  81. --keyword=g_dpgettext2:2c,3 \
  82. --flag=N_:1:pass-c-format \
  83. --flag=C_:2:pass-c-format \
  84. --flag=NC_:2:pass-c-format \
  85. --flag=g_dngettext:2:pass-c-format \
  86. --flag=g_strdup_printf:1:c-format \
  87. --flag=g_string_printf:2:c-format \
  88. --flag=g_string_append_printf:2:c-format \
  89. --flag=g_error_new:3:c-format \
  90. --flag=g_set_error:4:c-format \
  91. --flag=g_markup_printf_escaped:1:c-format \
  92. --flag=g_log:3:c-format \
  93. --flag=g_print:1:c-format \
  94. --flag=g_printerr:1:c-format \
  95. --flag=g_printf:1:c-format \
  96. --flag=g_fprintf:2:c-format \
  97. --flag=g_sprintf:2:c-format \
  98. --flag=g_snprintf:3:c-format \
  99. --flag=g_scanner_error:2:c-format \
  100. --flag=g_scanner_warn:2:c-format \
  101. $(POTFILES) \
  102. && test ! -f $(GETTEXT_PACKAGE).po \
  103. || ( rm -f $(srcdir)/$(GETTEXT_PACKAGE).pot \
  104. && mv $(GETTEXT_PACKAGE).po $(srcdir)/$(GETTEXT_PACKAGE).pot )
  105. install: install-exec install-data
  106. install-exec:
  107. install-data: install-data-@USE_NLS@
  108. install-data-no: all
  109. install-data-yes: all
  110. $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
  111. catalogs='$(CATALOGS)'; \
  112. for cat in $$catalogs; do \
  113. cat=`basename $$cat`; \
  114. case "$$cat" in \
  115. *.gmo) destdir=$(gnulocaledir);; \
  116. *) destdir=$(localedir);; \
  117. esac; \
  118. lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
  119. dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
  120. $(MKINSTALLDIRS) $$dir; \
  121. if test -r $$cat; then \
  122. $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
  123. echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
  124. else \
  125. $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
  126. echo "installing $(srcdir)/$$cat as" \
  127. "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
  128. fi; \
  129. if test -r $$cat.m; then \
  130. $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
  131. echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
  132. else \
  133. if test -r $(srcdir)/$$cat.m ; then \
  134. $(INSTALL_DATA) $(srcdir)/$$cat.m \
  135. $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
  136. echo "installing $(srcdir)/$$cat as" \
  137. "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
  138. else \
  139. true; \
  140. fi; \
  141. fi; \
  142. done
  143. if test "$(PACKAGE)" = "glib"; then \
  144. $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
  145. $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
  146. $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
  147. else \
  148. : ; \
  149. fi
  150. # Define this as empty until I found a useful application.
  151. installcheck:
  152. uninstall:
  153. catalogs='$(CATALOGS)'; \
  154. for cat in $$catalogs; do \
  155. cat=`basename $$cat`; \
  156. lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
  157. rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
  158. rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
  159. rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
  160. rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
  161. done
  162. if test "$(PACKAGE)" = "glib"; then \
  163. rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
  164. fi
  165. check: all
  166. dvi info tags TAGS ID:
  167. mostlyclean:
  168. rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp
  169. rm -fr *.o
  170. clean: mostlyclean
  171. distclean: clean
  172. rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
  173. maintainer-clean: distclean
  174. @echo "This command is intended for maintainers to use;"
  175. @echo "it deletes files that may require special tools to rebuild."
  176. rm -f $(GMOFILES)
  177. distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir)
  178. dist distdir: $(DISTFILES)
  179. dists="$(DISTFILES)"; \
  180. for file in $$dists; do \
  181. ln $(srcdir)/$$file $(distdir) 2> /dev/null \
  182. || cp -p $(srcdir)/$$file $(distdir); \
  183. done
  184. update-po: Makefile
  185. $(MAKE) $(GETTEXT_PACKAGE).pot
  186. tmpdir=`pwd`; \
  187. cd $(srcdir); \
  188. catalogs='$(CATALOGS)'; \
  189. for cat in $$catalogs; do \
  190. cat=`basename $$cat`; \
  191. lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
  192. echo "$$lang:"; \
  193. if $(MSGMERGE) $$lang.po $(GETTEXT_PACKAGE).pot -o $$tmpdir/$$lang.new.po; then \
  194. if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
  195. rm -f $$tmpdir/$$lang.new.po; \
  196. else \
  197. if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
  198. :; \
  199. else \
  200. echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
  201. rm -f $$tmpdir/$$lang.new.po; \
  202. exit 1; \
  203. fi; \
  204. fi; \
  205. else \
  206. echo "msgmerge for $$cat failed!"; \
  207. rm -f $$tmpdir/$$lang.new.po; \
  208. fi; \
  209. done
  210. # POTFILES is created from POTFILES.in by stripping comments, empty lines
  211. # and Intltool tags (enclosed in square brackets), and appending a full
  212. # relative path to them
  213. POTFILES: POTFILES.in
  214. ( if test 'x$(srcdir)' != 'x.'; then \
  215. posrcprefix='$(top_srcdir)/'; \
  216. else \
  217. posrcprefix="../"; \
  218. fi; \
  219. rm -f $@-t $@ \
  220. && (sed -e '/^#/d' \
  221. -e "s/^\[.*\] +//" \
  222. -e '/^[ ]*$$/d' \
  223. -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/[email protected] \
  224. | sed -e '$$s/\\$$//') > $@-t \
  225. && chmod a-w $@-t \
  226. && mv $@-t $@ )
  227. Makefile: Makefile.in.in ../config.status POTFILES
  228. cd .. \
  229. && $(SHELL) ./config.status $(subdir)/[email protected]
  230. # Tell versions [3.59,3.63) of GNU make not to export all variables.
  231. # Otherwise a system limit (for SysV at least) may be exceeded.
  232. .NOEXPORT: