From b573c1e4e5f61c6fd1c96985d73da4861cbbe728 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Thu, 21 Apr 2022 05:16:25 +0300 Subject: feat: add initial Makefile --- Makefile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Makefile 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 -- cgit v1.2.3