54 lines
1,001 B
Makefile
54 lines
1,001 B
Makefile
############
|
|
# 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
|
|
all: pdfPub
|
|
|
|
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)
|
|
|
|
%.pdf: %.md lenaisten-defs.sty
|
|
$(call compile,$<,$@)
|
|
|
|
%.tex: %.md lenaisten-defs.sty
|
|
$(call compile,$<,$@)
|