Improve graphviz

This commit is contained in:
Glenn Y. Rolland 2021-07-23 16:07:42 +02:00
parent d70b96a071
commit d5627404e1

View file

@ -3,28 +3,28 @@
## ##
## ##
## External variables (API) ## External variables influencing build process (API)
## ##
GRAPHVIZ_SRC_DIR= GRAPHVIZ_SRC_DIR ?=
GRAPHVIZ_DEST_DIR= GRAPHVIZ_DEST_DIR ?=
## ##
## Internal variables ## Internal variables
## ##
## Find .dot graphs ## Find .dot graphs
GRAPHVIZ_DOT=$(shell find $(GRAPHVIZ_SRC_DIR) \( -name '*.dot' ! -name '_*' \)) GRAPHVIZ_DOT := $(shell find $(GRAPHVIZ_SRC_DIR) \( -name '*.dot' ! -name '_*' \))
GRAPHVIZ_DOT_SVG=$(patsubst $(GRAPHVIZ_SRC_DIR)/%.dot,$(GRAPHVIZ_DEST_DIR)/%.dot.svg,$(GRAPHVIZ_DOT)) GRAPHVIZ_DOT_SVG := $(patsubst $(GRAPHVIZ_SRC_DIR)/%.dot,$(GRAPHVIZ_DEST_DIR)/%.dot.svg,$(GRAPHVIZ_DOT))
## Find .circo graphs ## Find .circo graphs
GRAPHVIZ_CIRCO=$(shell find $(GRAPHVIZ_SRC_DIR) \( -name '*.circo' ! -name '_*' \)) GRAPHVIZ_CIRCO := $(shell find $(GRAPHVIZ_SRC_DIR) \( -name '*.circo' ! -name '_*' \))
GRAPHVIZ_CIRCO_SVG=$(patsubst $(GRAPHVIZ_SRC_DIR)/%.circo,$(GRAPHVIZ_DEST_DIR)/%.circo.svg,$(GRAPHVIZ_CIRCO)) GRAPHVIZ_CIRCO_SVG := $(patsubst $(GRAPHVIZ_SRC_DIR)/%.circo,$(GRAPHVIZ_DEST_DIR)/%.circo.svg,$(GRAPHVIZ_CIRCO))
GRAPHVIZ_SVG=$(GRAPHVIZ_DOT_SVG) $(GRAPHVIZ_CIRCO_SVG) GRAPHVIZ_SVG := $(GRAPHVIZ_DOT_SVG) $(GRAPHVIZ_CIRCO_SVG)
## ##
## Prerequisistes (system packages) ## Prerequisistes (system packages)
## ##
GRAPHVIZ_APT_PACKAGES=graphviz GRAPHVIZ_APT_PACKAGES := graphviz
## ##
## Rules ## Rules
@ -36,13 +36,22 @@ $(GRAPHVIZ_DEST_DIR)/%.dot.svg: $(GRAPHVIZ_SRC_DIR)/%.dot
$(GRAPHVIZ_DEST_DIR)/%.circo.svg: $(GRAPHVIZ_SRC_DIR)/%.circo $(GRAPHVIZ_DEST_DIR)/%.circo.svg: $(GRAPHVIZ_SRC_DIR)/%.circo
circo -Tsvg $< > $@ circo -Tsvg $< > $@
graphviz-dot-svg: $(GRAPHVIZ_SVG): | $(GRAPHVIZ_DEST_DIR)
mkdir -p $(GRAPHVIZ_DEST_DIR)
graphviz-circo-svg: graphviz-build-dot-svg: $(GRAPHVIZ_DOT_SVG)
graphviz-svg: graphviz-dot-svg graphviz-circo-svg graphviz-build-circo-svg: $(GRAPHVIZ_CIRCO_SVG)
graphviz-build-svg: graphviz-build-dot-svg graphviz-build-circo-svg
graphviz-build: graphviz-build-svg
# Clean
#
graphviz-clean-svg: graphviz-clean-svg:
rm -f $(GRAPHVIZ_SVG)
graphviz-clean: graphviz-clean: graphviz-clean-svg