BUILD_DIR = /home/ruben/dwn/midgard BLOG ::= $(sort $(wildcard blog/*.md)) BLOG_HTML ::= $(BLOG:%.md=$(BUILD_DIR)/%.html) PYTHON ::= venv/bin/python .PHONY: all clean public all: $(BUILD_DIR)/index.html $(BUILD_DIR)/syntax.css public $(BLOG_HTML) $(BUILD_DIR)/index.html: index.html $(BLOG) do_blog.py @mkdir -p "$(dir $@)" $(PYTHON) do_blog.py --index "$<" "$@" $(BUILD_DIR)/blog/%.html: blog/%.md blog.html do_blog.py @mkdir -p "$(dir $@)" $(PYTHON) do_blog.py "$<" "$@" $(BUILD_DIR)/syntax.css: makefile $(PYTHON) -m pygments -S rainbow_dash -f html > "$@" public: cp -rt "$(BUILD_DIR)" public/. clean: rm -rf "$(BUILD_DIR)"