feat: add missing png and pdf generation to graphviz

This commit is contained in:
Glenn Y. Rolland 2024-01-05 22:36:04 +01:00
parent a9a2a53645
commit 8cad34ecf6

View file

@ -1,3 +1,8 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 Glenn Y. Rolland <glenux@glenux.net>
# Copyright © 2023 Glenn Y. Rolland <glenux@glenux.net>
## ##
## GRAPHVIZ MODULE ## GRAPHVIZ MODULE
## ##
@ -15,11 +20,18 @@ GRAPHVIZ_DEST_DIR ?=
## 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))
GRAPHVIZ_DOT_PNG := $(patsubst $(GRAPHVIZ_SRC_DIR)/%.dot,$(GRAPHVIZ_DEST_DIR)/%.dot.png,$(GRAPHVIZ_DOT))
GRAPHVIZ_DOT_PDF := $(patsubst $(GRAPHVIZ_SRC_DIR)/%.dot,$(GRAPHVIZ_DEST_DIR)/%.dot.pdf,$(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_CIRCO_PNG := $(patsubst $(GRAPHVIZ_SRC_DIR)/%.circo,$(GRAPHVIZ_DEST_DIR)/%.circo.png,$(GRAPHVIZ_CIRCO))
GRAPHVIZ_CIRCO_PDF := $(patsubst $(GRAPHVIZ_SRC_DIR)/%.circo,$(GRAPHVIZ_DEST_DIR)/%.circo.pdf,$(GRAPHVIZ_CIRCO))
GRAPHVIZ_SVG := $(GRAPHVIZ_DOT_SVG) $(GRAPHVIZ_CIRCO_SVG) GRAPHVIZ_SVG := $(GRAPHVIZ_DOT_SVG) $(GRAPHVIZ_CIRCO_SVG)
GRAPHVIZ_PNG := $(GRAPHVIZ_DOT_PNG) $(GRAPHVIZ_CIRCO_PNG)
GRAPHVIZ_PDF := $(GRAPHVIZ_DOT_PDF) $(GRAPHVIZ_CIRCO_PDF)
## ##
## Prerequisistes (system packages) ## Prerequisistes (system packages)
@ -40,21 +52,38 @@ $(GRAPHVIZ_DEST_DIR)/%.circo.svg: $(GRAPHVIZ_SRC_DIR)/%.circo | $(GRAPHVIZ_DEST_
circo -Tsvg $< > $@ circo -Tsvg $< > $@
$(GRAPHVIZ_SVG): | $(GRAPHVIZ_DEST_DIR) $(GRAPHVIZ_SVG): | $(GRAPHVIZ_DEST_DIR)
mkdir -p $(GRAPHVIZ_DEST_DIR)
$(GRAPHVIZ_PDF): | $(GRAPHVIZ_DEST_DIR)
$(GRAPHVIZ_PNG): | $(GRAPHVIZ_DEST_DIR)
.PHONY: graphviz-build-dot-svg
graphviz-build-dot-svg: $(GRAPHVIZ_DOT_SVG) graphviz-build-dot-svg: $(GRAPHVIZ_DOT_SVG)
.PHONY: graphviz-build-circo-svg
graphviz-build-circo-svg: $(GRAPHVIZ_CIRCO_SVG) graphviz-build-circo-svg: $(GRAPHVIZ_CIRCO_SVG)
.PHONY: graphviz-build-svg
graphviz-build-svg: graphviz-build-dot-svg graphviz-build-circo-svg graphviz-build-svg: graphviz-build-dot-svg graphviz-build-circo-svg
.PHONY: graphviz-buil
graphviz-build: graphviz-build-svg graphviz-build: graphviz-build-svg
# Clean # Clean
# #
.PHONY: graphviz-clean-svg
graphviz-clean-svg: graphviz-clean-svg:
rm -f $(GRAPHVIZ_SVG) rm -f $(GRAPHVIZ_SVG)
graphviz-clean: graphviz-clean-svg .PHONY: graphviz-clean-pdf
graphviz-clean-pdf:
rm -f $(GRAPHVIZ_PDF)
.PHONY: graphviz-clean-png
graphviz-clean-png:
rm -f $(GRAPHVIZ_PNG)
.PHONY: graphviz-clean
graphviz-clean: graphviz-clean-svg graphviz-clean-png graphviz-clean-pdf