]>
Commit | Line | Data |
---|---|---|
8f5fff53 KZ |
1 | |
2 | PO_FILES = $(wildcard *.po) | |
3 | PO_LANGS = $(PO_FILES:.po=) | |
4 | ||
5 | PO_STAMPS = po4a-gen.stamp | |
6 | MAN_SECTIONS = 1 3 5 8 | |
7 | CLEANFILES = $(PO_STAMPS) | |
8 | ||
9 | EXTRA_DIST = README.md $(PO_FILES) po4a.cfg util-linux-man.pot | |
10 | ||
842ec4ce | 11 | if ENABLE_POMAN |
65abace2 KZ |
12 | util-linux-man.pot: Makefile |
13 | $(AM_V_GEN) $(PO4A) --verbose --no-translations po4a.cfg | |
14 | ||
8f5fff53 KZ |
15 | po4a-gen.stamp: $(PO_FILES) |
16 | @echo 'po4a: generate man-pages translations' | |
17 | $(AM_V_GEN) $(PO4A) po4a.cfg | |
18 | @touch po4a-gen.stamp | |
19 | ||
20 | gen-trans: $(PO_STAMPS) | |
21 | ||
22 | asciidoc_man_cmd = $(ASCIIDOCTOR) \ | |
23 | -b manpage \ | |
6ca582fb KZ |
24 | -a 'release-version=$(VERSION)' \ |
25 | -a 'package-docdir=$(docdir)' \ | |
8f5fff53 KZ |
26 | -a 'VERSION=$(VERSION)' \ |
27 | -a 'ADJTIME_PATH=$(ADJTIME_PATH)' | |
28 | ||
29 | gen-mans: gen-trans | |
30 | @for l in $(PO_LANGS); do \ | |
31 | gendir="$(abs_builddir)/$$l"; \ | |
32 | genfiles=`echo $${gendir}/*.adoc`; \ | |
33 | if test "$$genfiles" != '$${gendir}/*.adoc'; then \ | |
34 | for file in $${genfiles}; do \ | |
35 | manname=`echo $$file | sed -e 's|^.*/||' -e 's|\.adoc||'`; \ | |
36 | test -f $${gendir}/$${manname} || { \ | |
37 | echo " GEN " $$l ": " $$manname && \ | |
38 | $(asciidoc_man_cmd) \ | |
39 | --base-dir=$${gendir} \ | |
40 | --destination-dir $${gendir} $${file}; \ | |
41 | }; \ | |
42 | done; \ | |
43 | fi; \ | |
44 | done | |
8f5fff53 KZ |
45 | all: gen-mans |
46 | ||
47 | clean-local: | |
48 | rm -f *~ *.bak | |
49 | ||
50 | distclean-local: | |
51 | rm -rf $(PO_LANGS) *.stamp | |
52 | ||
53 | install-data-local: gen-mans | |
54 | @for l in $(PO_LANGS); do \ | |
55 | mansrcdir="$(abs_builddir)/$$l"; \ | |
56 | for s in $(MAN_SECTIONS); do \ | |
57 | installfiles=`echo $${mansrcdir}/*.$$s`; \ | |
58 | if test "$$installfiles" != '$${mansrcdir}/*.$$s'; then \ | |
59 | installdir="$(DESTDIR)$(mandir)/$$l/man$$s"; \ | |
60 | $(MKDIR_P) "$${installdir}" || exit 1; \ | |
61 | for file in $$installfiles; do \ | |
62 | manname=`echo $$file | sed -e 's|^.*/||'`; \ | |
63 | echo " Installing " $$l ": " $$manname ; \ | |
64 | $(INSTALL_DATA) $$file $${installdir}; \ | |
65 | done; \ | |
66 | fi; \ | |
67 | done; \ | |
68 | done | |
64936a9d KZ |
69 | |
70 | uninstall-local: | |
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 | for file in $$installfiles; do \ | |
78 | manname=`echo $$file | sed -e 's|^.*/||'`; \ | |
79 | echo " Uninstalling " $$l ": " $$manname ; \ | |
80 | rm -f $${installdir}/$${manname}; \ | |
81 | done; \ | |
82 | fi; \ | |
83 | done; \ | |
84 | done | |
85 | ||
842ec4ce KZ |
86 | else |
87 | gen-trans: | |
88 | gen-mans: | |
89 | all: | |
90 | distclean-local: | |
91 | clean-local: | |
92 | endif |