28 lines
583 B
Makefile
28 lines
583 B
Makefile
BUILD_DIR = /home/ruben/dwn/midgard
|
|
|
|
BLOG ::= $(sort $(wildcard blog/*.md))
|
|
BLOG_HTML ::= $(BLOG:%.md=$(BUILD_DIR)/%.html)
|
|
|
|
PYTHON ::= venv/bin/python
|
|
|
|
.PHONY: clean public
|
|
|
|
all: $(BUILD_DIR)/index.html public $(BLOG_HTML)
|
|
|
|
$(BUILD_DIR)/index.html: index.html $(BLOG) do_index.py $(BUILD_DIR)
|
|
$(PYTHON) do_index.py "$<" "$@"
|
|
|
|
$(BUILD_DIR)/blog/%.html: blog/%.md blog.html do_blog.py $(BUILD_DIR)/blog
|
|
$(PYTHON) do_blog.py "$<" "$@"
|
|
|
|
$(BUILD_DIR):
|
|
mkdir -p "$@"
|
|
|
|
$(BUILD_DIR)/blog:
|
|
mkdir -p "$@"
|
|
|
|
public:
|
|
cp -rt "$(BUILD_DIR)" public/.
|
|
|
|
clean:
|
|
rm -rf "$(OUTPUT)" "$(BUILD_DIR)"
|