website/makefile

29 lines
583 B
Makefile
Raw Normal View History

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-02 02:55:24 +02:00
.PHONY: clean public
2020-06-02 02:47:22 +02:00
2020-06-02 02:55:24 +02:00
all: $(BUILD_DIR)/index.html public $(BLOG_HTML)
2020-06-02 02:47:22 +02:00
2020-06-02 15:42:25 +02:00
$(BUILD_DIR)/index.html: index.html $(BLOG) do_index.py $(BUILD_DIR)
2020-06-02 18:41:09 +02:00
$(PYTHON) do_index.py "$<" "$@"
2020-06-02 02:47:22 +02:00
2020-06-02 15:42:25 +02:00
$(BUILD_DIR)/blog/%.html: blog/%.md blog.html do_blog.py $(BUILD_DIR)/blog
2020-06-02 18:41:09 +02:00
$(PYTHON) do_blog.py "$<" "$@"
2020-06-02 02:47:22 +02:00
$(BUILD_DIR):
mkdir -p "$@"
2020-06-02 15:42:25 +02:00
$(BUILD_DIR)/blog:
mkdir -p "$@"
2020-06-02 02:55:24 +02:00
public:
cp -rt "$(BUILD_DIR)" public/.
2020-06-02 02:47:22 +02:00
clean:
rm -rf "$(OUTPUT)" "$(BUILD_DIR)"