Fill content for graphviz, mocodo & plantuml

This commit is contained in:
Glenn Y. Rolland 2021-07-23 15:39:44 +02:00
parent 685f1dd11a
commit 9ec13a0e9f
4 changed files with 111 additions and 17 deletions

0
dot.mk
View file

48
graphviz.mk Normal file
View file

@ -0,0 +1,48 @@
##
## GRAPHVIZ MODULE
##
##
## External variables (API)
##
GRAPHVIZ_SRC_DIR=
GRAPHVIZ_DEST_DIR=
##
## Internal variables
##
## Find .dot graphs
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))
## Find .circo graphs
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_SVG=$(GRAPHVIZ_DOT_SVG) $(GRAPHVIZ_CIRCO_SVG)
##
## Prerequisistes (system packages)
##
GRAPHVIZ_APT_PACKAGES=graphviz
##
## Rules
##
$(GRAPHVIZ_DEST_DIR)/%.dot.svg: $(GRAPHVIZ_SRC_DIR)/%.dot
dot -Tsvg $< > $@
$(GRAPHVIZ_DEST_DIR)/%.circo.svg: $(GRAPHVIZ_SRC_DIR)/%.circo
circo -Tsvg $< > $@
graphviz-dot-svg:
graphviz-circo-svg:
graphviz-svg: graphviz-dot-svg graphviz-circo-svg
graphviz-clean-svg:
graphviz-clean:

View file

@ -1,22 +1,35 @@
##
## MOCODO MODULE
##
## API ##
MOCODO_DIRECTORIES=?. ## External variables (API)
##
MOCODO_OPT=--colors brewer-6 --shapes verdana MOCODO_OPT=--colors brewer-6 --shapes verdana
MOCODO_SRC_DIR=
MOCODO_DEST_DIR=
## INTERNALS ##
MOCODO_MCD_FILES=$(shell find $(IMAGES_DIR) \( -name '*.mcd' ! -name '_*' \)) ## Internal variables
MOCODO_MCD_MLD=$(patsubst $(IMAGES_DIR)/%.mcd,$(BUILD_IMAGES_DIR)/%.mcd.mld,$(MOCODO_MCD_FILES)) ##
MOCODO_MCD_SVG=$(patsubst $(IMAGES_DIR)/%.mcd,$(BUILD_IMAGES_DIR)/%.mcd.svg,$(MOCODO_MCD_FILES)) MOCODO_MCD_FILES=$(shell find $(MOCODO_SRC_DIR) \( -name '*.mcd' ! -name '_*' \))
MOCODO_MCD_PDF=$(patsubst $(IMAGES_DIR)/%.mcd,$(BUILD_IMAGES_DIR)/%.mcd.pdf,$(MOCODO_MCD_FILES)) MOCODO_MCD_MLD=$(patsubst $(MOCODO_SRC_DIR)/%.mcd,$(MOCODO_DEST_DIR)/%.mcd.mld,$(MOCODO_MCD_FILES))
MOCODO_MCD_SVG=$(patsubst $(MOCODO_SRC_DIR)/%.mcd,$(MOCODO_DEST_DIR)/%.mcd.svg,$(MOCODO_MCD_FILES))
MOCODO_MCD_PDF=$(patsubst $(MOCODO_SRC_DIR)/%.mcd,$(MOCODO_DEST_DIR)/%.mcd.pdf,$(MOCODO_MCD_FILES))
MOCODO_MLD_FILES=$(shell find $(IMAGES_DIR) \( -name '*.mld' ! -name '_*' \)) $(MOCODO_MCD_MLD) MOCODO_MLD_FILES=$(shell find $(MOCODO_SRC_DIR) \( -name '*.mld' ! -name '_*' \)) $(MOCODO_MCD_MLD)
MOCODO_MLD_SVG=$(patsubst $(IMAGES_DIR)/%.mld,$(BUILD_IMAGES_DIR)/%.mld.svg,$(MOCODO_MLD_FILES)) MOCODO_MLD_SVG=$(patsubst $(MOCODO_SRC_DIR)/%.mld,$(MOCODO_DEST_DIR)/%.mld.svg,$(MOCODO_MLD_FILES))
MOCODO_MLD_PDF=$(patsubst $(IMAGES_DIR)/%.mld,$(BUILD_IMAGES_DIR)/%.mld.pdf,$(MOCODO_MLD_FILES)) MOCODO_MLD_PDF=$(patsubst $(MOCODO_SRC_DIR)/%.mld,$(MOCODO_DEST_DIR)/%.mld.pdf,$(MOCODO_MLD_FILES))
##
## Prerequisistes (system packages)
##
MOCODO_APT_PACKAGES=ghostscript librsvg2-bin MOCODO_APT_PACKAGES=ghostscript librsvg2-bin
%.mcd.mld: %.mcd ##
## Rules
##
$(MOCODO_DEST_DIR)/%.mcd.mld: $(MOCODO_SRC_DIR)/%.mcd
tmp=$$(mktemp -d) \ tmp=$$(mktemp -d) \
&& pipenv run mocodo \ && pipenv run mocodo \
$(MOCODO_OPT) \ $(MOCODO_OPT) \
@ -28,7 +41,7 @@ MOCODO_APT_PACKAGES=ghostscript librsvg2-bin
&& rm -fr $${tmp} \ && rm -fr $${tmp} \
&& touch --reference $< $@ && touch --reference $< $@
%.mcd.svg: %.mcd $(MOCODO_DEST_DIR)/%.mcd.svg: $(MOCODO_SRC_DIR)/%.mcd
tmp=$$(mktemp -d) \ tmp=$$(mktemp -d) \
&& pipenv run mocodo \ && pipenv run mocodo \
$(MOCODO_OPT) \ $(MOCODO_OPT) \
@ -40,7 +53,7 @@ MOCODO_APT_PACKAGES=ghostscript librsvg2-bin
&& rm -fr $${tmp} \ && rm -fr $${tmp} \
&& touch --reference $< $@ && touch --reference $< $@
%.mld.svg: %.mld $(MOCODO_DEST_DIR)/%.mld.svg: $(MOCODO_SRC_DIR)/%.mld
tmp=$$(mktemp -d) \ tmp=$$(mktemp -d) \
&& pipenv run mocodo \ && pipenv run mocodo \
$(MOCODO_OPT) \ $(MOCODO_OPT) \
@ -50,15 +63,14 @@ MOCODO_APT_PACKAGES=ghostscript librsvg2-bin
&& rm -fr $${tmp} \ && rm -fr $${tmp} \
&& touch --reference $< $@ && touch --reference $< $@
%.mld.pdf: %.mld.svg $(MOCODO_DEST_DIR)/%.mld.pdf: $(MOCODO_SRC_DIR)/%.mld.svg
# rsvg-convert -f pdf $< > $@ # rsvg-convert -f pdf $< > $@
rsvg-convert -f ps $< | gs -sDEVICE=pdfwrite -sOutputFile=$@ -f - rsvg-convert -f ps $< | gs -sDEVICE=pdfwrite -sOutputFile=$@ -f -
%.mcd.pdf: %.mcd.svg $(MOCODO_DEST_DIR)/%.mcd.pdf: $(MOCODO_SRC_DIR)/%.mcd.svg
# rsvg-convert -f pdf $< > $@ # rsvg-convert -f pdf $< > $@
rsvg-convert -f ps $< | gs -sDEVICE=pdfwrite -sOutputFile=$@ -f - rsvg-convert -f ps $< | gs -sDEVICE=pdfwrite -sOutputFile=$@ -f -
mocodo-mcd-mld: $(MOCODO_MCD_MLD) mocodo-mcd-mld: $(MOCODO_MCD_MLD)
mocodo-mcd-svg: $(MOCODO_MCD_SVG) mocodo-mcd-svg: $(MOCODO_MCD_SVG)

View file

@ -0,0 +1,34 @@
##
## PLANTUML MODULE
##
##
## External variables (API)
##
PLANTUML_SRC_DIR=
PLANTUML_DEST_DIR=
##
## Internal variables
##
## 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))
##
## Rules
##
$(PLANTUML_DEST_DIR)/%.uml.svg: $(PLANTUML_SRC_DIR)/%.uml
plantuml -pipe -tsvg < $< > $@
plantuml-uml-svg:
plantuml-svg:
plantuml-clean-svg:
plantuml-clean: