2012-11-05 15:17:00 +04:00
# build asciidoc books
i f d e f B U I L D D I R
DEST = -D " $( BUILDDIR) "
e n d i f
i f d e f D E B U G
VERBOSE = --verbose
e n d i f
2014-06-24 14:28:57 +04:00
# avoid common DEBUG for the time being
- i n c l u d e $( HOME ) / . m k i m a g e / p r o f i l e s . m k
2012-10-31 01:21:23 +04:00
PROJECT = mkimage-profiles
2012-11-05 15:17:00 +04:00
TOPLEVEL_DOC = $( PROJECT) .asciidoc
2012-11-05 15:08:59 +04:00
RESOURCE_FILES = /etc/asciidoc
2012-10-31 01:21:23 +04:00
A2X = a2x
2012-11-05 15:17:00 +04:00
FXC = .fop.xconf
L = ru
DEPTH = 3
# common args (and the source file to process) come last
XSLT_ARGS = --stringparam toc.max.depth $( DEPTH)
COMMON_ARGS = -d book -a lang = " $L " $( DEST) $( VERBOSE) $( TOPLEVEL_DOC)
HTML_ARGS = -a data-uri --icons -r $( RESOURCE_FILES) -r . \
--xsltproc-opts= '$(XSLT_ARGS)' $( COMMON_ARGS)
2014-06-24 14:28:57 +04:00
# most convenient deliverables
2016-02-08 20:07:56 +03:00
DOCS_OUT = mkimage-profiles.7 $( PROJECT) .pdf $( PROJECT) .html docbook-xsl.css
2014-06-24 14:28:57 +04:00
2014-08-12 13:13:36 +04:00
# intermediate files
DOCS_TMP = $( PROJECT) .fo $( PROJECT) .xml
2012-11-05 15:17:00 +04:00
.PHONY : all prep chunked xhtml pdf clean
2016-02-08 20:07:56 +03:00
all : man chunked xhtml pdf
2012-11-05 15:17:00 +04:00
2014-06-24 14:28:57 +04:00
# NB: destination defined externally
publish : all
@if [ -n " $( DOCS_PUBLISH) " ] ; then \
rsync -qa $( DOCS_OUT) " $( DOCS_PUBLISH) " ; \
fi
2012-11-05 15:17:00 +04:00
prep :
@if [ -n " $( BUILDDIR) " ] ; then mkdir -p " $( BUILDDIR) " ; fi
2016-02-08 20:07:56 +03:00
man :
@VERSION= " $$ (sed -rn 's/^Version: ([0-9.]+).* $$ /\1/p' \
../.gear/mkimage-profiles.spec) " ; \
sed -e " s,@VERSION@, $$ VERSION,g " \
< mkimage-profiles.7.in \
> mkimage-profiles.7
2012-11-05 15:17:00 +04:00
chunked xhtml : prep
@echo " ** building $@ book "
@$( A2X) -f $@ $( HTML_ARGS)
pdf : prep
@echo " ** building $@ book "
@$( A2X) --xsltproc-opts= ' $( XSLT_ARGS) \
--stringparam title.font.family "DejaVu Sans" \
--stringparam body.font.family "DejaVu Serif" \
--stringparam monospace.font.family "DejaVu Sans Mono" ' \
--fop --fop-opts= '-c $(FXC)' -f pdf $( COMMON_ARGS)
2012-10-31 01:21:23 +04:00
2012-11-05 15:17:00 +04:00
clean :
@echo "** cleaning up"
@if [ -d " $( BUILDDIR) " ] ; then cd " $( BUILDDIR) " ; fi ; \
2021-06-06 13:28:36 +03:00
rm -rf $( DOCS_OUT) $( DOCS_TMP) $( PROJECT) .chunked/