summaryrefslogtreecommitdiff
path: root/doc/doc.mk
blob: d1e4a1be293bde49385f9c2e755fb4e1129c65f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
DOC_BUILD_DIR := $(BUILD_DIR)/doc
DOCS := documentation
DOCUMENTS := $(DOCS:%=$(DOC_BUILD_DIR)/%.pdf)

DIAGRAMS_BUILD_DIR := $(DOC_BUILD_DIR)/diagrams
DIAGRAMS := device-semver-user device-semver-developer
IMAGES := $(DIAGRAMS:%=$(DIAGRAMS_BUILD_DIR)/%.pdf)

.PHONY: doc
doc: $(DOCUMENTS)

$(DOC_BUILD_DIR)/%.pdf: doc/%.tex $(IMAGES)
	mkdir -p $(dir $@)
	pdflatex -halt-on-error -output-directory $(DOC_BUILD_DIR) $<
	pdflatex -halt-on-error -output-directory $(DOC_BUILD_DIR) $<

$(DIAGRAMS_BUILD_DIR)/%.pdf: doc/diagrams/%.svg
	mkdir -p $(dir $@)
	inkscape -o $@ $<