BUILD_DIR = /home/ruben/dwn/midgard BLOG ::= $(sort $(wildcard blog/*.md)) BLOG_HTML ::= $(BLOG:%.md=$(BUILD_DIR)/%.html) .PHONY: clean public all: $(BUILD_DIR)/index.html public $(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 "$@" public: cp -rt "$(BUILD_DIR)" public/. clean: rm -rf "$(OUTPUT)" "$(BUILD_DIR)"