summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-01-03 11:50:48 +0100
committerMatthias Beyer <mail@beyermatthias.de>2021-01-03 11:50:48 +0100
commitda68145fdf4dc1bfa8fd8275d09599e0cf250267 (patch)
treec8851c5000c6aab35382a5551a8242af2e2fa676
parent2c8cfc55840a142482c0ade75a1ba7e883961ea1 (diff)
Add graphviz setup
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--doc/paper/Makefile16
-rw-r--r--doc/paper/shell.nix1
2 files changed, 16 insertions, 1 deletions
diff --git a/doc/paper/Makefile b/doc/paper/Makefile
index d94b535..70e9c70 100644
--- a/doc/paper/Makefile
+++ b/doc/paper/Makefile
@@ -35,6 +35,9 @@ SVGBOBC=$(shell which svgbob)
# Inkscape path to compile svg to tex
INKSCAPEC=$(shell which inkscape)
+# Graphviz compiler
+GRAPHVIZC=$(shell which dot)
+
##
## Flags
##
@@ -65,6 +68,9 @@ RM_FLAGS=-f
# Inkscape flags
INKSCAPE_FLAGS=-D -o
+# Graphviz flags
+GRAPHVIZ_FLAGS=-Tpng
+
##
## Standard commands
@@ -81,6 +87,7 @@ export RM
SVGBOB=$(SVGBOBC)
INKSCAPE=$(INKSCAPEC) $(INKSCAPE_FLAGS)
+GRAPHVIZ=$(GRAPHVIZC) $(GRAPHVIZ_FLAGS)
##
## Files
@@ -118,6 +125,9 @@ export MAKELOG
SVGBOB_ALL_SOURCES=$(shell find gen -name *.bob -type f)
SVGBOB_FILES=$(patsubst gen/%.bob,%,$(SVGBOB_ALL_SOURCES))
+# All Graphviz files
+GRAPHVIZ_ALL_SOURCES=$(shell find gen -name *.dot -type f)
+GRAPHVIZ_FILES=$(patsubst gen/%.dot,%,$(GRAPHVIZ_ALL_SOURCES))
##
@@ -175,7 +185,7 @@ all: $(PDF_FILE)
#
test one_time: $(AUX_FILE)
-gen_tex: $(SVGBOB_FILES)
+gen_tex: $(SVGBOB_FILES) $(GRAPHVIZ_FILES)
# Generate pictures with svgbob
$(SVGBOB_FILES): %: $(SVGBOB_ALL_SOURCES)
@@ -184,6 +194,10 @@ $(SVGBOB_FILES): %: $(SVGBOB_ALL_SOURCES)
@$(ECHO) "\t[INKSCAPE]\t$@.svg\t$(GEN_DIR)/$@.png"
@$(INKSCAPEC) $(INKSCAPE_FLAGS) $(GEN_DIR)/$@.png $(GEN_DIR)/$@.svg 2> /dev/null
+$(GRAPHVIZ_FILES): %: $(GRAPHVIZ_ALL_SOURCES)
+ @$(ECHO) "\t[GRAPHVIZ]\t$@\t$(GEN_DIR)/$@.png"
+ @$(GRAPHVIZ) $(GEN_DIR)/$@.dot -o $(GEN_DIR)/$@.png
+
##
## Generation tasks
diff --git a/doc/paper/shell.nix b/doc/paper/shell.nix
index 1bbdd82..86bcbba 100644
--- a/doc/paper/shell.nix
+++ b/doc/paper/shell.nix
@@ -7,6 +7,7 @@ pkgs.mkShell rec {
buildInputs = [
pkgs.svgbob
pkgs.inkscape
+ pkgs.graphviz
(texlive.combine {
inherit (texlive)