Last active
February 28, 2024 15:50
-
-
Save aquilax/2fe8dddb45d468287ec46fad5b418de2 to your computer and use it in GitHub Desktop.
Generate diagrams
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define variables | |
SRCDIR := . | |
DOTFILES := $(shell find $(SRCDIR) -type f -name '*.dot') | |
PUMLFILES := $(shell find $(SRCDIR) -type f -name '*.puml') | |
MERMAIDFILES := $(shell find $(SRCDIR) -type f -name '*.mmd') | |
PNGFILES := $(DOTFILES:.dot=.png) $(PUMLFILES:.puml=.png) $(MERMAIDFILES:.mmd=.png) | |
DOT := dot | |
PLANTUML := java -jar plantuml-1.2023.4.jar | |
MERMAID := mmdc | |
# Define the default target | |
all: $(PNGFILES) | |
# Define the rule to create PNG files from DOT files | |
%.png: %.dot | |
$(DOT) -Tpng $< -o $@ | |
# Define the rule to create PNG files from PlantUML files | |
%.png: %.puml | |
$(PLANTUML) -tpng $< | |
# Define the rule to create PNG files from Mermaid files | |
%.png: %.mmd | |
$(MERMAID) -i $< -o $@ | |
# Define the clean target | |
clean: | |
rm -f $(PNGFILES) | |
.PHONY: all clean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment