feature: Add ORA -> PNG support in Makefile

This commit is contained in:
Glenn Y. Rolland 2021-04-10 12:53:44 +02:00
parent 0a1059fe0d
commit 3e612dedbd

View file

@ -34,7 +34,14 @@ DOCS_IMAGES_DOT_SVG=$(patsubst $(IMAGES_DIR)/%.dot,$(BUILD_IMAGES_DIR)/%.dot.svg
## Find .circo graphs ## Find .circo graphs
DOCS_IMAGES_CIRCO=$(shell find $(IMAGES_DIR) \( -name '*.circo' ! -name '_*' \)) DOCS_IMAGES_CIRCO=$(shell find $(IMAGES_DIR) \( -name '*.circo' ! -name '_*' \))
DOCS_IMAGES_CIRCO_SVG=$(patsubst $(IMAGES_DIR)/%.circo,$(BUILD_IMAGES_DIR)/%.circo.svg,$(DOCS_IMAGES_CIRCO)) DOCS_IMAGES_CIRCO_SVG=$(patsubst $(IMAGES_DIR)/%.circo,$(BUILD_IMAGES_DIR)/%.circo.svg,$(DOCS_IMAGES_CIRCO))
## Find .ora images
DOCS_IMAGES_ORA=$(shell find $(IMAGES_DIR) \( -name '*.ora' ! -name '_*' \))
DOCS_IMAGES_ORA_PNG=$(patsubst $(IMAGES_DIR)/%.ora,$(BUILD_IMAGES_DIR)/%.ora.png,$(DOCS_IMAGES_ORA))
## Merge all lists
DOCS_IMAGES_SVG=$(DOCS_IMAGES_DOT_SVG) $(DOCS_IMAGES_CIRCO_SVG) $(DOCS_IMAGES_UML_SVG) DOCS_IMAGES_SVG=$(DOCS_IMAGES_DOT_SVG) $(DOCS_IMAGES_CIRCO_SVG) $(DOCS_IMAGES_UML_SVG)
DOCS_IMAGES_PNG=$(DOCS_IMAGES_ORA_PNG)
all: help all: help
@ -53,13 +60,21 @@ prepare-docs: ## install prerequisites for static docs site only
.PHONY: prepare prepare-slides prepare-docs .PHONY: prepare prepare-slides prepare-docs
images: $(DOCS_IMAGES_SVG) ## build images images: $(DOCS_IMAGES_SVG) $(DOCS_IMAGES_PNG) ## build images
@echo Uml: $(DOCS_IMAGES_UML) @echo "Source:"
@echo Dot: $(DOCS_IMAGES_DOT) @echo " ora: $(DOCS_IMAGES_ORA)"
@echo Circo: $(DOCS_IMAGES_CIRCO) @echo " uml: $(DOCS_IMAGES_UML)"
@echo Built: $(DOCS_IMAGES_SVG) @echo " dot: $(DOCS_IMAGES_DOT)"
@echo " circo: $(DOCS_IMAGES_CIRCO)"
@echo "Built: $(DOCS_IMAGES_SVG) $(DOCS_IMAGES_PNG)"
.PHONY: images .PHONY: images
%.ora.png: %.ora
TMPDIR="$$(mktemp -d)" \
&& unzip -q $< -d "$$TMPDIR" mergedimage.png \
&& touch "$$TMPDIR/mergedimage.png" \
&& mv "$$TMPDIR/mergedimage.png" $@
%.uml.svg: %.uml %.uml.svg: %.uml
plantuml -pipe -tsvg < $< > $@ plantuml -pipe -tsvg < $< > $@