website/makefile

29 lines
663 B
Makefile
Raw Normal View History

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