ODIR=output PAGES_SRC := $(wildcard content/pages/*) PAGES_DST := $(patsubst content/pages/%,$(ODIR)/%/index.html,$(PAGES_SRC)) PROJECTS_SRC := $(wildcard content/projects/*) PROJECTS_DST := $(patsubst content/projects/%,$(ODIR)/projects/%/index.html,$(PROJECTS_SRC)) POSTS_SRC := $(wildcard content/posts/*) POSTS_DST := $(patsubst content/posts/%,$(ODIR)/posts/%/index.html,$(POSTS_SRC)) all: $(PAGES_DST) $(PROJECTS_DST) $(POSTS_DST) $(ODIR)/style.css $(ODIR)/index.html $(ODIR)/posts/index.html $(ODIR)/%/index.html: content/pages/%/note.md mkdir -p "$(dir $@)" cat "$<" | ./bin/mdpage.sh --notitle > "$@" $(ODIR)/projects/%/index.html: content/projects/%/note.md mkdir -p "$(dir $@)" cat "$<" | ./bin/mdpage.sh > "$@" $(ODIR)/posts/%/index.html: content/posts/%/note.md mkdir -p "$(dir $@)" cat "$<" | ./bin/mdpage.sh > "$@" $(ODIR)/posts/index.html: $(POSTS_SRC) ./bin/toc.sh content/posts "/posts" | awk -f ./bin/markdown.awk | ./bin/page.sh Posts > "$@" $(ODIR)/index.html: content/index.md cat content/index.md | ./bin/mdpage.sh --notitle > "$@" $(ODIR)/style.css: style.css cp style.css $(ODIR)/style.css clean: rm -rf $(ODIR)/*