]> git.proxmox.com Git - pmg-docs.git/blame - pmg-doc-generator.mk.in
api-viewer: properly HTML encode properties
[pmg-docs.git] / pmg-doc-generator.mk.in
CommitLineData
1e94bc81 1DOCRELEASE=@RELEASE@
410dc2c9
DM
2
3DGDIR?=/usr/share/pmg-doc-generator
4
5ASCIIDOC_PMG?=/usr/bin/asciidoc-pmg
6
7PERL_DOC_ENV=PMG_GENERATING_DOCS=1
8
9PMG_COMMON_DOC_SOURCES= \
10 ${ASCIIDOC_PMG} \
11 pmg-copyright.adoc \
12 docinfo.xml
13
14all:
15
93f5feff
DM
16pmgsh.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
43a49777
DM
26pmg-smtp-filter.8-synopsis.adoc:
27 @echo 'Please use systemd tools to manage this service.' >$@.tmp
28 @echo '' >>$@.tmp
17f66284 29 @echo '*systemctl* `(start|stop|restart|reload|status)` `pmg-smtp-filter`' >>$@.tmp
43a49777
DM
30 mv $@.tmp $@
31
17f66284
DM
32pmgpolicy.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 $@
43a49777 37
410dc2c9
DM
38docinfo.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
7608b70c
DM
46pmg.%-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
410dc2c9
DM
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
62ifneq (${DGDIR},.)
63%.adoc: ${DGDIR}/%.adoc
64 cp $< $@.tmp
65 mv $@.tmp $@
66endif
67
68
69%-plain.html: %.adoc ${PMG_COMMON_DOC_SOURCES}
70 ${ASCIIDOC_PMG} compile-wiki -o $@ $*.adoc
71
72chapter-%.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
101cleanup-docgen:
102 rm -f *.xml.tmp *.1 *.5 *.8 *.adoc docinfo.xml
43a49777 103