lev-templates/Makefile

61 lines
1.2 KiB
Makefile
Raw Normal View History

2025-05-09 01:50:03 +00:00
############
# Settings #
############
suffixPub :=
suffixInt := _intern
###########
# Default #
###########
suffixSubst = $(patsubst %.$(2),%$(4).$(3),$(1))
mdFiles := $(wildcard *.md)
pdfFilesPub := $(call suffixSubst,$(mdFiles),md,pdf,$(suffixPub))
texFilesPub := $(call suffixSubst,$(mdFiles),md,tex,$(suffixPub))
pdfFilesInt := $(call suffixSubst,$(mdFiles),md,pdf,$(suffixInt))
texFilesInt := $(call suffixSubst,$(mdFiles),md,tex,$(suffixInt))
.PHONY: all pdf pdfPub pdfInt tex texPub texInt
2025-05-11 20:06:35 +00:00
all: pdf
2025-05-09 01:50:03 +00:00
pdf: pdfPub pdfInt
pdfPub: $(pdfFilesPub)
pdfInt: $(pdfFilesInt)
tex: texPub texInt
texPub: $(texFilesPub)
texInt: $(texFilesInt)
###########
# Recipes #
###########
compile = pandoc \
$(1) \
--standalone \
--from markdown \
--to latex \
--template lenaisten \
--variable colorlinks:true \
--variable csquotes:true \
--variable lang:de-DE \
--output $(2)
2025-05-11 20:06:35 +00:00
%$(suffixPub).pdf: %.md lenaisten-defs.sty
python3 ./redact.py $< | $(call compile,-,$@)
2025-05-09 01:50:03 +00:00
2025-05-11 20:06:35 +00:00
%$(suffixPub).tex: %.md lenaisten-defs.sty
python3 ./redact.py $< | $(call compile,-,$@)
%$(suffixInt).pdf: %.md lenaisten-defs.sty
python3 ./redact.py -i $< | $(call compile,-,$@)
%$(suffixInt).tex: %.md lenaisten-defs.sty
python3 ./redact.py -i $< | $(call compile,-,$@)