summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile24
1 files changed, 24 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..dc27999
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,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