Debian Codegraph @

storage/mroonga/vendor/groonga/build/makefiles/gettext.am

raw
1 include $(top_srcdir)/doc/files.am
2 include $(top_srcdir)/build/makefiles/sphinx-build.am
3
4 CLEANFILES =
5
6 EXTRA_DIST += \
7 $(po_files)
8
9 if DOCUMENT_AVAILABLE
10 EXTRA_DIST += \
11 $(mo_files)
12 endif
13
14 if DOCUMENT_BUILDABLE
15 BUILT_SOURCES += \
16 mo-build-stamp
17 CLEANFILES += \
18 pot-build-stamp \
19 edit-po-build-stamp \
20 mo-build-stamp
21 endif
22
23 SUFFIXES += .pot .po .mo .edit
24
25 .PHONY: gettext update build
26
27 .pot.edit:
28 if test -f $*.po; then \
29 msgmerge \
30 --quiet \
31 --sort-by-file \
32 [email protected] \
33 $*.po \
34 $<; \
35 else \
36 msginit \
37 --input=$< \
38 [email protected] \
39 --locale=$(LOCALE) \
40 --no-translator; \
41 fi
42 (echo "# -*- po -*-"; \
43 GREP_OPTIONS= grep -v '^# -\*- po -\*-' [email protected] | \
44 GREP_OPTIONS= grep -v '^"POT-Creation-Date:') > $@
45 rm [email protected]
46
47 .edit.po:
48 msgcat --no-location --output $@ $<
49
50 .po.mo:
51 msgfmt -o $@ $<
52
53 if DOCUMENT_BUILDABLE
54 update: edit-po-build-stamp
55 build: mo-build-stamp
56 else
57 update:
58 build:
59 endif
60
61 html: build
62
63 gettext:
64 rm *.pot || true
65 $(SPHINX_BUILD_COMMAND) -d doctrees -b gettext $(ALLSPHINXOPTS) .
66 xgettext --language Python --output conf.pot \
67 $(top_srcdir)/doc/source/conf.py
68
69 pot-build-stamp: $(absolute_source_files)
70 $(MAKE) gettext
71 @touch $@
72
73 edit-po-build-stamp: pot-build-stamp
74 $(MAKE) $(edit_po_files)
75 @touch $@
76
77 mo_build_stamp_dependencies = edit-po-build-stamp
78 if DOCUMENT_BUILDABLE
79 mo_build_stamp_dependencies += $(edit_po_files)
80 endif
81
82 mo-build-stamp: $(mo_build_stamp_dependencies)
83 $(MAKE) $(mo_files)
84 @touch $@