aboutsummaryrefslogtreecommitdiff
path: root/tools/makefile
blob: 5e8d26df72859bd353469f801fcfb9e49d5b147a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
TOOL := ../tools/target/debug/blog-tool

SRC_ARTICLES := $(shell find articles -type f)
OUT_ARTICLES := $(SRC_ARTICLES:articles/%.md=out/%.html)

all: $(OUT_ARTICLES) out/index.html

out/index.html: $(TOOL) $(SRC_ARTICLES)
	$(TOOL) render-index ./articles > $@

out/%.html: articles/%.md $(TOOL)
	mkdir -p out
	$(TOOL) render-article $< > $@

$(TOOL): $(shell find ../tools/src -type f)
	sh -c 'cd ../tools; cargo build'