Makefile 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  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.2.1
  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 = ja.po
  33. GMOFILES = ja.gmo
  34. UPDATEPOFILES = ja.po-update
  35. DUMMYPOFILES = ja.nop
  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. ../src/message.h \
  43. ../src/main.cc
  44. CATALOGS = ja.gmo
  45. # Makevars gets inserted here. (Don't remove this line!)
  46. # Makefile variables for PO directory in any package using GNU gettext.
  47. # Usually the message domain is the same as the package name.
  48. DOMAIN = $(PACKAGE)
  49. # These two variables depend on the location of this directory.
  50. subdir = po
  51. top_builddir = ..
  52. # These options get passed to xgettext.
  53. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
  54. # This is the copyright holder that gets inserted into the header of the
  55. # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
  56. # package. (Note that the msgstr strings, extracted from the package's
  57. # sources, belong to the copyright holder of the package.) Translators are
  58. # expected to transfer the copyright for their translations to this person
  59. # or entity, or to disclaim their copyright. The empty string stands for
  60. # the public domain; in this case the translators are expected to disclaim
  61. # their copyright.
  62. COPYRIGHT_HOLDER = Free Software Foundation, Inc.
  63. # This is the email address or URL to which the translators shall report
  64. # bugs in the untranslated strings:
  65. # - Strings which are not entire sentences, see the maintainer guidelines
  66. # in the GNU gettext documentation, section 'Preparing Strings'.
  67. # - Strings which use unclear terms or require additional context to be
  68. # understood.
  69. # - Strings which make invalid assumptions about notation of date, time or
  70. # money.
  71. # - Pluralisation problems.
  72. # - Incorrect English spelling.
  73. # - Incorrect formatting.
  74. # It can be your email address, or a mailing list address where translators
  75. # can write to without being subscribed, or the URL of a web page through
  76. # which the translators can contact you.
  77. MSGID_BUGS_ADDRESS = http://aria2.sourceforge.net/
  78. # This is the list of locale categories, beyond LC_MESSAGES, for which the
  79. # message catalogs shall be used. It is usually empty.
  80. EXTRA_LOCALE_CATEGORIES =
  81. .SUFFIXES:
  82. .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-update
  83. .po.mo:
  84. @echo "$(MSGFMT) -c -o $@ $<"; \
  85. $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
  86. .po.gmo:
  87. @lang=`echo $* | sed -e 's,.*/,,'`; \
  88. test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
  89. echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
  90. cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
  91. .sin.sed:
  92. sed -e '/^#/d' $< > t-$@
  93. mv t-$@ $@
  94. all: all-yes
  95. all-yes: stamp-po
  96. all-no:
  97. # stamp-po is a timestamp denoting the last time at which the CATALOGS have
  98. # been loosely updated. Its purpose is that when a developer or translator
  99. # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
  100. # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
  101. # invocations of "make" will do nothing. This timestamp would not be necessary
  102. # if updating the $(CATALOGS) would always touch them; however, the rule for
  103. # $(POFILES) has been designed to not touch files that don't need to be
  104. # changed.
  105. stamp-po: $(srcdir)/$(DOMAIN).pot
  106. test -z "$(CATALOGS)" || $(MAKE) $(CATALOGS)
  107. @echo "touch stamp-po"
  108. @echo timestamp > stamp-poT
  109. @mv stamp-poT stamp-po
  110. # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
  111. # otherwise packages like GCC can not be built if only parts of the source
  112. # have been downloaded.
  113. # This target rebuilds $(DOMAIN).pot; it is an expensive operation.
  114. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
  115. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
  116. $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
  117. --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
  118. --files-from=$(srcdir)/POTFILES.in \
  119. --copyright-holder='$(COPYRIGHT_HOLDER)' \
  120. --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)'
  121. test ! -f $(DOMAIN).po || { \
  122. if test -f $(srcdir)/$(DOMAIN).pot; then \
  123. sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
  124. sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
  125. if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
  126. rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
  127. else \
  128. rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
  129. mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
  130. fi; \
  131. else \
  132. mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
  133. fi; \
  134. }
  135. # This rule has no dependencies: we don't need to update $(DOMAIN).pot at
  136. # every "make" invocation, only create it when it is missing.
  137. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
  138. $(srcdir)/$(DOMAIN).pot:
  139. $(MAKE) $(DOMAIN).pot-update
  140. # This target rebuilds a PO file if $(DOMAIN).pot has changed.
  141. # Note that a PO file is not touched if it doesn't need to be changed.
  142. $(POFILES): $(srcdir)/$(DOMAIN).pot
  143. @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
  144. test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
  145. echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
  146. cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot
  147. install: install-exec install-data
  148. install-exec:
  149. install-data: install-data-yes
  150. if test "$(PACKAGE)" = "gettext-tools"; then \
  151. $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
  152. for file in $(DISTFILES.common) Makevars.template; do \
  153. $(INSTALL_DATA) $(srcdir)/$$file \
  154. $(DESTDIR)$(gettextsrcdir)/$$file; \
  155. done; \
  156. for file in Makevars; do \
  157. rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
  158. done; \
  159. else \
  160. : ; \
  161. fi
  162. install-data-no: all
  163. install-data-yes: all
  164. $(mkinstalldirs) $(DESTDIR)$(datadir)
  165. @catalogs='$(CATALOGS)'; \
  166. for cat in $$catalogs; do \
  167. cat=`basename $$cat`; \
  168. lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
  169. dir=$(localedir)/$$lang/LC_MESSAGES; \
  170. $(mkinstalldirs) $(DESTDIR)$$dir; \
  171. if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
  172. $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
  173. echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
  174. for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
  175. if test -n "$$lc"; then \
  176. if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
  177. link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
  178. mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
  179. mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
  180. (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
  181. for file in *; do \
  182. if test -f $$file; then \
  183. ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
  184. fi; \
  185. done); \
  186. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
  187. else \
  188. if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
  189. :; \
  190. else \
  191. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
  192. mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
  193. fi; \
  194. fi; \
  195. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
  196. ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
  197. ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
  198. cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
  199. echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
  200. fi; \
  201. done; \
  202. done
  203. install-strip: install
  204. installdirs: installdirs-exec installdirs-data
  205. installdirs-exec:
  206. installdirs-data: installdirs-data-yes
  207. if test "$(PACKAGE)" = "gettext-tools"; then \
  208. $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
  209. else \
  210. : ; \
  211. fi
  212. installdirs-data-no:
  213. installdirs-data-yes:
  214. $(mkinstalldirs) $(DESTDIR)$(datadir)
  215. @catalogs='$(CATALOGS)'; \
  216. for cat in $$catalogs; do \
  217. cat=`basename $$cat`; \
  218. lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
  219. dir=$(localedir)/$$lang/LC_MESSAGES; \
  220. $(mkinstalldirs) $(DESTDIR)$$dir; \
  221. for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
  222. if test -n "$$lc"; then \
  223. if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
  224. link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
  225. mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
  226. mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
  227. (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
  228. for file in *; do \
  229. if test -f $$file; then \
  230. ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
  231. fi; \
  232. done); \
  233. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
  234. else \
  235. if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
  236. :; \
  237. else \
  238. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
  239. mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
  240. fi; \
  241. fi; \
  242. fi; \
  243. done; \
  244. done
  245. # Define this as empty until I found a useful application.
  246. installcheck:
  247. uninstall: uninstall-exec uninstall-data
  248. uninstall-exec:
  249. uninstall-data: uninstall-data-yes
  250. if test "$(PACKAGE)" = "gettext-tools"; then \
  251. for file in $(DISTFILES.common) Makevars.template; do \
  252. rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
  253. done; \
  254. else \
  255. : ; \
  256. fi
  257. uninstall-data-no:
  258. uninstall-data-yes:
  259. catalogs='$(CATALOGS)'; \
  260. for cat in $$catalogs; do \
  261. cat=`basename $$cat`; \
  262. lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
  263. for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
  264. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
  265. done; \
  266. done
  267. check: all
  268. info dvi ps pdf html tags TAGS ctags CTAGS ID:
  269. mostlyclean:
  270. rm -f remove-potcdate.sed
  271. rm -f stamp-poT
  272. rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
  273. rm -fr *.o
  274. clean: mostlyclean
  275. distclean: clean
  276. rm -f Makefile Makefile.in POTFILES *.mo
  277. maintainer-clean: distclean
  278. @echo "This command is intended for maintainers to use;"
  279. @echo "it deletes files that may require special tools to rebuild."
  280. rm -f stamp-po $(GMOFILES)
  281. distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
  282. dist distdir:
  283. $(MAKE) update-po
  284. @$(MAKE) dist2
  285. # This is a separate target because 'update-po' must be executed before.
  286. dist2: $(DISTFILES)
  287. dists="$(DISTFILES)"; \
  288. if test "$(PACKAGE)" = "gettext-tools"; then \
  289. dists="$$dists Makevars.template"; \
  290. fi; \
  291. if test -f $(srcdir)/ChangeLog; then \
  292. dists="$$dists ChangeLog"; \
  293. fi; \
  294. for i in 0 1 2 3 4 5 6 7 8 9; do \
  295. if test -f $(srcdir)/ChangeLog.$$i; then \
  296. dists="$$dists ChangeLog.$$i"; \
  297. fi; \
  298. done; \
  299. if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
  300. for file in $$dists; do \
  301. if test -f $$file; then \
  302. cp -p $$file $(distdir); \
  303. else \
  304. cp -p $(srcdir)/$$file $(distdir); \
  305. fi; \
  306. done
  307. update-po: Makefile
  308. $(MAKE) $(DOMAIN).pot-update
  309. test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
  310. $(MAKE) update-gmo
  311. # General rule for updating PO files.
  312. .nop.po-update:
  313. @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
  314. if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
  315. tmpdir=`pwd`; \
  316. echo "$$lang:"; \
  317. test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
  318. echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
  319. cd $(srcdir); \
  320. if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
  321. if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
  322. rm -f $$tmpdir/$$lang.new.po; \
  323. else \
  324. if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
  325. :; \
  326. else \
  327. echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
  328. exit 1; \
  329. fi; \
  330. fi; \
  331. else \
  332. echo "msgmerge for $$lang.po failed!" 1>&2; \
  333. rm -f $$tmpdir/$$lang.new.po; \
  334. fi
  335. $(DUMMYPOFILES):
  336. update-gmo: Makefile $(GMOFILES)
  337. @:
  338. Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in LINGUAS
  339. cd $(top_builddir) \
  340. && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
  341. $(SHELL) ./config.status
  342. force:
  343. # Tell versions [3.59,3.63) of GNU make not to export all variables.
  344. # Otherwise a system limit (for SysV at least) may be exceeded.
  345. .NOEXPORT:
  346. # Special Makefile rules for English message catalogs with quotation marks.
  347. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot
  348. .SUFFIXES: .insert-header .po-update-en
  349. en@quot.po-update: en@quot.po-update-en
  350. en@boldquot.po-update: en@boldquot.po-update-en
  351. .insert-header.po-update-en:
  352. @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
  353. if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
  354. tmpdir=`pwd`; \
  355. echo "$$lang:"; \
  356. ll=`echo $$lang | sed -e 's/@.*//'`; \
  357. LC_ALL=C; export LC_ALL; \
  358. cd $(srcdir); \
  359. if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \
  360. if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
  361. rm -f $$tmpdir/$$lang.new.po; \
  362. else \
  363. if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
  364. :; \
  365. else \
  366. echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
  367. exit 1; \
  368. fi; \
  369. fi; \
  370. else \
  371. echo "creation of $$lang.po failed!" 1>&2; \
  372. rm -f $$tmpdir/$$lang.new.po; \
  373. fi
  374. en@quot.insert-header: insert-header.sin
  375. sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header
  376. en@boldquot.insert-header: insert-header.sin
  377. sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header
  378. mostlyclean: mostlyclean-quot
  379. mostlyclean-quot:
  380. rm -f *.insert-header