bavbavhaus.net/Makefile

33 lines
977 B
Makefile
Raw Normal View History

2024-04-12 22:28:47 +02:00
SHELL = /bin/sh
.SUFFIXES:
2024-05-16 23:05:10 +02:00
NOTES = $(shell pandoc lua pandoc/collect_notes.lua index.md)
TARGETS = $(patsubst %.md,public_html/%.html,$(NOTES))
GETDEPS = $(patsubst %.md,public_html/%.html.part,$(shell pandoc lua pandoc/collect_links.lua $(1)))
DEPSMETAFLAGS = $(patsubst %,-M linkparts=%,$(filter-out $<,$^))
2024-04-12 22:28:47 +02:00
2024-04-22 15:16:39 +02:00
.PHONY: all
2024-05-16 23:05:10 +02:00
all: $(TARGETS)
2024-05-04 19:25:10 +02:00
2024-05-02 23:53:43 +02:00
.SECONDEXPANSION:
2024-05-16 23:05:10 +02:00
public_html/%.html: %.md \
$$(call GETDEPS,%.md) \
public_html/sitemap.html.part
pandoc --data-dir pandoc -d bavbavhaus.net.yaml -M slug=$* $(DEPSMETAFLAGS) -o $@ $<
2024-04-12 22:28:47 +02:00
2024-05-02 20:10:51 +02:00
public_html/%.html.part: %.md
2024-05-16 23:05:10 +02:00
pandoc --data-dir pandoc -d bavbavhaus.net.part.yaml --id-prefix $* -M url=$*.html -M slug=$* -o $@ $<
public_html/sitemap.html.part: $(NOTES)
pandoc lua pandoc/sitemap.lua index.md $@
dest/%.docx: %.md
test -d dest || mkdir dest
pandoc --data-dir pandoc --resource-path pandoc -d docx.yaml -o $@ $<
2024-04-12 22:28:47 +02:00
2024-04-22 15:16:39 +02:00
.PHONY: clean
2024-05-02 20:10:51 +02:00
clean:
$(RM) public_html/*.html.part
$(RM) public_html/*.html
2024-05-16 23:05:10 +02:00
$(RM) -r dest