2016-10-14 14:10:35 +03:00
# also update debian/changelog
2018-05-14 13:33:03 +03:00
DOCRELEASE = 5.2
2016-10-14 14:10:35 +03:00
DGDIR ?= /usr/share/pve-doc-generator
ASCIIDOC_PVE ?= /usr/bin/asciidoc-pve
2017-02-06 17:46:32 +03:00
PERL_DOC_ENV = PVE_GENERATING_DOCS = 1
2018-10-17 14:01:57 +03:00
PERL_DOC_INC_DIRS := ${ PERL_DOC_INC_DIRS } .
PERL_DOC_INC = $( foreach dir,${ PERL_DOC_INC_DIRS } ,-I${ dir } )
2017-02-06 17:46:32 +03:00
2016-10-14 14:10:35 +03:00
PVE_COMMON_DOC_SOURCES = \
${ ASCIIDOC_PVE } \
pve-copyright.adoc \
docinfo.xml
all :
2018-11-09 13:05:42 +03:00
attributes.txt docinfo.xml pmxcfs.8-synopsis.adoc qmeventd.8-synopsis.adoc :
2016-10-14 14:10:35 +03:00
cp ${ DGDIR } /$@ $@ .tmp
mv $@ .tmp $@
%-opts.adoc : ${DGDIR }/gen -%-opts .pl
2018-10-17 14:01:57 +03:00
$( PERL_DOC_ENV) perl ${ PERL_DOC_INC } ${ DGDIR } /gen-$* -opts.pl >$@ .tmp
2016-10-14 14:10:35 +03:00
mv $@ .tmp $@
%.adoc : ${DGDIR }/gen -%-adoc .pl
2018-10-17 14:01:57 +03:00
$( PERL_DOC_ENV) perl ${ PERL_DOC_INC } ${ DGDIR } /gen-$* -adoc.pl >$@ .tmp
2016-10-14 14:10:35 +03:00
mv $@ .tmp $@
pveperf.1-synopsis.adoc :
echo '*pveperf* `[PATH]`' > pveperf.1-synopsis.adoc
%.1-synopsis.adoc :
2018-10-17 14:01:57 +03:00
$( PERL_DOC_ENV) perl ${ PERL_DOC_INC } -e " use PVE::CLI:: $( subst -,_,$* ) ;print PVE::CLI:: $( subst -,_,$* ) ->generate_asciidoc_synopsis(); " > $@ .tmp
2016-10-14 14:10:35 +03:00
mv $@ .tmp $@
%.8-synopsis.adoc :
2018-10-17 14:01:57 +03:00
$( PERL_DOC_ENV) perl ${ PERL_DOC_INC } -e " use PVE::Service:: $( subst -,_,$* ) ;print PVE::Service:: $( subst -,_,$* ) ->generate_asciidoc_synopsis(); " > $@ .tmp
2016-10-14 14:10:35 +03:00
mv $@ .tmp $@
i f n e q ( $ { D G D I R } , . )
%.adoc : ${DGDIR }/%.adoc
cp $< $@ .tmp
mv $@ .tmp $@
e n d i f
2018-10-17 14:01:58 +03:00
%.service-bash-completion :
perl ${ PERL_DOC_INC } -T -e " use PVE::Service:: $* ; PVE::Service:: $* ->generate_bash_completions(); " >$@ .tmp
mv $@ .tmp $@
%.bash-completion :
perl ${ PERL_DOC_INC } -T -e " use PVE::CLI:: $* ; PVE::CLI:: $* ->generate_bash_completions(); " >$@ .tmp
mv $@ .tmp $@
2016-10-14 14:10:35 +03:00
2018-10-17 14:01:59 +03:00
%.service-api-verified :
perl ${ PERL_DOC_INC } -T -e " use PVE::Service:: $* ; PVE::Service:: $* ->verify_api(); "
touch $@
%.api-verified :
perl ${ PERL_DOC_INC } -T -e " use PVE::CLI:: $* ; PVE::CLI:: $* ->verify_api(); "
touch $@
2016-10-14 14:10:35 +03:00
%-plain.html : %.adoc ${PVE_COMMON_DOC_SOURCES }
${ ASCIIDOC_PVE } compile-wiki -o $@ $* .adoc
chapter-%.html : %.adoc ${PVE_COMMON_DOC_SOURCES }
${ ASCIIDOC_PVE } compile-chapter -o $@ $* .adoc
%.1 : %.adoc %.1-synopsis .adoc ${PVE_COMMON_DOC_SOURCES }
${ ASCIIDOC_PVE } compile-man -o $@ $* .adoc
test -n " $$ {NOVIEW} " || man -l $@
%.1.html : %.adoc %.1-synopsis .adoc ${PVE_COMMON_DOC_SOURCES }
${ ASCIIDOC_PVE } compile-man-html -o $@ $* .adoc
%.8 : %.adoc %.8-synopsis .adoc ${PVE_COMMON_DOC_SOURCES }
${ ASCIIDOC_PVE } compile-man -o $@ $* .adoc
test -n " $$ {NOVIEW} " || man -l $@
%.8.html : %.adoc %.8-synopsis .adoc ${PVE_COMMON_DOC_SOURCES }
${ ASCIIDOC_PVE } compile-man-html -o $@ $* .adoc
%.5 : %.adoc %.5-opts .adoc ${PVE_COMMON_DOC_SOURCES }
${ ASCIIDOC_PVE } compile-man -o $@ $* .adoc
test -n " $$ {NOVIEW} " || man -l $@
%.5.html : %.adoc %.5-opts .adoc ${PVE_COMMON_DOC_SOURCES }
${ ASCIIDOC_PVE } compile-man-html -o $@ $* .adoc
%.5-plain.html : %.adoc %.5-opts .adoc ${PVE_COMMON_DOC_SOURCES }
${ ASCIIDOC_PVE } compile-man-wiki -o $@ $* .adoc
.PHONY : cleanup -docgen
cleanup-docgen :
2016-11-08 08:46:43 +03:00
rm -f *.xml.tmp *.1 *.5 *.8 *.adoc docinfo.xml