PageRenderTime 3675ms CodeModel.GetById 26ms RepoModel.GetById 1ms app.codeStats 0ms

/src/bin/diffutils/po/Makefile

https://bitbucket.org/ddevine/haiku
Makefile | 397 lines | 308 code | 56 blank | 33 comment | 85 complexity | 2d9ea24f5cfd2aa3476354367701eced MD5 | raw file
Possible License(s): Apache-2.0, LGPL-2.0, LGPL-2.1, MPL-2.0-no-copyleft-exception, MIT, ISC, BSD-3-Clause, AGPL-1.0, GPL-2.0, GPL-3.0, LGPL-3.0
  1. # Makefile for PO directory in any package using GNU gettext.
  2. # Copyright (C) 1995-1997, 2000-2002 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 = diffutils
  11. VERSION = 2.8.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 = /bin/install -c
  21. INSTALL_DATA = ${INSTALL} -m 644
  22. MKINSTALLDIRS = config/mkinstalldirs
  23. mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
  24. GMSGFMT = :
  25. MSGFMT = :
  26. XGETTEXT = AWK='gawk' $(SHELL) $(top_srcdir)/exgettext :
  27. MSGMERGE = msgmerge
  28. MSGMERGE_UPDATE = : --update
  29. MSGINIT = msginit
  30. MSGCONV = msgconv
  31. MSGFILTER = msgfilter
  32. POFILES = cs.po da.po de.po en_GB.po eo.po es.po fr.po gl.po he.po id.po ja.po pl.po ru.po sv.po tr.po zh_TW.po
  33. GMOFILES = cs.gmo da.gmo de.gmo en_GB.gmo eo.gmo es.gmo fr.gmo gl.gmo he.gmo id.gmo ja.gmo pl.gmo ru.gmo sv.gmo tr.gmo zh_TW.gmo
  34. UPDATEPOFILES = cs.po-update da.po-update de.po-update en_GB.po-update eo.po-update es.po-update fr.po-update gl.po-update he.po-update id.po-update ja.po-update pl.po-update ru.po-update sv.po-update tr.po-update zh_TW.po-update
  35. DUMMYPOFILES = cs.nop da.nop de.nop en_GB.nop eo.nop es.nop fr.nop gl.nop he.nop id.nop ja.nop pl.nop ru.nop sv.nop tr.nop zh_TW.nop
  36. DISTFILES.common = Makefile.in.in Makevars remove-potcdate.sin \
  37. $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
  38. DISTFILES = $(DISTFILES.common) POTFILES.in $(DOMAIN).pot \
  39. $(POFILES) $(GMOFILES) \
  40. $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
  41. POTFILES = \
  42. ../lib/c-stack.c \
  43. ../lib/error.c \
  44. ../lib/freesoft.c \
  45. ../lib/getopt.c \
  46. ../lib/regex.c \
  47. ../lib/xmalloc.c \
  48. ../src/analyze.c \
  49. ../src/cmp.c \
  50. ../src/diff.c \
  51. ../src/diff3.c \
  52. ../src/dir.c \
  53. ../src/sdiff.c \
  54. ../src/util.c
  55. CATALOGS = cs.gmo da.gmo de.gmo en_GB.gmo eo.gmo es.gmo fr.gmo gl.gmo he.gmo id.gmo ja.gmo pl.gmo ru.gmo sv.gmo tr.gmo zh_TW.gmo
  56. # Makevars gets inserted here. (Don't remove this line!)
  57. # Makefile variables for PO directory in any package using GNU gettext.
  58. # Usually the message domain is the same as the package name.
  59. DOMAIN = $(PACKAGE)
  60. # These two variables depend on the location of this directory.
  61. subdir = po
  62. top_builddir = ..
  63. # These options get passed to xgettext.
  64. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
  65. # This is the copyright holder that gets inserted into the header of the
  66. # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
  67. # package. (Note that the msgstr strings, extracted from the package's
  68. # sources, belong to the copyright holder of the package.) Translators are
  69. # expected to transfer the copyright for their translations to this person
  70. # or entity, or to disclaim their copyright. The empty string stands for
  71. # the public domain; in this case the translators are expected to disclaim
  72. # their copyright.
  73. COPYRIGHT_HOLDER = Free Software Foundation, Inc.
  74. # This is the list of locale categories, beyond LC_MESSAGES, for which the
  75. # message catalogs shall be used. It is usually empty.
  76. EXTRA_LOCALE_CATEGORIES =
  77. .SUFFIXES:
  78. .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-update
  79. .po.mo:
  80. @echo "$(MSGFMT) -c -o $@ $<"; \
  81. $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
  82. .po.gmo:
  83. @lang=`echo $* | sed -e 's,.*/,,'`; \
  84. test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
  85. echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
  86. cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
  87. .sin.sed:
  88. sed -e '/^#/d' $< > t-$@
  89. mv t-$@ $@
  90. all: all-no
  91. all-yes: $(CATALOGS)
  92. all-no:
  93. # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
  94. # otherwise packages like GCC can not be built if only parts of the source
  95. # have been downloaded.
  96. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
  97. $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
  98. --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
  99. --files-from=$(srcdir)/POTFILES.in \
  100. --copyright-holder='$(COPYRIGHT_HOLDER)'
  101. test ! -f $(DOMAIN).po || { \
  102. if test -f $(srcdir)/$(DOMAIN).pot; then \
  103. sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
  104. sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
  105. if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
  106. rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
  107. else \
  108. rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
  109. mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
  110. fi; \
  111. else \
  112. mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
  113. fi; \
  114. }
  115. $(srcdir)/$(DOMAIN).pot:
  116. $(MAKE) $(DOMAIN).pot-update
  117. $(POFILES): $(srcdir)/$(DOMAIN).pot
  118. @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
  119. test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
  120. echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
  121. cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot
  122. install: install-exec install-data
  123. install-exec:
  124. install-data: install-data-no
  125. if test "$(PACKAGE)" = "gettext"; then \
  126. $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
  127. for file in $(DISTFILES.common); do \
  128. $(INSTALL_DATA) $(srcdir)/$$file \
  129. $(DESTDIR)$(gettextsrcdir)/$$file; \
  130. done; \
  131. else \
  132. : ; \
  133. fi
  134. install-data-no: all
  135. install-data-yes: all
  136. $(mkinstalldirs) $(DESTDIR)$(datadir)
  137. @catalogs='$(CATALOGS)'; \
  138. for cat in $$catalogs; do \
  139. cat=`basename $$cat`; \
  140. lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
  141. dir=$(localedir)/$$lang/LC_MESSAGES; \
  142. $(mkinstalldirs) $(DESTDIR)$$dir; \
  143. if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
  144. $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
  145. echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
  146. for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
  147. if test -n "$$lc"; then \
  148. if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
  149. link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
  150. mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
  151. mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
  152. (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
  153. for file in *; do \
  154. if test -f $$file; then \
  155. ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
  156. fi; \
  157. done); \
  158. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
  159. else \
  160. if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
  161. :; \
  162. else \
  163. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
  164. mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
  165. fi; \
  166. fi; \
  167. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
  168. ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
  169. ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
  170. cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
  171. echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
  172. fi; \
  173. done; \
  174. done
  175. install-strip: install
  176. installdirs: installdirs-exec installdirs-data
  177. installdirs-exec:
  178. installdirs-data: installdirs-data-no
  179. if test "$(PACKAGE)" = "gettext"; then \
  180. $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
  181. else \
  182. : ; \
  183. fi
  184. installdirs-data-no:
  185. installdirs-data-yes:
  186. $(mkinstalldirs) $(DESTDIR)$(datadir)
  187. @catalogs='$(CATALOGS)'; \
  188. for cat in $$catalogs; do \
  189. cat=`basename $$cat`; \
  190. lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
  191. dir=$(localedir)/$$lang/LC_MESSAGES; \
  192. $(mkinstalldirs) $(DESTDIR)$$dir; \
  193. for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
  194. if test -n "$$lc"; then \
  195. if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
  196. link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
  197. mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
  198. mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
  199. (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
  200. for file in *; do \
  201. if test -f $$file; then \
  202. ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
  203. fi; \
  204. done); \
  205. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
  206. else \
  207. if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
  208. :; \
  209. else \
  210. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
  211. mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
  212. fi; \
  213. fi; \
  214. fi; \
  215. done; \
  216. done
  217. # Define this as empty until I found a useful application.
  218. installcheck:
  219. uninstall: uninstall-exec uninstall-data
  220. uninstall-exec:
  221. uninstall-data: uninstall-data-no
  222. if test "$(PACKAGE)" = "gettext"; then \
  223. for file in $(DISTFILES.common); do \
  224. rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
  225. done; \
  226. else \
  227. : ; \
  228. fi
  229. uninstall-data-no:
  230. uninstall-data-yes:
  231. catalogs='$(CATALOGS)'; \
  232. for cat in $$catalogs; do \
  233. cat=`basename $$cat`; \
  234. lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
  235. for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
  236. rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
  237. done; \
  238. done
  239. check: all
  240. dvi info tags TAGS ID:
  241. mostlyclean:
  242. rm -f remove-potcdate.sed
  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 $(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 -f $(srcdir)/ChangeLog; then dists="$$dists ChangeLog"; fi; \
  260. if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
  261. for file in $$dists; do \
  262. if test -f $$file; then \
  263. cp -p $$file $(distdir); \
  264. else \
  265. cp -p $(srcdir)/$$file $(distdir); \
  266. fi; \
  267. done
  268. update-po: Makefile
  269. $(MAKE) $(DOMAIN).pot-update
  270. $(MAKE) $(UPDATEPOFILES)
  271. $(MAKE) update-gmo
  272. # General rule for updating PO files.
  273. .nop.po-update:
  274. @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
  275. if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
  276. tmpdir=`pwd`; \
  277. echo "$$lang:"; \
  278. test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
  279. echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
  280. cd $(srcdir); \
  281. if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
  282. if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
  283. rm -f $$tmpdir/$$lang.new.po; \
  284. else \
  285. if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
  286. :; \
  287. else \
  288. echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
  289. exit 1; \
  290. fi; \
  291. fi; \
  292. else \
  293. echo "msgmerge for $$lang.po failed!" 1>&2; \
  294. rm -f $$tmpdir/$$lang.new.po; \
  295. fi
  296. $(DUMMYPOFILES):
  297. update-gmo: Makefile $(GMOFILES)
  298. @:
  299. Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in
  300. cd $(top_builddir) \
  301. && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
  302. $(SHELL) ./config.status
  303. force:
  304. # Tell versions [3.59,3.63) of GNU make not to export all variables.
  305. # Otherwise a system limit (for SysV at least) may be exceeded.
  306. .NOEXPORT:
  307. # Special Makefile rules for English message catalogs with quotation marks.
  308. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot
  309. .SUFFIXES: .insert-header .po-update-en
  310. en@quot.po-update: en@quot.po-update-en
  311. en@boldquot.po-update: en@boldquot.po-update-en
  312. .insert-header.po-update-en:
  313. @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
  314. if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
  315. tmpdir=`pwd`; \
  316. echo "$$lang:"; \
  317. ll=`echo $$lang | sed -e 's/@.*//'`; \
  318. LC_ALL=C; export LC_ALL; \
  319. cd $(srcdir); \
  320. 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 \
  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 "creation of $$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 "creation of $$lang.po failed!" 1>&2; \
  333. rm -f $$tmpdir/$$lang.new.po; \
  334. fi
  335. en@quot.insert-header: insert-header.sin
  336. sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header
  337. en@boldquot.insert-header: insert-header.sin
  338. sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header
  339. mostlyclean: mostlyclean-quot
  340. mostlyclean-quot:
  341. rm -f *.insert-header