fix: variable evaluation must be done in this order
This commit is contained in:
parent
5c519903f0
commit
9feef7a57e
1 changed files with 25 additions and 9 deletions
34
plantuml.mk
34
plantuml.mk
|
@ -5,17 +5,19 @@
|
|||
##
|
||||
## External variables (API)
|
||||
##
|
||||
PLANTUML_SUFFIX ?= uml
|
||||
PLANTUML_SRC_DIR ?=
|
||||
PLANTUML_DEST_DIR ?=
|
||||
|
||||
##
|
||||
## Internal variables
|
||||
## Internal variables (lazy recursive evaluation)
|
||||
##
|
||||
|
||||
## Find .uml graphs
|
||||
PLANTUML_UML := $(shell find $(PLANTUML_SRC_DIR) \( -name '*.uml' ! -name '_*' \))
|
||||
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))
|
||||
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))
|
||||
|
||||
|
||||
##
|
||||
|
@ -25,21 +27,31 @@ PLANTUML_UML_PDF := $(patsubst $(PLANTUML_SRC_DIR)/%.uml,$(PLANTUML_DEST_DIR)/%.
|
|||
$(PLANTUML_DEST_DIR):
|
||||
mkdir -p $(PLANTUML_DEST_DIR)
|
||||
|
||||
$(PLANTUML_DEST_DIR)/%.uml.svg: $(PLANTUML_SRC_DIR)/%.uml | $(PLANTUML_DEST_DIR)
|
||||
plantuml -pipe -tsvg < $< > $@
|
||||
$(PLANTUML_DEST_DIR)/%.uml.png: $(PLANTUML_SRC_DIR)/%.uml | $(PLANTUML_DEST_DIR)
|
||||
podman run -i plantuml/plantuml plantuml -pipe -tpng < $< > $@
|
||||
|
||||
$(PLANTUML_DEST_DIR)/%.uml.pdf: $(PLANTUML_SRC_DIR)/%.uml | $(PLANTUML_DEST_DIR)
|
||||
plantuml -pipe -tpdf < $< > $@
|
||||
$(PLANTUML_DEST_DIR)/%.uml.svg: $(PLANTUML_SRC_DIR)/%.uml | $(PLANTUML_DEST_DIR)
|
||||
podman run -i plantuml/plantuml plantuml -pipe -tsvg < $< > $@
|
||||
|
||||
$(PLANTUML_DEST_DIR)/%.uml.pdf: $(PLANTUML_SRC_DIR)/%.uml.svg | $(PLANTUML_DEST_DIR)
|
||||
#podman run -i plantuml/plantuml plantuml -pipe -tpdf < $< > $@
|
||||
rsvg-convert -f pdf -o $@ $<
|
||||
|
||||
.PHONY: plantuml-uml-svg
|
||||
plantuml-uml-svg: $(PLANTUML_UML_SVG)
|
||||
|
||||
.PHONY: plantuml-uml-png
|
||||
plantuml-uml-png: $(PLANTUML_UML_PNG)
|
||||
|
||||
.PHONY: plantuml-uml-pdf
|
||||
plantuml-uml-pdf: $(PLANTUML_UML_PDF)
|
||||
|
||||
.PHONY: plantuml-svg
|
||||
plantuml-svg: plantuml-uml-svg
|
||||
|
||||
.PHONY: plantuml-png
|
||||
plantuml-png: plantuml-uml-png
|
||||
|
||||
.PHONY: plantuml-pdf
|
||||
plantuml-pdf: plantuml-uml-pdf
|
||||
|
||||
|
@ -47,6 +59,10 @@ plantuml-pdf: plantuml-uml-pdf
|
|||
plantuml-clean-svg:
|
||||
rm -f $(PLANTUML_UML_SVG)
|
||||
|
||||
.PHONY: plantuml-clean-png
|
||||
plantuml-clean-png:
|
||||
rm -f $(PLANTUML_UML_PNG)
|
||||
|
||||
.PHONY: plantuml-clean-pdf
|
||||
plantuml-clean-pdf:
|
||||
rm -f $(PLANTUML_UML_PDF)
|
||||
|
@ -63,4 +79,4 @@ plantuml-info:
|
|||
@echo "PLANTUML_UML_PDF: $(PLANTUML_UML_PDF)"
|
||||
@echo "PLANTUML_UML_SVG: $(PLANTUML_UML_SVG)"
|
||||
|
||||
|
||||
.SUFFIXES:
|
||||
|
|
Loading…
Reference in a new issue