-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.plantuml
46 lines (32 loc) · 1.26 KB
/
Makefile.plantuml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# -*- mode: makefile; -*-
# Image extension (png, forced by plant uml)
IMG_EXT = png
# Image extension (uml, can be changed)
UML_EXT ?= uml
# List of UML files (dependencies)
UML_FILES ?= $(wildcard *.$(UML_EXT))
# List of image files (targets)
IMG_FILES = $(patsubst %.$(UML_EXT),%.$(IMG_EXT),$(UML_FILES))
# All existing image files
EXISTING_IMG_FILES = $(wildcard *.$(IMG_EXT))
# Obsolete existing image files (to be clean)
OBSOLETE_IMG_FILES = $(filter-out $(IMG_FILES),$(EXISTING_IMG_FILES))
# Default rule
plant-all: $(IMG_FILES)
# Rule to create an image target file from a UML dependency
%.$(IMG_EXT): %.$(UML_EXT) plantuml.jar
java -jar plantuml.jar $<
# Rule to download PlantUML jar file
plantuml.jar:
wget -O $@ https://github.com/plantuml/plantuml/releases/download/v1.2023.10/plantuml-1.2023.10.jar
# Rule to download PlantUML documentation file
PlantUML_Language_Reference_Guide_en.pdf:
wget http://pdf.plantuml.net/PlantUML_Language_Reference_Guide_en.pdf
# Rule to clean obsolete files
plant-clean:
if [ -n "$(OBSOLETE_IMG_FILES)" ]; then rm $(OBSOLETE_IMG_FILES); fi
# Rule to clean up
plant-veryclean: plant-clean
rm -f plantuml.jar PlantUML_Language_Reference_Guide.pdf
# Targets that are not really files
.PHONY: plant-all plant-clean plant-veryclean