bavbavhaus.net/Makefile

42 lines
1.3 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-06-26 16:01:51 +02:00
pages := $(patsubst %.md,public_html/%.html,$(notes))
parts := $(patsubst %.md,public_html/%.html.part,$(notes))
preqs := $(patsubst %.md,public_html/%.html.d,$(notes))
2024-05-17 15:35:32 +02:00
2024-06-26 16:01:51 +02:00
all: $(pages)
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-08-03 15:57:09 +02:00
pandoc $(BAVBAVHAUSFLAGS) -d bavbavhaus.net.yaml $< | sed 's/↩︎/[\&#8288;\&lt;\&#8288;-\&#8288;]/g' > $@
2024-04-12 22:28:47 +02:00
$(pages): pandoc/templates/bavbavhaus.net.html5
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
$(parts): pandoc/templates/bavbavhaus.net.part.html5
2024-06-21 15:28:35 +02:00
public_html/%.html.d: %.md
pandoc lua dependencies.lua $< > $@
2024-06-26 16:01:51 +02:00
include $(preqs)
2024-04-12 22:28:47 +02:00
2024-06-26 16:01:51 +02:00
clean: oldpages := $(filter-out $(pages),$(wildcard public_html/*.html))
clean: oldparts := $(filter-out $(parts),$(wildcard public_html/*.html.part))
clean: oldpreqs := $(filter-out $(preqs),$(wildcard public_html/*.html.d))
2024-05-02 20:10:51 +02:00
clean:
2024-06-26 16:01:51 +02:00
$(if $(oldpages),$(RM) $(filter-out $(pages),$(wildcard public_html/*.html)))
$(if $(oldparts),$(RM) $(filter-out $(parts),$(wildcard public_html/*.html.part)))
$(if $(oldpreqs),$(RM) $(filter-out $(preqs),$(wildcard public_html/*.html.d)))
2024-06-21 15:28:35 +02:00
2024-06-26 16:01:51 +02:00
.PHONY: all clean
2024-06-21 15:28:35 +02:00
dest/%.docx: %.md
test -d dest || mkdir dest
pandoc $(PANDOCFLAGS) -d docx.yaml -o $@ $<