Makefile.in.in 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. # Makefile for PO directory in any package using GNU gettext.
  2. # Copyright (C) 1995-2000 Ulrich Drepper <drepper@gnu.ai.mit.edu>
  3. # Copyright (C) 2000-2020 Free Software Foundation, Inc.
  4. #
  5. # Copying and distribution of this file, with or without modification,
  6. # are permitted in any medium without royalty provided the copyright
  7. # notice and this notice are preserved. This file is offered as-is,
  8. # without any warranty.
  9. #
  10. # Origin: gettext-0.21
  11. GETTEXT_MACRO_VERSION = 0.20
  12. PACKAGE = @PACKAGE@
  13. VERSION = @VERSION@
  14. PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
  15. SED = @SED@
  16. SHELL = /bin/sh
  17. @SET_MAKE@
  18. srcdir = @srcdir@
  19. top_srcdir = @top_srcdir@
  20. VPATH = @srcdir@
  21. prefix = @prefix@
  22. exec_prefix = @exec_prefix@
  23. datarootdir = @datarootdir@
  24. datadir = @datadir@
  25. localedir = @localedir@
  26. gettextsrcdir = $(datadir)/gettext/po
  27. INSTALL = @INSTALL@
  28. INSTALL_DATA = @INSTALL_DATA@
  29. # We use $(mkdir_p).
  30. # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
  31. # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
  32. # @install_sh@ does not start with $(SHELL), so we add it.
  33. # In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined
  34. # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
  35. # versions, $(mkinstalldirs) and $(install_sh) are unused.
  36. mkinstalldirs = $(SHELL) @install_sh@ -d
  37. install_sh = $(SHELL) @install_sh@
  38. MKDIR_P = @MKDIR_P@
  39. mkdir_p = @mkdir_p@
  40. # When building gettext-tools, we prefer to use the built programs
  41. # rather than installed programs. However, we can't do that when we
  42. # are cross compiling.
  43. CROSS_COMPILING = @CROSS_COMPILING@
  44. GMSGFMT_ = @GMSGFMT@
  45. GMSGFMT_no = @GMSGFMT@
  46. GMSGFMT_yes = @GMSGFMT_015@
  47. GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
  48. XGETTEXT_ = @XGETTEXT@
  49. XGETTEXT_no = @XGETTEXT@
  50. XGETTEXT_yes = @XGETTEXT_015@
  51. XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
  52. MSGMERGE = @MSGMERGE@
  53. MSGMERGE_UPDATE = @MSGMERGE@ --update
  54. MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
  55. MSGINIT = msginit
  56. MSGCONV = msgconv
  57. MSGFILTER = msgfilter
  58. POFILES = @POFILES@
  59. GMOFILES = @GMOFILES@
  60. UPDATEPOFILES = @UPDATEPOFILES@
  61. DUMMYPOFILES = @DUMMYPOFILES@
  62. DISTFILES.common = Makefile.in.in remove-potcdate.sin \
  63. $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
  64. DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \
  65. $(POFILES) $(GMOFILES) \
  66. $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
  67. POTFILES = \
  68. CATALOGS = @CATALOGS@
  69. POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot
  70. POFILESDEPS_yes = $(POFILESDEPS_)
  71. POFILESDEPS_no =
  72. POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT))
  73. DISTFILESDEPS_ = update-po
  74. DISTFILESDEPS_yes = $(DISTFILESDEPS_)
  75. DISTFILESDEPS_no =
  76. DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO))
  77. # Makevars gets inserted here. (Don't remove this line!)
  78. all: all-@USE_NLS@
  79. .SUFFIXES:
  80. .SUFFIXES: .po .gmo .sed .sin .nop .po-create .po-update
  81. # The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs.
  82. # The GNU Coding Standards say in
  83. # <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
  84. # "GNU distributions usually contain some files which are not source files
  85. # ... . Since these files normally appear in the source directory, they
  86. # should always appear in the source directory, not in the build directory.
  87. # So Makefile rules to update them should put the updated files in the
  88. # source directory."
  89. # Therefore we put these files in the source directory, not the build directory.
  90. # During .po -> .gmo conversion, take into account the most recent changes to
  91. # the .pot file. This eliminates the need to update the .po files when the
  92. # .pot file has changed, which would be troublesome if the .po files are put
  93. # under version control.
  94. $(GMOFILES): $(srcdir)/$(DOMAIN).pot
  95. .po.gmo:
  96. @lang=`echo $* | sed -e 's,.*/,,'`; \
  97. test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
  98. echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \
  99. cd $(srcdir) && \
  100. rm -f $${lang}.gmo && \
  101. $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \
  102. $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \
  103. mv t-$${lang}.gmo $${lang}.gmo && \
  104. rm -f $${lang}.1po
  105. .sin.sed:
  106. sed -e '/^#/d' $< > t-$@
  107. mv t-$@ $@
  108. all-yes: $(srcdir)/stamp-po
  109. all-no:
  110. # Ensure that the gettext macros and this Makefile.in.in are in sync.
  111. CHECK_MACRO_VERSION = \
  112. test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \
  113. || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \
  114. exit 1; \
  115. }
  116. # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
  117. # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
  118. # we don't want to bother translators with empty POT files). We assume that
  119. # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
  120. # In this case, $(srcdir)/stamp-po is a nop (i.e. a phony target).
  121. # $(srcdir)/stamp-po is a timestamp denoting the last time at which the CATALOGS
  122. # have been loosely updated. Its purpose is that when a developer or translator
  123. # checks out the package from a version control system, and the $(DOMAIN).pot
  124. # file is not under version control, "make" will update the $(DOMAIN).pot and
  125. # the $(CATALOGS), but subsequent invocations of "make" will do nothing. This
  126. # timestamp would not be necessary if updating the $(CATALOGS) would always
  127. # touch them; however, the rule for $(POFILES) has been designed to not touch
  128. # files that don't need to be changed.
  129. $(srcdir)/stamp-po: $(srcdir)/$(DOMAIN).pot
  130. @$(CHECK_MACRO_VERSION)
  131. test ! -f $(srcdir)/$(DOMAIN).pot || \
  132. test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
  133. @test ! -f $(srcdir)/$(DOMAIN).pot || { \
  134. echo "touch $(srcdir)/stamp-po" && \
  135. echo timestamp > $(srcdir)/stamp-poT && \
  136. mv $(srcdir)/stamp-poT $(srcdir)/stamp-po; \
  137. }
  138. # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
  139. # otherwise packages like GCC can not be built if only parts of the source
  140. # have been downloaded.
  141. # This target rebuilds $(DOMAIN).pot; it is an expensive operation.
  142. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
  143. # The determination of whether the package xyz is a GNU one is based on the
  144. # heuristic whether some file in the top level directory mentions "GNU xyz".
  145. # If GNU 'find' is available, we avoid grepping through monster files.
  146. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
  147. package_gnu="$(PACKAGE_GNU)"; \
  148. test -n "$$package_gnu" || { \
  149. if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \
  150. LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep -i 'GNU @PACKAGE@' /dev/null '{}' ';' 2>/dev/null; \
  151. else \
  152. LC_ALL=C grep -i 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \
  153. fi; \
  154. } | grep -v 'libtool:' >/dev/null; then \
  155. package_gnu=yes; \
  156. else \
  157. package_gnu=no; \
  158. fi; \
  159. }; \
  160. if test "$$package_gnu" = "yes"; then \
  161. package_prefix='GNU '; \
  162. else \
  163. package_prefix=''; \
  164. fi; \
  165. if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
  166. msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
  167. else \
  168. msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
  169. fi; \
  170. case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
  171. '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
  172. $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
  173. --add-comments=TRANSLATORS: \
  174. --files-from=$(srcdir)/POTFILES.in \
  175. --copyright-holder='$(COPYRIGHT_HOLDER)' \
  176. --msgid-bugs-address="$$msgid_bugs_address" \
  177. $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
  178. ;; \
  179. *) \
  180. $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
  181. --add-comments=TRANSLATORS: \
  182. --files-from=$(srcdir)/POTFILES.in \
  183. --copyright-holder='$(COPYRIGHT_HOLDER)' \
  184. --package-name="$${package_prefix}@PACKAGE@" \
  185. --package-version='@VERSION@' \
  186. --msgid-bugs-address="$$msgid_bugs_address" \
  187. $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
  188. ;; \
  189. esac
  190. test ! -f $(DOMAIN).po || { \
  191. if test -f $(srcdir)/$(DOMAIN).pot-header; then \
  192. sed -e '1,/^#$$/d' < $(DOMAIN).po > $(DOMAIN).1po && \
  193. cat $(srcdir)/$(DOMAIN).pot-header $(DOMAIN).1po > $(DOMAIN).po && \
  194. rm -f $(DOMAIN).1po \
  195. || exit 1; \
  196. fi; \
  197. if test -f $(srcdir)/$(DOMAIN).pot; then \
  198. sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
  199. sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
  200. if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
  201. rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
  202. else \
  203. rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
  204. mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
  205. fi; \
  206. else \
  207. mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
  208. fi; \
  209. }
  210. # This rule has no dependencies: we don't need to update $(DOMAIN).pot at
  211. # every "make" invocation, only create it when it is missing.
  212. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
  213. $(srcdir)/$(DOMAIN).pot:
  214. $(MAKE) $(DOMAIN).pot-update
  215. # This target rebuilds a PO file if $(DOMAIN).pot has changed.
  216. # Note that a PO file is not touched if it doesn't need to be changed.
  217. $(POFILES): $(POFILESDEPS)
  218. @test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot
  219. @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
  220. if test -f "$(srcdir)/$${lang}.po"; then \
  221. test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
  222. echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot"; \
  223. cd $(srcdir) \
  224. && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
  225. '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].*) \
  226. $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \
  227. 0.1[6-7] | 0.1[6-7].*) \
  228. $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --previous $${lang}.po $(DOMAIN).pot;; \
  229. *) \
  230. $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot;; \
  231. esac; \
  232. }; \
  233. else \
  234. $(MAKE) $${lang}.po-create; \
  235. fi
  236. install: install-exec install-data
  237. install-exec:
  238. install-data: install-data-@USE_NLS@
  239. if test "$(PACKAGE)" = "gettext-tools"; then \
  240. $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
  241. for file in $(DISTFILES.common) Makevars.template; do \
  242. $(INSTALL_DATA) $(srcdir)/$$file \
  243. $(DESTDIR)$(gettextsrcdir)/$$file; \
  244. done; \
  245. for file in Makevars; do \
  246. rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
  247. done; \
  248. else \
  249. : ; \
  250. fi
  251. install-data-no: all
  252. install-data-yes: all
  253. @catalogs='$(CATALOGS)'; \
  254. for cat in $$catalogs; do \
  255. cat=`basename $$cat`; \
  256. lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
  257. dir=$(localedir)/$$lang/LC_MESSAGES; \
  258. $(mkdir_p) $(DESTDIR)$$dir; \
  259. if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
  260. $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
  261. echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
  262. for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
  263. if test -n "$$lc"; then \
  264. if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
  265. link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
  266. mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
  267. mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
  268. (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
  269. for file in *; do \
  270. if test -f $$file; then \
  271. ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
  272. fi; \
  273. done); \
  274. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
  275. else \
  276. if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
  277. :; \
  278. else \
  279. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
  280. mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
  281. fi; \
  282. fi; \
  283. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
  284. ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
  285. ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
  286. cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
  287. echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
  288. fi; \
  289. done; \
  290. done
  291. install-strip: install
  292. installdirs: installdirs-exec installdirs-data
  293. installdirs-exec:
  294. installdirs-data: installdirs-data-@USE_NLS@
  295. if test "$(PACKAGE)" = "gettext-tools"; then \
  296. $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
  297. else \
  298. : ; \
  299. fi
  300. installdirs-data-no:
  301. installdirs-data-yes:
  302. @catalogs='$(CATALOGS)'; \
  303. for cat in $$catalogs; do \
  304. cat=`basename $$cat`; \
  305. lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
  306. dir=$(localedir)/$$lang/LC_MESSAGES; \
  307. $(mkdir_p) $(DESTDIR)$$dir; \
  308. for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
  309. if test -n "$$lc"; then \
  310. if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
  311. link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
  312. mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
  313. mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
  314. (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
  315. for file in *; do \
  316. if test -f $$file; then \
  317. ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
  318. fi; \
  319. done); \
  320. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
  321. else \
  322. if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
  323. :; \
  324. else \
  325. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
  326. mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
  327. fi; \
  328. fi; \
  329. fi; \
  330. done; \
  331. done
  332. # Define this as empty until I found a useful application.
  333. installcheck:
  334. uninstall: uninstall-exec uninstall-data
  335. uninstall-exec:
  336. uninstall-data: uninstall-data-@USE_NLS@
  337. if test "$(PACKAGE)" = "gettext-tools"; then \
  338. for file in $(DISTFILES.common) Makevars.template; do \
  339. rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
  340. done; \
  341. else \
  342. : ; \
  343. fi
  344. uninstall-data-no:
  345. uninstall-data-yes:
  346. catalogs='$(CATALOGS)'; \
  347. for cat in $$catalogs; do \
  348. cat=`basename $$cat`; \
  349. lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
  350. for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
  351. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
  352. done; \
  353. done
  354. check: all
  355. info dvi ps pdf html tags TAGS ctags CTAGS ID:
  356. install-dvi install-ps install-pdf install-html:
  357. mostlyclean:
  358. rm -f remove-potcdate.sed
  359. rm -f $(srcdir)/stamp-poT
  360. rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
  361. rm -fr *.o
  362. clean: mostlyclean
  363. distclean: clean
  364. rm -f Makefile Makefile.in POTFILES
  365. maintainer-clean: distclean
  366. @echo "This command is intended for maintainers to use;"
  367. @echo "it deletes files that may require special tools to rebuild."
  368. rm -f $(srcdir)/$(DOMAIN).pot $(srcdir)/stamp-po $(GMOFILES)
  369. distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
  370. dist distdir:
  371. test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS)
  372. @$(MAKE) dist2
  373. # This is a separate target because 'update-po' must be executed before.
  374. dist2: $(srcdir)/stamp-po $(DISTFILES)
  375. @dists="$(DISTFILES)"; \
  376. if test "$(PACKAGE)" = "gettext-tools"; then \
  377. dists="$$dists Makevars.template"; \
  378. fi; \
  379. if test -f $(srcdir)/$(DOMAIN).pot; then \
  380. dists="$$dists $(DOMAIN).pot stamp-po"; \
  381. else \
  382. case $(XGETTEXT) in \
  383. :) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because a suitable 'xgettext' program was not found in PATH." 1>&2;; \
  384. *) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because 'xgettext' found no strings to extract. Check the contents of the POTFILES.in file and the XGETTEXT_OPTIONS in the Makevars file." 1>&2;; \
  385. esac; \
  386. fi; \
  387. if test -f $(srcdir)/ChangeLog; then \
  388. dists="$$dists ChangeLog"; \
  389. fi; \
  390. for i in 0 1 2 3 4 5 6 7 8 9; do \
  391. if test -f $(srcdir)/ChangeLog.$$i; then \
  392. dists="$$dists ChangeLog.$$i"; \
  393. fi; \
  394. done; \
  395. if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
  396. for file in $$dists; do \
  397. if test -f $$file; then \
  398. cp -p $$file $(distdir) || exit 1; \
  399. else \
  400. cp -p $(srcdir)/$$file $(distdir) || exit 1; \
  401. fi; \
  402. done
  403. update-po: Makefile
  404. $(MAKE) $(DOMAIN).pot-update
  405. test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
  406. $(MAKE) update-gmo
  407. # General rule for creating PO files.
  408. .nop.po-create:
  409. @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
  410. echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
  411. exit 1
  412. # General rule for updating PO files.
  413. .nop.po-update:
  414. @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
  415. if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; fi; \
  416. tmpdir=`pwd`; \
  417. echo "$$lang:"; \
  418. test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
  419. echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang --previous $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
  420. cd $(srcdir); \
  421. if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
  422. '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].*) \
  423. $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
  424. 0.1[6-7] | 0.1[6-7].*) \
  425. $(MSGMERGE) $(MSGMERGE_OPTIONS) --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
  426. *) \
  427. $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
  428. esac; \
  429. }; then \
  430. if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
  431. rm -f $$tmpdir/$$lang.new.po; \
  432. else \
  433. if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
  434. :; \
  435. else \
  436. echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
  437. exit 1; \
  438. fi; \
  439. fi; \
  440. else \
  441. echo "msgmerge for $$lang.po failed!" 1>&2; \
  442. rm -f $$tmpdir/$$lang.new.po; \
  443. fi
  444. $(DUMMYPOFILES):
  445. update-gmo: Makefile $(GMOFILES)
  446. @:
  447. # Recreate Makefile by invoking config.status. Explicitly invoke the shell,
  448. # because execution permission bits may not work on the current file system.
  449. # Use @SHELL@, which is the shell determined by autoconf for the use by its
  450. # scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient.
  451. Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
  452. cd $(top_builddir) \
  453. && @SHELL@ ./config.status $(subdir)/$@.in po-directories
  454. force:
  455. # Tell versions [3.59,3.63) of GNU make not to export all variables.
  456. # Otherwise a system limit (for SysV at least) may be exceeded.
  457. .NOEXPORT: