knazarov.com/Makefile

37 lines
1 KiB
Makefile
Raw Normal View History

2021-08-15 20:11:40 +00:00
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
2021-08-15 20:11:40 +00:00
$(ODIR)/%/index.html: pages/%/note.md
mkdir -p "$(dir $@)"
cat "$<" | ./mdpage.sh --notitle > "$@"
$(ODIR)/projects/%/index.html: projects/%/note.md
2021-08-15 20:11:40 +00:00
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 > "$@"
2021-08-15 20:11:40 +00:00
$(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)/*