aboutsummaryrefslogtreecommitdiff
path: root/code/makefile
blob: df39830d7074d300d8cd41ce83480fe5cd421ec8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
TOOL := ../code/target/debug/blog-tool
TOOLC := $(TOOL) --root=articles

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

all: $(OUT_ARTICLES) out/index.html out/feed.atom

out/style.css: style.css
	cp $< $@
out/index.html: $(TOOL) $(SRC_ARTICLES)
	$(TOOLC) render-index > $@
out/feed.atom: $(TOOL) $(SRC_ARTICLES)
	$(TOOLC) generate-atom > $@
out/%.html: articles/%.md $(TOOL) out/style.css
	$(TOOLC) render-article $< > $@

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