You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile.in.in 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. # Makefile for PO directory in any package using GNU gettext.
  2. # Copyright (C) 1995-1997, 2000-2004 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
  3. #
  4. # This file can be copied and used freely without restrictions. It can
  5. # be used in projects which are not available under the GNU General Public
  6. # License but which still want to provide support for the GNU gettext
  7. # functionality.
  8. # Please note that the actual code of GNU gettext is covered by the GNU
  9. # General Public License and is *not* in the public domain.
  10. #
  11. # Origin: gettext-0.14
  12. PACKAGE = @PACKAGE@
  13. VERSION = @VERSION@
  14. SHELL = /bin/sh
  15. @SET_MAKE@
  16. srcdir = @srcdir@
  17. top_srcdir = @top_srcdir@
  18. VPATH = @srcdir@
  19. prefix = @prefix@
  20. exec_prefix = @exec_prefix@
  21. datadir = @datadir@
  22. localedir = $(datadir)/locale
  23. gettextsrcdir = $(datadir)/gettext/po
  24. INSTALL = @INSTALL@
  25. INSTALL_DATA = @INSTALL_DATA@
  26. MKINSTALLDIRS = @MKINSTALLDIRS@
  27. mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
  28. GMSGFMT = @GMSGFMT@
  29. MSGFMT = @MSGFMT@
  30. XGETTEXT = @XGETTEXT@
  31. MSGMERGE = msgmerge
  32. MSGMERGE_UPDATE = @MSGMERGE@ --update
  33. MSGINIT = msginit
  34. MSGCONV = msgconv
  35. MSGFILTER = msgfilter
  36. POFILES = @POFILES@
  37. GMOFILES = @GMOFILES@
  38. UPDATEPOFILES = @UPDATEPOFILES@
  39. DUMMYPOFILES = @DUMMYPOFILES@
  40. DISTFILES.common = Makefile.in.in remove-potcdate.sin \
  41. $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
  42. DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \
  43. $(POFILES) $(GMOFILES) \
  44. $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
  45. POTFILES = \
  46. CATALOGS = @CATALOGS@
  47. # Makevars gets inserted here. (Don't remove this line!)
  48. .SUFFIXES:
  49. .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
  50. .po.mo:
  51. @echo "$(MSGFMT) -c -o $@ $<"; \
  52. $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
  53. .po.gmo:
  54. @lang=`echo $* | sed -e 's,.*/,,'`; \
  55. test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
  56. echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
  57. cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
  58. .sin.sed:
  59. sed -e '/^#/d' $< > t-$@
  60. mv t-$@ $@
  61. all: all-@USE_NLS@
  62. all-yes: stamp-po
  63. all-no:
  64. # stamp-po is a timestamp denoting the last time at which the CATALOGS have
  65. # been loosely updated. Its purpose is that when a developer or translator
  66. # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
  67. # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
  68. # invocations of "make" will do nothing. This timestamp would not be necessary
  69. # if updating the $(CATALOGS) would always touch them; however, the rule for
  70. # $(POFILES) has been designed to not touch files that don't need to be
  71. # changed.
  72. stamp-po: $(srcdir)/$(DOMAIN).pot
  73. test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
  74. @echo "touch stamp-po"
  75. @echo timestamp > stamp-poT
  76. @mv stamp-poT stamp-po
  77. # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
  78. # otherwise packages like GCC can not be built if only parts of the source
  79. # have been downloaded.
  80. # This target rebuilds $(DOMAIN).pot; it is an expensive operation.
  81. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
  82. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
  83. $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
  84. --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
  85. --files-from=$(srcdir)/POTFILES.in \
  86. --copyright-holder='$(COPYRIGHT_HOLDER)' \
  87. --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)'
  88. test ! -f $(DOMAIN).po || { \
  89. if test -f $(srcdir)/$(DOMAIN).pot; then \
  90. sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
  91. sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
  92. if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
  93. rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
  94. else \
  95. rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
  96. mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
  97. fi; \
  98. else \
  99. mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
  100. fi; \
  101. }
  102. # This rule has no dependencies: we don't need to update $(DOMAIN).pot at
  103. # every "make" invocation, only create it when it is missing.
  104. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
  105. $(srcdir)/$(DOMAIN).pot:
  106. $(MAKE) $(DOMAIN).pot-update
  107. # This target rebuilds a PO file if $(DOMAIN).pot has changed.
  108. # Note that a PO file is not touched if it doesn't need to be changed.
  109. $(POFILES): $(srcdir)/$(DOMAIN).pot
  110. @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
  111. if test -f "$(srcdir)/$${lang}.po"; then \
  112. test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
  113. echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
  114. cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
  115. else \
  116. $(MAKE) $${lang}.po-create; \
  117. fi
  118. install: install-exec install-data
  119. install-exec:
  120. install-data: install-data-@USE_NLS@
  121. if test "$(PACKAGE)" = "gettext-tools"; then \
  122. $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
  123. for file in $(DISTFILES.common) Makevars.template; do \
  124. $(INSTALL_DATA) $(srcdir)/$$file \
  125. $(DESTDIR)$(gettextsrcdir)/$$file; \
  126. done; \
  127. for file in Makevars; do \
  128. rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
  129. done; \
  130. else \
  131. : ; \
  132. fi
  133. install-data-no: all
  134. install-data-yes: all
  135. $(mkinstalldirs) $(DESTDIR)$(datadir)
  136. @catalogs='$(CATALOGS)'; \
  137. for cat in $$catalogs; do \
  138. cat=`basename $$cat`; \
  139. lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
  140. dir=$(localedir)/$$lang/LC_MESSAGES; \
  141. $(mkinstalldirs) $(DESTDIR)$$dir; \
  142. if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
  143. $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
  144. echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
  145. for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
  146. if test -n "$$lc"; then \
  147. if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
  148. link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
  149. mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
  150. mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
  151. (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
  152. for file in *; do \
  153. if test -f $$file; then \
  154. ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
  155. fi; \
  156. done); \
  157. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
  158. else \
  159. if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
  160. :; \
  161. else \
  162. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
  163. mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
  164. fi; \
  165. fi; \
  166. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
  167. ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
  168. ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
  169. cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
  170. echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
  171. fi; \
  172. done; \
  173. done
  174. install-strip: install
  175. installdirs: installdirs-exec installdirs-data
  176. installdirs-exec:
  177. installdirs-data: installdirs-data-@USE_NLS@
  178. if test "$(PACKAGE)" = "gettext-tools"; then \
  179. $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
  180. else \
  181. : ; \
  182. fi
  183. installdirs-data-no:
  184. installdirs-data-yes:
  185. $(mkinstalldirs) $(DESTDIR)$(datadir)
  186. @catalogs='$(CATALOGS)'; \
  187. for cat in $$catalogs; do \
  188. cat=`basename $$cat`; \
  189. lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
  190. dir=$(localedir)/$$lang/LC_MESSAGES; \
  191. $(mkinstalldirs) $(DESTDIR)$$dir; \
  192. for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
  193. if test -n "$$lc"; then \
  194. if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
  195. link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
  196. mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
  197. mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
  198. (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
  199. for file in *; do \
  200. if test -f $$file; then \
  201. ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
  202. fi; \
  203. done); \
  204. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
  205. else \
  206. if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
  207. :; \
  208. else \
  209. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
  210. mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
  211. fi; \
  212. fi; \
  213. fi; \
  214. done; \
  215. done
  216. # Define this as empty until I found a useful application.
  217. installcheck:
  218. uninstall: uninstall-exec uninstall-data
  219. uninstall-exec:
  220. uninstall-data: uninstall-data-@USE_NLS@
  221. if test "$(PACKAGE)" = "gettext-tools"; then \
  222. for file in $(DISTFILES.common) Makevars.template; do \
  223. rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
  224. done; \
  225. else \
  226. : ; \
  227. fi
  228. uninstall-data-no:
  229. uninstall-data-yes:
  230. catalogs='$(CATALOGS)'; \
  231. for cat in $$catalogs; do \
  232. cat=`basename $$cat`; \
  233. lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
  234. for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
  235. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
  236. done; \
  237. done
  238. check: all
  239. info dvi ps pdf html tags TAGS ctags CTAGS ID:
  240. mostlyclean:
  241. rm -f remove-potcdate.sed
  242. rm -f stamp-poT
  243. rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
  244. rm -fr *.o
  245. clean: mostlyclean
  246. distclean: clean
  247. rm -f Makefile Makefile.in POTFILES *.mo
  248. maintainer-clean: distclean
  249. @echo "This command is intended for maintainers to use;"
  250. @echo "it deletes files that may require special tools to rebuild."
  251. rm -f stamp-po $(GMOFILES)
  252. distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
  253. dist distdir:
  254. $(MAKE) update-po
  255. @$(MAKE) dist2
  256. # This is a separate target because 'update-po' must be executed before.
  257. dist2: $(DISTFILES)
  258. dists="$(DISTFILES)"; \
  259. if test "$(PACKAGE)" = "gettext-tools"; then \
  260. dists="$$dists Makevars.template"; \
  261. fi; \
  262. if test -f $(srcdir)/ChangeLog; then \
  263. dists="$$dists ChangeLog"; \
  264. fi; \
  265. for i in 0 1 2 3 4 5 6 7 8 9; do \
  266. if test -f $(srcdir)/ChangeLog.$$i; then \
  267. dists="$$dists ChangeLog.$$i"; \
  268. fi; \
  269. done; \
  270. if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
  271. for file in $$dists; do \
  272. if test -f $$file; then \
  273. cp -p $$file $(distdir); \
  274. else \
  275. cp -p $(srcdir)/$$file $(distdir); \
  276. fi; \
  277. done
  278. update-po: Makefile
  279. $(MAKE) $(DOMAIN).pot-update
  280. test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
  281. $(MAKE) update-gmo
  282. # General rule for creating PO files.
  283. .nop.po-create:
  284. @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
  285. echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
  286. exit 1
  287. # General rule for updating PO files.
  288. .nop.po-update:
  289. @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
  290. if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
  291. tmpdir=`pwd`; \
  292. echo "$$lang:"; \
  293. test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
  294. echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
  295. cd $(srcdir); \
  296. if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
  297. if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
  298. rm -f $$tmpdir/$$lang.new.po; \
  299. else \
  300. if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
  301. :; \
  302. else \
  303. echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
  304. exit 1; \
  305. fi; \
  306. fi; \
  307. else \
  308. echo "msgmerge for $$lang.po failed!" 1>&2; \
  309. rm -f $$tmpdir/$$lang.new.po; \
  310. fi
  311. $(DUMMYPOFILES):
  312. update-gmo: Makefile $(GMOFILES)
  313. @:
  314. Makefile: Makefile.in.in $(top_builddir)/config.status @POMAKEFILEDEPS@
  315. cd $(top_builddir) \
  316. && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
  317. $(SHELL) ./config.status
  318. force:
  319. # Tell versions [3.59,3.63) of GNU make not to export all variables.
  320. # Otherwise a system limit (for SysV at least) may be exceeded.
  321. .NOEXPORT: