Makefile 15 KB

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