2 PO_FILES = $(wildcard *.po)
3 PO_LANGS = $(PO_FILES:.po=)
5 PO_STAMPS = po4a-gen.stamp
7 CLEANFILES = $(PO_STAMPS)
9 EXTRA_DIST = README.md $(PO_FILES) po4a.cfg util-linux-man.pot
10 DISTCLEANFILES = util-linux-man.pot $(PO_FILES)
13 util-linux-man.pot: Makefile
14 $(AM_V_GEN) $(PO4A) --verbose --no-translations po4a.cfg
16 po4a-gen.stamp: $(PO_FILES)
17 @echo 'po4a: generate man-pages translations'
18 $(AM_V_GEN) $(PO4A) --srcdir $(srcdir) $(srcdir)/po4a.cfg
21 # We need to call po4a --force only on 'make dist', otherwise .po and .pot
22 # files has to be unmodified. This update has to be done before 'make' copies
23 # sources to the $distdir. $EXTRA_DIST (where is util-linux-man.pot) is used as
24 # a dependence for 'distdir' automake target, so it's trigered by "make dist*"
27 @echo 'po4a: force pot-update'
28 $(AM_V_GEN) $(PO4A) --force --srcdir $(srcdir) $(srcdir)/po4a.cfg
30 gen-trans: $(PO_STAMPS)
32 asciidoc_man_cmd = $(ASCIIDOCTOR) \
34 -a 'release-version=$(VERSION)' \
35 -a 'package-docdir=$(docdir)' \
36 -a 'VERSION=$(VERSION)' \
37 -a 'ADJTIME_PATH=$(ADJTIME_PATH)' \
38 --load-path '$(top_srcdir)/tools' \
39 --require asciidoctor-unicodeconverter
41 if HAVE_ASCIIDOCTOR_FAILURE_LEVEL
42 asciidoc_man_cmd += --failure-level ERROR
47 for l in $(PO_LANGS); do \
48 gendir="$(abs_builddir)/$$l"; \
49 genfiles=`echo $${gendir}/*.adoc`; \
50 if test "$$genfiles" != "$${gendir}/*.adoc"; then \
51 for file in $${genfiles}; do \
52 manname=`echo $$file | sed -e 's|^.*/||' -e 's|\.adoc||'`; \
53 test -f $${gendir}/$${manname} || { \
54 echo " GEN " $$l ": " $$manname && \
56 --base-dir=$${gendir} \
57 --destination-dir $${gendir} $${file}; \
68 rm -rf $(PO_LANGS) *.stamp
70 install-data-local: gen-mans
71 @for l in $(PO_LANGS); do \
72 mansrcdir="$(abs_builddir)/$$l"; \
73 for s in $(MAN_SECTIONS); do \
74 installfiles=`echo $${mansrcdir}/*.$$s`; \
75 if test "$$installfiles" != "$${mansrcdir}/*.$$s"; then \
76 installdir="$(DESTDIR)$(mandir)/$$l/man$$s"; \
77 $(MKDIR_P) "$${installdir}" || exit 1; \
78 for file in $$installfiles; do \
79 manname=`echo $$file | sed -e 's|^.*/||'`; \
80 echo " Installing " $$l ": " $$manname ; \
81 $(INSTALL_DATA) $$file $${installdir}; \
88 @for l in $(PO_LANGS); do \
89 mansrcdir="$(abs_builddir)/$$l"; \
90 for s in $(MAN_SECTIONS); do \
91 installfiles=`echo $${mansrcdir}/*.$$s`; \
92 if test "$$installfiles" != "$${mansrcdir}/*.$$s"; then \
93 installdir="$(DESTDIR)$(mandir)/$$l/man$$s"; \
94 for file in $$installfiles; do \
95 manname=`echo $$file | sed -e 's|^.*/||'`; \
96 echo " Uninstalling " $$l ": " $$manname ; \
97 rm -f $${installdir}/$${manname}; \