Makefile.in 12 KB

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