2021-12-15 02:30:58 +01:00
|
|
|
# Load the configure script variables
|
|
|
|
-include ../configure.mk
|
|
|
|
|
|
|
|
##
|
|
|
|
## Options
|
|
|
|
##
|
|
|
|
|
|
|
|
# Pandoc flags
|
|
|
|
FLAGS = --filter pandoc-crossref --citeproc --toc --number-sections
|
|
|
|
PDF_FLAGS = --pdf-engine=xelatex
|
2021-12-15 02:31:01 +01:00
|
|
|
HTML_FLAGS = --standalone --katex$(KATEX_URL) --lua-filter filters/add-anchors.lua
|
2021-12-15 02:30:58 +01:00
|
|
|
|
|
|
|
# Rebuild everything if the makefile changed
|
|
|
|
.EXTRA_PREREQS += Makefile
|
|
|
|
|
|
|
|
# User manual
|
|
|
|
DOCDIR = build/doc
|
|
|
|
SECTIONS = $(wildcard [0-9].*.md)
|
|
|
|
MANUALS = $(addprefix $(DOCDIR)/,manual.html manual.pdf res)
|
|
|
|
|
|
|
|
##
|
|
|
|
## Targets
|
|
|
|
##
|
|
|
|
|
|
|
|
.PHONY: all clean
|
|
|
|
|
|
|
|
all: $(MANUALS)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -r build
|
|
|
|
|
|
|
|
$(DOCDIR)/manual.html: $(SECTIONS) res | $(DOCDIR)
|
|
|
|
pandoc $(FLAGS) $(HTML_FLAGS) $(filter %.md, $^) -o $@
|
|
|
|
|
|
|
|
$(DOCDIR)/res: res | $(DOCDIR)
|
|
|
|
cp -r $^ $@
|
|
|
|
|
|
|
|
$(DOCDIR)/manual.pdf: $(SECTIONS) | $(DOCDIR)
|
|
|
|
pandoc $(FLAGS) $(PDF_FLAGS) $^ -o $@
|
|
|
|
|
|
|
|
# Create directories
|
|
|
|
$(DOCDIR):
|
|
|
|
mkdir -p $@
|