update `Makefile`
parent
364c21ec62
commit
c098307fd7
35
Makefile
35
Makefile
|
@ -1,13 +1,17 @@
|
|||
.SUFFIXES:
|
||||
|
||||
notes := $(wildcard *.md)
|
||||
pages := $(patsubst %.md,public_html/%.html,$(notes))
|
||||
parts := $(patsubst %.md,public_html/%.html.part,$(notes))
|
||||
preqs := $(patsubst %.md,public_html/%.html.d,$(notes))
|
||||
|
||||
all: $(patsubst %.md,public_html/%.html,$(notes))
|
||||
all: $(pages)
|
||||
|
||||
PANDOCFLAGS := --data-dir pandoc
|
||||
BAVBAVHAUSFLAGS = $(PANDOCFLAGS) -M slug=$*
|
||||
|
||||
public_html/%.html: %.md
|
||||
@echo $(LANG)
|
||||
pandoc $(BAVBAVHAUSFLAGS) -d bavbavhaus.net.yaml -o $@ $<
|
||||
|
||||
public_html/%.html.part: %.md
|
||||
|
@ -16,30 +20,17 @@ public_html/%.html.part: %.md
|
|||
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 $@ $<
|
||||
include $(preqs)
|
||||
|
||||
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))
|
||||
clean:
|
||||
$(RM) public_html/*.html
|
||||
$(RM) public_html/*.html.part
|
||||
$(RM) public_html/*.html.d
|
||||
$(RM) -r dest
|
||||
$(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)))
|
||||
|
||||
.PHONY: all findbroken clean
|
||||
.PHONY: all clean
|
||||
|
||||
dest/%.docx: %.md
|
||||
test -d dest || mkdir dest
|
||||
|
|
Loading…
Reference in New Issue