1 # $Id: rst2htm.mk,v 1.10 2015/09/08 22:17:46 sjg Exp $
3 # @(#) Copyright (c) 2009, Simon J. Gerraty
5 # This file is provided in the hope that it will
6 # be of use. There is absolutely NO WARRANTY.
7 # Permission to copy, redistribute or otherwise
8 # use this file is hereby granted provided that
9 # the above copyright notice and this notice are
12 # Please send copies of changes and bug-fixes to:
16 # convert reStructuredText to HTML, using rst2html.py from
17 # docutils - http://docutils.sourceforge.net/
20 TXTSRCS
!= 'ls' -1t
${.CURDIR
}/*.txt
${.CURDIR
}/*.rst
2>/dev
/null
; echo
23 HTMFILES ?
= ${RSTSRCS
:R
:T
:O
:u
:%=%.htm
}
24 RST2HTML ?
= rst2html.py
27 # the following will run RST2S5 if the target name contains the word 'slides'
28 # otherwise it uses RST2HTML
29 RST2HTM
= ${"${.TARGET:T:M*slides*}":?
${RST2S5}:${RST2HTML}}
30 RST2HTM_SLIDES_FLAGS ?
= ${RST2S5_FLAGS}
31 RST2HTM_DOC_FLAGS ?
= ${RST2HTML_FLAGS}
32 RST2HTM_FLAGS ?
= ${"${.TARGET:T:M*slides*}":?
${RST2HTM_SLIDES_FLAGS}:${RST2HTM_DOC_FLAGS}}
34 RST2PDF_FLAGS ?
= ${"${.TARGET:T:M*slides*}":?
${RST2PDF_SLIDES_FLAGS}:${RST2PDF_DOC_FLAGS}}
36 RST_SUFFIXES ?
= .rst .txt
38 CLEANFILES
+= ${HTMFILES}
42 .SUFFIXES
: ${RST_SUFFIXES} .htm .pdf
44 ${RST_SUFFIXES
:@s@
$s.htm@
}:
45 ${RST2HTM} ${RST2HTM_FLAGS} ${FLAGS.
${.TARGET
}} ${.IMPSRC
} ${.TARGET
}
47 ${RST_SUFFIXES
:@s@
$s.pdf@
}:
48 ${RST2PDF} ${RST2PDF_FLAGS} ${FLAGS.
${.TARGET
}} ${.IMPSRC
} ${.TARGET
}
50 .for s in
${RSTSRCS
:O
:u
}