]> git.proxmox.com Git - pmg-docs.git/blob - pmg-doc-generator.mk.in
installation: fix codeblock rendering in zfs performance tips section
[pmg-docs.git] / pmg-doc-generator.mk.in
1 DOCRELEASE=@RELEASE@
2
3 DGDIR?=/usr/share/pmg-doc-generator
4
5 ASCIIDOC_PMG?=/usr/bin/asciidoc-pmg
6
7 PERL_DOC_ENV=PMG_GENERATING_DOCS=1
8
9 PMG_COMMON_DOC_SOURCES= \
10 ${ASCIIDOC_PMG} \
11 pmg-copyright.adoc \
12 docinfo.xml
13
14 all:
15
16 pmgsh.1-synopsis.adoc:
17 @echo 'Interactive session:' >$@.tmp
18 @echo '' >>$@.tmp
19 @echo '*pmgsh*' >>$@.tmp
20 @echo '' >>$@.tmp
21 @echo 'Directly call API functions:' >>$@.tmp
22 @echo '' >>$@.tmp
23 @echo '*pmgsh* `(get|set|create|help)` `<path>` `[OPTIONS]`' >>$@.tmp
24 mv $@.tmp $@
25
26 pmg-smtp-filter.8-synopsis.adoc:
27 @echo 'Please use systemd tools to manage this service.' >$@.tmp
28 @echo '' >>$@.tmp
29 @echo '*systemctl* `(start|stop|restart|reload|status)` `pmg-smtp-filter`' >>$@.tmp
30 mv $@.tmp $@
31
32 pmgpolicy.8-synopsis.adoc:
33 @echo 'Please use systemd tools to manage this service.' >$@.tmp
34 @echo '' >>$@.tmp
35 @echo '*systemctl* `(start|stop|restart|reload|status)` `pmgpolicy`' >>$@.tmp
36 mv $@.tmp $@
37
38 docinfo.xml:
39 cp ${DGDIR}/$@ $@.tmp
40 mv $@.tmp $@
41
42 %-opts.adoc: ${DGDIR}/gen-%-opts.pl
43 $(PERL_DOC_ENV) perl -I. ${DGDIR}/gen-$*-opts.pl >$@.tmp
44 mv $@.tmp $@
45
46 pmg.%-conf-opts.adoc: ${DGDIR}/gen-pmg.conf.5-opts.pl
47 $(PERL_DOC_ENV) perl -I. ${DGDIR}/gen-pmg.conf.5-opts.pl $* >$@.tmp
48 mv $@.tmp $@
49
50 %.adoc: ${DGDIR}/gen-%-adoc.pl
51 $(PERL_DOC_ENV) perl -I. ${DGDIR}/gen-$*-adoc.pl >$@.tmp
52 mv $@.tmp $@
53
54 %.1-synopsis.adoc:
55 $(PERL_DOC_ENV) perl -I. -e "use PMG::CLI::$(subst -,_,$*);print PMG::CLI::$(subst -,_,$*)->generate_asciidoc_synopsis();" > $@.tmp
56 mv $@.tmp $@
57
58 %.8-synopsis.adoc:
59 $(PERL_DOC_ENV) perl -I. -e "use PMG::Service::$(subst -,_,$*);print PMG::Service::$(subst -,_,$*)->generate_asciidoc_synopsis();" > $@.tmp
60 mv $@.tmp $@
61
62 ifneq (${DGDIR},.)
63 %.adoc: ${DGDIR}/%.adoc
64 cp $< $@.tmp
65 mv $@.tmp $@
66 endif
67
68
69 %-plain.html: %.adoc ${PMG_COMMON_DOC_SOURCES}
70 ${ASCIIDOC_PMG} compile-wiki -o $@ $*.adoc
71
72 chapter-%.html: %.adoc ${PMG_COMMON_DOC_SOURCES}
73 ${ASCIIDOC_PMG} compile-chapter -o $@ $*.adoc
74
75 %.1: %.adoc %.1-synopsis.adoc ${PMG_COMMON_DOC_SOURCES}
76 ${ASCIIDOC_PMG} compile-man -o $@ $*.adoc
77 test -n "$${NOVIEW}" || man -l $@
78
79 %.1.html: %.adoc %.1-synopsis.adoc ${PMG_COMMON_DOC_SOURCES}
80 ${ASCIIDOC_PMG} compile-man-html -o $@ $*.adoc
81
82 %.8: %.adoc %.8-synopsis.adoc ${PMG_COMMON_DOC_SOURCES}
83 ${ASCIIDOC_PMG} compile-man -o $@ $*.adoc
84 test -n "$${NOVIEW}" || man -l $@
85
86 %.8.html: %.adoc %.8-synopsis.adoc ${PMG_COMMON_DOC_SOURCES}
87 ${ASCIIDOC_PMG} compile-man-html -o $@ $*.adoc
88
89 %.5: %.adoc %.5-opts.adoc ${PMG_COMMON_DOC_SOURCES}
90 ${ASCIIDOC_PMG} compile-man -o $@ $*.adoc
91 test -n "$${NOVIEW}" || man -l $@
92
93 %.5.html: %.adoc %.5-opts.adoc ${PMG_COMMON_DOC_SOURCES}
94 ${ASCIIDOC_PMG} compile-man-html -o $@ $*.adoc
95
96 %.5-plain.html: %.adoc %.5-opts.adoc ${PMG_COMMON_DOC_SOURCES}
97 ${ASCIIDOC_PMG} compile-man-wiki -o $@ $*.adoc
98
99
100 .PHONY: cleanup-docgen
101 cleanup-docgen:
102 rm -f *.xml.tmp *.1 *.5 *.8 *.adoc docinfo.xml
103