summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2022-04-21 05:16:25 +0300
committereug-vs <eugene@eug-vs.xyz>2022-04-21 05:16:25 +0300
commitb573c1e4e5f61c6fd1c96985d73da4861cbbe728 (patch)
tree0411a758706e818133e056d4b71a6a2f659bbd2c
downloadbenzin-b573c1e4e5f61c6fd1c96985d73da4861cbbe728.tar.gz
feat: add initial Makefile
-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