]> git.ipfire.org Git - thirdparty/util-linux.git/blame - po-man/Makefile.am
po-man: update variables in Makefile.am
[thirdparty/util-linux.git] / po-man / Makefile.am
CommitLineData
8f5fff53
KZ
1
2PO_FILES = $(wildcard *.po)
3PO_LANGS = $(PO_FILES:.po=)
4
5PO_STAMPS = po4a-gen.stamp
6MAN_SECTIONS = 1 3 5 8
7CLEANFILES = $(PO_STAMPS)
8
9EXTRA_DIST = README.md $(PO_FILES) po4a.cfg util-linux-man.pot
10
842ec4ce 11if ENABLE_POMAN
65abace2
KZ
12util-linux-man.pot: Makefile
13 $(AM_V_GEN) $(PO4A) --verbose --no-translations po4a.cfg
14
8f5fff53
KZ
15po4a-gen.stamp: $(PO_FILES)
16 @echo 'po4a: generate man-pages translations'
17 $(AM_V_GEN) $(PO4A) po4a.cfg
18 @touch po4a-gen.stamp
19
20gen-trans: $(PO_STAMPS)
21
22asciidoc_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
29gen-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
45all: gen-mans
46
47clean-local:
48 rm -f *~ *.bak
49
50distclean-local:
51 rm -rf $(PO_LANGS) *.stamp
52
53install-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
70uninstall-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
86else
87gen-trans:
88gen-mans:
89all:
90distclean-local:
91clean-local:
92endif