2021-07-23 13:39:44 +00:00
|
|
|
##
|
|
|
|
## PLANTUML MODULE
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
## External variables (API)
|
|
|
|
##
|
2024-01-05 18:24:35 +00:00
|
|
|
PLANTUML_SUFFIX ?= uml
|
2023-12-18 16:25:07 +00:00
|
|
|
PLANTUML_SRC_DIR ?=
|
|
|
|
PLANTUML_DEST_DIR ?=
|
2021-07-23 13:39:44 +00:00
|
|
|
|
|
|
|
##
|
2024-01-05 18:24:35 +00:00
|
|
|
## Internal variables (lazy recursive evaluation)
|
2021-07-23 13:39:44 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
## Find .uml graphs
|
2024-01-05 18:24:35 +00:00
|
|
|
PLANTUML_UML = $(shell find $(PLANTUML_SRC_DIR) \( -name '*.uml' ! -name '_*' \))
|
|
|
|
PLANTUML_UML_PNG = $(patsubst $(PLANTUML_SRC_DIR)/%.uml,$(PLANTUML_DEST_DIR)/%.uml.png,$(PLANTUML_UML))
|
|
|
|
PLANTUML_UML_SVG = $(patsubst $(PLANTUML_SRC_DIR)/%.uml,$(PLANTUML_DEST_DIR)/%.uml.svg,$(PLANTUML_UML))
|
|
|
|
PLANTUML_UML_PDF = $(patsubst $(PLANTUML_SRC_DIR)/%.uml,$(PLANTUML_DEST_DIR)/%.uml.pdf,$(PLANTUML_UML))
|
2021-07-23 13:39:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
##
|
|
|
|
## Rules
|
|
|
|
##
|
|
|
|
|
2023-12-18 16:25:07 +00:00
|
|
|
$(PLANTUML_DEST_DIR):
|
|
|
|
mkdir -p $(PLANTUML_DEST_DIR)
|
2021-07-23 13:39:44 +00:00
|
|
|
|
2024-01-05 18:24:35 +00:00
|
|
|
$(PLANTUML_DEST_DIR)/%.uml.png: $(PLANTUML_SRC_DIR)/%.uml | $(PLANTUML_DEST_DIR)
|
|
|
|
podman run -i plantuml/plantuml plantuml -pipe -tpng < $< > $@
|
|
|
|
|
2023-12-18 16:25:07 +00:00
|
|
|
$(PLANTUML_DEST_DIR)/%.uml.svg: $(PLANTUML_SRC_DIR)/%.uml | $(PLANTUML_DEST_DIR)
|
2024-01-05 18:24:35 +00:00
|
|
|
podman run -i plantuml/plantuml plantuml -pipe -tsvg < $< > $@
|
2021-07-23 13:39:44 +00:00
|
|
|
|
2024-01-05 20:41:37 +00:00
|
|
|
$(PLANTUML_DEST_DIR)/%.uml.pdf: $(PLANTUML_DEST_DIR)/%.uml.svg | $(PLANTUML_DEST_DIR)
|
2024-01-05 18:24:35 +00:00
|
|
|
#podman run -i plantuml/plantuml plantuml -pipe -tpdf < $< > $@
|
|
|
|
rsvg-convert -f pdf -o $@ $<
|
2021-07-23 13:39:44 +00:00
|
|
|
|
2023-12-18 16:25:07 +00:00
|
|
|
.PHONY: plantuml-uml-svg
|
|
|
|
plantuml-uml-svg: $(PLANTUML_UML_SVG)
|
|
|
|
|
2024-01-05 18:24:35 +00:00
|
|
|
.PHONY: plantuml-uml-png
|
|
|
|
plantuml-uml-png: $(PLANTUML_UML_PNG)
|
|
|
|
|
2023-12-18 16:25:07 +00:00
|
|
|
.PHONY: plantuml-uml-pdf
|
|
|
|
plantuml-uml-pdf: $(PLANTUML_UML_PDF)
|
|
|
|
|
|
|
|
.PHONY: plantuml-svg
|
|
|
|
plantuml-svg: plantuml-uml-svg
|
|
|
|
|
2024-01-05 18:24:35 +00:00
|
|
|
.PHONY: plantuml-png
|
|
|
|
plantuml-png: plantuml-uml-png
|
|
|
|
|
2023-12-18 16:25:07 +00:00
|
|
|
.PHONY: plantuml-pdf
|
|
|
|
plantuml-pdf: plantuml-uml-pdf
|
|
|
|
|
|
|
|
.PHONY: plantuml-clean-svg
|
2021-07-23 13:39:44 +00:00
|
|
|
plantuml-clean-svg:
|
2023-12-18 16:25:07 +00:00
|
|
|
rm -f $(PLANTUML_UML_SVG)
|
|
|
|
|
2024-01-05 18:24:35 +00:00
|
|
|
.PHONY: plantuml-clean-png
|
|
|
|
plantuml-clean-png:
|
|
|
|
rm -f $(PLANTUML_UML_PNG)
|
|
|
|
|
2023-12-18 16:25:07 +00:00
|
|
|
.PHONY: plantuml-clean-pdf
|
|
|
|
plantuml-clean-pdf:
|
|
|
|
rm -f $(PLANTUML_UML_PDF)
|
|
|
|
|
|
|
|
.PHONY: plantuml-clean
|
|
|
|
plantuml-clean: plantuml-clean-pdf plantuml-clean-svg
|
|
|
|
|
|
|
|
.PHONY: plantuml-info
|
|
|
|
plantuml-info:
|
|
|
|
@echo "PLANTUML_DEST_DIR: $(PLANTUML_DEST_DIR)"
|
|
|
|
@echo "PLANTUML_SRC_DIR: $(PLANTUML_SRC_DIR)"
|
|
|
|
@echo "--"
|
|
|
|
@echo "PLANTUML_UML: $(PLANTUML_UML)"
|
|
|
|
@echo "PLANTUML_UML_PDF: $(PLANTUML_UML_PDF)"
|
|
|
|
@echo "PLANTUML_UML_SVG: $(PLANTUML_UML_SVG)"
|
2021-07-23 13:39:44 +00:00
|
|
|
|
2024-01-05 18:24:35 +00:00
|
|
|
.SUFFIXES:
|
2024-01-05 20:41:37 +00:00
|
|
|
|