-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
26 lines (19 loc) · 715 Bytes
/
Makefile
File metadata and controls
26 lines (19 loc) · 715 Bytes
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
default: help
.PHONY: help
pdfs := $(patsubst %.md,%.pdf,$(wildcard *.md))
dotpngs := $(patsubst %.dot,%.png,$(wildcard *.dot))
all: $(pdfs) ## Generate all PDF cheatsheets
images: dotimages ## Generate all images
dotimages: $(dotpngs) ## Generate all graphviz images
%.pdf: %.odt ## Make PDF
soffice --convert-to pdf $< --headless
%.odt: %.md images ## Make ODT
pandoc $< -o $@ --reference-doc=template/reference.odt
%.png: %.dot ## Make graphviz image
dot -Tpng -o $@ $<
clean: ## Clean generated files
rm -f *.pdf
rm -f *.odt
rm -f *.png
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1,$$2}'