PREFIX = motions TEX = $(addsuffix _.tex, $(basename $(wildcard *.mdwn))) PDF = $(addprefix $(PREFIX)-, $(subst .main.tex,.pdf,$(wildcard *.main.tex))) ALL = $(TEX) $(PDF) PREAMBLE = preamble_.tex acronyms_.tex attendants_.tex print: echo $(ALL) all: $(ALL) %_.tex: %.mdwn cat < $< | sed -e 's/SCB/\\scb\\/g' -e 's/^$$/\\mypar\n/' | pandoc -f markdown -t latex > $@ motions-%.pdf: %.main.tex $(TEX) $(PREAMBLE) pdflatex -jobname=$(basename $@) $< clean: rm -f $(ALL) $(PREAMBLE): %_.tex: ../../preamble/%.tex sed 's/..\/preamble\/\([a-z]*\)/\1_/g' < $< > $@