update `Makefile`

master
urosm 2024-06-21 15:28:35 +02:00
parent b28dadd62e
commit a412484b06
1 changed files with 31 additions and 14 deletions

View File

@ -1,30 +1,47 @@
.SUFFIXES:
.PHONY: all
all: dependencies.mk
notes := $(wildcard *.md)
dependencies.mk:
pandoc lua pandoc/dependencies.lua index.md $@
include dependencies.mk
all: $(patsubst %.md,public_html/%.html,$(notes))
PANDOCFLAGS := --data-dir pandoc
BAVBAVHAUSFLAGS = $(PANDOCFLAGS) -M slug=$*
public_html/%.html: parts = $(filter-out $<,$^)
public_html/%.html: %.md
pandoc $(BAVBAVHAUSFLAGS) -d bavbavhaus.net.yaml $(patsubst %,-M parts=%,$(parts)) -o $@ $<
pandoc $(BAVBAVHAUSFLAGS) -d bavbavhaus.net.yaml -o $@ $<
public_html/%.html.part: %.md
pandoc $(BAVBAVHAUSFLAGS) -d bavbavhaus.net.part.yaml --id-prefix $* -o $@ $<
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 $@ $<
clean:
$(RM) public_html/*.html
$(RM) public_html/*.html.part
$(RM) public_html/*.html.d
$(RM) -r dest
.PHONY: all findbroken clean
dest/%.docx: %.md
test -d dest || mkdir dest
pandoc $(PANDOCFLAGS) -d docx.yaml -o $@ $<
.PHONY: clean
clean:
$(RM) dependencies.mk
$(RM) public_html/*.html
$(RM) public_html/*.html.part
$(RM) -r dest