diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2014-03-02 11:53:21 +0100 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2014-03-02 11:53:21 +0100 |
commit | 87b50c45f54979eaa905a32c73ba331ff335281c (patch) | |
tree | f63b077f9c2ac79d093a5cb6aab4d2ba7943d7f5 /doc/OMakefile | |
parent | bf8136fd24b955cef8904dc7d7a7eac1f3d2d2c3 (diff) | |
download | context-rst-87b50c45f54979eaa905a32c73ba331ff335281c.tar.gz |
build and package documentation smoothly
Diffstat (limited to 'doc/OMakefile')
-rw-r--r-- | doc/OMakefile | 41 |
1 files changed, 41 insertions, 0 deletions
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 |