summaryrefslogtreecommitdiff
path: root/mk/rst2htm.mk
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2013-04-01 14:07:52 +0000
committer <>2013-05-17 14:06:43 +0000
commit986bc2ac05bc4c08c6a0ed30c9e97674932ccfeb (patch)
tree8346daf16e98e93415195acbf99f09cb5326b73b /mk/rst2htm.mk
downloadbmake-tarball-986bc2ac05bc4c08c6a0ed30c9e97674932ccfeb.tar.gz
Imported from /home/lorry/working-area/delta_bmake-tarball/bmake.tar.gz.HEADbmakemaster
Diffstat (limited to 'mk/rst2htm.mk')
-rw-r--r--mk/rst2htm.mk43
1 files changed, 43 insertions, 0 deletions
diff --git a/mk/rst2htm.mk b/mk/rst2htm.mk
new file mode 100644
index 0000000..8bd66da
--- /dev/null
+++ b/mk/rst2htm.mk
@@ -0,0 +1,43 @@
+# $Id: rst2htm.mk,v 1.8 2011/04/03 21:39:25 sjg Exp $
+#
+# @(#) Copyright (c) 2009, Simon J. Gerraty
+#
+# This file is provided in the hope that it will
+# be of use. There is absolutely NO WARRANTY.
+# Permission to copy, redistribute or otherwise
+# use this file is hereby granted provided that
+# the above copyright notice and this notice are
+# left intact.
+#
+# Please send copies of changes and bug-fixes to:
+# sjg@crufty.net
+#
+
+# convert reStructuredText to HTML, using rst2html.py from
+# docutils - http://docutils.sourceforge.net/
+
+.if empty(TXTSRCS)
+TXTSRCS != 'ls' -1t ${.CURDIR}/*.txt ${.CURDIR}/*.rst 2>/dev/null; echo
+.endif
+RSTSRCS ?= ${TXTSRCS}
+HTMFILES ?= ${RSTSRCS:R:T:O:u:%=%.htm}
+RST2HTML ?= rst2html.py
+RST2S5 ?= rst2s5.py
+# the following will run RST2S5 if the target name contains the word 'slides'
+# otherwise it uses RST2HTML
+RST2HTM = ${"${.TARGET:T:M*slides*}":?${RST2S5} ${RST2S5_FLAGS}:${RST2HTML} ${RST2HTML_FLAGS}}
+
+RST_SUFFIXES ?= .rst .txt
+
+CLEANFILES += ${HTMFILES}
+
+html: ${HTMFILES}
+
+.SUFFIXES: ${RST_SUFFIXES} .htm
+
+${RST_SUFFIXES:@s@$s.htm@}:
+ ${RST2HTM} ${.IMPSRC} ${.TARGET}
+
+.for s in ${RSTSRCS:O:u}
+${s:R:T}.htm: $s
+.endfor