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