From 87b50c45f54979eaa905a32c73ba331ff335281c Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 2 Mar 2014 11:53:21 +0100 Subject: build and package documentation smoothly --- doc/OMakefile | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 doc/OMakefile (limited to 'doc') diff --git a/doc/OMakefile b/doc/OMakefile new file mode 100644 index 0000000..3de13bc --- /dev/null +++ b/doc/OMakefile @@ -0,0 +1,41 @@ +## Subdirectory omake makefile for the reStructuredText module +## for Context. See the root OMakefile for details. +## https://bitbucket.org/phg/context-rst/src/tip/OMakefile +.PHONY: manual clean nuke + +name = manual + +manual_src = $(name).tex +manual_rst = documentation.rst +manual_pdf = $(name).pdf +manual_tmp = doc.tex +manual_junk[] = $(addprefix $(name), .tuc .log) +manual_spam = $(name)-termout.log + +## The manual is itself written in reStructuredText. This leads to +## a precarious situation: the module is required to be present in +## order for the manual to be built. We’re going to have to find +## some solution for smooth bootstrapping, but at the moment that’s +## a low priority goal. +$(manual_pdf): :effects: $(manual_tmp) $(manual_junk) $(manual_spam) + rm -rf -- $(manual_spam) + echo ":: creating $(manual_tmp) from $(manual_rst)" + mtxrun --script rst \ + --if=$(file $(manual_rst)) \ + --of=$(manual_tmp) \ + &> $(manual_spam) + echo ":: creating $@ from $(manual_src) and $(manual_tmp)" + context $(file $(manual_src)) &>> $(manual_spam) + +manual: $(manual_pdf) + +clean: + rm -rf -- $(manual_junk) $(manual_tmp) $(manual_spam) + +nuke: clean + rm -rf -- $(manual_pdf) + +## note to self: default targets in subdirectories will +## lead to those targets being built whenever omake is +## invoked without arguments from the root tree as well. +#.DEFAULT: manual -- cgit v1.2.3