From 437cdd9cf0b60e028689a297bfe5ae24bcc5ca2b Mon Sep 17 00:00:00 2001 From: Midgard <2885-Midgard@users.noreply.framagit.org> Date: Tue, 2 Jun 2020 02:47:22 +0200 Subject: [PATCH] Add makefile --- makefile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 makefile diff --git a/makefile b/makefile new file mode 100644 index 0000000..bb36e48 --- /dev/null +++ b/makefile @@ -0,0 +1,20 @@ +BUILD_DIR = /home/ruben/dwn/midgard + +BLOG ::= $(sort $(wildcard blog/*.md)) +BLOG_HTML ::= $(BLOG:%.md=$(BUILD_DIR)/%.html) + +.PHONY: clean + +all: $(BUILD_DIR)/index.html $(BLOG_HTML) + +$(BUILD_DIR)/index.html: $(BUILD_DIR) do_index.py index.html $(BLOG) + ./do_index.py "index.html" "$@" + +$(BUILD_DIR)/%.html: $(BUILD_DIR) do_blog.py %.md + ./do_blog.py "$(*F).md" "$@" + +$(BUILD_DIR): + mkdir -p "$@" + +clean: + rm -rf "$(OUTPUT)" "$(BUILD_DIR)"