bavbavhaus.net/Makefile

48 lines
1.2 KiB
Makefile
Raw Normal View History

2024-04-12 22:28:47 +02:00
.SUFFIXES:
2024-06-21 15:28:35 +02:00
notes := $(wildcard *.md)
2024-05-17 15:35:32 +02:00
2024-06-21 15:28:35 +02:00
all: $(patsubst %.md,public_html/%.html,$(notes))
2024-05-21 00:58:38 +02:00
2024-06-08 23:02:47 +02:00
PANDOCFLAGS := --data-dir pandoc
BAVBAVHAUSFLAGS = $(PANDOCFLAGS) -M slug=$*
2024-05-04 19:25:10 +02:00
2024-06-08 23:02:47 +02:00
public_html/%.html: %.md
2024-06-21 15:28:35 +02:00
pandoc $(BAVBAVHAUSFLAGS) -d bavbavhaus.net.yaml -o $@ $<
2024-04-12 22:28:47 +02:00
2024-05-02 20:10:51 +02:00
public_html/%.html.part: %.md
2024-05-21 00:58:38 +02:00
pandoc $(BAVBAVHAUSFLAGS) -d bavbavhaus.net.part.yaml --id-prefix $* -o $@ $<
2024-05-16 23:05:10 +02:00
2024-06-21 15:28:35 +02:00
public_html/%.html.d: %.md
pandoc lua dependencies.lua $< > $@
include $(patsubst %.md,public_html/%.html.d,$(notes))
# include dependencies.mk
#
# dependencies.mk: $(wildcard *.md)
# pandoc lua pandoc/dependencies.lua index.md $@
#
# PANDOCFLAGS := --data-dir pandoc
# BAVBAVHAUSFLAGS = $(PANDOCFLAGS) -M slug=$*
#
# public_html/%.html: parts = $(filter-out $<,$^)
# public_html/%.html: %.md | dependencies.mk
# pandoc $(BAVBAVHAUSFLAGS) -d bavbavhaus.net.yaml $(patsubst %,-M parts=%,$(parts)) -o $@ $<
#
# public_html/%.html.part: %.md
# pandoc $(BAVBAVHAUSFLAGS) -d bavbavhaus.net.part.yaml --id-prefix $* -o $@ $<
2024-04-12 22:28:47 +02:00
2024-05-02 20:10:51 +02:00
clean:
$(RM) public_html/*.html
2024-05-21 00:58:38 +02:00
$(RM) public_html/*.html.part
2024-06-21 15:28:35 +02:00
$(RM) public_html/*.html.d
2024-05-16 23:05:10 +02:00
$(RM) -r dest
2024-06-21 15:28:35 +02:00
.PHONY: all findbroken clean
dest/%.docx: %.md
test -d dest || mkdir dest
pandoc $(PANDOCFLAGS) -d docx.yaml -o $@ $<