2020-06-02 02:47:22 +02:00
|
|
|
BUILD_DIR = /home/ruben/dwn/midgard
|
|
|
|
|
|
|
|
BLOG ::= $(sort $(wildcard blog/*.md))
|
|
|
|
BLOG_HTML ::= $(BLOG:%.md=$(BUILD_DIR)/%.html)
|
|
|
|
|
2020-06-02 18:41:09 +02:00
|
|
|
PYTHON ::= venv/bin/python
|
|
|
|
|
2020-06-08 23:46:23 +02:00
|
|
|
.PHONY: all clean public
|
2020-06-02 02:47:22 +02:00
|
|
|
|
2020-06-08 02:55:50 +02:00
|
|
|
all: $(BUILD_DIR)/index.html $(BUILD_DIR)/syntax.css public $(BLOG_HTML)
|
2020-06-02 02:47:22 +02:00
|
|
|
|
2020-06-13 14:46:35 +02:00
|
|
|
$(BUILD_DIR)/index.html: templates/index.html $(BLOG) page.py
|
2020-06-11 01:57:52 +02:00
|
|
|
@mkdir -p "$(@D)"
|
2020-06-13 14:46:35 +02:00
|
|
|
$(PYTHON) page.py --index "$<" "$@"
|
2020-06-02 02:47:22 +02:00
|
|
|
|
2020-06-13 14:46:35 +02:00
|
|
|
$(BUILD_DIR)/blog/%.html: blog/%.md templates/blog.html page.py
|
2020-06-11 01:57:52 +02:00
|
|
|
@mkdir -p "$(@D)"
|
2020-06-13 14:46:35 +02:00
|
|
|
$(PYTHON) page.py "$<" "$@"
|
2020-06-02 02:47:22 +02:00
|
|
|
|
2020-06-08 02:55:50 +02:00
|
|
|
$(BUILD_DIR)/syntax.css: makefile
|
2020-06-11 01:57:52 +02:00
|
|
|
@mkdir -p "$(@D)"
|
2020-06-08 23:46:23 +02:00
|
|
|
$(PYTHON) -m pygments -S rainbow_dash -f html > "$@"
|
2020-06-08 02:55:50 +02:00
|
|
|
|
2020-06-02 02:55:24 +02:00
|
|
|
public:
|
|
|
|
cp -rt "$(BUILD_DIR)" public/.
|
|
|
|
|
2020-06-02 02:47:22 +02:00
|
|
|
clean:
|
2020-06-08 02:55:50 +02:00
|
|
|
rm -rf "$(BUILD_DIR)"
|