summaryrefslogtreecommitdiff
path: root/Makefile
blob: dc27999491605006482852eca93fe189b85de641 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# BENZIN Makefile

HEADER=templates/header.html
PANDOC_ARGS=--from=gfm+emoji --to=html --section-divs

SOURCES=$(wildcard src/*.md src/**/*.md)
TMP_HTML=$(patsubst src/%.md, tmp/%.content.html, $(SOURCES))
HTML=$(patsubst src/%.md, out/%.html, $(SOURCES))

.PHONY: clean all
.SECONDARY: $(TMP_HTML)

all: $(HTML)

out/%.html: $(HEADER) tmp/%.content.html
	mkdir -p $(@D)
	cat $^ > $@

tmp/%.content.html: src/%.md
	mkdir -p $(@D)
	cat $< | pandoc $(PANDOC_ARGS) > $@

clean:
	rm -rf tmp out