]>
Commit | Line | Data |
---|---|---|
410dc2c9 DM |
1 | # also update debian/changelog |
2 | DOCRELEASE=5.0 | |
3 | ||
4 | DGDIR?=/usr/share/pmg-doc-generator | |
5 | ||
6 | ASCIIDOC_PMG?=/usr/bin/asciidoc-pmg | |
7 | ||
8 | PERL_DOC_ENV=PMG_GENERATING_DOCS=1 | |
9 | ||
10 | PMG_COMMON_DOC_SOURCES= \ | |
11 | ${ASCIIDOC_PMG} \ | |
12 | pmg-copyright.adoc \ | |
13 | docinfo.xml | |
14 | ||
15 | all: | |
16 | ||
43a49777 DM |
17 | pmg-smtp-filter.8-synopsis.adoc: |
18 | @echo 'Please use systemd tools to manage this service.' >$@.tmp | |
19 | @echo '' >>$@.tmp | |
17f66284 | 20 | @echo '*systemctl* `(start|stop|restart|reload|status)` `pmg-smtp-filter`' >>$@.tmp |
43a49777 DM |
21 | mv $@.tmp $@ |
22 | ||
17f66284 DM |
23 | pmgpolicy.8-synopsis.adoc: |
24 | @echo 'Please use systemd tools to manage this service.' >$@.tmp | |
25 | @echo '' >>$@.tmp | |
26 | @echo '*systemctl* `(start|stop|restart|reload|status)` `pmgpolicy`' >>$@.tmp | |
27 | mv $@.tmp $@ | |
43a49777 | 28 | |
410dc2c9 DM |
29 | docinfo.xml: |
30 | cp ${DGDIR}/$@ $@.tmp | |
31 | mv $@.tmp $@ | |
32 | ||
33 | %-opts.adoc: ${DGDIR}/gen-%-opts.pl | |
34 | $(PERL_DOC_ENV) perl -I. ${DGDIR}/gen-$*-opts.pl >$@.tmp | |
35 | mv $@.tmp $@ | |
36 | ||
37 | %.adoc: ${DGDIR}/gen-%-adoc.pl | |
38 | $(PERL_DOC_ENV) perl -I. ${DGDIR}/gen-$*-adoc.pl >$@.tmp | |
39 | mv $@.tmp $@ | |
40 | ||
41 | %.1-synopsis.adoc: | |
42 | $(PERL_DOC_ENV) perl -I. -e "use PMG::CLI::$(subst -,_,$*);print PMG::CLI::$(subst -,_,$*)->generate_asciidoc_synopsis();" > $@.tmp | |
43 | mv $@.tmp $@ | |
44 | ||
45 | %.8-synopsis.adoc: | |
46 | $(PERL_DOC_ENV) perl -I. -e "use PMG::Service::$(subst -,_,$*);print PMG::Service::$(subst -,_,$*)->generate_asciidoc_synopsis();" > $@.tmp | |
47 | mv $@.tmp $@ | |
48 | ||
49 | ifneq (${DGDIR},.) | |
50 | %.adoc: ${DGDIR}/%.adoc | |
51 | cp $< $@.tmp | |
52 | mv $@.tmp $@ | |
53 | endif | |
54 | ||
55 | ||
56 | %-plain.html: %.adoc ${PMG_COMMON_DOC_SOURCES} | |
57 | ${ASCIIDOC_PMG} compile-wiki -o $@ $*.adoc | |
58 | ||
59 | chapter-%.html: %.adoc ${PMG_COMMON_DOC_SOURCES} | |
60 | ${ASCIIDOC_PMG} compile-chapter -o $@ $*.adoc | |
61 | ||
62 | %.1: %.adoc %.1-synopsis.adoc ${PMG_COMMON_DOC_SOURCES} | |
63 | ${ASCIIDOC_PMG} compile-man -o $@ $*.adoc | |
64 | test -n "$${NOVIEW}" || man -l $@ | |
65 | ||
66 | %.1.html: %.adoc %.1-synopsis.adoc ${PMG_COMMON_DOC_SOURCES} | |
67 | ${ASCIIDOC_PMG} compile-man-html -o $@ $*.adoc | |
68 | ||
69 | %.8: %.adoc %.8-synopsis.adoc ${PMG_COMMON_DOC_SOURCES} | |
70 | ${ASCIIDOC_PMG} compile-man -o $@ $*.adoc | |
71 | test -n "$${NOVIEW}" || man -l $@ | |
72 | ||
73 | %.8.html: %.adoc %.8-synopsis.adoc ${PMG_COMMON_DOC_SOURCES} | |
74 | ${ASCIIDOC_PMG} compile-man-html -o $@ $*.adoc | |
75 | ||
76 | %.5: %.adoc %.5-opts.adoc ${PMG_COMMON_DOC_SOURCES} | |
77 | ${ASCIIDOC_PMG} compile-man -o $@ $*.adoc | |
78 | test -n "$${NOVIEW}" || man -l $@ | |
79 | ||
80 | %.5.html: %.adoc %.5-opts.adoc ${PMG_COMMON_DOC_SOURCES} | |
81 | ${ASCIIDOC_PMG} compile-man-html -o $@ $*.adoc | |
82 | ||
83 | %.5-plain.html: %.adoc %.5-opts.adoc ${PMG_COMMON_DOC_SOURCES} | |
84 | ${ASCIIDOC_PMG} compile-man-wiki -o $@ $*.adoc | |
85 | ||
86 | ||
87 | .PHONY: cleanup-docgen | |
88 | cleanup-docgen: | |
89 | rm -f *.xml.tmp *.1 *.5 *.8 *.adoc docinfo.xml | |
43a49777 | 90 |