From da68145fdf4dc1bfa8fd8275d09599e0cf250267 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 3 Jan 2021 11:50:48 +0100 Subject: Add graphviz setup Signed-off-by: Matthias Beyer --- doc/paper/Makefile | 16 +++++++++++++++- doc/paper/shell.nix | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3