website

Sources for my personal website
Log | Files | Refs | README

commit aa036ddf3b17537bd7fd282099adbb6d776591d6
parent 17c04bc9c06db6676445edb5023810aa41f6e798
Author: Sven Möller <sven-moeller@outlook.de>
Date:   Mon, 13 Dec 2021 10:44:28 +0100

Improve Makefile

Diffstat:
MMakefile | 20+++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,14 +1,20 @@ -MD2HTML := pandoc --template template.html +DST_DIR ?= dst SRCS := $(wildcard *.md) -DST_DIR ?= dst +DSTS := $(SRCS:%.md=$(DST_DIR)/%.html) + +.PHONY: all clean + +all: $(DSTS) $(DST_DIR)/style.css + +$(DST_DIR)/%.html: %.md template.html | $(DST_DIR) + pandoc --template template.html $< -o $@ -all: $(SRCS:%.md=%.html) +$(DST_DIR)/style.css: style.css | $(DST_DIR) + cp $< $@ -%.html: %.md - mkdir -p $(DST_DIR) - cp style.css $(DST_DIR) - $(MD2HTML) $< -o $(DST_DIR)/$@ +$(DST_DIR): + mkdir -p $@ clean: rm -rvf $(DST_DIR)